This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.1'.
[unix-history] / usr.sbin / sendmail / doc / op / op.me
CommitLineData
6f14531a
RG
1.\" Copyright (c) 1983 Eric P. Allman
2.\" Copyright (c) 1983, 1993
3.\" The Regents of the University of California. All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software
14.\" must display the following acknowledgement:
15.\" This product includes software developed by the University of
16.\" California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
c2714ef5 33.\" @(#)op.me 8.34 (Berkeley) 3/3/94
6f14531a
RG
34.\"
35.\" eqn op.me | pic | troff -me
36.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
37.oh 'Sendmail Installation and Operation Guide''SMM:08-%'
38.\" SD is lib if sendmail is installed in /usr/lib, sbin if in /usr/sbin
39.ds SD sbin
d747e748
JH
40.\" SB is bin if newaliases/mailq are installed in /usr/bin, ucb if in /usr/ucb
41.ds SB bin
6f14531a
RG
42.nr si 3n
43.de $0
44.(x
45.in \\$3u*3n
46.ti -3n
47\\$2. \\$1
48.)x
49..
50.de $C
51.(x
52.in 0
53\\$1 \\$2. \\$3
54.)x
55..
d747e748 56.sc
6f14531a
RG
57.+c
58.(l C
59.sz 16
60.b SENDMAIL
61.sz 12
62.sp
63.b "INSTALLATION AND OPERATION GUIDE"
64.sz 10
65.sp
66.r
67Eric Allman
68University of California, Berkeley
69Mammoth Project
70eric@CS.Berkeley.EDU
71.sp
c2714ef5 72Version 8.34
6f14531a 73.sp
d747e748 74For Sendmail Version 8.6
6f14531a
RG
75.)l
76.sp 2
77.pp
78.i Sendmail
79implements a general purpose internetwork mail routing facility
80under the UNIX*
81.(f
d747e748 82*UNIX is a trademark of Unix Systems Laboratories.
6f14531a
RG
83.)f
84operating system.
85It is not tied to any one transport protocol \*-
86its function may be likened to a crossbar switch,
87relaying messages from one domain into another.
88In the process,
89it can do a limited amount of message header editing
90to put the message into a format that is appropriate
91for the receiving domain.
92All of this is done under the control of a configuration file.
93.pp
94Due to the requirements of flexibility
95for
96.i sendmail ,
97the configuration file can seem somewhat unapproachable.
98However, there are only a few basic configurations
99for most sites,
100for which standard configuration files have been supplied.
101Most other configurations
102can be built by adjusting an existing configuration files
103incrementally.
104.pp
105.i Sendmail
106is based on
107RFC822 (Internet Mail Format Protocol),
108RFC821 (Simple Mail Transport Protocol),
109RFC1123 (Internet Host Requirements),
110and
111RFC1425 (SMTP Service Extensions).
112However, since
113.i sendmail
114is designed to work in a wider world,
115in many cases it can be configured to exceed these protocols.
116These cases are described herein.
117.pp
118Although
119.i sendmail
120is intended to run
121without the need for monitoring,
122it has a number of features
123that may be used to monitor or adjust the operation
124under unusual circumstances.
125These features are described.
126.pp
127Section one describes how to do a basic
128.i sendmail
129installation.
130Section two
131explains the day-to-day information you should know
132to maintain your mail system.
133If you have a relatively normal site,
134these two sections should contain sufficient information
135for you to install
136.i sendmail
137and keep it happy.
138Section three
139describes some parameters that may be safely tweaked.
140Section four
141has information regarding the command line arguments.
142Section five
143contains the nitty-gritty information about the configuration
144file.
145This section is for masochists
146and people who must write their own configuration file.
147Section six
d747e748
JH
148describes configuration that can be done at compile time.
149Section seven
6f14531a
RG
150gives a brief description of differences
151in this version of
152.i sendmail .
153The appendixes give a brief
154but detailed explanation of a number of features
155not described in the rest of the paper.
d747e748 156.bp 7
6f14531a
RG
157.sh 1 "BASIC INSTALLATION"
158.pp
d747e748
JH
159There are two basic steps to installing
160.i sendmail .
6f14531a 161The hard part is to build the configuration table.
d747e748
JH
162This is a file that
163.i sendmail
164reads when it starts up
6f14531a
RG
165that describes the mailers it knows about,
166how to parse addresses,
167how to rewrite the message header,
168and the settings of various options.
169Although the configuration table is quite complex,
170a configuration can usually be built
171by adjusting an existing off-the-shelf configuration.
172The second part is actually doing the installation,
173i.e., creating the necessary files, etc.
174.pp
d747e748
JH
175The remainder of this section will describe the installation of
176.i sendmail
6f14531a
RG
177assuming you can use one of the existing configurations
178and that the standard installation parameters are acceptable.
179All pathnames and examples
180are given from the root of the
181.i sendmail
182subtree,
183normally
184.i /usr/src/usr.\*(SD/sendmail
3a363396 185on 4.4BSD.
6f14531a
RG
186.pp
187If you are loading this off the tape,
042b8fbf 188continue with the next section.
6f14531a
RG
189If you have a running binary already on your system,
190you should probably skip to section 1.2.
191.sh 2 "Compiling Sendmail"
192.pp
d747e748
JH
193All
194.i sendmail
195source is in the
6f14531a
RG
196.i src
197subdirectory.
198If you are running on a 4.4BSD system,
199compile by typing
200.q make .
201On other systems, you may have to make some other adjustments.
202.sh 3 "Old versions of make"
203.pp
204If you are not running the new version of
205.b make
206you will probably have to use
207.(b
208make \-f Makefile.dist
209.)b
210This file does not assume several new syntaxes,
211including the
212.q +=
213syntax in macro definition
214and the
215.q ".include"
216syntax.
217.sh 3 "Compilation flags"
218.pp
219.i Sendmail
220supports two different formats
221for the
222.i aliases
223database.
224These formats are:
225.nr ii 1i
226.ip NDBM
227The ``new DBM'' format,
228available on nearly all systems around today.
229This was the preferred format prior to 4.4BSD.
230It allows such complex things as multiple databases
231and closing a currently open database.
232.ip NEWDB
233The new database package from Berkeley.
234If you have this, use it.
235It allows
236long records,
237multiple open databases,
238real in-memory caching,
239and so forth.
240You can define this in conjunction with one of the other two;
241if you do,
242old databases are read,
243but when a new database is created it will be in NEWDB format.
244As a nasty hack,
d747e748 245if you have NEWDB, NDBM, and NIS defined,
6f14531a
RG
246and if the file
247.i /var/yp/Makefile
248exists and is readable,
249.i sendmail
250will create both new and old versions of the alias file
251during a
252.i newalias
253command.
254This is required because the Sun NIS/YP system
255reads the DBM version of the alias file.
256It's ugly as sin,
257but it works.
258.lp
259If neither of these are defined,
260.i sendmail
261reads the alias file into memory on every invocation.
262This can be slow and should be avoided.
263.pp
264System V based systems can define
265SYSTEM5
266to make several small adjustments.
267This changes the handling of timezones
268and uses the much less efficient
269.i lockf
270call in preference to
271.i flock .
272These can be specified separately using the compilation flags
273SYS5TZ
274and
275LOCKF
276respectively.
277.pp
278If you don't have the
279.i unsetenv
280routine in your system library, define the UNSETENV compilation flag.
281.pp
282You may also have to define the compilation variable LA_TYPE
283to describe how your load average is computed.
284This and other flags are detailed in section 6.1.
285.sh 3 "Compilation and installation"
286.pp
287After making the local system configuration described above,
288You should be able to compile and install the system.
289Compilation can be performed using
290.q make\**
291.(f
292\**where you may have to replace
293.q make
294with
295.q "make \-f Makefile.dist"
296as appropriate.
297.)f
298in the
299.b sendmail/src
300directory.
301You may be able to install using
302.(b
303make install
304.)b
305This should install the binary in
306/usr/\*(SD
307and create links from
d747e748 308/usr/\*(SB/newaliases
6f14531a 309and
d747e748 310/usr/\*(SB/mailq
6f14531a
RG
311to
312/usr/\*(SD/sendmail.
3a363396 313On 4.4BSD systems it will also format and install man pages.
6f14531a
RG
314.sh 2 "Configuration Files"
315.pp
316.i Sendmail
317cannot operate without a configuration file.
318The configuration defines the mail systems understood at this site,
319how to access them,
320how to forward email to remote mail systems,
321and a number of tuning parameters.
322This configuration file is detailed
323in the later portion of this document.
324.pp
325The
326.i sendmail
327configuration can be daunting at first.
328The world is complex,
329and the mail configuration reflects that.
330The distribution includes an m4-based configuration package
331that hides a lot of the complexity.
332.pp
333These configuration files are simpler than old versions
334largely because the world has become simpler;
335in particular,
336text-based host files are officially eliminated,
337obviating the need to
338.q hide
339hosts behind a registered internet gateway.
340.pp
341These files also assume that most of your neighbors
342use domain-based UUCP addressing;
343that is,
344instead of naming hosts as
345.q host!user
346they will use
347.q host.domain!user .
348The configuration files can be customized to work around this,
349but it is more complex.
350.pp
351I haven't tested these yet on an isolated LAN environment
352with a single UUCP connection to the outside world.
353If you are in such an environment,
354please send comments to
d747e748 355sendmail@CS.Berkeley.EDU.
6f14531a
RG
356.pp
357Our configuration files are processed by
358.i m4
359to facilitate local customization;
360the directory
361.i cf
362of the
d747e748 363.i sendmail
6f14531a
RG
364distribution directory
365contains the source files.
366This directory contains several subdirectories:
367.nr ii 1i
368.ip cf
369Both site-dependent and site-independent descriptions of hosts.
370These can be literal host names
371(e.g.,
372.q ucbvax.mc )
373when the hosts are gateways
374or more general descriptions
375(such as
376.q "tcpproto.mc"
377as a general description of an SMTP-connected host
378or
379.q "uucpproto.mc"
380as a general description of a UUCP-connected host).
381Files ending
382.b \&.mc
383(``Master Configuration'')
384are the input descriptions;
385the output is in the corresponding
386.b \&.cf
387file.
388The general structure of these files is described below.
389.ip domain
390Site-dependent subdomain descriptions.
391These are tied to the way your organization wants to do addressing.
392For example,
393.b domain/cs.exposed.m4
394is our description for hosts in the CS.Berkeley.EDU subdomain
395that want their individual hostname to be externally visible;
396.b domain/cs.hidden.m4
397is the same except that the hostname is hidden
398(everything looks like it comes from CS.Berkeley.EDU).
399These are referenced using the
400.sm DOMAIN
401.b m4
402macro in the
403.b \&.mc
404file.
405.ip feature
406Definitions of specific features that some particular host in your site
407might want.
408These are referenced using the
409.sm FEATURE
410.b m4
411macro.
412An example feature is
413use_cw_file
d747e748
JH
414(which tells
415.i sendmail
416to read an /etc/sendmail.cw file on startup
6f14531a
RG
417to find the set of local names).
418.ip hack
419Local hacks, referenced using the
420.sm HACK
421.b m4
422macro.
423Try to avoid these.
424The point of having them here is to make it clear that they smell.
425.ip m4
426Site-independent
427.i m4 (1)
428include files that have information common to all configuration files.
429This can be thought of as a
430.q #include
431directory.
432.ip mailer
433Definitions of mailers,
434referenced using the
435.sm MAILER
436.b m4
437macro.
438Defined mailer types in this distribution are
439fax,
440local,
441smtp,
442uucp,
443and usenet.
444.ip ostype
445Definitions describing various operating system environments
446(such as the location of support files).
447These are referenced using the
448.sm OSTYPE
449.b m4
450macro.
451.ip sh
452Shell files used by the
453.b m4
454build process.
455You shouldn't have to mess with these.
456.ip siteconfig
457Local site configuration information,
458such as UUCP connectivity.
459They normally contain lists of site information, for example:
460.(b
461SITE(contessa)
462SITE(hoptoad)
463SITE(nkainc)
464SITE(well)
465.)b
466They are referenced using the SITECONFIG macro:
467.(b
468SITECONFIG(site.config.file, name_of_site, X)
469.)b
470where
471.i X
472is the macro/class name to use.
473It can be U
474(indicating locally connected hosts)
475or one of W, X, or Y
476for up to three remote UUCP hubs.
477.pp
478If you are in a new domain
479(e.g., a company),
480you will probably want to create a
481cf/domain
482file for your domain.
483This consists primarily of relay definitions:
484for example, Berkeley's domain definition
485defines relays for
486BitNET,
487CSNET,
488and UUCP.
489Of these,
490only the UUCP relay is particularly specific
491to Berkeley.
492All of these are internet-style domain names.
493Please check to make certain they are reasonable for your domain.
494.pp
495Subdomains at Berkeley are also represented in the
496cf/domain
497directory.
498For example,
499the domain
500cs-exposed
501is the Computer Science subdomain with the local hostname shown
502to other users;
503cs-hidden
504makes users appear to be from the CS.Berkeley.EDU subdomain
505(with no local host information included).
506You will probably have to update this directory
507to be appropriate for your domain.
508.pp
509You will have to use or create
510.b \&.mc
511files in the
512.i cf/cf
513subdirectory for your hosts.
514This is detailed in the
515cf/README
516file.
517.sh 2 "Details of Installation Files"
518.pp
519This subsection describes the files that
520comprise the
d747e748 521.i sendmail
6f14531a
RG
522installation.
523.sh 3 "/usr/\*(SD/sendmail"
524.pp
d747e748
JH
525The binary for
526.i sendmail
527is located in /usr/\*(SD\**.
6f14531a
RG
528.(f
529\**This is usually
530/usr/sbin
531on 4.4BSD and newer systems;
532many systems install it in
533/usr/lib.
534I understand it is in /usr/ucblib
535on System V Release 4.
536.)f
537It should be setuid root.
538For security reasons,
539/, /usr, and /usr/\*(SD
540should be owned by root, mode 755\**.
541.(f
542\**Some vendors ship them owned by bin;
543this creates a security hole that is not actually related to
544.i sendmail .
545Other important directories that should have restrictive ownerships
546and permissions are
547/bin, /usr/bin, /etc, /usr/etc, /lib, and /usr/lib.
548.)f
549.sh 3 "/etc/sendmail.cf"
550.pp
d747e748
JH
551This is the configuration file for
552.i sendmail .
553This is the only non-library file name compiled into
554.i sendmail \**.
6f14531a
RG
555.(f
556\**The system libraries can reference other files;
557in particular, system library subroutines that
d747e748 558.i sendmail
6f14531a
RG
559calls probably reference
560.i /etc/passwd
561and
562.i /etc/resolv.conf .
563.)f
564Some older systems install it in
565.b /usr/lib/sendmail.cf .
566.pp
567If you want to move this file,
568change
569.i src/pathnames.h .
570.pp
571The configuration file is normally created
572using the distribution files described above.
573If you have a particularly unusual system configuration
574you may need to create a special version.
575The format of this file is detailed in later sections
576of this document.
d747e748 577.sh 3 "/usr/\*(SB/newaliases"
6f14531a 578.pp
042b8fbf 579The
6f14531a 580.i newaliases
042b8fbf 581command should just be a link to
6f14531a
RG
582.i sendmail :
583.(b
d747e748 584rm \-f /usr/\*(SB/newaliases
042b8fbf 585ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
6f14531a
RG
586.)b
587This can be installed in whatever search path you prefer
588for your system.
589.sh 3 "/var/spool/mqueue"
590.pp
591The directory
592.i /var/spool/mqueue
593should be created to hold the mail queue.
594This directory should be mode 700
595and owned by root.
596.pp
597The actual path of this directory
598is defined in the
599.b Q
600option of the
601.i sendmail.cf
602file.
603.sh 3 "/etc/aliases*"
604.pp
605The system aliases are held in
606.q /etc/aliases .
607A sample is given in
608.q lib/aliases
609which includes some aliases which
610.i must
611be defined:
612.(b
613cp lib/aliases /etc/aliases
614.i "edit /etc/aliases"
615.)b
616You should extend this file with any aliases that are apropos to your system.
617.pp
618Normally
619.i sendmail
620looks at a version of these files maintained by the
621.i dbm \|(3)
622or
623.i db \|(3)
624routines.
625These are stored either in
626.q /etc/aliases.dir
627and
628.q /etc/aliases.pag
629or
630.q /etc/aliases.db
631depending on which database package you are using.
632These can initially be created as empty files,
633but they will have to be initialized promptly.
634These should be mode 644:
635.(b
636cp /dev/null /etc/aliases.dir
637cp /dev/null /etc/aliases.pag
638chmod 644 /etc/aliases.*
639newaliases
640.)b
641The
642.i db
643routines preset the mode reasonably,
644so this step can be skipped.
645The actual path of this file
646is defined in the
647.b A
648option of the
649.i sendmail.cf
650file.
6f14531a
RG
651.sh 3 "/etc/rc"
652.pp
d747e748
JH
653It will be necessary to start up the
654.i sendmail
655daemon when your system reboots.
6f14531a
RG
656This daemon performs two functions:
657it listens on the SMTP socket for connections
658(to receive mail from a remote system)
659and it processes the queue periodically
660to insure that mail gets delivered when hosts come up.
661.pp
662Add the following lines to
663.q /etc/rc
664(or
665.q /etc/rc.local
666as appropriate)
667in the area where it is starting up the daemons:
668.(b
669if [ \-f /usr/\*(SD/sendmail \-a \-f /etc/sendmail.cf ]; then
670 (cd /var/spool/mqueue; rm \-f [lnx]f*)
671 /usr/\*(SD/sendmail \-bd \-q30m &
672 echo \-n ' sendmail' >/dev/console
673fi
674.)b
675The
676.q cd
677and
678.q rm
679commands insure that all lock files have been removed;
680extraneous lock files may be left around
681if the system goes down in the middle of processing a message.
682The line that actually invokes
683.i sendmail
684has two flags:
685.q \-bd
686causes it to listen on the SMTP port,
687and
688.q \-q30m
689causes it to run the queue every half hour.
690.pp
691Some people use a more complex startup script,
692removing zero length qf files and df files for which there is no qf file.
693For example:
694.(b
695# remove zero length qf files
696for qffile in qf*
697do
698 if [ \-r $qffile ]
699 then
700 if [ ! \-s $qffile ]
701 then
702 echo \-n " <zero: $qffile>" > /dev/console
703 rm \-f $qffile
704 fi
705 fi
706done
707# rename tf files to be qf if the qf does not exist
708for tffile in tf*
709do
710 qffile=`echo $tffile | sed 's/t/q/'`
711 if [ \-r $tffile \-a ! \-f $qffile ]
712 then
713 echo \-n " <recovering: $tffile>" > /dev/console
714 mv $tffile $qffile
715 else
716 echo \-n " <extra: $tffile>" > /dev/console
717 rm \-f $tffile
718 fi
719done
d747e748 720# remove df files with no corresponding qf files
6f14531a
RG
721for dffile in df*
722do
723 qffile=`echo $dffile | sed 's/d/q/'`
724 if [ \-r $dffile \-a ! \-f $qffile ]
725 then
726 echo \-n " <incomplete: $dffile>" > /dev/console
d747e748 727 mv $dffile `echo $dffile | sed 's/d/D/'`
6f14531a
RG
728 fi
729done
d747e748
JH
730# announce files that have been saved during disaster recovery
731for xffile in [A-Z]f*
732do
733 echo \-n " <panic: $xffile>" > /dev/console
734done
6f14531a
RG
735.)b
736.pp
737If you are not running a version of UNIX
738that supports Berkeley TCP/IP,
739do not include the
740.b \-bd
741flag.
742.sh 3 "/usr/lib/sendmail.hf"
743.pp
744This is the help file used by the SMTP
745.b HELP
746command.
747It should be copied from
748.q lib/sendmail.hf :
749.(b
750cp lib/sendmail.hf /usr/lib
751.)b
752The actual path of this file
753is defined in the
754.b H
755option of the
756.i sendmail.cf
757file.
758.sh 3 "/etc/sendmail.st"
759.pp
760If you wish to collect statistics
761about your mail traffic,
762you should create the file
763.q /etc/sendmail.st :
764.(b
765cp /dev/null /etc/sendmail.st
766chmod 666 /etc/sendmail.st
767.)b
768This file does not grow.
769It is printed with the program
770.q mailstats/mailstats.c.
771The actual path of this file
772is defined in the
773.b S
774option of the
775.i sendmail.cf
776file.
d747e748 777.sh 3 "/usr/\*(SB/newaliases"
6f14531a
RG
778.pp
779If
780.i sendmail
781is invoked as
782.q newaliases,
783it will simulate the
784.b \-bi
785flag
786(i.e., will rebuild the alias database;
787see below).
788This should be a link to /usr/\*(SD/sendmail.
d747e748 789.sh 3 "/usr/\*(SB/mailq"
6f14531a
RG
790.pp
791If
792.i sendmail
793is invoked as
794.q mailq,
795it will simulate the
796.b \-bp
797flag
798(i.e.,
799.i sendmail
800will print the contents of the mail queue;
801see below).
802This should be a link to /usr/\*(SD/sendmail.
803.sh 1 "NORMAL OPERATIONS"
6f14531a
RG
804.sh 2 "The System Log"
805.pp
806The system log is supported by the
807.i syslogd \|(8)
808program.
042b8fbf
AM
809All messages from
810.i sendmail
811are logged under the
812.sm LOG_MAIL
813facility.
6f14531a
RG
814.sh 3 "Format"
815.pp
816Each line in the system log
817consists of a timestamp,
818the name of the machine that generated it
819(for logging from several machines
820over the local area network),
821the word
822.q sendmail: ,
823and a message.
824.sh 3 "Levels"
825.pp
826If you have
827.i syslogd \|(8)
828or an equivalent installed,
829you will be able to do logging.
830There is a large amount of information that can be logged.
831The log is arranged as a succession of levels.
832At the lowest level
833only extremely strange situations are logged.
834At the highest level,
835even the most mundane and uninteresting events
836are recorded for posterity.
837As a convention,
838log levels under ten
839are considered generally
840.q useful;
841log levels above 64
842are reserved for debugging purposes.
843Levels from 11\-64 are reserved for verbose information
844that some sites might want.
845.pp
846A complete description of the log levels
847is given in section 4.6.
848.sh 2 "The Mail Queue"
849.pp
850The mail queue should be processed transparently.
851However, you may find that manual intervention is sometimes necessary.
852For example,
853if a major host is down for a period of time
854the queue may become clogged.
d747e748
JH
855Although
856.i sendmail
857ought to recover gracefully when the host comes up,
6f14531a
RG
858you may find performance unacceptably bad in the meantime.
859.sh 3 "Printing the queue"
860.pp
861The contents of the queue can be printed
862using the
863.i mailq
864command
865(or by specifying the
866.b \-bp
d747e748
JH
867flag to
868.i sendmail ):
6f14531a
RG
869.(b
870mailq
871.)b
872This will produce a listing of the queue id's,
873the size of the message,
874the date the message entered the queue,
875and the sender and recipients.
876.sh 3 "Forcing the queue"
877.pp
878.i Sendmail
879should run the queue automatically
880at intervals.
881The algorithm is to read and sort the queue,
882and then to attempt to process all jobs in order.
883When it attempts to run the job,
884.i sendmail
885first checks to see if the job is locked.
886If so, it ignores the job.
887.pp
888There is no attempt to insure that only one queue processor
889exists at any time,
890since there is no guarantee that a job cannot take forever
891to process
892(however,
893.i sendmail
894does include heuristics to try to abort jobs
895that are taking absurd amounts of time;
896technically, this violates RFC 821, but is blessed by RFC 1123).
897Due to the locking algorithm,
898it is impossible for one job to freeze the entire queue.
899However,
900an uncooperative recipient host
901or a program recipient
902that never returns
903can accumulate many processes in your system.
904Unfortunately,
905there is no completely general way to solve this.
906.pp
907In some cases,
908you may find that a major host going down
909for a couple of days
910may create a prohibitively large queue.
911This will result in
912.i sendmail
913spending an inordinate amount of time
914sorting the queue.
915This situation can be fixed by moving the queue to a temporary place
916and creating a new queue.
917The old queue can be run later when the offending host returns to service.
918.pp
919To do this,
920it is acceptable to move the entire queue directory:
921.(b
922cd /var/spool
923mv mqueue omqueue; mkdir mqueue; chmod 700 mqueue
924.)b
925You should then kill the existing daemon
926(since it will still be processing in the old queue directory)
927and create a new daemon.
928.pp
929To run the old mail queue,
930run the following command:
931.(b
932/usr/\*(SD/sendmail \-oQ/var/spool/omqueue \-q
933.)b
934The
935.b \-oQ
936flag specifies an alternate queue directory
937and the
938.b \-q
939flag says to just run every job in the queue.
940If you have a tendency toward voyeurism,
941you can use the
942.b \-v
943flag to watch what is going on.
944.pp
945When the queue is finally emptied,
946you can remove the directory:
947.(b
948rmdir /var/spool/omqueue
949.)b
950.sh 2 "The Alias Database"
951.pp
952The alias database exists in two forms.
953One is a text form,
954maintained in the file
955.i /etc/aliases.
956The aliases are of the form
957.(b
958name: name1, name2, ...
959.)b
960Only local names may be aliased;
961e.g.,
962.(b
963eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU
964.)b
965will not have the desired effect.
966Aliases may be continued by starting any continuation lines
967with a space or a tab.
968Blank lines and lines beginning with a sharp sign
969(\c
970.q # )
971are comments.
972.pp
973The second form is processed by the
974.i dbm \|(3)
975(or
976.i db \|(3))
977library.
978This form is in the files
979.i /etc/aliases.dir
980and
981.i /etc/aliases.pag.
982This is the form that
983.i sendmail
984actually uses to resolve aliases.
985This technique is used to improve performance.
986.pp
987You can also use
988.sm NIS -based
989alias files.
990For example, the specification:
991.(b
992OA/etc/aliases
993OAnis:mail.aliases@my.nis.domain
994.)b
995will first search the /etc/aliases file
996and then the map named
997.q mail.aliases
998in
999.q my.nis.domain .
042b8fbf
AM
1000Warning: if you build your own
1001.sm NIS -based
1002alias files,
1003be sure to provide the
1004.b \-l
1005flag to
1006.i makedbm (8)
1007to map upper case letters in the keys to lower case;
1008otherwise, aliases with upper case letters in their names
1009won't match incoming addresses.
3a363396
NW
1010.pp
1011Additional flags can be added after the colon
1012exactly like a
1013.b K
1014line \(em for example:
1015.(b
1016OAnis:-N mail.aliases@my.nis.domain
1017.)b
1018will search the appropriate NIS map and always include null bytes in the key.
6f14531a
RG
1019.sh 3 "Rebuilding the alias database"
1020.pp
1021The DB or DBM version of the database
1022may be rebuilt explicitly by executing the command
1023.(b
1024newaliases
1025.)b
1026This is equivalent to giving
1027.i sendmail
1028the
1029.b \-bi
1030flag:
1031.(b
1032/usr/\*(SD/sendmail \-bi
1033.)b
1034.pp
1035If the
1036.q D
1037option is specified in the configuration,
1038.i sendmail
1039will rebuild the alias database automatically
1040if possible
1041when it is out of date.
1042Auto-rebuild can be dangerous
1043on heavily loaded machines
1044with large alias files;
1045if it might take more than five minutes
1046to rebuild the database,
1047there is a chance that several processes will start the rebuild process
1048simultaneously.
1049.pp
1050If you have multiple aliases databases specified,
1051the
1052.b \-bi
1053flag rebuilds all the database types it understands
1054(for example, it can rebuild dbm databases but not nis databases).
1055.sh 3 "Potential problems"
1056.pp
1057There are a number of problems that can occur
1058with the alias database.
1059They all result from a
1060.i sendmail
1061process accessing the DBM version
1062while it is only partially built.
1063This can happen under two circumstances:
1064One process accesses the database
1065while another process is rebuilding it,
1066or the process rebuilding the database dies
1067(due to being killed or a system crash)
1068before completing the rebuild.
1069.pp
1070Sendmail has two techniques to try to relieve these problems.
1071First, it ignores interrupts while rebuilding the database;
1072this avoids the problem of someone aborting the process
1073leaving a partially rebuilt database.
1074Second,
1075at the end of the rebuild
1076it adds an alias of the form
1077.(b
1078@: @
1079.)b
1080(which is not normally legal).
d747e748
JH
1081Before
1082.i sendmail
1083will access the database,
6f14531a
RG
1084it checks to insure that this entry exists\**.
1085.(f
1086\**The
1087.q a
1088option is required in the configuration
1089for this action to occur.
042b8fbf 1090This should normally be specified.
6f14531a
RG
1091.)f
1092.sh 3 "List owners"
1093.pp
1094If an error occurs on sending to a certain address,
1095say
1096.q \fIx\fP ,
1097.i sendmail
1098will look for an alias
1099of the form
1100.q owner-\fIx\fP
1101to receive the errors.
1102This is typically useful
1103for a mailing list
1104where the submitter of the list
1105has no control over the maintenance of the list itself;
1106in this case the list maintainer would be the owner of the list.
1107For example:
1108.(b
1109unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser,
1110 sam@matisse
1111owner-unix-wizards: eric@ucbarpa
1112.)b
1113would cause
1114.q eric@ucbarpa
1115to get the error that will occur
1116when someone sends to
1117unix-wizards
1118due to the inclusion of
1119.q nosuchuser
1120on the list.
1121.pp
1122List owners also cause the envelope sender address to be modified.
1123The contents of the owner alias are used if they point to a single user,
1124otherwise the name of the alias itself is used.
1125For this reason, and to obey Internet conventions,
1126a typical scheme would be:
1127.(b
1128list: some, set, of, addresses
3a363396 1129list-request: list-admin-1, list-admin-2, ...
6f14531a
RG
1130owner-list: list-request
1131.)b
1132.sh 2 "User Information Database"
1133.pp
1134If you have a version of
1135.i sendmail
1136with the user information database
1137compiled in,
1138and you have specified one or more databases using the
1139.b U
1140option,
1141the databases will be searched for a
1142.i user :maildrop
1143entry.
1144If found, the mail will be sent to the specified address.
1145.pp
1146If the first token passed to user part of the
1147.q local
1148mailer is an at sign,
1149the at sign will be stripped off
1150and this step will be skipped.
1151.sh 2 "Per-User Forwarding (.forward Files)"
1152.pp
1153As an alternative to the alias database,
1154any user may put a file with the name
1155.q .forward
1156in his or her home directory.
1157If this file exists,
1158.i sendmail
1159redirects mail for that user
1160to the list of addresses listed in the .forward file.
1161For example, if the home directory for user
1162.q mckusick
1163has a .forward file with contents:
1164.(b
1165mckusick@ernie
1166kirk@calder
1167.)b
1168then any mail arriving for
1169.q mckusick
1170will be redirected to the specified accounts.
1171.pp
1172Actually, the configuration file defines a sequence of filenames to check.
1173By default, this is the user's .forward file,
1174but can be defined to be more generally using the
1175.b J
1176option.
1177If you change this,
1178you will have to inform your user base of the change;
1179\&.forward is pretty well incorporated into the collective subconscious.
1180.sh 2 "Special Header Lines"
1181.pp
1182Several header lines have special interpretations
1183defined by the configuration file.
1184Others have interpretations built into
1185.i sendmail
1186that cannot be changed without changing the code.
1187These builtins are described here.
1188.sh 3 "Return-Receipt-To:"
1189.pp
1190If this header is sent,
1191a message will be sent to any specified addresses
1192when the final delivery is complete,
1193that is,
1194when successfully delivered to a mailer with the
1195.b l
d747e748
JH
1196flag (local delivery) set in the mailer descriptor\**.
1197.(f
1198\**Some sites disable this header,
1199and other (non-\c
1200.i sendmail )
1201systems do not implement it.
1202Do not assume that a failure to get a return receipt
1203means that the mail did not arrive.
1204Also, do not assume that getting a return receipt
1205means that the mail has been read;
1206it just means that the message has been delivered
1207to the recipient's mailbox.
1208.)f
6f14531a
RG
1209.sh 3 "Errors-To:"
1210.pp
1211If errors occur anywhere during processing,
1212this header will cause error messages to go to
1213the listed addresses.
1214This is intended for mailing lists.
1215.pp
1216The Errors-To: header was created in the bad old days
1217when UUCP didn't understand the distinction between an envelope and a header;
1218this was a hack to provide what should now be passed
1219as the envelope sender address.
1220It should go away.
1221It is only used if the
1222.b l
1223option is set.
1224.sh 3 "Apparently-To:"
1225.pp
1226If a message comes in with no recipients listed in the message
1227(in a To:, Cc:, or Bcc: line)
1228then
1229.i sendmail
1230will add an
1231.q "Apparently-To:"
1232header line for any recipients it is aware of.
1233This is not put in as a standard recipient line
1234to warn any recipients that the list is not complete.
1235.pp
1236At least one recipient line is required under RFC 822.
1237.sh 2 "IDENT Protocol Support"
1238.pp
1239.i Sendmail
1240supports the IDENT protocol as defined in RFC 1413.
1241Although this enhances identification
1242of the author of an email message
1243by doing a ``call back'' to the originating system to include
1244the owner of a particular TCP connection
1245in the audit trail
1246it is in no sense perfect;
1247a determined forger can easily spoof the IDENT protocol.
1248The following description is excerpted from RFC 1413:
1249.ba +5
d747e748 1250.lp
6f14531a
RG
12516. Security Considerations
1252.lp
1253The information returned by this protocol is at most as trustworthy
1254as the host providing it OR the organization operating the host. For
1255example, a PC in an open lab has few if any controls on it to prevent
1256a user from having this protocol return any identifier the user
1257wants. Likewise, if the host has been compromised the information
1258returned may be completely erroneous and misleading.
1259.lp
1260The Identification Protocol is not intended as an authorization or
1261access control protocol. At best, it provides some additional
1262auditing information with respect to TCP connections. At worst, it
1263can provide misleading, incorrect, or maliciously incorrect
1264information.
1265.lp
1266The use of the information returned by this protocol for other than
1267auditing is strongly discouraged. Specifically, using Identification
1268Protocol information to make access control decisions - either as the
1269primary method (i.e., no other checks) or as an adjunct to other
1270methods may result in a weakening of normal host security.
1271.lp
1272An Identification server may reveal information about users,
1273entities, objects or processes which might normally be considered
1274private. An Identification server provides service which is a rough
1275analog of the CallerID services provided by some phone companies and
1276many of the same privacy considerations and arguments that apply to
1277the CallerID service apply to Identification. If you wouldn't run a
1278"finger" server due to privacy considerations you may not want to run
1279this protocol.
1280.ba
1281.sh 1 "ARGUMENTS"
1282.pp
1283The complete list of arguments to
1284.i sendmail
1285is described in detail in Appendix A.
1286Some important arguments are described here.
1287.sh 2 "Queue Interval"
1288.pp
1289The amount of time between forking a process
1290to run through the queue
1291is defined by the
1292.b \-q
1293flag.
1294If you run in mode
1295.b f
1296or
1297.b a
1298this can be relatively large,
1299since it will only be relevant
1300when a host that was down comes back up.
1301If you run in
1302.b q
1303mode
1304it should be relatively short,
1305since it defines the maximum amount of time that a message
1306may sit in the queue.
1307.pp
1308RFC 1123 section 5.3.1.1 says that this value should be at least 30 minutes
1309(although that probably doesn't make sense if you use ``queue-only'' mode).
1310.sh 2 "Daemon Mode"
1311.pp
1312If you allow incoming mail over an IPC connection,
1313you should have a daemon running.
1314This should be set by your
1315.i /etc/rc
1316file using the
1317.b \-bd
1318flag.
1319The
1320.b \-bd
1321flag and the
1322.b \-q
1323flag may be combined in one call:
1324.(b
1325/usr/\*(SD/sendmail \-bd \-q30m
1326.)b
1327.sh 2 "Forcing the Queue"
1328.pp
1329In some cases you may find that the queue has gotten clogged for some reason.
1330You can force a queue run
1331using the
1332.b \-q
1333flag (with no value).
1334It is entertaining to use the
1335.b \-v
1336flag (verbose)
1337when this is done to watch what happens:
1338.(b
1339/usr/\*(SD/sendmail \-q \-v
1340.)b
1341.pp
1342You can also limit the jobs to those with a particular queue identifier,
1343sender, or recipient
1344using one of the queue modifiers.
1345For example,
1346.q \-qRberkeley
1347restricts the queue run to jobs that have the string
1348.q berkeley
1349somewhere in one of the recipient addresses.
1350Similarly,
1351.q \-qSstring
1352limits the run to particular senders and
1353.q \-qIstring
1354limits it to particular identifiers.
1355.sh 2 "Debugging"
1356.pp
1357There are a fairly large number of debug flags
1358built into
1359.i sendmail .
1360Each debug flag has a number and a level,
1361where higher levels means to print out more information.
1362The convention is that levels greater than nine are
1363.q absurd,
1364i.e.,
1365they print out so much information that you wouldn't normally
1366want to see them except for debugging that particular piece of code.
1367Debug flags are set using the
1368.b \-d
1369option;
1370the syntax is:
1371.(b
1372.ta \w'debug-option 'u
1373debug-flag: \fB\-d\fP debug-list
1374debug-list: debug-option [ , debug-option ]
1375debug-option: debug-range [ . debug-level ]
1376debug-range: integer | integer \- integer
1377debug-level: integer
1378.)b
1379where spaces are for reading ease only.
1380For example,
1381.(b
1382\-d12 Set flag 12 to level 1
1383\-d12.3 Set flag 12 to level 3
1384\-d3-17 Set flags 3 through 17 to level 1
1385\-d3-17.4 Set flags 3 through 17 to level 4
1386.)b
1387For a complete list of the available debug flags
1388you will have to look at the code
1389(they are too dynamic to keep this documentation up to date).
1390.sh 2 "Trying a Different Configuration File"
1391.pp
1392An alternative configuration file
1393can be specified using the
1394.b \-C
1395flag; for example,
1396.(b
1397/usr/\*(SD/sendmail \-Ctest.cf
1398.)b
1399uses the configuration file
1400.i test.cf
1401instead of the default
1402.i /etc/sendmail.cf.
1403If the
1404.b \-C
1405flag has no value
1406it defaults to
1407.i sendmail.cf
1408in the current directory.
1409.sh 2 "Changing the Values of Options"
1410.pp
1411Options can be overridden using the
1412.b \-o
1413flag.
1414For example,
1415.(b
1416/usr/\*(SD/sendmail \-oT2m
1417.)b
1418sets the
1419.b T
1420(timeout) option to two minutes
1421for this run only.
1422.pp
1423Some options have security implications.
1424Sendmail allows you to set these,
1425but refuses to run as root thereafter.
3a363396
NW
1426.sh 2 "Logging Traffic"
1427.pp
1428Many SMTP implementations do not fully implement the protocol.
1429For example, some personal computer based SMTPs
1430do not understand continuation lines in reply codes.
1431These can be very hard to trace.
1432If you suspect such a problem, you can set traffic logging using the
1433.b \-X
1434flag.
1435For example,
1436.(b
1437/usr/\*(SD/sendmail \-X /tmp/traffic -bd
1438.)b
1439will log all traffic in the file
1440.i /tmp/traffic .
1441.pp
1442This logs a lot of data very quickly and should never be used
1443during normal operations.
1444After starting up such a daemon,
1445force the errant implementation to send a message to your host.
1446All message traffic in and out of
1447.i sendmail ,
1448including the incoming SMTP traffic,
1449will be logged in this file.
042b8fbf
AM
1450.sh 2 "Dumping State"
1451.pp
1452You can ask
1453.i sendmail
1454to log a dump of the open files
1455and the connection cache
1456by sending it a
1457.sm SIGUSR1
1458signal.
1459The results are logged at
1460.sm LOG_DEBUG
1461priority.
6f14531a
RG
1462.sh 1 "TUNING"
1463.pp
1464There are a number of configuration parameters
1465you may want to change,
1466depending on the requirements of your site.
1467Most of these are set
1468using an option in the configuration file.
1469For example,
1470the line
1471.q OT5d
1472sets option
1473.q T
1474to the value
1475.q 5d
1476(five days).
1477.pp
1478Most of these options have appropriate defaults for most sites.
1479However,
1480sites having very high mail loads may find they need to tune them
1481as appropriate for their mail load.
1482In particular,
1483sites experiencing a large number of small messages,
1484many of which are delivered to many recipients,
1485may find that they need to adjust the parameters
1486dealing with queue priorities.
1487.sh 2 "Timeouts"
1488.pp
1489All time intervals are set
1490using a scaled syntax.
1491For example,
1492.q 10m
1493represents ten minutes, whereas
1494.q 2h30m
1495represents two and a half hours.
1496The full set of scales is:
1497.(b
1498.ta 4n
1499s seconds
1500m minutes
1501h hours
1502d days
1503w weeks
1504.)b
1505.sh 3 "Queue interval"
1506.pp
1507The argument to the
1508.b \-q
1509flag
1510specifies how often a sub-daemon will run the queue.
1511This is typically set to between fifteen minutes
1512and one hour.
1513RFC 1123 section 5.3.1.1 recommends that this be at least 30 minutes.
1514.sh 3 "Read timeouts"
1515.pp
1516It is possible to time out when reading the standard input
1517or when reading from a remote SMTP server.
1518These timeouts are set using the
1519.b r
1520option in the configuration file.
1521The argument is a list of
1522.i keyword=value
1523pairs.
1524The recognized keywords, their default values, and the minimum values
1525allowed by RFC 1123 section 5.3.2 are:
1526.nr ii 1i
1527.ip initial
1528The wait for the initial 220 greeting message
1529[5m, 5m].
1530.ip helo
1531The wait for a reply from a HELO or EHLO command
1532[5m, unspecified].
1533This may require a host name lookup, so
1534five minutes is probably a reasonable minimum.
1535.ip mail\(dg
1536The wait for a reply from a MAIL command
1537[10m, 5m].
1538.ip rcpt\(dg
1539The wait for a reply from a RCPT command
1540[1h, 5m].
1541This should be long
1542because it could be pointing at a list
1543that takes a long time to expand.
1544.ip datainit\(dg
1545The wait for a reply from a DATA command
1546[5m, 2m].
1547.ip datablock\(dg
1548The wait for reading a data block
1549(that is, the body of the message).
1550[1h, 3m].
1551This should be long because it also applies to programs
1552piping input to
1553.i sendmail
1554which have no guarantee of promptness.
1555.ip datafinal\(dg
1556The wait for a reply from the dot terminating a message.
1557[1h, 10m].
1558If this is shorter than the time actually needed
1559for the receiver to deliver the message,
1560duplicates will be generated.
1561This is discussed in RFC 1047.
1562.ip rset
1563The wait for a reply from a RSET command
1564[5m, unspecified].
1565.ip quit
1566The wait for a reply from a QUIT command
1567[2m, unspecified].
1568.ip misc
1569The wait for a reply from miscellaneous (but short) commands
1570such as NOOP (no-operation) and VERB (go into verbose mode).
1571[2m, unspecified].
1572.ip command\(dg
1573In server SMTP,
1574the time to wait for another command.
1575[1h, 5m].
d747e748
JH
1576.ip ident
1577The timeout waiting for a reply to an IDENT query
1578[30s, unspecified].
6f14531a
RG
1579.lp
1580For compatibility with old configuration files,
1581if no ``keyword='' is specified,
1582all the timeouts marked with \(dg are set to the indicated value.
1583.pp
1584Many of the RFC 1123 minimum values
1585may well be too short.
1586.i Sendmail
1587was designed to the RFC 822 protocols,
1588which did not specify read timeouts;
1589hence,
1590.i sendmail
1591does not guarantee to reply to messages promptly.
1592In particular, a
1593.q RCPT
1594command specifying a mailing list
1595will expand and verify the entire list;
1596a large list on a slow system
1597may take more than five minutes\**.
1598.(f
1599\**This verification includes looking up every address
1600with the name server;
1601this involves network delays,
1602and can in some cases can be considerable.
1603.)f
1604I recommend a one hour timeout \*-
1605since this failure is rare,
1606a long timeout is not onerous
1607and may ultimately help reduce network load.
1608.pp
1609For example, the line:
1610.(b
1611Orcommand=25m,datablock=3h
1612.)b
1613sets the server SMTP command timeout to 25 minutes
1614and the input data block timeout to three hours.
1615.sh 3 "Message timeouts"
1616.pp
1617After sitting in the queue for a few days,
1618a message will time out.
1619This is to insure that at least the sender is aware
1620of the inability to send a message.
1621The timeout is typically set to three days.
1622This timeout is set using the
1623.b T
1624option in the configuration file.
1625.pp
1626The time of submission is set in the queue,
1627rather than the amount of time left until timeout.
1628As a result, you can flush messages that have been hanging
1629for a short period
1630by running the queue
1631with a short message timeout.
1632For example,
1633.(b
1634/usr/\*(SD/sendmail \-oT1d \-q
1635.)b
1636will run the queue
1637and flush anything that is one day old.
1638.pp
1639Since this option is global,
1640and since you can not
1641.i "a priori"
1642know how long another host outside your domain will be down,
1643a five day timeout is recommended.
1644This allows a recipient to fix the problem even if it occurs
1645at the beginning of a long weekend.
1646RFC 1123 section 5.3.1.1 says that this parameter
1647should be ``at least 4\-5 days''.
1648.pp
1649The
1650.b T
1651option can also take a second timeout indicating a time after which
1652a warning message should be sent;
1653the two timeouts are separated by a slash.
1654For example, the value
1655.(b
16565d/4h
1657.)b
1658causes email to fail after five days,
1659but a warning message will be sent after four hours.
1660This should be large enough that the message will have been tried
1661several times.
1662.sh 2 "Forking During Queue Runs"
1663.pp
1664By setting the
1665.b Y
1666option,
1667.i sendmail
1668will fork before each individual message
1669while running the queue.
1670This will prevent
1671.i sendmail
1672from consuming large amounts of memory,
1673so it may be useful in memory-poor environments.
1674However, if the
1675.b Y
1676option is not set,
1677.i sendmail
1678will keep track of hosts that are down during a queue run,
1679which can improve performance dramatically.
1680.pp
1681If the
1682.b Y
1683option is set,
1684.i sendmail
1685can not use connection caching.
1686.sh 2 "Queue Priorities"
1687.pp
1688Every message is assigned a priority when it is first instantiated,
1689consisting of the message size (in bytes)
1690offset by the message class times the
1691.q "work class factor"
1692and the number of recipients times the
1693.q "work recipient factor."
1694The priority is used to order the queue.
1695Higher numbers for the priority mean that the message will be processed later
1696when running the queue.
1697.pp
1698The message size is included so that large messages are penalized
1699relative to small messages.
1700The message class allows users to send
1701.q "high priority"
1702messages by including a
1703.q Precedence:
1704field in their message;
1705the value of this field is looked up in the
1706.b P
1707lines of the configuration file.
1708Since the number of recipients affects the amount of load a message presents
1709to the system,
1710this is also included into the priority.
1711.pp
1712The recipient and class factors
1713can be set in the configuration file using the
1714.b y
1715and
1716.b z
1717options respectively.
1718They default to 30000 (for the recipient factor)
1719and 1800
1720(for the class factor).
1721The initial priority is:
1722.EQ
d747e748 1723pri = msgsize - (class times bold z) + (nrcpt times bold y)
6f14531a
RG
1724.EN
1725(Remember, higher values for this parameter actually mean
1726that the job will be treated with lower priority.)
1727.pp
1728The priority of a job can also be adjusted each time it is processed
1729(that is, each time an attempt is made to deliver it)
1730using the
1731.q "work time factor,"
1732set by the
1733.b Z
1734option.
1735This is added to the priority,
1736so it normally decreases the precedence of the job,
1737on the grounds that jobs that have failed many times
1738will tend to fail again in the future.
1739The
1740.b Z
1741option defaults to 90000.
1742.sh 2 "Load Limiting"
1743.pp
1744.i Sendmail
1745can be asked to queue (but not deliver)
1746mail if the system load average gets too high
1747using the
1748.b x
1749option.
1750When the load average exceeds the value of the
1751.b x
1752option,
1753the delivery mode is set to
1754.b q
1755(queue only)
1756if the
1757.i "Queue Factor"
1758(\c
1759.b q
1760option)
1761divided by the difference in the current load average and the
1762.b x
1763option
1764plus one
1765exceeds the priority of the message \(em
1766that is, the message is queued iff:
1767.EQ
1768pri > { bold q } over { LA - { bold x } + 1 }
1769.EN
1770The
1771.b q
d747e748
JH
1772option defaults to 600000,
1773so each point of load average is worth 600000
6f14531a
RG
1774priority points
1775(as described above).
1776.pp
1777For drastic cases,
1778the
1779.b X
d747e748
JH
1780option defines a load average at which
1781.i sendmail
1782will refuse
6f14531a
RG
1783to accept network connections.
1784Locally generated mail
1785(including incoming UUCP mail)
1786is still accepted.
1787.sh 2 "Delivery Mode"
1788.pp
1789There are a number of delivery modes that
1790.i sendmail
1791can operate in,
1792set by the
1793.q d
1794configuration option.
1795These modes
1796specify how quickly mail will be delivered.
1797Legal modes are:
1798.(b
1799.ta 4n
1800i deliver interactively (synchronously)
1801b deliver in background (asynchronously)
1802q queue only (don't deliver)
1803.)b
1804There are tradeoffs.
1805Mode
1806.q i
1807passes the maximum amount of information to the sender,
1808but is hardly ever necessary.
1809Mode
1810.q q
1811puts the minimum load on your machine,
1812but means that delivery may be delayed for up to the queue interval.
1813Mode
1814.q b
1815is probably a good compromise.
1816However, this mode can cause large numbers of processes
1817if you have a mailer that takes a long time to deliver a message.
1818.pp
1819If you run in mode
1820.q q
1821(queue only)
d747e748
JH
1822or
1823.q b
1824(deliver in background)
6f14531a
RG
1825.i sendmail
1826will not expand aliases and follow .forward files
1827upon initial receipt of the mail.
1828This speeds up the response to RCPT commands.
1829.sh 2 "Log Level"
1830.pp
d747e748
JH
1831The level of logging can be set for
1832.i sendmail .
6f14531a
RG
1833The default using a standard configuration table is level 9.
1834The levels are as follows:
1835.nr ii 0.5i
1836.ip 0
1837No logging.
1838.ip 1
1839Serious system failures and potential security problems.
1840.ip 2
1841Lost communications (network problems) and protocol failures.
1842.ip 3
1843Other serious failures.
1844.ip 4
1845Minor failures.
1846.ip 5
1847Message collection statistics.
1848.ip 6
1849Creation of error messages,
1850VRFY and EXPN commands.
1851.ip 7
1852Delivery failures (host or user unknown, etc.).
1853.ip 8
1854Successful deliveries.
1855.ip 9
1856Messages being deferred
1857(due to a host being down, etc.).
1858.ip 10
1859Database expansion (alias, forward, and userdb lookups).
1860.ip 15
1861Automatic alias database rebuilds.
1862.ip 20
1863Logs attempts to run locked queue files.
1864These are not errors,
1865but can be useful to note if your queue appears to be clogged.
1866.ip 30
1867Lost locks (only if using lockf instead of flock).
1868.lp
1869Additionally,
1870values above 64 are reserved for extremely verbose debuggging output.
1871No normal site would ever set these.
1872.sh 2 "File Modes"
1873.pp
1874There are a number of files
1875that may have a number of modes.
1876The modes depend on what functionality you want
1877and the level of security you require.
1878.sh 3 "To suid or not to suid?"
1879.pp
1880.i Sendmail
1881can safely be made
1882setuid to root.
1883At the point where it is about to
1884.i exec \|(2)
1885a mailer,
1886it checks to see if the userid is zero;
1887if so,
1888it resets the userid and groupid to a default
1889(set by the
1890.b u
1891and
1892.b g
1893options).
1894(This can be overridden
1895by setting the
1896.b S
1897flag to the mailer
1898for mailers that are trusted
1899and must be called as root.)
1900However,
1901this will cause mail processing
1902to be accounted
1903(using
1904.i sa \|(8))
1905to root
1906rather than to the user sending the mail.
1907.sh 3 "Should my alias database be writable?"
1908.pp
1909At Berkeley
1910we have the alias database
1911(/etc/aliases*)
1912mode 644.
1913While this is not as flexible as if the database
1914were more 666, it avoids potential security problems
1915with a globally writable database.
1916.pp
1917The database that
1918.i sendmail
1919actually used
1920is represented by the two files
1921.i aliases.dir
1922and
1923.i aliases.pag
1924(both in /etc)
1925(or
1926.i aliases.db
1927if you are running with the new Berkeley database primitives).
1928The mode on these files should match the mode
1929on /etc/aliases.
1930If
1931.i aliases
1932is writable
1933and the
1934DBM
1935files
1936(\c
1937.i aliases.dir
1938and
1939.i aliases.pag )
1940are not,
1941users will be unable to reflect their desired changes
1942through to the actual database.
1943However,
1944if
1945.i aliases
1946is read-only
1947and the DBM files are writable,
1948a slightly sophisticated user
1949can arrange to steal mail anyway.
1950.pp
1951If your DBM files are not writable by the world
1952or you do not have auto-rebuild enabled
1953(with the
1954.q D
1955option),
1956then you must be careful to reconstruct the alias database
1957each time you change the text version:
1958.(b
1959newaliases
1960.)b
1961If this step is ignored or forgotten
1962any intended changes will also be ignored or forgotten.
1963.sh 2 "Connection Caching"
1964.pp
1965When processing the queue,
d747e748 1966.i sendmail
6f14531a
RG
1967will try to keep the last few open connections open
1968to avoid startup and shutdown costs.
1969This only applies to IPC connections.
1970.pp
1971When trying to open a connection
1972the cache is first searched.
1973If an open connection is found, it is probed to see if it is still active
1974by sending a
1975.sm NOOP
1976command.
1977It is not an error if this fails;
1978instead, the connection is closed and reopened.
1979.pp
1980Two parameters control the connection cache.
1981The
1982.b k
1983option defines the number of simultaneous open connections
1984that will be permitted.
1985If it is set to zero,
1986connections will be closed as quickly as possible.
1987The default is one.
1988This should be set as appropriate for your system size;
1989it will limit the amount of system resources that
d747e748 1990.i sendmail
6f14531a
RG
1991will use during queue runs.
1992.pp
1993The
1994.b K
1995option specifies the maximum time that any cached connection
1996will be permitted to idle.
1997When the idle time exceeds this value
1998the connection is closed.
1999This number should be small
2000(under ten minutes)
2001to prevent you from grabbing too many resources
2002from other hosts.
2003The default is five minutes.
2004.sh 2 "Name Server Access"
2005.pp
2006If your system supports the name server,
2007then the probability is that
2008.i sendmail
d747e748
JH
2009will be using it regardless of how you configure
2010.i sendmail .
2011In particular, the system routine
2012.i gethostbyname (3)
2013is used to look up host names,
2014and most vendor versions try some combination of DNS, NIS,
2015and file lookup in /etc/hosts.
2016.pp
2017However, if you do not have a nameserver configured at all,
2018such as at a UUCP-only site,
2019.i sendmail
2020will get a
6f14531a
RG
2021.q "connection refused"
2022message when it tries to connect to the name server
d747e748 2023(either indirectly by calling
6f14531a 2024.i gethostbyname
d747e748 2025or directly by looking up MX records).
6f14531a
RG
2026If the
2027.b I
2028option is set,
2029.i sendmail
d747e748
JH
2030will interpret this to mean a temporary failure
2031and will queue the mail for later processing;
6f14531a
RG
2032otherwise, it ignores the name server data.
2033If your name server is running properly,
2034the setting of this option is not relevant;
2035however, it is important that it be set properly
2036to make error handling work properly.
2037.pp
2038This option also allows you to tweak name server options.
2039The command line takes a series of flags as documented in
2040.i resolver (3)
2041(with the leading
2042.q RES_
2043deleted).
2044Each can be preceded by an optional `+' or `\(mi'.
2045For example, the line
2046.(b
2047OITrue +AAONLY \(miDNSRCH
2048.)b
2049turns on the AAONLY (accept authoritative answers only)
2050and turns off the DNSRCH (search the domain path) options.
2051Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE
2052flags on and all others off.
2053Note the use of the initial ``True'' \*-
d747e748
JH
2054this is for compatibility with previous versions of
2055.i sendmail ,
6f14531a
RG
2056but is not otherwise necessary.
2057.pp
2058Version level 1 configurations
2059turn DNSRCH and DEFNAMES off when doing delivery lookups,
2060but leave them on everywhere else.
3a363396 2061Version 8 of
6f14531a
RG
2062.i sendmail
2063ignores them when doing canonification lookups
2064(that is, when using $[ ... $]),
2065and always does the search.
2066If you don't want to do automatic name extension,
2067don't call $[ ... $].
2068.pp
2069The search rules for $[ ... $] are somewhat different than usual.
2070If the name (that is, the ``...'')
2071has at least one dot, it always tries the unmodified name first.
2072If that fails, it tries the reduced search path,
2073and lastly tries the unmodified name
2074(but only for names without a dot,
2075since names with a dot have already been tried).
2076This allows names such as
2077``utc.CS''
2078to match the site in Czechoslovakia
2079rather than the site in your local Computer Science department.
2080It also prefers A and CNAME records over MX records \*-
2081that is, if it finds an MX record it makes note of it,
2082but keeps looking.
2083This way, if you have a wildcard MX record matching your domain,
2084it will not assume that all names match.
2085.sh 2 "Moving the Per-User Forward Files"
2086.pp
2087Some sites mount each user's home directory
2088from a local disk on their workstation,
2089so that local access is fast.
2090However, the result is that .forward file lookups are slow.
2091In some cases,
2092mail can even be delivered on machines inappropriately
2093because of a file server being down.
2094The performance can be especially bad if you run the automounter.
2095.pp
2096The
2097.b J
2098option allows you to set a path of forward files.
2099For example, the config file line
2100.(b
2101OJ/var/forward/$u:$z/.forward
2102.)b
2103would first look for a file with the same name as the user's login
2104in /var/forward;
2105if that is not found (or is inaccessible)
2106the file
2107.q \&.forward
2108in the user's home directory is searched.
2109A truly perverse site could also search by sender
2110by using $r, $s, or $f.
2111.pp
2112If you create a directory such as /var/forward,
2113it should be mode 1777
2114(that is, the sticky bit should be set).
2115Users should create the files mode 644.
2116.sh 2 "Free Space"
2117.pp
2118On systems that have the
2119.i statfs (2)
2120system call,
2121you can specify a minimum number of free blocks on the queue filesystem
2122using the
2123.b b
2124option.
2125If there are fewer than the indicated number of blocks free
2126on the filesystem on which the queue is mounted
2127the SMTP server will reject mail
2128with the
2129452 error code.
2130This invites the SMTP client to try again later.
2131.pp
2132Beware of setting this option too high;
2133it can cause rejection of email
2134when that mail would be processed without difficulty.
2135.pp
2136This option can also specify an advertised
2137.q "maximum message size"
2138for hosts that speak ESMTP.
2139.sh 2 "Privacy Flags"
2140.pp
2141The
2142.b p
2143option allows you to set certain
2144``privacy''
2145flags.
2146Actually, many of them don't give you any extra privacy,
2147rather just insisting that client SMTP servers
2148use the HELO command
2149before using certain commands.
2150.pp
2151The option takes a series of flag names;
2152the final privacy is the inclusive or of those flags.
2153For example:
2154.(b
2155Op needmailhelo, noexpn
2156.)b
2157insists that the HELO or EHLO command be used before a MAIL command is accepted
2158and disables the EXPN command.
2159.pp
2160The
2161.q restrictmailq
2162option restricts printing the queue to the group that owns the queue directory.
2163It is absurd to set this if you don't also protect the logs.
d747e748
JH
2164.pp
2165The
2166.q restrictqrun
2167option restricts people running the queue
2168(that is, using the
2169.b \-q
2170command line flag)
2171to root and the owner of the queue directory.
6f14531a
RG
2172.sh 2 "Send to Me Too"
2173.pp
2174Normally,
2175.i sendmail
2176deletes the (envelope) sender from any list expansions.
2177For example, if
2178.q matt
2179sends to a list that contains
2180.q matt
2181as one of the members he won't get a copy of the message.
2182If the
2183.b \-m
2184(me too)
2185command line flag, or if the
2186.b m
2187option is set in the configuration file,
2188this behaviour is supressed.
2189Some sites like to run the
2190.sm SMTP
2191daemon with
2192.b \-m .
2193.sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE"
2194.pp
2195This section describes the configuration file
2196in detail,
2197including hints on how to write one of your own
2198if you have to.
2199.pp
2200There is one point that should be made clear immediately:
2201the syntax of the configuration file
2202is designed to be reasonably easy to parse,
2203since this is done every time
2204.i sendmail
2205starts up,
2206rather than easy for a human to read or write.
2207On the
2208.q "future project"
2209list is a
2210configuration-file compiler.
2211.pp
2212An overview of the configuration file
2213is given first,
2214followed by details of the semantics.
2215.sh 2 "Configuration File Lines"
2216.pp
2217The configuration file is organized as a series of lines,
2218each of which begins with a single character
2219defining the semantics for the rest of the line.
2220Lines beginning with a space or a tab
2221are continuation lines
2222(although the semantics are not well defined in many places).
2223Blank lines and lines beginning with a sharp symbol
2224(`#')
2225are comments.
2226.sh 3 "R and S \*- rewriting rules"
2227.pp
2228The core of address parsing
2229are the rewriting rules.
2230These are an ordered production system.
2231.i Sendmail
2232scans through the set of rewriting rules
2233looking for a match on the left hand side
2234(LHS)
2235of the rule.
2236When a rule matches,
2237the address is replaced by the right hand side
2238(RHS)
2239of the rule.
2240.pp
2241There are several sets of rewriting rules.
2242Some of the rewriting sets are used internally
2243and must have specific semantics.
2244Other rewriting sets
2245do not have specifically assigned semantics,
2246and may be referenced by the mailer definitions
2247or by other rewriting sets.
2248.pp
2249The syntax of these two commands are:
2250.(b F
2251.b S \c
2252.i n
2253.)b
2254Sets the current ruleset being collected to
2255.i n .
2256If you begin a ruleset more than once
2257it deletes the old definition.
2258.(b F
2259.b R \c
2260.i lhs
2261.i rhs
2262.i comments
2263.)b
2264The
2265fields must be separated
2266by at least one tab character;
2267there may be embedded spaces
2268in the fields.
2269The
2270.i lhs
2271is a pattern that is applied to the input.
2272If it matches,
2273the input is rewritten to the
2274.i rhs .
2275The
2276.i comments
2277are ignored.
2278.pp
2279Macro expansions of the form
2280.b $ \c
2281.i x
2282are performed when the configuration file is read.
2283Expansions of the form
2284.b $& \c
2285.i x
2286are performed at run time using a somewhat less general algorithm.
2287This for is intended only for referencing internally defined macros
2288such as
2289.b $h
2290that are changed at runtime.
2291.sh 4 "The left hand side"
2292.pp
2293The left hand side of rewriting rules contains a pattern.
2294Normal words are simply matched directly.
2295Metasyntax is introduced using a dollar sign.
2296The metasymbols are:
2297.(b
2298.ta \w'\fB$=\fP\fIx\fP 'u
2299\fB$*\fP Match zero or more tokens
2300\fB$+\fP Match one or more tokens
2301\fB$\-\fP Match exactly one token
2302\fB$=\fP\fIx\fP Match any phrase in class \fIx\fP
2303\fB$~\fP\fIx\fP Match any word not in class \fIx\fP
2304.)b
2305If any of these match,
2306they are assigned to the symbol
2307.b $ \c
2308.i n
2309for replacement on the right hand side,
2310where
2311.i n
2312is the index in the LHS.
2313For example,
2314if the LHS:
2315.(b
2316$\-:$+
2317.)b
2318is applied to the input:
2319.(b
2320UCBARPA:eric
2321.)b
2322the rule will match, and the values passed to the RHS will be:
2323.(b
2324.ta 4n
2325$1 UCBARPA
2326$2 eric
2327.)b
2328.pp
2329Additionally, the LHS can include
2330.b $@
2331to match zero tokens.
2332This is
2333.i not
2334bound to a
2335.b $ \c
2336.i N
2337on the RHS, and is normally only used when it stands alone
2338in order to match the null input.
2339.sh 4 "The right hand side"
2340.pp
2341When the left hand side of a rewriting rule matches,
2342the input is deleted and replaced by the right hand side.
2343Tokens are copied directly from the RHS
2344unless they begin with a dollar sign.
2345Metasymbols are:
2346.(b
2347.ta \w'$#mailer\0\0\0'u
2348\fB$\fP\fIn\fP Substitute indefinite token \fIn\fP from LHS
2349\fB$[\fP\fIname\fP\fB$]\fP Canonicalize \fIname\fP
2350\fB$(\fP\fImap key\fP \fB$@\fP\fIarguments\fP \fB$:\fP\fIdefault\fP \fB$)\fP
2351 Generalized keyed mapping function
2352\fB$>\fP\fIn\fP \*(lqCall\*(rq ruleset \fIn\fP
2353\fB$#\fP\fImailer\fP Resolve to \fImailer\fP
2354\fB$@\fP\fIhost\fP Specify \fIhost\fP
2355\fB$:\fP\fIuser\fP Specify \fIuser\fP
2356.)b
2357.pp
2358The
2359.b $ \c
2360.i n
2361syntax substitutes the corresponding value from a
2362.b $+ ,
2363.b $\- ,
2364.b $* ,
2365.b $= ,
2366or
2367.b $~
2368match on the LHS.
2369It may be used anywhere.
2370.pp
2371A host name enclosed between
2372.b $[
2373and
2374.b $]
2375is looked up using the
2376.i gethostent \|(3)
2377routines and replaced by the canonical name\**.
2378.(f
2379\**This is actually
2380completely equivalent
2381to $(host \fIhostname\fP$).
2382In particular, a
2383.b $:
2384default can be used.
2385.)f
2386For example,
2387.q $[csam$]
2388might become
2389.q lbl-csam.arpa
2390and
2391.q $[[128.32.130.2]$]
2392would become
2393.q vangogh.CS.Berkeley.EDU.
2394.i Sendmail
2395recognizes it's numeric IP address
2396without calling the name server
2397and replaces it with it's canonical name.
2398.pp
2399The
2400.b $(
2401\&...
2402.b $)
2403syntax is a more general form of lookup;
2404it uses a named map instead of an implicit map.
042b8fbf 2405If no lookup is found, the indicated
6f14531a
RG
2406.i default
2407is inserted;
2408if no default is specified and no lookup matches,
2409the value is left unchanged.
2410.pp
2411The
2412.b $> \c
2413.i n
2414syntax
2415causes the remainder of the line to be substituted as usual
2416and then passed as the argument to ruleset
2417.i n .
2418The final value of ruleset
2419.i n
2420then becomes
2421the substitution for this rule.
2422.pp
2423The
2424.b $#
2425syntax should
2426.i only
d747e748
JH
2427be used in ruleset zero
2428or a subroutine of ruleset zero.
6f14531a 2429It causes evaluation of the ruleset to terminate immediately,
d747e748
JH
2430and signals to
2431.i sendmail
2432that the address has completely resolved.
6f14531a
RG
2433The complete syntax is:
2434.(b
2435\fB$#\fP\fImailer\fP \fB$@\fP\fIhost\fP \fB$:\fP\fIuser\fP
2436.)b
2437This specifies the
2438{mailer, host, user}
24393-tuple necessary to direct the mailer.
2440If the mailer is local
2441the host part may be omitted\**.
2442.(f
2443\**You may want to use it for special
2444.q "per user"
2445extensions.
2446For example, at CMU you can send email to
2447.q jgm+foo ;
2448the part after the plus sign
2449is not part of the user name,
2450and is passed to the local mailer for local use.
2451.)f
2452The
2453.i mailer
2454must be a single word,
2455but the
2456.i host
2457and
2458.i user
2459may be multi-part.
2460If the
2461.i mailer
2462is the builtin IPC mailer,
2463the
2464.i host
2465may be a colon-separated list of hosts
2466that are searched in order for the first working address
2467(exactly like MX records).
042b8fbf
AM
2468The
2469.i user
2470is later rewritten by the mailer-specific envelope rewriting set
2471and assigned to the
2472.b $u
2473macro.
c2714ef5 2474As a special case, if the value to
2475.b $#
2476is
2477.q local
2478and the first character of the
2479.b $:
2480value is
2481.q @ ,
2482the
2483.q @
2484is stripped off, and a flag is set in the address descriptor
2485that causes sendmail to not do ruleset 5 processing.
6f14531a 2486.pp
c2714ef5 2487Normally, a rule that matches is retried,
042b8fbf 2488that is,
c2714ef5 2489the rule loops until it fails.
6f14531a
RG
2490A RHS may also be preceded by a
2491.b $@
2492or a
2493.b $:
042b8fbf 2494to change this behavior.
6f14531a
RG
2495A
2496.b $@
2497prefix causes the ruleset to return with the remainder of the RHS
2498as the value.
2499A
2500.b $:
2501prefix causes the rule to terminate immediately,
2502but the ruleset to continue;
2503this can be used to avoid continued application of a rule.
2504The prefix is stripped before continuing.
2505.pp
2506The
2507.b $@
2508and
2509.b $:
2510prefixes may precede a
2511.b $>
2512spec;
2513for example:
2514.(b
2515.ta 8n
2516R$+ $: $>7 $1
2517.)b
2518matches anything,
2519passes that to ruleset seven,
2520and continues;
2521the
2522.b $:
2523is necessary to avoid an infinite loop.
2524.pp
2525Substitution occurs in the order described,
2526that is,
2527parameters from the LHS are substituted,
2528hostnames are canonicalized,
2529.q subroutines
2530are called,
2531and finally
2532.b $# ,
2533.b $@ ,
2534and
2535.b $:
2536are processed.
2537.sh 4 "Semantics of rewriting rule sets"
2538.pp
2539There are five rewriting sets
2540that have specific semantics.
2541These are related as depicted by figure 2.
2542.(z
2543.hl
2544.ie n \{\
2545.(c
2546 +---+
2547 -->| 0 |-->resolved address
2548 / +---+
2549 / +---+ +---+
2550 / ---->| 1 |-->| S |--
2551 +---+ / +---+ / +---+ +---+ \e +---+
2552addr-->| 3 |-->| D |-- --->| 4 |-->msg
2553 +---+ +---+ \e +---+ +---+ / +---+
2554 --->| 2 |-->| R |--
2555 +---+ +---+
2556.)c
2557
2558.\}
2559.el .ie !"\*(.T"" \
2560\{\
2561.PS
2562boxwid = 0.3i
2563boxht = 0.3i
2564movewid = 0.3i
2565moveht = 0.3i
2566linewid = 0.3i
2567lineht = 0.3i
2568
2569 box invis "addr"; arrow
2570Box3: box "3"
2571A1: arrow
2572BoxD: box "D"; line; L1: Here
2573C: [
2574 C1: arrow; box "1"; arrow; box "S"; line; E1: Here
2575 move to C1 down 0.5; right
2576 C2: arrow; box "2"; arrow; box "R"; line; E2: Here
2577 ] with .w at L1 + (0.5, 0)
2578 move to C.e right 0.5
2579L4: arrow; box "4"; arrow; box invis "msg"
2580 line from L1 to C.C1
2581 line from L1 to C.C2
2582 line from C.E1 to L4
2583 line from C.E2 to L4
2584 move to BoxD.n up 0.6; right
2585Box0: arrow; box "0"
2586 arrow; box invis "resolved address" width 1.3
2587 line from 1/3 of the way between A1 and BoxD.w to Box0
2588.PE
2589.\}
2590.el .sp 2i
2591.ce
2592Figure 2 \*- Rewriting set semantics
2593.(c
2594D \*- sender domain addition
2595S \*- mailer-specific sender rewriting
2596R \*- mailer-specific recipient rewriting
2597.)c
2598.hl
2599.)z
2600.pp
2601Ruleset three
2602should turn the address into
2603.q "canonical form."
2604This form should have the basic syntax:
2605.(b
2606local-part@host-domain-spec
2607.)b
2608If no
2609.q @
2610sign is specified,
2611then the
2612host-domain-spec
2613.i may
2614be appended from the
2615sender address
2616(if the
2617.b C
2618flag is set in the mailer definition
2619corresponding to the
2620.i sending
2621mailer).
2622Ruleset three
d747e748
JH
2623is applied by
2624.i sendmail
6f14531a
RG
2625before doing anything with any address.
2626.pp
2627Ruleset zero
2628is applied after ruleset three
2629to addresses that are going to actually specify recipients.
2630It must resolve to a
2631.i "{mailer, host, user}"
2632triple.
2633The
2634.i mailer
2635must be defined in the mailer definitions
2636from the configuration file.
2637The
2638.i host
2639is defined into the
2640.b $h
2641macro
2642for use in the argv expansion of the specified mailer.
2643.pp
2644Rulesets one and two
2645are applied to all sender and recipient addresses respectively.
2646They are applied before any specification
2647in the mailer definition.
2648They must never resolve.
2649.pp
2650Ruleset four is applied to all addresses
2651in the message.
2652It is typically used
2653to translate internal to external form.
2654.sh 4 "IPC mailers"
2655.pp
2656Some special processing occurs
2657if the ruleset zero resolves to an IPC mailer
2658(that is, a mailer that has
2659.q [IPC]
2660listed as the Path in the
2661.b M
2662configuration line.
2663The host name passed after
2664.q $@
2665has MX expansion performed;
2666this looks the name up in DNS to find alternate delivery sites.
2667.pp
2668The host name can also be provided as a dotted quad in square brackets;
2669for example:
2670.(b
2671[128.32.149.78]
2672.)b
2673This causes direct conversion of the numeric value
2674to a TCP/IP host address.
2675.pp
2676The host name passed in after the
2677.q $@
2678may also be a colon-separated list of hosts.
2679Each is separately MX expanded and the results are concatenated
2680to make (essentially) one long MX list.
2681The intent here is to create
2682.q fake
2683MX records that are not published in DNS
2684for private internal networks.
2685.pp
2686As a final special case, the host name can be passed in
2687as a text string
2688in square brackets:
2689.(b
2690[ucbvax.berkeley.edu]
2691.)b
2692This form avoids the MX mapping.
2693.b N.B.:
2694This is intended only for situations where you have a network firewall,
2695so that your MX record points to a gateway machine;
2696this machine could then do direct delivery to machines
2697within your local domain.
2698Use of this feature directly violates RFC 1123 section 5.3.5:
2699it should not be used lightly.
2700.sh 3 "D \*- define macro"
2701.pp
2702Macros are named with a single character.
2703These may be selected from the entire ASCII set,
2704but user-defined macros
2705should be selected from the set of upper case letters only.
2706Lower case letters
2707and special symbols
2708are used internally.
2709.pp
2710The syntax for macro definitions is:
2711.(b F
2712.b D \c
2713.i x\|val
2714.)b
2715where
2716.i x
2717is the name of the macro
2718and
2719.i val
2720is the value it should have.
2721.pp
2722Macros are interpolated
2723using the construct
2724.b $ \c
2725.i x ,
2726where
2727.i x
2728is the name of the macro to be interpolated.
2729This interpolation is done when the configuration file is read,
2730except in
2731.b M
2732lines.
2733The special construct
2734.b $& \c
2735.i x
2736can be used in
2737.b R
2738lines to get deferred interpolation.
2739.pp
2740Conditionals can be specified using the syntax:
2741.(b
2742$?x text1 $| text2 $.
2743.)b
2744This interpolates
2745.i text1
2746if the macro
2747.b $x
2748is set,
2749and
2750.i text2
2751otherwise.
2752The
2753.q else
2754(\c
2755.b $| )
2756clause may be omitted.
2757.pp
2758Lower case macro names are reserved to have
2759special semantics,
d747e748
JH
2760used to pass information in or out of
2761.i sendmail ,
6f14531a
RG
2762and special characters are reserved to
2763provide conditionals, etc.
2764Upper case names
2765(that is,
2766.b $A
2767through
2768.b $Z )
2769are specifically reserved for configuration file authors.
2770.pp
d747e748
JH
2771The following macros are defined and/or used internally by
2772.i sendmail
2773for interpolation into argv's for mailers
2774or for other contexts.
2775The ones marked \(dg are information passed into sendmail\**,
2776.(f
2777\**As of version 8.6,
2778all of these macros have reasonable defaults.
2779Previous versions required that they be defined.
2780.)f
2781the ones marked \(dd are information passed both in and out of sendmail,
2782and the unmarked macros are passed out of sendmail
2783but are not otherwise used internally.
2784These macros are:
2785.nr ii 5n
2786.ip $a
2787.b "The origination date in RFC 822 format."
2788.ip $b
2789.b "The current date in RFC 822 format."
2790.ip $c
2791.b "The hop count."
2792.ip $d
2793.b "The current date in UNIX (ctime) format."
2794.ip $e\(dg
2795.b "The SMTP entry message."
2796This is printed out when SMTP starts up.
6f14531a
RG
2797The first word must be the
2798.b $j
d747e748
JH
2799macro as specified by RFC821.
2800Defaults to
2801.q "$j Sendmail $v ready at $b" .
2802Commonly redefined to include the configuration version number, e.g.,
2803.q "$j Sendmail $v/$Z ready at $b"
2804.ip $f
2805.b "The sender (from) address."
2806.ip $g
2807.b "The sender address relative to the recipient."
2808.ip $h
2809.b "The recipient host."
2810.ip $i
2811.b "The queue id."
2812.ip $j\(dd
2813.b "The \*(lqofficial\*(rq domain name for this site."
2814This is fully qualified if the full qualification can be found.
2815It
2816.i must
2817be redefined to be the fully qualified domain name
2818if your system is not configured so that information can find
2819it automatically.
2820.ip $k
2821.b "The UUCP node name (from the uname system call)."
2822.ip $l\(dg
2823.b "The format of the UNIX from line."
2824Unless you have changed the UNIX mailbox format,
2825you should not change the default,
2826which is
2827.q "From $g $d" .
2828.ip $m
2829.b "The domain part of the \fIgethostname\fP return value."
2830Under normal circumstances,
6f14531a 2831.b $j
d747e748
JH
2832is equivalent to
2833.b $w.$m .
2834.ip $n\(dg
2835.b "The name of the daemon (for error messages)."
2836Defaults to
2837.q MAILER-DAEMON .
2838.ip $o\(dg
042b8fbf 2839.b "The set of \*(lqoperators\*(rq in addresses."
d747e748 2840A list of characters
6f14531a
RG
2841which will be considered tokens
2842and which will separate tokens
2843when doing parsing.
2844For example, if
2845.q @
2846were in the
2847.b $o
2848macro, then the input
2849.q a@b
2850would be scanned as three tokens:
2851.q a,
2852.q @,
2853and
2854.q b.
d747e748
JH
2855Defaults to
2856.q ".:@[]" ,
2857which is the minimum set necessary to do RFC 822 parsing;
2858a richer set of operators is
2859.q ".:%@!/[]" ,
2860which adds support for UUCP, the %-hack, and X.400 addresses.
2861.ip $p
2862.b "Sendmail's process id."
2863.ip $q\(dg
2864.b "Default format of sender address."
2865The
6f14531a
RG
2866.b $q
2867macro specifies how an address should appear in a message
2868when it is defaulted.
d747e748
JH
2869Defaults to
2870.q "<$g>" .
2871It is commonly redefined to be
2872.q "$?x$x <$g>$|$g$."
2873or
2874.q "$g$?x ($x)$." ,
2875corresponding to the following two formats:
6f14531a
RG
2876.(b
2877Eric Allman <eric@CS.Berkeley.EDU>
2878eric@CS.Berkeley.EDU (Eric Allman)
2879.)b
2880.i Sendmail
2881properly quotes names that have special characters
2882if the first form is used.
d747e748
JH
2883.ip $r
2884.b "Protocol used to receive the message."
2885.ip $s
2886.b "Sender's host name."
2887.ip $t
2888.b "A numeric representation of the current time."
2889.ip $u
2890.b "The recipient user."
2891.ip $v
2892.b "The version number of \fIsendmail\fP."
2893.ip $w\(dd
2894.b "The hostname of this site."
6f14531a 2895.pp
d747e748
JH
2896The
2897.b $w
2898macro is set to the root name of this host (but see below for caveats).
2899.ip $x
2900.b "The full name of the sender."
2901.ip $z
2902.b "The home directory of the recipient."
2903.ip $_
2904.b "The validated sender address."
6f14531a
RG
2905.pp
2906There are three types of dates that can be used.
2907The
2908.b $a
2909and
2910.b $b
2911macros are in RFC 822 format;
2912.b $a
2913is the time as extracted from the
2914.q Date:
2915line of the message
2916(if there was one),
2917and
2918.b $b
2919is the current date and time
2920(used for postmarks).
2921If no
2922.q Date:
2923line is found in the incoming message,
2924.b $a
2925is set to the current time also.
2926The
2927.b $d
2928macro is equivalent to the
2929.b $b
2930macro in UNIX
2931(ctime)
2932format.
2933.pp
d747e748
JH
2934The macros
2935.b $w ,
2936.b $j ,
2937and
2938.b $m
2939are set to the identity of this host.
2940.i Sendmail
2941tries to find the fully qualified name of the host
2942if at all possible;
2943it does this by calling
2944.i gethostname (2)
2945to get the current hostname
2946and then passing that to
2947.i gethostbyname (3)
2948which is supposed to return the canonical version of that host name.\**
2949.(f
2950\**For example, on some systems
2951.i gethostname
2952might return
2953.q foo
2954which would be mapped to
2955.q foo.bar.com
2956by
2957.i gethostbyname .
2958.)f
2959Assuming this is successful,
2960.b $j
2961is set to the fully qualified name
2962and
2963.b $m
2964is set to the domain part of the name
2965(everything after the first dot).
2966The
2967.b $w
2968macro is set to the first word
2969(everything before the first dot)
2970if you have a level 5 or higher configuration file;
2971otherwise, it is set to the same value as
2972.b $j .
2973If the canonification is not successful,
2974it is imperative that the config file set
2975.b $j
2976to the fully qualified domain name\**.
2977.(f
2978\**Older versions of sendmail didn't pre-define
2979.b $j
2980at all, so up until 8.6,
2981config files
2982.i always
2983had to define
2984.b $j .
2985.)f
2986.pp
6f14531a
RG
2987The
2988.b $f
2989macro is the id of the sender
2990as originally determined;
2991when mailing to a specific host
2992the
2993.b $g
2994macro is set to the address of the sender
2995.ul
2996relative to the recipient.
2997For example,
2998if I send to
2999.q bollard@matisse.CS.Berkeley.EDU
3000from the machine
3001.q vangogh.CS.Berkeley.EDU
3002the
3003.b $f
3004macro will be
3005.q eric
3006and the
3007.b $g
3008macro will be
3009.q eric@vangogh.CS.Berkeley.EDU.
3010.pp
3011The
3012.b $x
3013macro is set to the full name of the sender.
3014This can be determined in several ways.
3015It can be passed as flag to
d747e748 3016.i sendmail .
6f14531a
RG
3017The second choice is the value of the
3018.q Full-name:
3019line in the header if it exists,
3020and the third choice is the comment field
3021of a
3022.q From:
3023line.
3024If all of these fail,
3025and if the message is being originated locally,
3026the full name is looked up in the
3027.i /etc/passwd
3028file.
3029.pp
3030When sending,
3031the
3032.b $h ,
3033.b $u ,
3034and
3035.b $z
3036macros get set to the host, user, and home directory
3037(if local)
3038of the recipient.
3039The first two are set from the
3040.b $@
3041and
3042.b $:
3043part of the rewriting rules, respectively.
3044.pp
3045The
3046.b $p
3047and
3048.b $t
3049macros are used to create unique strings
3050(e.g., for the
3051.q Message-Id:
3052field).
3053The
3054.b $i
3055macro is set to the queue id on this host;
3056if put into the timestamp line
3057it can be extremely useful for tracking messages.
3058The
3059.b $v
3060macro is set to be the version number of
3061.i sendmail ;
3062this is normally put in timestamps
3063and has been proven extremely useful for debugging.
d747e748 3064.pp
6f14531a
RG
3065The
3066.b $c
3067field is set to the
3068.q "hop count,"
3069i.e., the number of times this message has been processed.
3070This can be determined
3071by the
3072.b \-h
3073flag on the command line
3074or by counting the timestamps in the message.
3075.pp
3076The
3077.b $r
3078and
3079.b $s
d747e748
JH
3080fields are set to the protocol used to communicate with
3081.i sendmail
6f14531a 3082and the sending hostname.
d747e748 3083.pp
6f14531a
RG
3084The
3085.b $_
3086is set to a validated sender host name.
3087If the sender is running an RFC 1413 compliant IDENT server,
3088it will include the user name on that host.
3089.sh 3 "C and F \*- define classes"
3090.pp
3091Classes of phrases may be defined
3092to match on the left hand side of rewriting rules,
3093where a
3094.q phrase
3095is a sequence of characters that do not contain space characters.
3096For example
3097a class of all local names for this site
3098might be created
3099so that attempts to send to oneself
3100can be eliminated.
3101These can either be defined directly in the configuration file
3102or read in from another file.
3103Classes may be given names
3104from the set of upper case letters.
3105Lower case letters and special characters
3106are reserved for system use.
3107.pp
3108The syntax is:
3109.(b F
3110.b C \c
3111.i c\|phrase1
3112.i phrase2...
3113.br
3114.b F \c
3115.i c\|file
3116.)b
3117The first form defines the class
3118.i c
3119to match any of the named words.
3120It is permissible to split them among multiple lines;
3121for example, the two forms:
3122.(b
3123CHmonet ucbmonet
3124.)b
3125and
3126.(b
3127CHmonet
3128CHucbmonet
3129.)b
3130are equivalent.
3131The second form
3132reads the elements of the class
3133.i c
3134from the named
3135.i file .
3136.pp
3137The
3138.b $~
3139(match entries not in class)
3140only matches a single word;
3141multi-word entries in the class are ignored in this context.
3142.pp
3143The class
3144.b $=w
3145is set to be the set of all names
3146this host is known by.
3147This can be used to match local hostnames.
3148.pp
3149The class
3150.b $=k
3151is set to be the same as
3152.b $k ,
3153that is, the UUCP node name.
042b8fbf
AM
3154.pp
3155The class
3156.b $=m
3157is set to the set of domains by which this host is known,
3158initially just
3159.b $m .
3160.pp
3161.i Sendmail
3162can be compiled to allow a
3163.i scanf (3)
3164string on the
3165.b F
3166line.
3167This lets you do simplistic parsing of text files.
3168For example, to read all the user names in your system
3169.i /etc/passwd
3170file into a class, use
3171.(b
3172FL/etc/passwd %[^:]
3173.)b
3174which reads every line up to the first colon.
6f14531a
RG
3175.sh 3 "M \*- define mailer"
3176.pp
3177Programs and interfaces to mailers
3178are defined in this line.
3179The format is:
3180.(b F
3181.b M \c
3182.i name ,
3183{\c
3184.i field =\c
3185.i value \|}*
3186.)b
3187where
3188.i name
3189is the name of the mailer
3190(used internally only)
3191and the
3192.q field=name
3193pairs define attributes of the mailer.
3194Fields are:
3195.(b
3196.ta 1i
3197Path The pathname of the mailer
3198Flags Special flags for this mailer
3199Sender A rewriting set for sender addresses
3200Recipient A rewriting set for recipient addresses
3201Argv An argument vector to pass to this mailer
3202Eol The end-of-line string for this mailer
3203Maxsize The maximum message length to this mailer
3204Linelimit The maximum line length in the message body
3205Directory The working directory for the mailer
3206.)b
3207Only the first character of the field name is checked.
3208.pp
3209The following flags may be set in the mailer description.
3210Any other flags may be used freely
3211to conditionally assign headers to messages
3212destined for particular mailers.
3213.nr ii 4n
3214.ip a
3215Run Extended SMTP (ESMTP) protocol (defined in RFCs 1425, 1426, and 1427).
3216.ip b
3217Force a blank line on the end of a message.
3218This is intended to work around some stupid versions of
3219/bin/mail
3220that require a blank line, but do not provide it themselves.
3221It would not normally be used on network mail.
3222.ip c
3223Do not include comments in addresses.
3224This should only be used if you have to work around
3225a remote mailer that gets confused by comments.
3226.ip C
3227If mail is
3228.i received
3229from a mailer with this flag set,
3230any addresses in the header that do not have an at sign
3231(\c
3232.q @ )
3233after being rewritten by ruleset three
3234will have the
3235.q @domain
3236clause from the sender
3237tacked on.
3238This allows mail with headers of the form:
3239.(b
3240From: usera@hosta
3241To: userb@hostb, userc
3242.)b
3243to be rewritten as:
3244.(b
3245From: usera@hosta
3246To: userb@hostb, userc@hosta
3247.)b
3248automatically.
3249.ip D
3250This mailer wants a
3251.q Date:
3252header line.
3253.ip e
3254This mailer is expensive to connect to,
3255so try to avoid connecting normally;
3256any necessary connection will occur during a queue run.
3257.ip E
3258Escape lines beginning with
3259.q From
3260in the message with a `>' sign.
3261.ip f
3262The mailer wants a
3263.b \-f
3264.i from
3265flag,
3266but only if this is a network forward operation
3267(i.e.,
3268the mailer will give an error
3269if the executing user
3270does not have special permissions).
3271.ip F
3272This mailer wants a
3273.q From:
3274header line.
3275.ip g
3276Normally,
3277.i sendmail
3278sends internally generated email (e.g., error messages)
3279using the null return address\**
3280.(f
3281\**Actually, this only applies to SMTP,
3282which uses the ``MAIL FROM:<>'' command.
3283.)f
3284as required by RFC 1123.
3285However, some mailers don't accept a null return address.
3286If necessary,
3287you can set the
3288.b g
3289flag to prevent
3290.i sendmail
3291from obeying the standards;
3292error messages will be sent as from the MAILER-DAEMON
3293(actually, the value of the
3294.b $n
3295macro).
3296.ip h
3297Upper case should be preserved in host names
3298for this mailer.
3299.ip I
3300This mailer will be speaking SMTP
3301to another
3302.i sendmail
3303\*-
3304as such it can use special protocol features.
3305This option is not required
3306(i.e.,
3307if this option is omitted the transmission will still operate successfully,
3308although perhaps not as efficiently as possible).
3309.ip l
3310This mailer is local
3311(i.e.,
3312final delivery will be performed).
3313.ip L
3314Limit the line lengths as specified in RFC821.
3315This deprecated option should be replaced by the
3316.b L=
3317mail declaration.
3318For historic reasons, the
3319.b L
3320flag also sets the
3321.b 7
3322flag.
3323.ip m
3324This mailer can send to multiple users
3325on the same host
3326in one transaction.
3327When a
3328.b $u
3329macro occurs in the
3330.i argv
3331part of the mailer definition,
3332that field will be repeated as necessary
3333for all qualifying users.
3334.ip M
3335This mailer wants a
3336.q Message-Id:
3337header line.
3338.ip n
3339Do not insert a UNIX-style
3340.q From
3341line on the front of the message.
3342.ip p
3343Use the route-addr style reverse-path in the SMTP
3344.q "MAIL FROM:"
3345command
3346rather than just the return address;
3347although this is required in RFC821 section 3.1,
3348many hosts do not process reverse-paths properly.
3349Reverse-paths are officially discouraged by RFC 1123.
3350.ip P
3351This mailer wants a
3352.q Return-Path:
3353line.
3354.ip r
3355Same as
3356.b f ,
3357but sends a
3358.b \-r
3359flag.
3360.ip s
3361Strip quote characters off of the address
3362before calling the mailer.
3363.ip S
3364Don't reset the userid
3365before calling the mailer.
3366This would be used in a secure environment
3367where
3368.i sendmail
3369ran as root.
3370This could be used to avoid forged addresses.
3371This flag is suppressed if given from an
3372.q unsafe
3373environment
3374(e.g, a user's mail.cf file).
3375.ip u
3376Upper case should be preserved in user names
3377for this mailer.
3378.ip U
3379This mailer wants Unix-style
3380.q From
3381lines with the ugly UUCP-style
3382.q "remote from <host>"
3383on the end.
3384.ip x
3385This mailer wants a
3386.q Full-Name:
3387header line.
3388.ip X
3389This mailer want to use the hidden dot algorithm
3390as specified in RFC821;
3391basically,
3392any line beginning with a dot
3393will have an extra dot prepended
3394(to be stripped at the other end).
3395This insures that lines in the message containing a dot
3396will not terminate the message prematurely.
3397.ip 7
3398Strip all output to seven bits.
3399This is the default if the
3400.b L
3401flag is set.
c2714ef5 3402Note that clearing this option is not
6f14531a
RG
3403sufficient to get full eight bit data passed through
3404.i sendmail .
3405If the
3406.b 7
3407option is set, this is essentially always set,
3408since the eighth bit was stripped on input.
3409.pp
3410The mailer with the special name
3411.q error
3412can be used to generate a user error.
3413The (optional) host field is an exit status to be returned,
3414and the user field is a message to be printed.
3415The exit status may be numeric or one of the values
3416USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
3417to return the corresponding EX_ exit code.
3418For example, the entry:
3419.(b
3420$#error $@ NOHOST $: Host unknown in this domain
3421.)b
3422on the RHS of a rule
3423will cause the specified error to be generated
3424and the
3425.q "Host unknown"
3426exit status to be returned
3427if the LHS matches.
3428This mailer is only functional in ruleset zero.
3429.pp
3430The mailer named
3431.q local
3432.i must
3433be defined in every configuration file.
3434This is used to deliver local mail,
3435and is treated specially in several ways.
3436Additionally, three other mailers named
3437.q prog ,
3438.q *file* ,
3439and
3440.q *include*
3441may be defined to tune the delivery of messages to programs,
3442files,
3443and :include: lists respectively.
3444They default to:
3445.(b
3446Mprog, P=/bin/sh, F=lsD, A=sh \-c $u
3447M*file*, P=/dev/null, F=lsDFMPEu, A=FILE
3448M*include*, P=/dev/null, F=su, A=INCLUDE
3449.)b
3450.pp
3451The Sender and Recipient rewriting sets
3452may either be a simple integer
3453or may be two integers separated by a slash;
3454if so, the first rewriting set is applied to envelope
3455addresses
3456and the second is applied to headers.
3457.pp
3458The Directory
3459is actually a colon-separated path of directories to try.
3460For example, the definition
3461.q D=$z:/
3462first tries to execute in the recipient's home directory;
3463if that is not available,
3464it tries to execute in the root of the filesystem.
3465This is intended to be used only on the
3466.q prog
3467mailer,
3468since some shells (such as
3469.i csh )
3470refuse to execute if they cannot read the home directory.
3471Since the queue directory is not normally readable by normal users
3472.i csh
3473scripts as recipients can fail.
3474.sh 3 "H \*- define header"
3475.pp
d747e748
JH
3476The format of the header lines that
3477.i sendmail
3478inserts into the message
6f14531a
RG
3479are defined by the
3480.b H
3481line.
3482The syntax of this line is:
3483.(b F
3484.b H [\c
3485.b ? \c
3486.i mflags \c
3487.b ? ]\c
3488.i hname \c
3489.b :
3490.i htemplate
3491.)b
3492Continuation lines in this spec
3493are reflected directly into the outgoing message.
3494The
3495.i htemplate
3496is macro expanded before insertion into the message.
3497If the
3498.i mflags
3499(surrounded by question marks)
3500are specified,
3501at least one of the specified flags
3502must be stated in the mailer definition
3503for this header to be automatically output.
3504If one of these headers is in the input
3505it is reflected to the output
3506regardless of these flags.
3507.pp
3508Some headers have special semantics
3509that will be described below.
3510.sh 3 "O \*- set option"
3511.pp
3512There are a number of
3513.q random
3514options that
3515can be set from a configuration file.
3516Options are represented by single characters.
3517The syntax of this line is:
3518.(b F
3519.b O \c
3520.i o\|value
3521.)b
3522This sets option
3523.i o
3524to be
3525.i value .
3526Depending on the option,
3527.i value
3528may be a string, an integer,
3529a boolean
3530(with legal values
3531.q t ,
3532.q T ,
3533.q f ,
3534or
3535.q F ;
3536the default is TRUE),
3537or
3538a time interval.
3539.pp
3540The options supported are:
3541.nr ii 1i
3542.ip a\fIN\fP
3543If set,
3544wait up to
3545.i N
3546minutes for an
3547.q @:@
3548entry to exist in the alias database
3549before starting up.
3550If it does not appear in
3551.i N
3552minutes,
3553rebuild the database
3554(if the
3555.b D
3556option is also set)
3557or issue a warning.
3558.ip "A\fIspec, spec, ...\fP"
3559Specify possible alias file(s).
3560Each
3561.i spec
3562should be in the format
3563``\c
3564.i class \c
3565.b :
3566.i file ''
3567where
3568.i class \c
3569.b :
3570is optional and defaults to ``implicit''.
3571Depending on how
d747e748 3572.i sendmail
6f14531a
RG
3573is compiled, valid classes are
3574.q implicit
3575(search through a compiled-in list of alias file types,
3576for back compatibility),
3577.q hash
3578(if
3579.sm NEWDB
3580is specified),
3581.q dbm
3582(if
3583.sm NDBM
3584is specified),
3585.q stab
3586(internal symbol table \*- not normally used
3587unless you have no other database lookup),
3588or
3589.q nis
3590(if
3591.sm NIS
3592is specified).
3593If a list of
3594.i spec s
3595are provided,
3596.i sendmail
3597searches them in order.
3598.ip b\fIN\fP/\fIM\fP
3599Insist on at least
3600.i N
3601blocks free on the filesystem that holds the queue files
3602before accepting email via SMTP.
3603If there is insufficient space
3604.i sendmail
3605gives a 452 response
3606to the MAIL command.
3607This invites the sender to try again later.
3608The optional
3609.i M
3610is a maximum message size advertised in the ESMTP EHLO response.
3611It is currently otherwise unused.
3612.ip B\fIc\fP
3613Set the blank substitution character to
3614.i c .
3615Unquoted spaces in addresses are replaced by this character.
3616Defaults to space (i.e., no change is made).
3617.ip c
3618If an outgoing mailer is marked as being expensive,
3619don't connect immediately.
3620This requires that queueing be compiled in,
3621since it will depend on a queue run process to
3622actually send the mail.
3623.ip C\fIN\fP
3624Checkpoints the queue every
3625.i N
3626(default 10)
3627addresses sent.
3628If your system crashes during delivery to a large list,
3629this prevents retransmission to any but the last
3630.I N
3631recipients.
3632.ip d\fIx\fP
3633Deliver in mode
3634.i x .
3635Legal modes are:
3636.(b
3637.ta 4n
3638i Deliver interactively (synchronously)
3639b Deliver in background (asynchronously)
3640q Just queue the message (deliver during queue run)
3641.)b
3642Defaults to ``b'' if no option is specified,
3643``i'' if it is specified but given no argument
3644(i.e., ``Od'' is equivalent to ``Odi'').
3645.ip D
3646If set,
3647rebuild the alias database if necessary and possible.
3648If this option is not set,
3649.i sendmail
3650will never rebuild the alias database
3651unless explicitly requested
3652using
3653.b \-bi .
3654.ip e\fIx\fP
3655Dispose of errors using mode
3656.i x .
3657The values for
3658.i x
3659are:
3660.(b
3661p Print error messages (default)
3662q No messages, just give exit status
3663m Mail back errors
3664w Write back errors (mail if user not logged in)
3665e Mail back errors and give zero exit stat always
3666.)b
3667.ip E\fIfile/message\fP
3668Prepend error messages with the indicated message.
3669If it begins with a slash,
3670it is assumed to be the pathname of a file
3671containing a message (this is the recommended setting).
3672Otherwise, it is a literal message.
3673The error file might contain the name, email address, and/or phone number
3674of a local postmaster who could provide assistance
3675in to end users.
3676If the option is missing or null,
3677or if it names a file which does not exist or which is not readable,
3678no message is printed.
3679.ip f
3680Save
3681Unix-style
3682.q From
3683lines at the front of headers.
3684Normally they are assumed redundant
3685and discarded.
3686.ip F\fImode\fP
3687The file mode for queue files.
3688.ip g\fIn\fP
3689Set the default group id
3690for mailers to run in
3691to
3692.i n .
3693Defaults to 1.
d747e748 3694The value can also be given as a symbolic group name.
6f14531a
RG
3695.ip G
3696Allow fuzzy matching on the GECOS field.
3697If this flag is set,
3698and the usual user name lookups fail
3699(that is, there is no alias with this name and a
3700.i getpwnam
3701fails),
3702sequentially search the password file
3703for a matching entry in the GECOS field.
3704This also requires that MATCHGECOS
3705be turned on during compilation.
3706This option is not recommended.
3707.ip h\fIN\fP
3708The maximum hop count.
3709Messages that have been processed more than
3710.i N
3711times are assumed to be in a loop and are rejected.
3712Defaults to 25.
3713.ip H\fIfile\fP
3714Specify the help file
3715for SMTP.
3716.ip i
3717Ignore dots in incoming messages.
3718This is always disabled (that is, dots are always accepted)
3719when reading SMTP mail.
3720.ip I
3721Insist that the BIND name server be running
3722to resolve host names.
3723If this is not set and the name server is not running,
3724the
3725.i /etc/hosts
3726file will be considered complete.
3727In general, you do want to set this option
3728if your
3729.i /etc/hosts
3730file does not include all hosts known to you
3731or if you are using the MX (mail forwarding) feature of the BIND name server.
3732The name server will still be consulted
3733even if this option is not set, but
3734.i sendmail
3735will feel free to resort to reading
3736.i /etc/hosts
3737if the name server is not available.
3738Thus, you should
3739.i never
3740set this option if you do not run the name server.
3741.ip j
3742If set, send error messages in MIME format
3743(see RFC1341 and RFC1344 for details).
3744.ip J\fIpath\fP
3745Set the path for searching for users' .forward files.
3746The default is
3747.q $z/.forward .
3748Some sites that use the automounter may prefer to change this to
3749.q /var/forward/$u
3750to search a file with the same name as the user in a system directory.
3751It can also be set to a sequence of paths separated by colons;
3752.i sendmail
3753stops at the first file it can successfully and safely open.
3754For example,
3755.q /var/forward/$u:$z/.forward
3756will search first in /var/forward/\c
3757.i username
3758and then in
3759.i ~username /.forward
3760(but only if the first file does not exist).
3761.ip k\fIN\fP
3762The maximum number of open connections that will be cached at a time.
3763The default is one.
042b8fbf 3764This delays closing the current connection until
d747e748
JH
3765either this invocation of
3766.i sendmail
3767needs to connect to another host
6f14531a
RG
3768or it terminates.
3769Setting it to zero defaults to the old behavior,
3770that is, connections are closed immediately.
3771.ip K\fItimeout\fP
3772The maximum amount of time a cached connection will be permitted to idle
3773without activity.
3774If this time is exceeded,
3775the connection is immediately closed.
3776This value should be small (on the order of ten minutes).
3777Before
d747e748 3778.i sendmail
6f14531a
RG
3779uses a cached connection,
3780it always sends a NOOP (no operation) command
3781to check the connection;
3782if this fails, it reopens the connection.
3783This keeps your end from failing if the other end times out.
3784The point of this option is to be a good network neighbor
3785and avoid using up excessive resources
3786on the other end.
3787The default is five minutes.
3788.ip l
3789If there is an
3790.q Errors-To:
3791header, send error messages to the addresses listed there.
3792They normally go to the envelope sender.
d747e748
JH
3793Use of this option causes
3794.i sendmail
3795to violate RFC 1123.
6f14531a
RG
3796.ip L\fIn\fP
3797Set the default log level to
3798.i n .
3799Defaults to 9.
3800.ip m
3801Send to me too,
3802even if I am in an alias expansion.
3803.ip M\fIx\|value\fP
3804Set the macro
3805.i x
3806to
3807.i value .
3808This is intended only for use from the command line.
3809.ip n
3810Validate the RHS of aliases when rebuilding the alias database.
3811.ip o
3812Assume that the headers may be in old format,
3813i.e.,
3814spaces delimit names.
3815This actually turns on
3816an adaptive algorithm:
3817if any recipient address contains a comma, parenthesis,
3818or angle bracket,
3819it will be assumed that commas already exist.
3820If this flag is not on,
3821only commas delimit names.
3822Headers are always output with commas between the names.
3823.ip O\fIoptions\fP
3824Set server SMTP options.
3825The options are
3826.i key=value
3827pairs.
3828Known keys are:
3829.(b
3830.ta 1i
3831Port Name/number of listening port (defaults to "smtp")
3832Addr Address mask (defaults INADDR_ANY)
3833Family Address family (defaults to INET)
3834Listen Size of listen queue (defaults to 10)
3835.)b
3836The
3837.i Addr ess
3838mask may be a numeric address in dot notation
3839or a network name.
3840.ip p\fI\|opt,opt,...\fP
3841Set the privacy
3842.i opt ions.
3843``Privacy'' is really a misnomer;
3844many of these are just a way of insisting on stricter adherence
3845to the SMTP protocol.
3846The
3847.i opt ions
3848can be selected from:
3849.(b
3850.ta \w'needvrfyhelo'u+3n
3851public Allow open access
3852needmailhelo Insist on HELO or EHLO command before MAIL
3853needexpnhelo Insist on HELO or EHLO command before EXPN
3854noexpn Disallow EXPN entirely
3855needvrfyhelo Insist on HELO or EHLO command before VRFY
3856novrfy Disallow VRFY entirely
3857restrictmailq Restrict mailq command
d747e748 3858restrictqrun Restrict \-q command line flag
6f14531a 3859goaway Disallow essentially all SMTP status queries
042b8fbf 3860authwarnings Put X-Authentication-Warning: headers in messages
6f14531a
RG
3861.)b
3862The
3863.q goaway
3864pseudo-flag sets all flags except
d747e748
JH
3865.q restrictmailq
3866and
3867.q restrictqrun .
6f14531a
RG
3868If mailq is restricted,
3869only people in the same group as the queue directory
3870can print the queue.
d747e748
JH
3871If queue runs are restricted,
3872only root and the owner of the queue directory
3873can run the queue.
042b8fbf
AM
3874Authentication Warnings add warnings about various conditions
3875that may indicate attempts to spoof the mail system,
3876such as using an non-standard queue directory.
6f14531a
RG
3877.ip P\fIpostmaster\fP
3878If set,
3879copies of error messages will be sent to the named
3880.i postmaster .
3881Only the header of the failed message is sent.
3882Since most errors are user problems,
3883this is probably not a good idea on large sites,
3884and arguably contains all sorts of privacy violations,
3885but it seems to be popular with certain operating systems vendors.
3886.ip q\fIfactor\fP
3887Use
3888.i factor
3889as the multiplier in the map function
3890to decide when to just queue up jobs rather than run them.
3891This value is divided by the difference between the current load average
3892and the load average limit
3893(\c
3894.b x
3895flag)
3896to determine the maximum message priority
3897that will be sent.
3898Defaults to 600000.
3899.ip Q\fIdir\fP
3900Use the named
3901.i dir
3902as the queue directory.
3903.ip r\|\fItimeouts\fP
3904Timeout reads after
3905.i time
3906interval.
3907The
3908.i timeouts
3909argument is a list of
3910.i keyword=value
3911pairs.
3912The recognized timeouts and their default values, and their
3913minimum values specified in RFC 1123 section 5.3.2 are:
3914.(b
3915.ta \w'datafinal'u+3n
3916initial wait for initial greeting message [5m, 5m]
3917helo reply to HELO or EHLO command [5m, none]
3918mail reply to MAIL command [10m, 5m]
3919rcpt reply to RCPT command [1h, 5m]
3920datainit reply to DATA command [5m, 2m]
3921datablock data block read [1h, 3m]
3922datafinal reply to final ``.'' in data [1h, 10m]
3923rset reply to RSET command [5m, none]
3924quit reply to QUIT command [2m, none]
3925misc reply to NOOP and VERB commands [2m, none]
3926command command read [1h, 5m]
d747e748 3927ident IDENT protocol timeout [30s, none]
6f14531a
RG
3928.)b
3929All but
3930.q command
3931apply to client SMTP.
3932For back compatibility,
3933a timeout with no ``keyword='' part
3934will set all of the longer values.
3a363396
NW
3935.ip R
3936Normally,
3937.i sendmail
3938tries to eliminate any unnecessary explicit routes
3939when sending an error message
3940(as discussed in RFC 1123 \(sc 5.2.6).
3941For example,
3942when sending an error message to
3943.(b
3944<@known1,@known2,@unknown:user@known3>
3945.)b
3946.i sendmail
3947will strip off the
3948.q @known1
3949in order to make the route as direct as possible.
3950However, if the
3951.b R
3952option is set, this will be disabled,
3953and the mail will be sent to the first address in the route,
3954even if later addresses are known.
3955This may be useful if you are caught behind a firewall.
6f14531a
RG
3956.ip s
3957Be super-safe when running things,
3958i.e.,
3959always instantiate the queue file,
3960even if you are going to attempt immediate delivery.
3961.i Sendmail
3962always instantiates the queue file
042b8fbf 3963before returning control the client
6f14531a
RG
3964under any circumstances.
3965.ip S\fIfile\fP
3966Log statistics in the named
3967.i file .
d747e748
JH
3968.ip t\fItzinfo\fP
3969Set the local time zone info to
3970.i tzinfo
3971\*- for example,
3972.q PST8PDT .
3973Actually, if this is not set,
3974the TZ environment variable is cleared (so the system default is used);
3975if set but null, the user's TZ variable is used,
3976and if set and non-null the TZ variable is set to this value.
6f14531a
RG
3977.ip T\fIrtime/wtime\fP
3978Set the queue timeout to
3979.i rtime .
3980After this interval,
3981messages that have not been successfully sent
3982will be returned to the sender.
3983Defaults to five days.
3984The optional
3985.i wtime
3986is the time after which a warning message is sent.
3987If it is missing or zero
3988then no warning messages are sent.
3989.ip u\fIn\fP
3990Set the default userid for mailers to
3991.i n .
3992Mailers without the
3993.i S
3994flag in the mailer definition
3995will run as this user.
3996Defaults to 1.
d747e748 3997The value can also be given as a symbolic user name.
6f14531a
RG
3998.ip U\fIudbspec\fP
3999The user database specification.
4000.ip v
4001Run in verbose mode.
4002If this is set,
4003.i sendmail
4004adjusts options
4005.b c
4006(don't connect to expensive mailers)
4007and
4008.b d
4009(delivery mode)
4010so that all mail is delivered completely
4011in a single job
4012so that you can see the entire delivery process.
4013Option
4014.b v
4015should
4016.i never
4017be set in the configuration file;
4018it is intended for command line use only.
4019.ip V\fIfallbackhost\fP
4020If specified, the
4021.i fallbackhost
4022acts like a very low priority MX
4023on every host.
4024This is intended to be used by sites with poor network connectivity.
d747e748
JH
4025.ip w
4026If you are the
4027.q best
4028(that is, lowest preference)
4029MX for a given host,
4030you should normally detect this situation
4031and treat that condition specially,
4032by forwarding the mail to a UUCP feed,
4033treating it as local,
4034or whatever.
4035However, in some cases (such as Internet firewalls)
4036you may want to try to connect directly to that host
4037as though it had no MX records at all.
4038Setting this option causes
4039.i sendmail
4040to try this.
4041The downside is that errors in your configuration
4042are likely to be diagnosed as
4043.q "host unknown"
4044or
4045.q "message timed out"
4046instead of something more meaningful.
4047This option is disrecommended.
6f14531a
RG
4048.ip x\fILA\fP
4049When the system load average exceeds
4050.i LA ,
4051just queue messages
4052(i.e., don't try to send them).
4053Defaults to 8.
4054.ip X\fILA\fP
4055When the system load average exceeds
4056.i LA ,
4057refuse incoming SMTP connections.
4058Defaults to 12.
4059.ip y\fIfact\fP
4060The indicated
4061.i fact or
4062is added to the priority (thus
4063.i lowering
4064the priority of the job)
4065for each recipient,
4066i.e., this value penalizes jobs with large numbers of recipients.
4067Defaults to 30000.
4068.ip Y
4069If set,
4070deliver each job that is run from the queue in a separate process.
4071Use this option if you are short of memory,
4072since the default tends to consume considerable amounts of memory
4073while the queue is being processed.
4074.ip z\fIfact\fP
4075The indicated
4076.i fact or
4077is multiplied by the message class
4078(determined by the Precedence: field in the user header
4079and the
4080.b P
4081lines in the configuration file)
4082and subtracted from the priority.
4083Thus, messages with a higher Priority: will be favored.
4084Defaults to 1800.
4085.ip Z\fIfact\fP
4086The
4087.i fact or
4088is added to the priority
4089every time a job is processed.
4090Thus,
4091each time a job is processed,
4092its priority will be decreased by the indicated value.
4093In most environments this should be positive,
4094since hosts that are down are all too often down for a long time.
4095Defaults to 90000.
4096.ip 7
4097Strip input to seven bits for compatibility with old systems.
4098This shouldn't be necessary.
4099.lp
4100All options can be specified on the command line using the
4101\-o flag,
4102but most will cause
4103.i sendmail
4104to relinquish its setuid permissions.
4105The options that will not cause this are
4106b, d, e, E, i, L, m, o, p, r, s, v, C, and 7.
4107Also, M (define macro) when defining the r or s macros
4108is also considered
4109.q safe .
4110.sh 3 "P \*- precedence definitions"
4111.pp
4112Values for the
4113.q "Precedence:"
4114field may be defined using the
4115.b P
4116control line.
4117The syntax of this field is:
4118.(b
4119\fBP\fP\fIname\fP\fB=\fP\fInum\fP
4120.)b
4121When the
4122.i name
4123is found in a
4124.q Precedence:
4125field,
4126the message class is set to
4127.i num .
4128Higher numbers mean higher precedence.
4129Numbers less than zero
4130have the special property
4131that if an error occurs during processing
4132the body of the message will not be returned;
4133this is expected to be used for
4134.q "bulk"
4135mail such as through mailing lists.
4136The default precedence is zero.
4137For example,
4138our list of precedences is:
4139.(b
4140Pfirst-class=0
4141Pspecial-delivery=100
4142Plist=\-30
4143Pbulk=\-60
4144Pjunk=\-100
4145.)b
4146People writing mailing list exploders
4147are encouraged to use
4148.q "Precedence: list" .
4149Older versions of
4150.i sendmail
4151(which discarded all error returns for negative precedences)
4152didn't recognize this name, giving it a default precedence of zero.
4153This allows list maintainers to see error returns
4154on both old and new versions of
4155.i sendmail .
4156.sh 3 "V \*- configuration version level"
4157.pp
4158To provide compatibility with old configuration files,
4159the
4160.b V
4161line has been added to define some very basic semantics
4162of the configuration file.
4163These are not intended to be long term supports;
4164rather, they describe compatibility features
4165which will probably be removed in future releases.
4166.pp
d747e748
JH
4167.b N.B.:
4168these version
4169.i levels
4170have nothing
4171to do with the version
4172.i number
4173on the files.
4174For example,
4175as of this writing
4176version 8 config files
4177(specifically, 8.6)
4178used version level 5 configurations.
4179.pp
6f14531a
RG
4180.q Old
4181configuration files are defined as version level one.
4182Version level two files make the following changes:
4183.np
4184Host name canonification ($[ ... $])
4185appends a dot if the name is recognized;
4186this gives the config file a way of finding out if anything matched.
4187(Actually, this just initializes the
4188.q host
4189map with the
4190.q \-a.
4191flag \*- you can reset it to anything you prefer
4192by declaring the map explicitly.)
4193.np
4194Default host name extension is consistent throughout processing;
4195version level one configurations turned off domain extension
4196(that is, adding the local domain name)
4197during certain points in processing.
4198Version level two configurations are expected to include a trailing dot
4199to indicate that the name is already canonical.
4200.np
4201Local names that are not aliases
4202are passed through a new distinguished ruleset five;
4203this can be used to append a local relay.
4204This behaviour can be prevented by resolving the local name
4205with an initial `@'.
4206That is, something that resolves to a local mailer and a user name of
4207.q vikki
4208will be passed through ruleset five,
4209but a user name of
4210.q @vikki
4211will have the `@' stripped,
4212will not be passed through ruleset five,
4213but will otherwise be treated the same as the prior example.
4214The expectation is that this might be used to implement a policy
4215where mail sent to
4216.q vikki
4217was handled by a central hub,
4218but mail sent to
4219.q vikki@localhost
4220was delivered directly.
4221.pp
4222Version level three files
4223allow # initiated comments on all lines.
4224Exceptions are backslash escaped # marks
4225and the $# syntax.
d747e748
JH
4226.pp
4227Version level four configurations
4228are completely equivalent to level three
4229for historical reasons.
4230.pp
4231Version level five configuration files
4232change the default definition of
4233.b $w
4234to be just the first component of the hostname.
042b8fbf
AM
4235.pp
4236The
4237.b V
4238line may have an optional
4239.b / \c
4240.i vendor
4241to indicate that this configuration file uses modifications
4242specific to a particular vendor\**.
4243.(f
4244\**And of course, vendors are encouraged to add themselves
4245to the list of recognized vendors by editing the routine
4246.i setvendor
4247in
4248.i conf.c .
4249.)f
6f14531a
RG
4250.sh 3 "K \*- key file declaration"
4251.pp
4252Special maps can be defined using the line:
4253.(b
4254Kmapname mapclass arguments
4255.)b
4256The
4257.i mapname
4258is the handle by which this map is referenced in the rewriting rules.
4259The
4260.i mapclass
4261is the name of a type of map;
d747e748
JH
4262these are compiled in to
4263.i sendmail .
6f14531a
RG
4264The
4265.i arguments
4266are interpreted depending on the class;
4267typically,
4268there would be a single argument naming the file containing the map.
4269.pp
4270Maps are referenced using the syntax:
4271.(b
4272$( \fImap\fP \fIkey\fP $@ \fIarguments\fP $: \fIdefault\fP $)
4273.)b
4274where either or both of the
4275.i arguments
4276or
4277.i default
4278portion may be omitted.
4279The
4280.i arguments
4281may appear more than once.
4282The indicated
4283.i key
4284and
4285.i arguments
4286are passed to the appropriate mapping function.
4287If it returns a value, it replaces the input.
4288If it does not return a value and the
4289.i default
4290is specified, the
4291.i default
4292replaces the input.
4293Otherwise, the input is unchanged.
4294.pp
4295During replacement of either a map value or default
4296the string
4297.q %\fIn\fP
4298(where
4299.i n
4300is a digit)
4301is replaced by the corresponding
4302.i argument .
4303Argument zero
4304is always the database key.
4305For example, the rule
4306.(b
4307.ta 1.5i
4308R$- ! $+ $: $(uucp $1 $@ $2 $: %1 @ %0 . UUCP $)
4309.)b
4310Looks up the UUCP name in a (user defined) UUCP map;
4311if not found it turns it into
4312.q \&.UUCP
4313form.
4314The database might contain records like:
4315.(b
4316decvax %1@%0.DEC.COM
4317research %1@%0.ATT.COM
4318.)b
4319.pp
4320The built in map with both name and class
4321.q host
4322is the host name canonicalization lookup.
4323Thus,
4324the syntax:
4325.(b
4326$(host \fIhostname\fP$)
4327.)b
4328is equivalent to:
4329.(b
4330$[\fIhostname\fP$]
4331.)b
4332.pp
4333There are four predefined database lookup classes:
4334.q dbm ,
4335.q btree ,
4336.q hash ,
4337and
4338.q nis .
d747e748
JH
4339The first requires that
4340.i sendmail
4341be compiled with the
6f14531a
RG
4342.b ndbm
4343library;
4344the second two require the
4345.b db
4346library,
d747e748
JH
4347and the third requires that
4348.i sendmail
4349be compiled with NIS support.
042b8fbf 4350All four accept as arguments the same optional flags
d747e748
JH
4351and a filename
4352(or a mapname for NIS;
4353the filename is the root of the database path,
4354so that
4355.q .db
4356or some other extension appropriate for the database type
4357will be added to get the actual database name).
6f14531a
RG
4358Known flags are:
4359.ip "\-o"
4360Indicates that this map is optional \*- that is,
4361if it cannot be opened,
4362no error is produced,
d747e748
JH
4363and
4364.i sendmail
4365will behave as if the map existed but was empty.
6f14531a 4366.ip "\-N"
3a363396
NW
4367Normally when maps are written,
4368the trailing null byte is not included as part of the key.
4369If this flag is indicated it will be included.
4370During lookups, only the null-byte-included form will be searched.
4371See also
4372.b \-O.
4373.ip "\-O"
4374If neither
4375.b \-N
4376or
4377.b \-O
4378are specified,
4379.i sendmail
4380uses an adaptive algorithm to decide whether or not to look for null bytes
4381on the end of keys.
4382It starts by trying both;
4383if it finds any key with a null byte it never tries again without a null byte
4384and vice versa.
4385If this flag is specified,
4386it never tries with a null byte;
4387this can speed matches but is never necessary.
4388If both
4389.b \-N
4390and
4391.b \-O
4392are specified,
4393.i sendmail
4394will never try any matches at all \(em
4395that is, everything will appear to fail.
6f14531a 4396.ip "\-a\fIx\fP"
d747e748 4397Append the string
6f14531a
RG
4398.i x
4399on successful matches.
4400For example, the default
4401.i host
4402map appends a dot on successful matches.
4403.ip "\-f"
d747e748 4404Do not fold upper to lower case before looking up the key.
6f14531a
RG
4405.ip "\-m"
4406Match only (without replacing the value).
4407If you only care about the existence of a key and not the value
4408(as you might when searching the NIS map
4409.q hosts.byname
4410for example),
4411this flag prevents the map from substituting the value.
4412However,
4413The \-a argument is still appended on a match,
4414and the default is still taken if the match fails.
4415.pp
4416The
4417.i dbm
4418map appends the strings
4419.q \&.pag
4420and
4421.q \&.dir
4422to the given filename;
4423the two
4424.i db -based
4425maps append
4426.q \&.db .
d747e748
JH
4427For example, the map specification
4428.(b
4429Kuucp dbm \-o \-N /usr/lib/uucpmap
4430.)b
4431specifies an optional map named
4432.q uucp
4433of class
4434.q dbm ;
4435it always has null bytes at the end of every string,
4436and the data is located in
4437/usr/lib/uucpmap.{dir,pag}.
6f14531a
RG
4438.pp
4439The program
4440.i makemap (8)
4441can be used to build any of the three database-oriented maps.
4442It takes the following flags:
4443.ip \-f
d747e748 4444Fold upper to lower case in the map.
6f14531a
RG
4445.ip \-N
4446Include null bytes in keys.
4447.ip \-o
4448Append to an existing (old) file.
4449.ip \-r
4450Allow replacement of existing keys;
4451normally, re-inserting an existing key is an error.
4452.ip \-v
4453Print what is happening.
d747e748
JH
4454.lp
4455The
4456.i sendmail
4457daemon does not have to be restarted to read the new maps
4458as long as you change them in place;
4459file locking is used so that the maps won't be read
4460while they are being updated.\**
4461.(f
4462\**That is, don't create new maps and then use
4463.i mv (1)
4464to move them into place.
4465I consider this a shortfall (a.k.a. bug) in
4466.i sendmail
4467which should be fixed in a future release.
4468.)f
6f14531a
RG
4469.pp
4470There are also two builtin maps that are,
4471strictly speaking,
4472not database lookups.
4473.pp
4474The
4475.q host
4476map does host domain canonification;
4477given a host name it calls the name server
4478to find the canonical name for that host.
4479.pp
4480The
4481.q dequote
4482map strips double quotes (") from a name.
4483It does not strip backslashes.
4484It will not strip quotes if the resulting string
4485would contain unscannable syntax
4486(that is, basic errors like unbalanced angle brackets;
4487more sophisticated errors such as unknown hosts are not checked).
4488The intent is for use when trying to accept mail from systems such as
4489DECnet
4490that routinely quote odd syntax such as
4491.(b
4492"49ers::ubell"
4493.)b
4494A typical usage is probably something like:
4495.(b
4496Kdequote dequote
4497
4498\&...
4499
4500R$\- $: $(dequote $1 $)
4501R$\- $+ $: $>3 $1 $2
4502.)b
4503Care must be taken to prevent unexpected results;
4504for example,
4505.(b
4506"|someprogram < input > output"
4507.)b
4508will have quotes stripped,
4509but the result is probably not what you had in mind.
4510Fortunately these cases are rare.
4511.pp
4512New classes can be added in the routine
4513.b setupmaps
4514in file
4515.b conf.c .
4516.sh 2 "Building a Configuration File From Scratch"
4517.pp
4518Building a configuration table from scratch is an extremely difficult job.
4519Fortunately,
4520it is almost never necessary to do so;
4521nearly every situation that may come up
4522may be resolved by changing an existing table.
4523In any case,
4524it is critical that you understand what it is that you are trying to do
4525and come up with a philosophy for the configuration table.
4526This section is intended to explain what the real purpose
4527of a configuration table is
4528and to give you some ideas
4529for what your philosophy might be.
4530.pp
4531.b "Do not even consider"
4532writing your own configuration file
4533without carefully studying
4534RFC 821, 822, and 1123.
4535You should also read RFC 976
4536if you are doing UUCP exchange.
4537.sh 3 "What you are trying to do"
4538.pp
4539The configuration table has three major purposes.
4540The first and simplest
4541is to set up the environment for
4542.i sendmail .
4543This involves setting the options,
4544defining a few critical macros,
4545etc.
4546Since these are described in other places,
4547we will not go into more detail here.
4548.pp
4549The second purpose is to rewrite addresses in the message.
4550This should typically be done in two phases.
4551The first phase maps addresses in any format
4552into a canonical form.
4553This should be done in ruleset three.
4554The second phase maps this canonical form
4555into the syntax appropriate for the receiving mailer.
4556.i Sendmail
4557does this in three subphases.
4558Rulesets one and two
4559are applied to all sender and recipient addresses respectively.
4560After this,
4561you may specify per-mailer rulesets
4562for both sender and recipient addresses;
4563this allows mailer-specific customization.
4564Finally,
4565ruleset four is applied to do any default conversion
4566to external form.
4567.pp
4568The third purpose
4569is to map addresses into the actual set of instructions
4570necessary to get the message delivered.
4571Ruleset zero must resolve to the internal form,
4572which is in turn used as a pointer to a mailer descriptor.
4573The mailer descriptor describes the interface requirements
4574of the mailer.
4575.sh 3 "Philosophy"
4576.pp
4577The particular philosophy you choose will depend heavily
4578on the size and structure of your organization.
4579I will present a few possible philosophies here.
4580There are as many philosophies as there are config designers;
4581feel free to develop your own.
4582.pp
4583One general point applies to all of these philosophies:
4584it is almost always a mistake
4585to try to do full host route resolution.
4586For example,
4587if you are on a UUCP-only site
4588and you are trying to get names of the form
4589.q user@host
4590to the Internet,
4591it does not pay to route them to
4592.q xyzvax!decvax!ucbvax!c70!user@host
4593since you then depend on several links not under your control,
4594some of which are likely to misparse it anyway.
4595The best approach to this problem
4596is to simply forward the message for
4597.q user@host
4598to
4599.q xyzvax
4600and let xyzvax
4601worry about it from there.
4602In summary,
4603just get the message closer to the destination,
4604rather than determining the full path.
4605.sh 4 "Large site, many hosts \*- minimum information"
4606.pp
4607Berkeley is an example of a large site,
4608i.e., more than two or three hosts
4609and multiple mail connections.
4610We have decided that the only reasonable philosophy
4611in our environment
4612is to designate one host as the guru for our site.
4613It must be able to resolve any piece of mail it receives.
4614The other sites should have the minimum amount of information
4615they can get away with.
4616In addition,
4617any information they do have
4618should be hints rather than solid information.
4619.pp
4620For example,
4621a typical site on our local ether network is
4622.q monet
4623(actually
4624.q monet.CS.Berkeley.EDU ).
4625When monet receives mail for delivery,
4626it checks whether it knows
4627that the destination host is directly reachable;
4628if so, mail is sent to that host.
4629If it receives mail for any unknown host,
4630it just passes it directly to
4631.q ucbvax.CS.Berkeley.EDU ,
4632our master host.
4633Ucbvax may determine that the host name is illegal
4634and reject the message,
4635or may be able to do delivery.
4636However, it is important to note that when a new mail connection is added,
4637the only host that
4638.i must
4639have its tables updated
4640is ucbvax;
4641the others
4642.i may
4643be updated if convenient,
4644but this is not critical.
4645.pp
4646This picture is slightly muddied
4647due to network connections that are not actually located
4648on ucbvax.
4649For example,
4650some UUCP connections are currently on
4651.q ucbarpa.
4652However,
4653monet
4654.i "does not"
4655know about this;
4656the information is hidden totally between ucbvax and ucbarpa.
4657Mail going from monet to a UUCP host
4658is transferred via the ethernet
4659from monet to ucbvax,
4660then via the ethernet from ucbvax to ucbarpa,
4661and then is submitted to UUCP.
4662Although this involves some extra hops,
4663we feel this is an acceptable tradeoff.
4664.pp
4665An interesting point is that it would be possible
4666to update monet
4667to send appropriate UUCP mail directly to ucbarpa
4668if the load got too high;
4669if monet failed to note a host as connected to ucbarpa
4670it would go via ucbvax as before,
4671and if monet incorrectly sent a message to ucbarpa
4672it would still be sent by ucbarpa
4673to ucbvax as before.
4674The only problem that can occur is loops,
4675for example,
4676if ucbarpa thought that ucbvax had the UUCP connection
4677and vice versa.
4678For this reason,
4679updates should
4680.i always
4681happen to the master host first.
4682.pp
4683This philosophy results as much from the need
4684to have a single source for the configuration files
4685(typically built using
4686.i m4 \|(1)
4687or some similar tool)
4688as any logical need.
4689Maintaining more than three separate tables by hand
4690is essentially an impossible job.
4691.sh 4 "Small site \*- complete information"
4692.pp
4693A small site
4694(two or three hosts and few external connections)
4695may find it more reasonable to have complete information
4696at each host.
4697This would require that each host
4698know exactly where each network connection is,
4699possibly including the names of each host on that network.
4700As long as the site remains small
042b8fbf 4701and the configuration remains relatively static,
6f14531a
RG
4702the update problem will probably not be too great.
4703.sh 4 "Single host"
4704.pp
4705This is in some sense the trivial case.
4706The only major issue is trying to insure that you don't
4707have to know too much about your environment.
4708For example,
4709if you have a UUCP connection
4710you might find it useful to know about the names of hosts
4711connected directly to you,
4712but this is really not necessary
4713since this may be determined from the syntax.
4714.sh 4 "A completely different philosophy"
4715.pp
4716This is adapted from Bruce Lilly.
4717Any errors in interpretation are mine.
4718.pp
4719Do minimal changes in ruleset 3:
4720fix some common but unambiguous errors (e.g. trailing dot on domains) and
4721hide bang paths foo!bar into bar@foo.UUCP.
4722The resulting "canonical" form is any valid RFC822/RFC1123/RFC976 address.
4723.pp
4724Ruleset 0 does the bulk of the work.
4725It removes the trailing "@.UUCP" that hides bang paths,
4726strips anything not needed to resolve,
4727e.g. the phrase from phrase <route-addr> and from named groups,
4728rejects unparseable addresses using $#error,
4729and finally
4730resolves to a mailer/host/user triple.
4731Ruleset 0 is rather lengthy
4732as it has to handle 3 basic address forms:
4733RFC976 bang paths,
4734RFC1123 %-hacks
4735(including vanilla RFC822 local-part@domain),
4736and RFC822 source routes.
4737It's also complicated by having to handle named lists.
4738.pp
4739The header rewriting rulesets 1 and 2
4740remove the trailing "@.UUCP" that hides bang paths.
4741Ruleset 2 also strips the $# mailer $@ host (for test mode).
4742.pp
4743Ruleset 4 does absolutely nothing.
4744.pp
4745The per-mailer rewriting rulesets conform the envelope and
4746header addresses to the requirements of the specific
4747mailer.
4748.pp
4749Lots of rulesets-as-subroutines are used.
4750.pp
4751As a result, header addresses are subject to minimal munging
4752(per RFC1123), and the general plan is per RFC822 sect. 3.4.10.
4753.sh 3 "Relevant issues"
4754.pp
4755The canonical form you use
4756should almost certainly be as specified in
4757the Internet protocols
4758RFC819 and RFC822.
4759Copies of these RFC's are included on the
4760.i sendmail
4761tape
4762as
4763.i doc/rfc819.lpr
4764and
4765.i doc/rfc822.lpr .
4766.pp
4767RFC822
4768describes the format of the mail message itself.
4769.i Sendmail
4770follows this RFC closely,
4771to the extent that many of the standards described in this document
4772can not be changed without changing the code.
4773In particular,
4774the following characters have special interpretations:
4775.(b
4776< > ( ) " \e
4777.)b
4778Any attempt to use these characters for other than their RFC822
4779purpose in addresses is probably doomed to disaster.
4780.pp
4781RFC819
4782describes the specifics of the domain-based addressing.
4783This is touched on in RFC822 as well.
4784Essentially each host is given a name
4785which is a right-to-left dot qualified pseudo-path
4786from a distinguished root.
4787The elements of the path need not be physical hosts;
4788the domain is logical rather than physical.
4789For example,
4790at Berkeley
4791one legal host might be
4792.q a.CC.Berkeley.EDU ;
4793reading from right to left,
4794.q EDU
4795is a top level domain
4796comprising educational institutions,
4797.q Berkeley
4798is a logical domain name,
4799.q CC
4800represents the Computer Center,
4801(in this case a strictly logical entity),
4802and
4803.q a
4804is a host in the Computer Center.
4805.pp
4806Beware when reading RFC819
4807that there are a number of errors in it.
4808.sh 3 "How to proceed"
4809.pp
4810Once you have decided on a philosophy,
4811it is worth examining the available configuration tables
4812to decide if any of them are close enough
4813to steal major parts of.
4814Even under the worst of conditions,
4815there is a fair amount of boiler plate that can be collected safely.
4816.pp
4817The next step is to build ruleset three.
4818This will be the hardest part of the job.
4819Beware of doing too much to the address in this ruleset,
4820since anything you do will reflect through
4821to the message.
4822In particular,
4823stripping of local domains is best deferred,
4824since this can leave you with addresses with no domain spec at all.
4825Since
4826.i sendmail
4827likes to append the sending domain to addresses with no domain,
4828this can change the semantics of addresses.
4829Also try to avoid
4830fully qualifying domains in this ruleset.
4831Although technically legal,
4832this can lead to unpleasantly and unnecessarily long addresses
4833reflected into messages.
4834The Berkeley configuration files
4835define ruleset nine
4836to qualify domain names and strip local domains.
4837This is called from ruleset zero
4838to get all addresses into a cleaner form.
4839.pp
4840Once you have ruleset three finished,
4841the other rulesets should be relatively trivial.
4842If you need hints,
4843examine the supplied configuration tables.
4844.sh 3 "Testing the rewriting rules \*- the \-bt flag"
4845.pp
4846When you build a configuration table,
4847you can do a certain amount of testing
4848using the
4849.q "test mode"
4850of
4851.i sendmail .
4852For example,
4853you could invoke
4854.i sendmail
4855as:
4856.(b
4857sendmail \-bt \-Ctest.cf
4858.)b
4859which would read the configuration file
4860.q test.cf
4861and enter test mode.
4862In this mode,
4863you enter lines of the form:
4864.(b
4865rwset address
4866.)b
4867where
4868.i rwset
4869is the rewriting set you want to use
4870and
4871.i address
4872is an address to apply the set to.
4873Test mode shows you the steps it takes
4874as it proceeds,
4875finally showing you the address it ends up with.
4876You may use a comma separated list of rwsets
4877for sequential application of rules to an input.
4878For example:
4879.(b
48803,1,21,4 monet:bollard
4881.)b
4882first applies ruleset three to the input
4883.q monet:bollard.
4884Ruleset one is then applied to the output of ruleset three,
4885followed similarly by rulesets twenty-one and four.
4886.pp
4887If you need more detail,
4888you can also use the
4889.q \-d21
4890flag to turn on more debugging.
4891For example,
4892.(b
4893sendmail \-bt \-d21.99
4894.)b
4895turns on an incredible amount of information;
4896a single word address
4897is probably going to print out several pages worth of information.
4898.pp
4899You should be warned that internally,
d747e748 4900.i sendmail
6f14531a 4901applies ruleset 3 to all addresses.
d747e748
JH
4902In this version of
4903.i sendmail ,
4904you will have to do that manually.
6f14531a
RG
4905For example, older versions allowed you to use
4906.(b
49070 bruce@broadcast.sony.com
4908.)b
4909This version requires that you use:
4910.(b
49113,0 bruce@broadcast.sony.com
4912.)b
4913.sh 3 "Building mailer descriptions"
4914.pp
4915To add an outgoing mailer to your mail system,
4916you will have to define the characteristics of the mailer.
4917.pp
4918Each mailer must have an internal name.
4919This can be arbitrary,
4920except that the names
4921.q local
4922and
4923.q prog
4924must be defined.
4925.pp
4926The pathname of the mailer must be given in the P field.
4927If this mailer should be accessed via an IPC connection,
4928use the string
4929.q [IPC]
4930instead.
4931.pp
4932The F field defines the mailer flags.
4933You should specify an
4934.q f
4935or
4936.q r
4937flag to pass the name of the sender as a
4938.b \-f
4939or
4940.b \-r
4941flag respectively.
4942These flags are only passed if they were passed to
d747e748 4943.i sendmail ,
6f14531a
RG
4944so that mailers that give errors under some circumstances
4945can be placated.
4946If the mailer is not picky
4947you can just specify
4948.q "\-f $g"
4949in the argv template.
4950If the mailer must be called as
4951.b root
4952the
4953.q S
4954flag should be given;
4955this will not reset the userid
4956before calling the mailer\**.
4957.(f
4958\**\c
4959.i Sendmail
4960must be running setuid to root
4961for this to work.
4962.)f
4963If this mailer is local
4964(i.e., will perform final delivery
4965rather than another network hop)
4966the
4967.q l
4968flag should be given.
4969Quote characters
4970(backslashes and " marks)
4971can be stripped from addresses if the
4972.q s
4973flag is specified;
4974if this is not given
4975they are passed through.
4976If the mailer is capable of sending to more than one user
4977on the same host
4978in a single transaction
4979the
4980.q m
4981flag should be stated.
4982If this flag is on,
4983then the argv template containing
4984.b $u
4985will be repeated for each unique user
4986on a given host.
4987The
4988.q e
4989flag will mark the mailer as being
4990.q expensive,
4991which will cause
4992.i sendmail
4993to defer connection
4994until a queue run\**.
4995.(f
4996\**The
4997.q c
4998configuration option must be given
4999for this to be effective.
5000.)f
5001.pp
5002An unusual case is the
5003.q C
5004flag.
5005This flag applies to the mailer that the message is received from,
5006rather than the mailer being sent to;
5007if set,
5008the domain spec of the sender
5009(i.e., the
5010.q @host.domain
5011part)
5012is saved
5013and is appended to any addresses in the message
5014that do not already contain a domain spec.
5015For example,
5016a message of the form:
5017.(b
5018From: eric@vangogh.CS.Berkeley.EDU
5019To: wnj@monet.CS.Berkeley.EDU, mckusick
5020.)b
5021will be modified to:
5022.(b
5023From: eric@vangogh.CS.Berkeley.EDU
5024To: wnj@monet.CS.Berkeley.EDU, mckusick@vangogh.CS.Berkeley.EDU
5025.)b
5026.i "if and only if"
5027the
5028.q C
042b8fbf
AM
5029flag is defined in the mailer resolved to
5030by running
5031.q eric@vangogh.CS.Berkeley.EDU
5032through rulesets 3 and 0.
6f14531a
RG
5033.pp
5034Other flags are described
5035in Appendix C.
5036.pp
5037The S and R fields in the mailer description
5038are per-mailer rewriting sets
5039to be applied to sender and recipient addresses
5040respectively.
5041These are applied after the sending domain is appended
5042and the general rewriting sets
5043(numbers one and two)
5044are applied,
5045but before the output rewrite
5046(ruleset four)
5047is applied.
5048A typical use is to append the current domain
5049to addresses that do not already have a domain.
5050For example,
5051a header of the form:
5052.(b
5053From: eric
5054.)b
5055might be changed to be:
5056.(b
5057From: eric@vangogh.CS.Berkeley.EDU
5058.)b
5059or
5060.(b
5061From: ucbvax!eric
5062.)b
5063depending on the domain it is being shipped into.
5064These sets can also be used
5065to do special purpose output rewriting
5066in cooperation with ruleset four.
5067.pp
d747e748
JH
5068The S and R fields
5069can be specified as two numbers separated by a slash
5070(e.g.,
5071.q "S=10/11" ),
5072meaning that all envelope addresses will be processed through ruleset 10
5073and all header addresses will be processed through ruleset 11.
5074With only one number specified,
5075both envelope and header rewriting sets are set to the indicated ruleset.
5076.pp
6f14531a
RG
5077The E field defines the string to use
5078as an end-of-line indication.
5079A string containing only newline is the default.
5080The usual backslash escapes
5081(\er, \en, \ef, \eb)
5082may be used.
5083.pp
5084Finally,
042b8fbf 5085an argv template is given as the A field.
6f14531a
RG
5086It may have embedded spaces.
5087If there is no argv with a
5088.b $u
5089macro in it,
5090.i sendmail
5091will speak SMTP
5092to the mailer.
5093If the pathname for this mailer is
5094.q [IPC],
5095the argv should be
5096.(b
5097IPC $h [ \fIport\fP ]
5098.)b
5099where
5100.i port
5101is the optional port number
5102to connect to.
5103.pp
5104For example,
5105the specifications:
5106.(b
5107.ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'u
5108Mlocal, P=/bin/mail, F=rlsm S=10, R=20, A=mail \-d $u
5109Mether, P=[IPC], F=meC, S=11, R=21, A=IPC $h, M=100000
5110.)b
5111specifies a mailer to do local delivery
5112and a mailer for ethernet delivery.
5113The first is called
5114.q local,
5115is located in the file
5116.q /bin/mail,
5117takes a picky
5118.b \-r
5119flag,
5120does local delivery,
5121quotes should be stripped from addresses,
5122and multiple users can be delivered at once;
5123ruleset ten
5124should be applied to sender addresses in the message
5125and ruleset twenty
5126should be applied to recipient addresses;
5127the argv to send to a message will be the word
5128.q mail,
5129the word
5130.q \-d,
5131and words containing the name of the receiving user.
5132If a
5133.b \-r
5134flag is inserted
5135it will be between the words
5136.q mail
5137and
5138.q \-d.
5139The second mailer is called
5140.q ether,
5141it should be connected to via an IPC connection,
5142it can handle multiple users at once,
5143connections should be deferred,
5144and any domain from the sender address
5145should be appended to any receiver name
5146without a domain;
5147sender addresses should be processed by ruleset eleven
5148and recipient addresses by ruleset twenty-one.
5149There is a 100,000 byte limit on messages passed through this mailer.
5150.sh 2 "The User Database"
5151.pp
d747e748
JH
5152If you have a version of
5153.i sendmail
5154with the user database package
6f14531a
RG
5155compiled in,
5156the handling of sender and recipient addresses
5157is modified.
5158.pp
5159The location of this database is controlled with the
5160.b U
5161option.
5162.sh 3 "Structure of the user database"
5163.pp
5164The database is a sorted (BTree-based) structure.
5165User records are stored with the key:
5166.(b
5167\fIuser-name\fP\fB:\fP\fIfield-name\fP
5168.)b
5169The sorted database format ensures that user records are clustered together.
5170Meta-information is always stored with a leading colon.
5171.pp
5172Field names define both the syntax and semantics of the value.
5173Defined fields include:
5174.nr ii 1i
5175.ip maildrop
5176The delivery address for this user.
5177There may be multiple values of this record.
5178In particular,
5179mailing lists will have one
5180.i maildrop
5181record for each user on the list.
5182.ip "mailname"
5183The outgoing mailname for this user.
5184For each outgoing name,
5185there should be an appropriate
5186.i maildrop
5187record for that name to allow return mail.
5188See also
5189.i :default:mailname .
5190.ip mailsender
5191Changes any mail sent to this address to have the indicated envelope sender.
5192This is intended for mailing lists,
5193and will normally be the name of an appropriate -request address.
5194It is very similar to the owner-\c
5195.i list
5196syntax in the alias file.
5197.ip fullname
5198The full name of the user.
5199.ip office-address
5200The office address for this user.
5201.ip office-phone
5202The office phone number for this user.
5203.ip office-fax
5204The office FAX number for this user.
5205.ip home-address
5206The home address for this user.
5207.ip home-phone
5208The home phone number for this user.
5209.ip home-fax
5210The home FAX number for this user.
5211.ip project
5212A (short) description of the project this person is affiliated with.
5213In the University this is often just the name of their graduate advisor.
5214.ip plan
5215A pointer to a file from which plan information can be gathered.
5216.pp
5217As of this writing,
d747e748
JH
5218only a few of these fields are actually being used by
5219.i sendmail :
6f14531a
RG
5220.i maildrop
5221and
5222.i mailname .
5223A
5224.i finger
5225program that uses the other fields is planned.
5226.sh 3 "User database semantics"
5227.pp
5228When the rewriting rules submit an address to the local mailer,
5229the user name is passed through the alias file.
5230If no alias is found (or if the alias points back to the same address),
5231the name (with
5232.q :maildrop
5233appended)
5234is then used as a key in the user database.
5235If no match occurs (or if the maildrop points at the same address),
5236forwarding is tried.
5237.pp
5238If the first token of the user name returned by ruleset 0
5239is an
5240.q @
5241sign, the user database lookup is skipped.
5242The intent is that the user database will act as a set of defaults
5243for a cluster (in our case, the Computer Science Division);
5244mail sent to a specific machine should ignore these defaults.
5245.pp
5246When mail is sent,
5247the name of the sending user is looked up in the database.
5248If that user has a
5249.q mailname
5250record,
5251the value of that record is used as their outgoing name.
5252For example, I might have a record:
5253.(b
5254eric:mailname Eric.Allman@CS.Berkeley.EDU
5255.)b
5256This would cause my outgoing mail to be sent as Eric.Allman.
5257.pp
5258If a
5259.q maildrop
5260is found for the user,
5261but no corresponding
042b8fbf 5262.q mailname
6f14531a
RG
5263record exists,
5264the record
5265.q :default:mailname
5266is consulted.
5267If present, this is the name of a host to override the local host.
5268For example, in our case we would set it to
5269.q CS.Berkeley.EDU .
5270The effect is that anyone known in the database
5271gets their outgoing mail stamped as
5272.q user@CS.Berkeley.EDU ,
5273but people not listed in the database use the local hostname.
d747e748
JH
5274.sh 3 "Creating the database\**"
5275.(f
5276\**These instructions are known to be incomplete.
5277A future version of the user database is planned
5278including things such as finger service \*- and good documentation.
5279.)f
5280.pp
5281The user database is built from a text file
5282using the
5283.i makemap
5284utility
5285(in the distribution in the makemap subdirectory).
5286The text file is a series of lines corresponding to userdb records;
5287each line has a key and a value separated by white space.
5288The key is always in the format described above \*-
5289for example:
5290.(b
5291eric:maildrop
5292.)b
5293This file is normally installed in a system directory;
5294for example, it might be called
5295.i /etc/userdb .
5296To make the database version of the map, run the program:
5297.(b
5298makemap btree /etc/userdb.db < /etc/userdb
5299.)b
5300Then create a config file that uses this.
5301For example, using the V8 M4 configuration, include the
5302following line in your .mc file:
5303.(b
5304define(\`confUSERDB_SPEC\', /etc/userdb.db)
5305.)b
6f14531a
RG
5306.sh 1 "OTHER CONFIGURATION"
5307.pp
5308There are some configuration changes that can be made by
5309recompiling
5310.i sendmail .
5311This section describes what changes can be made
5312and what has to be modified to make them.
5313.sh 2 "Parameters in src/Makefile"
5314.pp
5315These parameters are intended to describe the compilation environment,
5316not site policy,
5317and should normally be defined in src/Makefile.
5318.ip NDBM
5319If set,
5320the new version of the DBM library
5321that allows multiple databases will be used.
5322If neither NDBM nor NEWDB are set,
5323a much less efficient method of alias lookup is used.
5324.ip NEWDB
5325If set, use the new database package from Berkeley (from 4.4BSD).
5326This package is substantially faster than DBM or NDBM.
5327If NEWDB and NDBM are both set,
d747e748
JH
5328.i sendmail
5329will read DBM files,
6f14531a 5330but will create and use NEWDB files.
d747e748
JH
5331.ip NIS
5332Include support for NIS.
6f14531a
RG
5333If set together with
5334.i both
5335NEWDB and NDBM,
5336.i sendmail
5337will create both DBM and NEWDB files if and only if
5338the file /var/yp/Makefile
5339exists and is readable.
5340This is intended for compatibility with Sun Microsystems'
5341.i mkalias
5342program used on YP masters.
6f14531a
RG
5343.ip SYSTEM5
5344Set all of the compilation parameters appropriate for System V.
5345.ip LOCKF
5346Use System V
5347.b lockf
5348instead of Berkeley
5349.b flock .
5350Due to the highly unusual semantics of locks
5351across forks in
5352.b lockf ,
5353this should never be used unless absolutely necessary.
5354Set by default if
5355SYSTEM5 is set.
5356.ip SYS5TZ
5357Use System V
5358time zone semantics.
5359.ip HASINITGROUPS
5360Set this if your system has the
5361.i initgroups()
5362call
5363(if you have multiple group support).
5364This is the default if SYSTEM5 is
5365.i not
5366defined or if you are on HPUX.
5367.ip HASUNAME
5368Set this if you have the
5369.i uname (2)
5370system call (or corresponding library routine).
5371Set by default if
5372SYSTEM5
5373is set.
5374.ip HASSTATFS
5375Set this if you have the
5376.i statfs (2)
5377system call.
5378This will allow you to give a temporary failure
5379message to incoming SMTP email
5380when you are low on disk space.
3a363396 5381It is set by default on 4.4BSD and OSF/1 systems.
6f14531a
RG
5382.ip HASUSTAT
5383Set if you have the
5384.i ustat (2)
5385system call.
5386This is an alternative implementation of disk space control.
5387You should only set one of HASSTATFS or HASUSTAT;
5388the first is preferred.
5389.ip _PATH_SENDMAILCF
5390The pathname of the sendmail.cf file.
6f14531a
RG
5391.ip _PATH_SENDMAILPID
5392The pathname of the sendmail.pid file.
5393.ip LA_TYPE
5394The load average type.
5395Details are described below.
5396.lp
042b8fbf 5397The are several built-in ways of computing the load average.
6f14531a
RG
5398.i Sendmail
5399tries to auto-configure them based on imperfect guesses;
5400you can select one using the
5401.i cc
5402option
5403.b \-DLA_TYPE= \c
5404.i type ,
5405where
5406.i type
5407is:
5408.ip LA_INT
5409The kernel stores the load average in the kernel as an array of long integers.
5410The actual values are scaled by a factor FSCALE
5411(default 256).
d747e748
JH
5412.ip LA_SHORT
5413The kernel stores the load average in the kernel as an array of short integers.
5414The actual values are scaled by a factor FSCALE
5415(default 256).
6f14531a
RG
5416.ip LA_FLOAT
5417The kernel stores the load average in the kernel as an array of
5418double precision floats.
042b8fbf
AM
5419.ip LA_MACH
5420Use MACH-style load averages.
6f14531a
RG
5421.ip LA_SUBR
5422Call the
5423.i getloadavg
5424routine to get the load average as an array of doubles.
5425.ip LA_ZERO
5426Always return zero as the load average.
5427This is the fallback case.
5428.lp
5429If type
d747e748
JH
5430.sm LA_INT ,
5431.sm LA_SHORT ,
6f14531a
RG
5432or
5433.sm LA_FLOAT
5434is specified,
5435you may also need to specify
5436.sm _PATH_UNIX
5437(the path to your system binary)
5438and
5439.sm LA_AVENRUN
5440(the name of the variable containing the load average in the kernel;
5441usually
5442.q _avenrun
5443or
5444.q avenrun ).
d747e748
JH
5445.pp
5446There are also several compilation flags to indicate the environment
5447such as
5448.q _AIX3
5449and
5450.q _SCO_unix_ .
5451See the READ_ME
5452file for the latest scoop on these flags.
6f14531a
RG
5453.sh 2 "Parameters in src/conf.h"
5454.pp
5455Parameters and compilation options
5456are defined in conf.h.
5457Most of these need not normally be tweaked;
5458common parameters are all in sendmail.cf.
5459However, the sizes of certain primitive vectors, etc.,
5460are included in this file.
5461The numbers following the parameters
5462are their default value.
5463.nr ii 1.2i
5464.ip "MAXLINE [1024]"
5465The maximum line length of any input line.
5466If message lines exceed this length
5467they will still be processed correctly;
5468however, header lines,
5469configuration file lines,
5470alias lines,
5471etc.,
5472must fit within this limit.
5473.ip "MAXNAME [256]"
5474The maximum length of any name,
5475such as a host or a user name.
5476.ip "MAXPV [40]"
5477The maximum number of parameters to any mailer.
5478This limits the number of recipients that may be passed in one transaction.
5479It can be set to any arbitrary number above about 10,
5480since
5481.i sendmail
5482will break up a delivery into smaller batches as needed.
5483A higher number may reduce load on your system, however.
5484.ip "MAXATOM [100]"
5485The maximum number of atoms
5486(tokens)
5487in a single address.
5488For example,
5489the address
5490.q "eric@CS.Berkeley.EDU"
5491is seven atoms.
5492.ip "MAXMAILERS [25]"
5493The maximum number of mailers that may be defined
5494in the configuration file.
5495.ip "MAXRWSETS [100]"
5496The maximum number of rewriting sets
5497that may be defined.
5498.ip "MAXPRIORITIES [25]"
5499The maximum number of values for the
5500.q Precedence:
5501field that may be defined
5502(using the
5503.b P
5504line in sendmail.cf).
5505.ip "MAXUSERENVIRON [40]"
5506The maximum number of items in the user environment
5507that will be passed to subordinate mailers.
5508.ip "QUEUESIZE [1000]"
5509The maximum number of entries that will be processed
5510in a single queue run.
5511.ip "MAXMXHOSTS [20]"
5512The maximum number of MX records we will accept for any single host.
6f14531a
RG
5513.lp
5514A number of other compilation options exist.
5515These specify whether or not specific code should be compiled in.
5516.nr ii 1.2i
5517.ip DEBUG
5518If set, debugging information is compiled in.
5519To actually get the debugging output,
5520the
5521.b \-d
5522flag must be used.
5523.b "WE STRONGLY RECOMMEND THAT THIS BE LEFT ON."
5524Some people, believing that it was a security hole
5525(it was, once)
5526have turned it off and thus crippled debuggers.
5527.ip NETINET
5528If set,
5529support for Internet protocol networking is compiled in.
5530Previous versions of
d747e748 5531.i sendmail
6f14531a
RG
5532referred to this as
5533.sm DAEMON ;
5534this old usage is now incorrect.
5535.ip NETISO
5536If set,
5537support for ISO protocol networking is compiled in
5538(it may be appropriate to #define this in the Makefile instead of conf.h).
5539.ip LOG
5540If set,
5541the
5542.i syslog
5543routine in use at some sites is used.
5544This makes an informational log record
5545for each message processed,
5546and makes a higher priority log record
5547for internal system errors.
5548.ip MATCHGECOS
5549Compile in the code to do ``fuzzy matching'' on the GECOS field
5550in /etc/passwd.
5551This also requires that option G be turned on.
5552.ip NAMED_BIND
5553Compile in code to use the
5554Berkeley Internet Name Domain (BIND) server
5555to resolve TCP/IP host names.
5556.ip NOTUNIX
5557If you are using a non-UNIX mail format,
5558you can set this flag to turn off special processing
5559of UNIX-style
5560.q "From "
5561lines.
5562.ip QUEUE
5563This flag should be set to compile in the queueing code.
5564If this is not set,
5565mailers must accept the mail immediately
5566or it will be returned to the sender.
5567.ip SETPROCTITLE
5568If defined,
5569.i sendmail
5570will change its
5571.i argv
5572array to indicate its current status.
5573This can be used in conjunction with the
5574.i ps
5575command to find out just what it's up to.
5576.ip SMTP
5577If set,
5578the code to handle user and server SMTP will be compiled in.
5579This is only necessary if your machine has some mailer
5580that speaks SMTP
5581(this means most machines everywhere).
5582.ip UGLYUUCP
5583If you have a UUCP host adjacent to you which is not running
5584a reasonable version of
5585.i rmail ,
5586you will have to set this flag to include the
5587.q "remote from sysname"
5588info on the from line.
5589Otherwise, UUCP gets confused about where the mail came from.
5590.ip USERDB
5591Include the
5592.b experimental
5593Berkeley user information database package.
5594This adds a new level of local name expansion
5595between aliasing and forwarding.
5596It also uses the NEWDB package.
5597This may change in future releases.
5598.ip IDENTPROTO
5599Compile in the IDENT protocol as defined in RFC 1413.
5600This defaults on for all systems except Ultrix,
5601which apparently has the interesting
5602.q feature
5603that when it receives a
5604.q "host unreachable"
5605message it closes all open connections to that host.
5606Since some firewall gateways send this error code
5607when you access an unauthorized port (such as 113, used by IDENT),
5608Ultrix cannot receive email from such hosts.
5609.sh 2 "Configuration in src/conf.c"
5610.pp
5611The following changes can be made in conf.c.
5612.sh 3 "Built-in Header Semantics"
5613.pp
5614Not all header semantics are defined in the configuration file.
5615Header lines that should only be included by certain mailers
5616(as well as other more obscure semantics)
5617must be specified in the
5618.i HdrInfo
5619table in
5620.i conf.c .
5621This table contains the header name
5622(which should be in all lower case)
5623and a set of header control flags (described below),
5624The flags are:
5625.ip H_ACHECK
5626Normally when the check is made to see if a header line is compatible
5627with a mailer,
5628.i sendmail
5629will not delete an existing line.
5630If this flag is set,
5631.i sendmail
5632will delete
5633even existing header lines.
5634That is,
5635if this bit is set and the mailer does not have flag bits set
5636that intersect with the required mailer flags
5637in the header definition in
5638sendmail.cf,
5639the header line is
5640.i always
5641deleted.
5642.ip H_EOH
5643If this header field is set,
5644treat it like a blank line,
5645i.e.,
5646it will signal the end of the header
5647and the beginning of the message text.
5648.ip H_FORCE
5649Add this header entry
5650even if one existed in the message before.
5651If a header entry does not have this bit set,
5652.i sendmail
5653will not add another header line if a header line
5654of this name already existed.
5655This would normally be used to stamp the message
5656by everyone who handled it.
5657.ip H_TRACE
5658If set,
5659this is a timestamp
5660(trace)
5661field.
5662If the number of trace fields in a message
5663exceeds a preset amount
5664the message is returned
5665on the assumption that it has an aliasing loop.
5666.ip H_RCPT
5667If set,
5668this field contains recipient addresses.
5669This is used by the
5670.b \-t
5671flag to determine who to send to
5672when it is collecting recipients from the message.
5673.ip H_FROM
5674This flag indicates that this field
5675specifies a sender.
5676The order of these fields in the
5677.i HdrInfo
5678table specifies
d747e748 5679.i sendmail 's
6f14531a
RG
5680preference
5681for which field to return error messages to.
5682.nr ii 5n
5683.lp
5684Let's look at a sample
5685.i HdrInfo
5686specification:
5687.(b
5688.ta 4n +\w'"return-receipt-to", 'u
5689struct hdrinfo HdrInfo[] =
5690\&{
5691 /* originator fields, most to least significant */
5692 "resent-sender", H_FROM,
5693 "resent-from", H_FROM,
5694 "sender", H_FROM,
5695 "from", H_FROM,
5696 "full-name", H_ACHECK,
5697 /* destination fields */
5698 "to", H_RCPT,
5699 "resent-to", H_RCPT,
5700 "cc", H_RCPT,
5701 /* message identification and control */
5702 "message", H_EOH,
5703 "text", H_EOH,
5704 /* trace fields */
5705 "received", H_TRACE|H_FORCE,
5706
5707 NULL, 0,
5708};
5709.)b
5710This structure indicates that the
5711.q To: ,
5712.q Resent-To: ,
5713and
5714.q Cc:
5715fields
5716all specify recipient addresses.
5717Any
5718.q Full-Name:
5719field will be deleted unless the required mailer flag
5720(indicated in the configuration file)
5721is specified.
5722The
5723.q Message:
5724and
5725.q Text:
5726fields will terminate the header;
5727these are used by random dissenters around the network world.
5728The
5729.q Received:
5730field will always be added,
5731and can be used to trace messages.
5732.pp
5733There are a number of important points here.
5734First,
5735header fields are not added automatically just because they are in the
5736.i HdrInfo
5737structure;
5738they must be specified in the configuration file
5739in order to be added to the message.
5740Any header fields mentioned in the configuration file but not
5741mentioned in the
5742.i HdrInfo
5743structure have default processing performed;
5744that is,
5745they are added unless they were in the message already.
5746Second,
5747the
5748.i HdrInfo
5749structure only specifies cliched processing;
5750certain headers are processed specially by ad hoc code
5751regardless of the status specified in
5752.i HdrInfo .
5753For example,
5754the
5755.q Sender:
5756and
5757.q From:
5758fields are always scanned on ARPANET mail
5759to determine the sender\**;
5760.(f
5761\**Actually, this is no longer true in SMTP;
5762this information is contained in the envelope.
5763The older ARPANET protocols did not completely distinguish
5764envelope from header.
5765.)f
5766this is used to perform the
5767.q "return to sender"
5768function.
5769The
5770.q "From:"
5771and
5772.q "Full-Name:"
5773fields are used to determine the full name of the sender
5774if possible;
5775this is stored in the macro
5776.b $x
5777and used in a number of ways.
5778.sh 3 "Restricting Use of Email"
5779.pp
5780If it is necessary to restrict mail through a relay,
5781the
5782.i checkcompat
5783routine can be modified.
5784This routine is called for every recipient address.
5785It returns an exit status
5786indicating the status of the message.
5787The status
5788.sm EX_OK
5789accepts the address,
5790.sm EX_TEMPFAIL
5791queues the message for a later try,
5792and other values
5793(commonly
5794.sm EX_UNAVAILABLE )
5795reject the message.
5796It is up to
5797.i checkcompat
5798to print an error message
5799(using
5800.i usrerr )
5801if the message is rejected.
5802For example,
5803.i checkcompat
5804could read:
5805.(b
5806.re
5807.sz -1
5808.ta 4n +4n +4n +4n +4n +4n +4n
5809int
5810checkcompat(to, e)
5811 register ADDRESS *to;
5812 register ENVELOPE *e;
5813\&{
5814 register STAB *s;
5815
5816 s = stab("private", ST_MAILER, ST_FIND);
5817 if (s != NULL && e\->e_from.q_mailer != LocalMailer &&
5818 to->q_mailer == s->s_mailer)
5819 {
5820 usrerr("No private net mail allowed through this machine");
5821 return (EX_UNAVAILABLE);
5822 }
5823 if (MsgSize > 50000 && to\->q_mailer != LocalMailer)
5824 {
5825 usrerr("Message too large for non-local delivery");
5826 NoReturn = TRUE;
5827 return (EX_UNAVAILABLE);
5828 }
5829 return (EX_OK);
5830}
5831.sz
5832.)b
5833This would reject messages greater than 50000 bytes
5834unless they were local.
5835The
5836.i NoReturn
5837flag can be sent to suppress the return of the actual body
5838of the message in the error return.
5839The actual use of this routine is highly dependent on the
5840implementation,
5841and use should be limited.
5842.sh 3 "Load Average Computation"
5843.pp
5844The routine
5845.i getla
5846should return an approximation of the current system load average
5847as an integer.
5848There are four versions included on compilation flags
5849as described above.
5850.sh 3 "New Database Map Classes"
5851.pp
5852New key maps can be added by creating a class initialization function
5853and a lookup function.
5854These are then added to the routine
5855.i setupmaps.
5856.pp
5857The initialization function is called as
5858.(b
5859\fIxxx\fP_map_init(MAP *map, char *mapname, char *args)
5860.)b
5861The
5862.i map
5863is an internal data structure.
5864The
5865.i mapname
5866is the name of the map (used for error messages).
5867The
5868.i args
5869is a pointer to the rest of the configuration file line;
5870flags and filenames can be extracted from this line.
5871The initialization function must return
5872.sm TRUE
5873if it successfully opened the map,
5874.sm FALSE
5875otherwise.
5876.pp
5877The lookup function is called as
5878.(b
5879\fIxxx\fP_map_lookup(MAP *map, char buf[], int bufsize, char **av, int *statp)
5880.)b
5881The
5882.i map
5883defines the map internally.
5884The parameters
5885.i buf
5886and
5887.i bufsize
5888have the input key.
5889This may be (and often is) used destructively.
5890The
5891.i av
5892is a list of arguments passed in from the rewrite line.
5893The lookup function should return a pointer to the new value.
5894IF the map lookup fails,
5895.i *statp
5896should be set to an exit status code;
5897in particular, it should be set to
5898.sm EX_TEMPFAIL
5899if recovery is to be attempted by the higher level code.
5900.sh 3 "Queueing Function"
5901.pp
5902The routine
5903.i shouldqueue
5904is called to decide if a message should be queued
5905or processed immediately.
5906Typically this compares the message priority to the current load average.
5907The default definition is:
5908.(b
5909bool
5910shouldqueue(pri, ctime)
5911 long pri;
5912 time_t ctime;
5913{
5914 if (CurrentLA < QueueLA)
5915 return (FALSE);
5916 if (CurrentLA >= RefuseLA)
5917 return (TRUE);
5918 return (pri > (QueueFactor / (CurrentLA \- QueueLA + 1)));
5919}
5920.)b
5921If the current load average
5922(global variable
5923.i CurrentLA ,
5924which is set before this function is called)
5925is less than the low threshold load average
5926(option
5927.b x ,
5928variable
5929.i QueueLA ),
5930.i shouldqueue
5931returns
5932.sm FALSE
5933immediately
5934(that is, it should
5935.i not
5936queue).
5937If the current load average exceeds the high threshold load average
5938(option
5939.b X ,
5940variable
5941.i RefuseLA ),
5942.i shouldqueue
5943returns
5944.sm TRUE
5945immediately.
5946Otherwise, it computes the function based on the message priority,
5947the queue factor
5948(option
5949.b q ,
5950global variable
5951.i QueueFactor ),
5952and the current and threshold load averages.
5953.pp
5954An implementation wishing to take the actual age of the message into account
5955can also use the
5956.i ctime
5957parameter,
5958which is the time that the message was first submitted to
5959.i sendmail .
5960Note that the
5961.i pri
5962parameter is already weighted
5963by the number of times the message has been tried
5964(although this tends to lower the priority of the message with time);
5965the expectation is that the
5966.i ctime
5967would be used as an
5968.q "escape clause"
5969to ensure that messages are eventually processed.
5970.sh 3 "Refusing Incoming SMTP Connections"
5971.pp
5972The function
5973.i refuseconnections
5974returns
5975.sm TRUE
5976if incoming SMTP connections should be refused.
5977The current implementation is based exclusively on the current load average
5978and the refuse load average option
5979(option
5980.b X ,
5981global variable
5982.i RefuseLA ):
5983.(b
5984bool
5985refuseconnections()
5986{
5987 return (CurrentLA >= RefuseLA);
5988}
5989.)b
5990A more clever implementation
5991could look at more system resources.
5992.sh 3 "Load Average Computation"
5993.pp
5994The routine
5995.i getla
5996returns the current load average (as a rounded integer).
5997The distribution includes several possible implementations.
5998.sh 2 "Configuration in src/daemon.c"
5999.pp
6000The file
6001.i src/daemon.c
6002contains a number of routines that are dependent
6003on the local networking environment.
3a363396 6004The version supplied assumes you have BSD style sockets.
6f14531a
RG
6005.pp
6006In previous releases,
6007we recommended that you modify the routine
6008.i maphostname
6009if you wanted to generalize
6010.b $[
6011\&...\&
6012.b $]
6013lookups.
6014We now recommend that you create a new keyed map instead.
3a363396 6015.sh 1 "CHANGES IN VERSION 8"
6f14531a
RG
6016.pp
6017The following summarizes changes
6018since the last commonly available version of
d747e748 6019.i sendmail
6f14531a
RG
6020(5.67):
6021.sh 2 "Connection Caching"
6022.pp
6023Instead of closing SMTP connections immediately,
6024those connections are cached for possible future use.
6025The advent of MX records made this effective for mailing lists;
6026in addition,
6027substantial performance improvements can be expected for queue processing.
6028.sh 2 "MX Piggybacking"
6029.pp
6030If two hosts with different names in a single message
6031happen to have the same set of MX hosts,
6032they can be sent in the same transaction.
3a363396
NW
6033Version 8 notices this and tries to batch the messages.
6034.sh 2 "RFC 1123 Compliance"
6035.pp
6036A number of changes have been made to make
6037.i sendmail
6038.q "conditionally compliant"
6039(that is,
6040.i sendmail
6041satisfies all of the
6042.q MUST
6043clauses and most but not all of the
6044.q SHOULD
6045clauses in RFC 1123).
6046.pp
6047The major areas of change are (numbers are RFC 1123 section numbers):
6048.nr ii \w'5.3.1.1\0\0'u
6049.ip 5.2.7
6050Response to RCPT command is fast.
6051.ip 5.2.8
6052Numeric IP addresses are logged in Received: lines.
6053.ip 5.2.17
6054Self domain literal is properly handled.
6055.ip 5.3.2
6056Better control over individual timeouts.
6057.ip 5.3.3
6058Error messages are sent as
6059.q From:<> .
6060.ip 5.3.3
6061Error messages are never sent to
6062.q <> .
6063.ip 5.3.3
6064Route-addrs are pruned.
6065.lp
6066The areas in which
6067.i sendmail
6068is not
6069.q "unconditionally compliant"
6070are:
6071.ip 5.2.6
6072.i Sendmail
6073does do header munging.
6074.ip 5.2.10
6075.i Sendmail
6076doesn't always use the exact SMTP message text
6077as listed in RFC 821.
6078.ip 5.3.1.1
6079.i Sendmail
6080doesn't guarantee only one connect for each host in queue runs.
6081.ip 5.3.1.1
6082.i Sendmail
6083doesn't always provide adequate concurrency limits.
6084.sh 2 "Extended SMTP Support"
6085.pp
6086Version 8 includes both sending and receiving support for Extended
6087SMTP support as defined by RFC 1425 (basic) and RFC 1427 (SIZE);
6088and limited support for RFC 1426 (BODY).
6f14531a
RG
6089.sh 2 "Eight-Bit Clean"
6090.pp
6091Previous versions of
d747e748 6092.i sendmail
6f14531a
RG
6093used the 0200 bit for quoting.
6094This version avoids that use.
6095However, for compatibility with RFC 822,
6096you can set option `7' to get seven bit stripping.
6097.pp
042b8fbf 6098Individual mailers can still produce seven bit output using the
6f14531a
RG
6099`7' mailer flag.
6100.sh 2 "User Database"
6101.pp
6102The user database is an as-yet experimental attempt
6103to provide unified large-site name support.
6104We are installing it at Berkeley;
6105future versions may show significant modifications.
6106.sh 2 "Improved BIND Support"
6107.pp
6108The BIND support,
6109particularly for MX records,
6110had a number of annoying
6111.q features
6112which have been removed in this release.
6113In particular,
d747e748
JH
6114these more tightly bind (pun intended) the name server to
6115.i sendmail ,
6f14531a
RG
6116so that the name server resolution rules are incorporated directly into
6117.b sendmail .
6118.sh 2 "Keyed Files"
6119.pp
6120Generalized keyed files is an idea taken directly from
6121.sm IDA
d747e748 6122.i sendmail
6f14531a
RG
6123(albeit with a completely different implementation).
6124They can be useful on large sites.
6125.pp
3a363396 6126Version 8 also understands YP.
6f14531a
RG
6127.sh 2 "Multi-Word Classes"
6128.pp
6129Classes can now be multiple words.
6130For example,
6131.(b
6132CShofmann.CS.Berkeley.EDU
6133.)b
6134allows you to match the entire string
6135.q hofmann.CS.Berkeley.EDU
6136using the single construct
6137.q $=S .
6138.sh 2 "Deferred Macro Expansion"
6139.pp
6140The
6141.b $& \c
6142.i x
6143construct has been adopted from
6144.sm IDA .
6145.sh 2 "IDENT Protocol Support"
6146.pp
6147The IDENT protocol as defined in RFC 1413 is supported.
6148.sh 2 "Parsing Bug Fixes"
6149.pp
6150A number of small bugs having to do with things like
6151backslash-escaped quotes inside of comments
6152have been fixed.
6153.sh 2 "Separate Envelope/Header Processing"
6154.pp
6155Since the From: line is passed in separately from the envelope sender,
6156these have both been made visible;
6157the
6158.b $g
6159macro is set to the envelope sender during processing
6160of mailer argument vectors
6161and the header sender during processing of headers.
6162.pp
6163It is also possible to specify separate per-mailer
6164envelope and header processing.
6165The
6166.b S enderRWSet
6167and
6168.b R ecipientRWset
6169arguments for mailers
6170can be specified as
6171.i envelope/header
6172to give different rewritings for envelope versus header addresses.
6173.sh 2 "Owner-List Propagates to Envelope"
6174.pp
6175When an alias has an associated owner\-list name,
6176that alias is used to change the envelope sender address.
6177This will cause downstream errors to be returned to that owner.
6178.sh 2 "Dynamic Header Allocation"
6179.pp
6180The fixed size limit on header lines has been eliminated.
3a363396
NW
6181.sh 2 "New Command Line Flags"
6182.pp
6183The
6184.b \-B
6185flag has been added to pass in body type information.
6f14531a 6186.pp
3a363396
NW
6187The
6188.b \-p
6189flag has been added
6f14531a 6190to pass in protocol information.
3a363396
NW
6191.pp
6192The
6193.b \-X
6194flag has been added
6195to allow logging of all protocol in and out of
6196.i sendmail
6197for debugging.
6198.sh 2 "Enhanced Command Line Flags"
6199.pp
6200The
6201.b \-q
6202flag can limit limit a queue run to specific recipients, senders, or queue ids
6203using
6204.b \-qR\c
6205.i substring ,
6206.b \-qS\c
6207.i substring ,
6208or
6209.b \-qI\c
6210.i substring
6211respectively.
6f14531a
RG
6212.sh 2 "New and Old Configuration Line Types"
6213.pp
6214The
6215.b T
6216(Trusted users) configuration line has been deleted.
6217It will still be accepted but will be ignored.
6218.pp
6219The
6220.b K
6221line has been added to declare database maps.
6222.pp
6223The
6224.b V
6225line has been added to declare the configuration version level.
3a363396
NW
6226.pp
6227The
6228.b M
6229line has a
6230.q D=
6231field that lets you change into a temporary directory while that mailer
6232is running.
6f14531a
RG
6233.sh 2 "New Options"
6234.pp
6235Several new options have been added,
6236many to support new features,
6237others to allow tuning that was previously available
6238only by recompiling.
6239They are described in detail in Section 5.1.5.
6240Briefly,
3a363396 6241.nr ii 0.5i
6f14531a
RG
6242.ip b
6243Insist on a minimum number of disk blocks.
6244.ip C
6245Set checkpoint interval.
6246.ip E
6247Default error message.
6248.ip G
6249Enable GECOS matching.
6250.ip h
6251Maximum hop count.
6252.ip j
6253Send errors in MIME-encapsulated format.
6254.ip J
6255Forward file path.
6256.ip k
6257Connection cache size
6258.ip K
6259Connection cache lifetime.
6260.ip l
6261Enable Errors-To: header.
6262These headers violate RFC 1123;
6263this option is included to provide back compatibility
d747e748
JH
6264with old versions of
6265.i sendmail .
3a363396
NW
6266.ip O
6267Set incoming SMTP daemon options, such as an alternate SMTP port.
6f14531a
RG
6268.ip p
6269Privacy options.
3a363396
NW
6270.ip R
6271Don't prune route-addrs.
6f14531a
RG
6272.ip U
6273User database spec.
3a363396
NW
6274.ip V
6275Fallback
6276.q MX
6277host.
d747e748
JH
6278.ip w
6279.q "Best MX"
6280handling technique.
6f14531a
RG
6281.ip 7
6282Do not run eight bit clean.
6283.sh 2 "Extended Options"
6284.pp
6285The
6286.b r
6287(read timeout),
6288.b I
6289(use BIND),
6290and
6291.b T
6292(queue timeout)
6293options have been extended to pass in more information.
3a363396 6294.sh 2 "New Mailer Flags"
6f14531a 6295.pp
3a363396
NW
6296Several new mailer flags have been added.
6297.ip a
6298Try to use ESMTP when creating a connection.
6299If this is not set,
6300.i sendmail
6301will still try if the other end hints that it knows about ESMTP
6302in its greeting message;
6303this flag says to try even if it doesn't hint.
6304If the EHLO (extended hello)
6305command fails,
6306.i sendmail
6307falls back to old SMTP.
6308.ip b
6309Ensure that there is a blank line at the end of all messages.
6310.ip c
6311Strip all comments from addresses;
6f14531a
RG
6312this should only be used as a last resort
6313when dealing with cranky mailers.
3a363396
NW
6314.ip g
6315Never use the null sender as the envelope sender,
6316even when running SMTP.
6317Although this violates RFC 1123,
6318it may be necessary when you must deal with some obnoxious old hosts.
6319.ip 7
6320Strip all output to 7 bits.
6321.sh 2 "New Pre-Defined Macros"
6322.pp
6323The following macros are pre-defined:
6324.ip $k
6325The UUCP node name,
6326nominally from
6327.i uname (2)
6328call.
6329.ip $m
6330The domain part of our full hostname.
6331.ip $_
6332The RFC 1413-provided sender address.
6f14531a
RG
6333.sh 2 "New LHS Token"
6334.pp
3a363396 6335Version 8 allows
6f14531a
RG
6336.b $@
6337on the Left Hand Side of an
6338.q R
6339line to match zero tokens.
6340This is intended to be used to match the null input.
6341.sh 2 "Bigger Defaults"
6342.pp
3a363396 6343Version 8 allows up to 100 rulesets instead of 30.
6f14531a
RG
6344It is recommended that rulesets 0\-9 be reserved for
6345.i sendmail 's
6346dedicated use in future releases.
6347.pp
6348The total number of MX records that can be used has been raised to 20.
6349.pp
6350The number of queued messages that can be handled at one time
6351has been raised from 600 to 1000.
6352.sh 2 "Different Default Tuning Parameters"
6353.pp
3a363396 6354Version 8 has changed the default parameters
6f14531a
RG
6355for tuning queue costs
6356to make the number of recipients more important
6357than the size of the message (for small messages).
6358This is reasonable if you are connected with reasonably fast links.
6359.sh 2 "Auto-Quoting in Addresses"
6360.pp
6361Previously, the
6362.q "Full Name <email address>"
6363syntax would generate incorrect protocol output
6364if
6365.q "Full Name"
6366had special characters such as dot.
6367This version puts quotes around such names.
6368.sh 2 "Symbolic Names On Error Mailer"
6369.pp
6370Several names have been built in to the $@ portion of the $#error
6371mailer.
6372.sh 2 "SMTP VRFY Doesn't Expand"
6373.pp
6374Previous versions of
6375.i sendmail
6376treated VRFY and EXPN the same.
6377In this version,
6378VRFY doesn't expand aliases or follow .forward files.
d747e748 6379EXPN still does.
6f14531a
RG
6380.pp
6381As an optimization, if you run with your default delivery mode being
d747e748 6382queue-only or deliver-in-background,
6f14531a
RG
6383the RCPT command will also not chase aliases and .forward files.
6384It will chase them when it processes the queue.
6385.sh 2 "[IPC] Mailers Allow Multiple Hosts"
6386.pp
6387When an address resolves to a mailer that has
6388.q [IPC]
6389as its
6390.q Path ,
6391the $@ part (host name)
6392can be a colon-separated list of hosts instead of a single hostname.
d747e748
JH
6393This asks
6394.i sendmail
6395to search the list for the first entry that is available
6f14531a
RG
6396exactly as though it were an MX record.
6397The intent is to route internal traffic through internal networks
6398without publishing an MX record to the net.
6399MX expansion is still done on the individual items.
6400.sh 2 "Aliases Extended"
6401.pp
6402The implementation has been merged with maps.
6403Among other things,
6404this supports NIS-based aliases.
6405.sh 2 "Portability and Security Enhancements"
6406.pp
6407A number of internal changes have been made to enhance portability.
6408.pp
6409Several fixes have been made to increase the paranoia factor.
3a363396
NW
6410.sh 2 "Miscellaneous Changes"
6411.pp
6412.i Sendmail
6413writes a
6414.i /etc/sendmail.pid
6415file with the current process id of the SMTP daemon.
6416.pp
6417Two people using the same program in their .forward file
6418are considered different
6419so that duplicate elimination doesn't delete one of them.
6420.pp
6421The
6422.i mailstats
6423program prints mailer names
6424and gets the location of the
6425.i sendmail.st
6426file from
6427.i /etc/sendmail.cf .
6428.pp
6429Many minor bugs have been fixed, such as handling of backslashes
6430inside of quotes.
6431.pp
6432A hook (ruleset 5) has been added
6433to allow rewriting of local addresses after aliasing.
6f14531a
RG
6434.sh 1 "ACKNOWLEDGEMENTS"
6435.pp
6436I've worked on
6437.i sendmail
6438for many years,
6439and many employers have been remarkably patient
6440about letting me work on a large project
6441that was not part of my official job.
6442This includes time on the INGRES Project at Berkeley,
6443at Britton Lee,
6444and again on the Mammoth Project at Berkeley.
6445.pp
6446Much of the second wave of improvements
6447should be credited to Bryan Costales of ICSI.
6448As he passed me drafts of his book on
6449.i sendmail
6450I was inspired to start working on things again.
6451Bryan was also available to bounce ideas off of.
6452.pp
6453Many, many people contributed chunks of code and ideas to
6454.i sendmail .
6455It has proven to be a group network effort.
3a363396 6456Version 8 in particular was a group project.
6f14531a
RG
6457The following people made notable contributions:
6458.(l
6459Keith Bostic, CSRG, University of California, Berkeley
6460Michael J. Corrigan, University of California, San Diego
6461Bryan Costales, International Computer Science Institute
d747e748 6462Pa\*:r (Pell) Emanuelsson
6f14531a
RG
6463Craig Everhart, Transarc Corporation
6464Tom Ivar Helbekkmo, Norwegian School of Economics
6465Allan E. Johannesen, WPI
d747e748
JH
6466Jonathan Kamens, OpenVision Technologies, Inc.
6467Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
6f14531a 6468Brian Kantor, University of California, San Diego
d747e748 6469Murray S. Kucherawy, HookUp Communication Corp.
6f14531a 6470Bruce Lilly, Sony U.S.
d747e748 6471Karl London
6f14531a
RG
6472Nakamura Motonori, Kyoto University
6473John Gardiner Myers, Carnegie Mellon University
6474Neil Rickert, Northern Illinois University
d747e748 6475Eric Schnoebelen, Convex Computer Corp.
6f14531a
RG
6476Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
6477Christophe Wolfhugel, Herve Schauer Consultants (Paris)
6478.)l
6479I apologize for anyone I have omitted, misspelled, misattributed, or
6480otherwise missed.
6481Many other people have contributed ideas, comments, and encouragement.
6482I appreciate their contribution as well.
6483.++ A
6484.+c "COMMAND LINE FLAGS"
6485.ba 0
6486.nr ii 1i
6487.pp
6488Arguments must be presented with flags before addresses.
6489The flags are:
6490.ip \-b\fIx\fP
6491Set operation mode to
6492.i x .
6493Operation modes are:
6494.(b
6495.ta 4n
6496m Deliver mail (default)
6497s Speak SMTP on input side
6498d Run as a daemon
6499t Run in test mode
6500v Just verify addresses, don't collect or deliver
6501i Initialize the alias database
6502p Print the mail queue
6f14531a 6503.)b
3a363396
NW
6504.ip \-B\fItype\fP
6505Indicate body type.
6f14531a
RG
6506.ip \-C\fIfile\fP
6507Use a different configuration file.
6508.i Sendmail
6509runs as the invoking user (rather than root)
6510when this flag is specified.
6511.ip \-d\fIlevel\fP
6512Set debugging level.
6513.ip "\-f\ \fIaddr\fP"
6514The sender's machine address is
6515.i addr .
6516.ip \-F\fIname\fP
6517Sets the full name of this user to
6518.i name .
6519.ip "\-h\ \fIcnt\fP"
6520Sets the
6521.q "hop count"
6522to
6523.i cnt .
6524This represents the number of times this message has been processed
6525by
6526.i sendmail
6527(to the extent that it is supported by the underlying networks).
6528.i Cnt
6529is incremented during processing,
6530and if it reaches
6531MAXHOP
6532(currently 30)
6533.i sendmail
6534throws away the message with an error.
6535.ip \-n
6536Don't do aliasing or forwarding.
6537.ip "\-r\ \fIaddr\fP"
6538An obsolete form of
6539.b \-f .
6540.ip \-o\fIx\|value\fP
6541Set option
6542.i x
6543to the specified
6544.i value .
6545These options are described in Appendix B.
6546.ip \-p\fIprotocol\fP
6547Set the sending protocol.
6548Programs are encouraged to set this.
6549The protocol field can be in the form
6550.i protocol \c
6551.b : \c
6552.i host
6553to set both the sending protocol and sending host.
6554For example,
6555.q \-pUUCP:uunet
6556sets the sending protocol to UUCP
6557and the sending host to uunet.
6558(Some existing programs use \-oM to set the r and s macros;
6559this is equivalent to using \-p.)
6560.ip \-q\fItime\fP
6561Try to process the queued up mail.
6562If the time is given,
d747e748
JH
6563a
6564.i sendmail
6565will run through the queue at the specified interval
6f14531a
RG
6566to deliver queued mail;
6567otherwise, it only runs once.
6568.ip \-q\fIXstring\fP
6569Run the queue once,
6570limiting the jobs to those matching
6571.i Xstring .
6572The key letter
6573.i X
6574can be
6575.b I
6576to limit based on queue identifier,
6577.b R
6578to limit based on recipient,
6579or
6580.b S
6581to limit based on sender.
6582A particular queued job is accepted if one of the corresponding addresses
6583contains the indicated
6584.i string .
6585.ip \-t
6586Read the header for
6587.q To: ,
6588.q Cc: ,
6589and
6590.q Bcc:
6591lines, and send to everyone listed in those lists.
6592The
6593.q Bcc:
6594line will be deleted before sending.
6595Any addresses in the argument vector will be deleted
6596from the send list.
3a363396 6597.ip "\-X \fIlogfile\fP"
d747e748
JH
6598Log all traffic in and out of
6599.i sendmail
6600in the indicated
3a363396
NW
6601.i logfile
6602for debugging mailer problems.
6603This produces a lot of data very quickly and should be used sparingly.
6f14531a
RG
6604.pp
6605There are a number of options that may be specified as
042b8fbf 6606primitive flags.
6f14531a
RG
6607These are the e, i, m, and v options.
6608Also,
6609the f option
6610may be specified as the
6611.b \-s
6612flag.
6613.+c "QUEUE FILE FORMATS"
6614.pp
6615This appendix describes the format of the queue files.
6616These files live in the directory defined by the
6617.b Q
6618option in the
6619.i sendmail.cf
6620file, usually
6621.i /var/spool/mqueue
6622or
6623.i /usr/spool/mqueue .
6624.pp
6625All queue files have the name
6626\fIx\fP\|\fBf\fP\fIAAA99999\fP
6627where
6628.i AAA99999
6629is the
6630.i id
6631for this message
6632and the
6633.i x
6634is a type.
6635The first letter of the id encodes the hour of the day
6636that the message was received by the system
6637(with A being the hour between midnight and 1:00AM).
6638All files with the same id collectively define one message.
6639.pp
6640The types are:
6641.nr ii 0.5i
6642.ip d
6643The data file.
6644The message body (excluding the header) is kept in this file.
6645.ip l
6646The lock file.
6647If this file exists,
6648the job is currently being processed,
6649and a queue run will not process the file.
6650For that reason,
6651an extraneous
6652.b lf
6653file can cause a job to apparently disappear
6654(it will not even time out!).
6655[Actually, this file is obsolete on most systems that support the
6656.b flock
6657or
6658.b lockf
6659system calls.]
6660.ip n
6661This file is created when an id is being created.
6662It is a separate file to insure that no mail can ever be destroyed
6663due to a race condition.
6664It should exist for no more than a few milliseconds
6665at any given time.
6666[This is only used on old versions of
d747e748 6667.i sendmail ;
6f14531a
RG
6668it is not used
6669on newer versions.]
6670.ip q
6671The queue control file.
6672This file contains the information necessary to process the job.
6673.ip t
6674A temporary file.
6675These are an image of the
6676.b qf
6677file when it is being rebuilt.
6678It should be renamed to a
6679.b qf
6680file very quickly.
6681.ip x
6682A transcript file,
6683existing during the life of a session
6684showing everything that happens
6685during that session.
6686.pp
6687The
6688.b qf
6689file is structured as a series of lines
6690each beginning with a code letter.
6691The lines are as follows:
6692.ip D
6693The name of the data file.
6694There may only be one of these lines.
6695.ip H
6696A header definition.
6697There may be any number of these lines.
6698The order is important:
6699they represent the order in the final message.
6700These use the same syntax
6701as header definitions in the configuration file.
6702.ip C
6703The controlling address.
6704The syntax is
6705.q localuser:aliasname .
6706Recipient addresses following this line
6707will be flagged so that deliveries will be run as the
6708.i localuser
6709(a user name from the /etc/passwd file);
6710.i aliasname
6711is the name of the alias that expanded to this address
6712(used for printing messages).
6713.ip R
6714A recipient address.
6715This will normally be completely aliased,
6716but is actually realiased when the job is processed.
6717There will be one line
6718for each recipient.
6719.ip S
6720The sender address.
6721There may only be one of these lines.
6722.ip E
6723An error address.
6724If any such lines exist,
6725they represent the addresses that should receive error messages.
6726.ip T
6727The job creation time.
6728This is used to compute when to time out the job.
6729.ip P
6730The current message priority.
6731This is used to order the queue.
6732Higher numbers mean lower priorities.
6733The priority changes
6734as the message sits in the queue.
6735The initial priority depends on the message class
6736and the size of the message.
6737.ip M
6738A message.
6739This line is printed by the
6740.i mailq
6741command,
6742and is generally used to store status information.
6743It can contain any text.
6744.ip F
6745Flag bits, represented as one letter per flag.
6746Defined flag bits are
6747.b r
6748indicating that this is a response message
6749and
6750.b w
6751indicating that a warning message has been sent
6752announcing that the mail has been delayed.
6753.ip $
6754A macro definition.
6755The values of certain macros
6756(as of this writing, only
6757.b $r
6758and
6759.b $s )
6760are passed through to the queue run phase.
6761.ip B
6762The body type.
6763The remainder of the line is a text string defining the body type.
6764If this field is missing,
6765the body type is assumed to be
6766.q "undefined"
6767and no special processing is attempted.
6768Legal values are
6769.q 7BIT
6770and
6771.q 8BITMIME .
6772.pp
6773As an example,
6774the following is a queue file sent to
6775.q eric@mammoth.Berkeley.EDU
6776and
6777.q bostic@okeeffe.CS.Berkeley.EDU \**:
6778.(f
6779\**This example is contrived and probably inaccurate for your environment.
6780Glance over it to get an idea;
6781nothing can replace looking at what your own system generates.
6782.)f
6783.(b
6784P835771
6785T404261372
6786DdfAAA13557
6787Seric
6788Eowner-sendmail@vangogh.CS.Berkeley.EDU
6789Ceric:sendmail@vangogh.CS.Berkeley.EDU
6790Reric@mammoth.Berkeley.EDU
6791Rbostic@okeeffe.CS.Berkeley.EDU
6792H?P?return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU>
6793Hreceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
6794 Fri, 17 Jul 92 00:28:55 -0700
6795Hreceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
6796 id AAA06698; Fri, 17 Jul 92 00:28:54 -0700
6797Hreceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
6798 id AA22777; Fri, 17 Jul 92 03:29:14 -0400
6799Hreceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
6800 id AA22757; Fri, 17 Jul 92 09:31:25 GMT
6801H?F?from: eric@foo.bar.baz.de (Eric Allman)
6802H?x?full-name: Eric Allman
6803Hmessage-id: <9207170931.AA22757@foo.bar.baz.de>
6804HTo: sendmail@vangogh.CS.Berkeley.EDU
6805Hsubject: this is an example message
6806.)b
6807This shows the name of the data file,
6808the person who sent the message,
6809the submission time
6810(in seconds since January 1, 1970),
6811the message priority,
6812the message class,
6813the recipients,
6814and the headers for the message.
6815.+c "SUMMARY OF SUPPORT FILES"
6816.pp
6817This is a summary of the support files
6818that
6819.i sendmail
6820creates or generates.
6821Many of these can be changed by editing the sendmail.cf file;
6822check there to find the actual pathnames.
6823.nr ii 1i
6824.ip "/usr/\*(SD/sendmail"
6825The binary of
6826.i sendmail .
d747e748 6827.ip /usr/\*(SB/newaliases
6f14531a
RG
6828A link to /usr/\*(SD/sendmail;
6829causes the alias database to be rebuilt.
6830Running this program is completely equivalent to giving
6831.i sendmail
6832the
6833.b \-bi
6834flag.
d747e748 6835.ip /usr/\*(SB/mailq
6f14531a
RG
6836Prints a listing of the mail queue.
6837This program is equivalent to using the
6838.b \-bp
6839flag to
6840.i sendmail .
6841.ip /etc/sendmail.cf
6842The configuration file,
6843in textual form.
6f14531a
RG
6844.ip /usr/lib/sendmail.hf
6845The SMTP help file.
6846.ip /etc/sendmail.st
6847A statistics file; need not be present.
6848.ip /etc/sendmail.pid
6849Created in daemon mode;
6850it contains the process id of the current SMTP daemon.
6851If you use this in scripts;
6852use ``head \-1'' to get just the first line;
6853later versions of
6854.i sendmail
6855may add information to subsequent lines.
6856.ip /etc/aliases
6857The textual version of the alias file.
6858.ip /etc/aliases.{pag,dir}
6859The alias file in
6860.i dbm \|(3)
6861format.
6862.ip /var/spool/mqueue
6863The directory in which the mail queue
6864and temporary files reside.
6865.ip /var/spool/mqueue/qf*
6866Control (queue) files for messages.
6867.ip /var/spool/mqueue/df*
6868Data files.
6869.ip /var/spool/mqueue/tf*
6870Temporary versions of the qf files,
6871used during queue file rebuild.
6872.ip /var/spool/mqueue/xf*
6873A transcript of the current session.
6874.\".ro
6875.\".ls 1
6876.\".tp
6877.\".sp 2i
6878.\".in 0
6879.\".ce 100
6880.\".sz 24
6881.\".b SENDMAIL
6882.\".sz 14
6883.\".sp
6884.\"INSTALLATION AND OPERATION GUIDE
6885.\".sp
6886.\".sz 10
6887.\"Eric Allman
6888.\"Britton-Lee, Inc.
6889.\".sp
c2714ef5 6890.\"Version 8.34
6f14531a 6891.\".ce 0
d747e748
JH
6892.bp 2
6893.rs
6894.sp |4i
6895.ce 2
6896This page intentionally left blank;
6897replace it with a blank sheet for double-sided output.
6898.bp 3
6f14531a
RG
6899.ce
6900.sz 12
6901TABLE OF CONTENTS
6902.sz 10
6903.sp
6904.\" remove some things to avoid "out of temp file space" problem
6905.rm sh
6906.rm (x
6907.rm )x
6908.rm ip
6909.rm pp
6910.rm lp
6911.rm he
6912.rm fo
6913.rm eh
6914.rm oh
6915.rm ef
6916.rm of
6917.xp