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