]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/sendmail/doc/op/op.me
MFC: Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for
[FreeBSD/FreeBSD.git] / contrib / sendmail / doc / op / op.me
1 .\" Copyright (c) 1998-2013 Proofpoint, Inc. and its suppliers.
2 .\"     All rights reserved.
3 .\" Copyright (c) 1983, 1995 Eric P. Allman.  All rights reserved.
4 .\" Copyright (c) 1983, 1993
5 .\"     The Regents of the University of California.  All rights reserved.
6 .\"
7 .\" By using this file, you agree to the terms and conditions set
8 .\" forth in the LICENSE file which can be found at the top level of
9 .\" the sendmail distribution.
10 .\"
11 .\"
12 .\"     $Id: op.me,v 8.759 2014-01-13 14:40:05 ca Exp $
13 .\"
14 .\" eqn op.me | pic | troff -me
15 .\"
16 .\" Define \(sc if not defined (for text output)
17 .\"
18 .if !c \(sc .char \(sc S
19 .\"
20 .\" Define \(dg as "*" for text output and create a new .DG macro
21 .\" which describes the symbol.
22 .\"
23 .if n .ds { [
24 .if n .ds } ]
25 .ie !c \(dg \{\
26 .char \(dg *
27 .de DG
28 an asterick
29 ..
30 .\}
31 .el \{\
32 .de DG
33 a dagger
34 ..
35 .\}
36 .\"
37 .\" Define \(dd as "#" for text output and create a new .DD macro
38 .\" which describes the symbol.
39 .\"
40 .ie !c \(dd \{\
41 .char \(dd #
42 .de DD
43 a pound sign
44 ..
45 .\}
46 .el \{\
47 .de DD
48 a double dagger
49 ..
50 .\}
51 .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
52 .oh 'Sendmail Installation and Operation Guide''SMM:08-%'
53 .\" SD is lib if sendmail is installed in /usr/lib, sbin if in /usr/sbin
54 .ds SD sbin
55 .\" SB is bin if newaliases/mailq are installed in /usr/bin, ucb if in /usr/ucb
56 .ds SB bin
57 .nr si 3n
58 .de $0
59 .(x
60 .in \\$3u*3n
61 .ti -3n
62 \\$2.  \\$1
63 .)x
64 ..
65 .de $C
66 .(x
67 .in 0
68 \\$1 \\$2.  \\$3
69 .)x
70 ..
71 .+c
72 .(l C
73 .sz 16
74 .b SENDMAIL\u\s-6TM\s0\d
75 .sz 12
76 .sp
77 .b "INSTALLATION AND OPERATION GUIDE"
78 .(f
79 .b DISCLAIMER:
80 This documentation is under modification.
81 .)f
82 .sz 10
83 .sp
84 .r
85 Eric Allman
86 Claus Assmann
87 Gregory Neil Shapiro
88 Proofpoint, Inc.
89 .sp
90 .de Ve
91 Version \\$2
92 ..
93 .rm Ve
94 .sp
95 For Sendmail Version 8.16
96 .)l
97 .(f
98 Sendmail is a trademark of Proofpoint, Inc.
99 US Patent Numbers 6865671, 6986037.
100 .)f
101 .sp 2
102 .pp
103 .i Sendmail \u\s-2TM\s0\d
104 implements a general purpose internetwork mail routing facility
105 under the UNIX\(rg
106 operating system.
107 It is not tied to any one transport protocol \*-
108 its function may be likened to a crossbar switch,
109 relaying messages from one domain into another.
110 In the process,
111 it can do a limited amount of message header editing
112 to put the message into a format that is appropriate
113 for the receiving domain.
114 All of this is done under the control of a configuration file.
115 .pp
116 Due to the requirements of flexibility
117 for
118 .i sendmail ,
119 the configuration file can seem somewhat unapproachable.
120 However, there are only a few basic configurations
121 for most sites,
122 for which standard configuration files have been supplied.
123 Most other configurations
124 can be built by adjusting an existing configuration file
125 incrementally.
126 .pp
127 .i Sendmail
128 is based on
129 RFC 821 (Simple Mail Transport Protocol),
130 RFC 822 (Internet Mail Headers Format),
131 RFC 974 (MX routing),
132 RFC 1123 (Internet Host Requirements),
133 RFC 1413 (Identification server),
134 RFC 1652 (SMTP 8BITMIME Extension),
135 RFC 1869 (SMTP Service Extensions),
136 RFC 1870 (SMTP SIZE Extension),
137 RFC 1891 (SMTP Delivery Status Notifications),
138 RFC 1892 (Multipart/Report),
139 RFC 1893 (Enhanced Mail System Status Codes),
140 RFC 1894 (Delivery Status Notifications),
141 RFC 1985 (SMTP Service Extension for Remote Message Queue Starting),
142 RFC 2033 (Local Message Transmission Protocol),
143 RFC 2034 (SMTP Service Extension for Returning Enhanced Error Codes),
144 RFC 2045 (MIME),
145 RFC 2476 (Message Submission),
146 RFC 2487 (SMTP Service Extension for Secure SMTP over TLS),
147 RFC 2554 (SMTP Service Extension for Authentication),
148 RFC 2821 (Simple Mail Transfer Protocol),
149 RFC 2822 (Internet Message Format),
150 RFC 2852 (Deliver By SMTP Service Extension),
151 RFC 2920 (SMTP Service Extension for Command Pipelining),
152 and
153 RFC 7505 (A "Null MX" No Service Resource Record for Domains That Accept No Mail).
154 However, since
155 .i sendmail
156 is designed to work in a wider world,
157 in many cases it can be configured to exceed these protocols.
158 These cases are described herein.
159 .pp
160 Although
161 .i sendmail
162 is intended to run
163 without the need for monitoring,
164 it has a number of features
165 that may be used to monitor or adjust the operation
166 under unusual circumstances.
167 These features are described.
168 .pp
169 Section one describes how to do a basic
170 .i sendmail
171 installation.
172 Section two
173 explains the day-to-day information you should know
174 to maintain your mail system.
175 If you have a relatively normal site,
176 these two sections should contain sufficient information
177 for you to install
178 .i sendmail
179 and keep it happy.
180 Section three
181 has information regarding the command line arguments.
182 Section four
183 describes some parameters that may be safely tweaked.
184 Section five
185 contains the nitty-gritty information about the configuration
186 file.
187 This section is for masochists
188 and people who must write their own configuration file.
189 Section six
190 describes configuration that can be done at compile time.
191 The appendixes give a brief
192 but detailed explanation of a number of features
193 not described in the rest of the paper.
194 .bp 7
195 .sh 1 "BASIC INSTALLATION"
196 .pp
197 There are two basic steps to installing
198 .i sendmail .
199 First, you have to compile and install the binary.
200 If
201 .i sendmail
202 has already been ported to your operating system
203 that should be simple.
204 Second, you must build a run-time configuration file.
205 This is a file that
206 .i sendmail
207 reads when it starts up
208 that describes the mailers it knows about,
209 how to parse addresses,
210 how to rewrite the message header,
211 and the settings of various options.
212 Although the configuration file can be quite complex,
213 a configuration can usually be built
214 using an M4-based configuration language.
215 Assuming you have the standard
216 .i sendmail
217 distribution, see
218 .i cf/README
219 for further information.
220 .pp
221 The remainder of this section will describe the installation of
222 .i sendmail
223 assuming you can use one of the existing configurations
224 and that the standard installation parameters are acceptable.
225 All pathnames and examples
226 are given from the root of the
227 .i sendmail
228 subtree,
229 normally
230 .i /usr/src/usr.\*(SD/sendmail
231 on 4.4BSD-based systems.
232 .pp
233 Continue with the next section if you need/want to compile
234 .i sendmail
235 yourself.
236 If you have a running binary already on your system,
237 you should probably skip to section 1.2.
238 .sh 2 "Compiling Sendmail"
239 .pp
240 All
241 .i sendmail
242 source is in the
243 .i sendmail
244 subdirectory.
245 To compile sendmail,
246 .q cd
247 into the
248 .i sendmail
249 directory and type
250 .(b
251 \&./Build
252 .)b
253 This will leave the binary in an appropriately named subdirectory,
254 e.g.,
255 obj.BSD-OS.2.1.i386.
256 It works for multiple object versions
257 compiled out of the same directory.
258 .sh 3 "Tweaking the Build Invocation"
259 .pp
260 You can give parameters on the
261 .i Build
262 command.
263 In most cases these are only used when the
264 .i obj.*
265 directory is first created.
266 To restart from scratch, use
267 .i -c .
268 These commands include:
269 .nr ii 0.5i
270 .ip "\-L \fIlibdirs\fP"
271 A list of directories to search for libraries.
272 .ip "\-I \fIincdirs\fP"
273 A list of directories to search for include files.
274 .ip "\-E \fIenvar\fP=\fIvalue\fP"
275 Set an environment variable to an indicated
276 .i value
277 before compiling.
278 .ip "\-c"
279 Create a new
280 .i obj.*
281 tree before running.
282 .ip "\-f \fIsiteconfig\fP"
283 Read the indicated site configuration file.
284 If this parameter is not specified,
285 .i Build
286 includes
287 .i all
288 of the files
289 .i $BUILDTOOLS/Site/site.$oscf.m4
290 and
291 .i $BUILDTOOLS/Site/site.config.m4 ,
292 where $BUILDTOOLS is normally
293 .i \&../devtools
294 and $oscf is the same name as used on the
295 .i obj.*
296 directory.
297 See below for a description of the site configuration file.
298 .ip "\-S"
299 Skip auto-configuration.
300 .i Build
301 will avoid auto-detecting libraries if this is set.
302 All libraries and map definitions must be specified
303 in the site configuration file.
304 .lp
305 Most other parameters are passed to the
306 .i make
307 program; for details see
308 .i $BUILDTOOLS/README .
309 .sh 3 "Creating a Site Configuration File"
310 .\"XXX
311 .pp
312 See sendmail/README for various compilation flags that can be set,
313 and devtools/README for details how to set them.
314 .sh 3 "Tweaking the Makefile"
315 .pp
316 .\" .b "XXX This should all be in the Site Configuration File section."
317 .i Sendmail
318 supports two different formats
319 for the local (on disk) version of databases,
320 notably the
321 .i aliases
322 database.
323 At least one of these should be defined if at all possible.
324 .nr ii 1i
325 .ip CDB
326 Constant DataBase (tinycdb).
327 .ip NDBM
328 The ``new DBM'' format,
329 available on nearly all systems around today.
330 This was the preferred format prior to 4.4BSD.
331 It allows such complex things as multiple databases
332 and closing a currently open database.
333 .ip NEWDB
334 The Berkeley DB package.
335 If you have this, use it.
336 It allows
337 long records,
338 multiple open databases,
339 real in-memory caching,
340 and so forth.
341 You can define this in conjunction with
342 .sm NDBM ;
343 if you do,
344 old alias databases are read,
345 but when a new database is created it will be in NEWDB format.
346 As a nasty hack,
347 if you have NEWDB, NDBM, and NIS defined,
348 and if the alias file name includes the substring
349 .q /yp/ ,
350 .i sendmail
351 will create both new and old versions of the alias file
352 during a
353 .i newalias
354 command.
355 This is required because the Sun NIS/YP system
356 reads the DBM version of the alias file.
357 It's ugly as sin,
358 but it works.
359 .lp
360 If neither of these are defined,
361 .i sendmail
362 reads the alias file into memory on every invocation.
363 This can be slow and should be avoided.
364 There are also several methods for remote database access:
365 .ip LDAP
366 Lightweight Directory Access Protocol.
367 .ip NIS
368 Sun's Network Information Services (formerly YP).
369 .ip NISPLUS
370 Sun's NIS+ services.
371 .ip NETINFO
372 NeXT's NetInfo service.
373 .ip HESIOD
374 Hesiod service (from Athena).
375 .lp
376 Other compilation flags are set in
377 .i conf.h
378 and should be predefined for you
379 unless you are porting to a new environment.
380 For more options see
381 .i sendmail/README .
382 .sh 3 "Compilation and installation"
383 .pp
384 After making the local system configuration described above,
385 You should be able to compile and install the system.
386 The script
387 .q Build
388 is the best approach on most systems:
389 .(b
390 \&./Build
391 .)b
392 This will use
393 .i uname (1)
394 to create a custom Makefile for your environment.
395 .pp
396 If you are installing in the standard places,
397 you should be able to install using
398 .(b
399 \&./Build install
400 .)b
401 This should install the binary in
402 /usr/\*(SD
403 and create links from
404 /usr/\*(SB/newaliases
405 and
406 /usr/\*(SB/mailq
407 to
408 /usr/\*(SD/sendmail.
409 On most systems it will also format and install man pages.
410 Notice: as of version 8.12
411 .i sendmail
412 will no longer be installed set-user-ID root by default.
413 If you really want to use the old method, you can specify it as target:
414 .(b
415 \&./Build install-set-user-id
416 .)b
417 .sh 2 "Configuration Files"
418 .pp
419 .i Sendmail
420 cannot operate without a configuration file.
421 The configuration defines the mail delivery mechanisms understood at this site,
422 how to access them,
423 how to forward email to remote mail systems,
424 and a number of tuning parameters.
425 This configuration file is detailed
426 in the later portion of this document.
427 .pp
428 The
429 .i sendmail
430 configuration can be daunting at first.
431 The world is complex,
432 and the mail configuration reflects that.
433 The distribution includes an m4-based configuration package
434 that hides a lot of the complexity.
435 See
436 .i cf/README
437 for details.
438 .pp
439 Our configuration files are processed by
440 .i m4
441 to facilitate local customization;
442 the directory
443 .i cf
444 of the
445 .i sendmail
446 distribution directory
447 contains the source files.
448 This directory contains several subdirectories:
449 .nr ii 1i
450 .ip cf
451 Both site-dependent and site-independent descriptions of hosts.
452 These can be literal host names
453 (e.g.,
454 .q ucbvax.mc )
455 when the hosts are gateways
456 or more general descriptions
457 (such as
458 .q "generic-solaris2.mc"
459 as a general description of an SMTP-connected host
460 running Solaris 2.x.
461 Files ending
462 .b \&.mc
463 (``M4 Configuration'')
464 are the input descriptions;
465 the output is in the corresponding
466 .b \&.cf
467 file.
468 The general structure of these files is described below.
469 .ip domain
470 Site-dependent subdomain descriptions.
471 These are tied to the way your organization wants to do addressing.
472 For example,
473 .b domain/CS.Berkeley.EDU.m4
474 is our description for hosts in the CS.Berkeley.EDU subdomain.
475 These are referenced using the
476 .sm DOMAIN
477 .b m4
478 macro in the
479 .b \&.mc
480 file.
481 .ip feature
482 Definitions of specific features that some particular host in your site
483 might want.
484 These are referenced using the
485 .sm FEATURE
486 .b m4
487 macro.
488 An example feature is
489 use_cw_file
490 (which tells
491 .i sendmail
492 to read an /etc/mail/local-host-names file on startup
493 to find the set of local names).
494 .ip hack
495 Local hacks, referenced using the
496 .sm HACK
497 .b m4
498 macro.
499 Try to avoid these.
500 The point of having them here is to make it clear that they smell.
501 .ip m4
502 Site-independent
503 .i m4 (1)
504 include files that have information common to all configuration files.
505 This can be thought of as a
506 .q #include
507 directory.
508 .ip mailer
509 Definitions of mailers,
510 referenced using the
511 .sm MAILER
512 .b m4
513 macro.
514 The mailer types that are known in this distribution are
515 fax,
516 local,
517 smtp,
518 uucp,
519 and usenet.
520 For example, to include support for the UUCP-based mailers,
521 use
522 .q MAILER(uucp) .
523 .ip ostype
524 Definitions describing various operating system environments
525 (such as the location of support files).
526 These are referenced using the
527 .sm OSTYPE
528 .b m4
529 macro.
530 .ip sh
531 Shell files used by the
532 .b m4
533 build process.
534 You shouldn't have to mess with these.
535 .ip siteconfig
536 Local UUCP connectivity information.
537 This directory has been supplanted by the mailertable feature;
538 any new configurations should use that feature to do UUCP
539 (and other) routing.
540 The use of this directory is deprecated.
541 .pp
542 If you are in a new domain
543 (e.g., a company),
544 you will probably want to create a
545 cf/domain
546 file for your domain.
547 This consists primarily of relay definitions
548 and features you want enabled site-wide:
549 for example, Berkeley's domain definition
550 defines relays for
551 BitNET
552 and UUCP.
553 These are specific to Berkeley,
554 and should be fully-qualified internet-style domain names.
555 Please check to make certain they are reasonable for your domain.
556 .pp
557 Subdomains at Berkeley are also represented in the
558 cf/domain
559 directory.
560 For example,
561 the domain
562 CS.Berkeley.EDU
563 is the Computer Science subdomain,
564 EECS.Berkeley.EDU
565 is the Electrical Engineering and Computer Sciences subdomain,
566 and
567 S2K.Berkeley.EDU
568 is the Sequoia 2000 subdomain.
569 You will probably have to add an entry to this directory
570 to be appropriate for your domain.
571 .pp
572 You will have to use or create
573 .b \&.mc
574 files in the
575 .i cf/cf
576 subdirectory for your hosts.
577 This is detailed in the
578 cf/README
579 file.
580 .sh 2 "Details of Installation Files"
581 .pp
582 This subsection describes the files that
583 comprise the
584 .i sendmail
585 installation.
586 .sh 3 "/usr/\*(SD/sendmail"
587 .pp
588 The binary for
589 .i sendmail
590 is located in /usr/\*(SD\**.
591 .(f
592 \**This is usually
593 /usr/sbin
594 on 4.4BSD and newer systems;
595 many systems install it in
596 /usr/lib.
597 I understand it is in /usr/ucblib
598 on System V Release 4.
599 .)f
600 It should be set-group-ID smmsp as described in
601 sendmail/SECURITY.
602 For security reasons,
603 /, /usr, and /usr/\*(SD
604 should be owned by root, mode 0755\**.
605 .(f
606 \**Some vendors ship them owned by bin;
607 this creates a security hole that is not actually related to
608 .i sendmail .
609 Other important directories that should have restrictive ownerships
610 and permissions are
611 /bin, /usr/bin, /etc, /etc/mail, /usr/etc, /lib, and /usr/lib.
612 .)f
613 .sh 3 "/etc/mail/sendmail.cf"
614 .pp
615 This is the main configuration file for
616 .i sendmail \**.
617 .(f
618 \**Actually, the pathname varies depending on the operating system;
619 /etc/mail is the preferred directory.
620 Some older systems install it in
621 .b /usr/lib/sendmail.cf ,
622 and I've also seen it in
623 .b /usr/ucblib .
624 If you want to move this file,
625 add -D_PATH_SENDMAILCF=\e"/file/name\e"
626 to the flags passed to the C compiler.
627 Moving this file is not recommended:
628 other programs and scripts know of this location.
629 .)f
630 This is one of the two non-library file names compiled into
631 .i sendmail \**,
632 the other is /etc/mail/submit.cf.
633 .(f
634 \**The system libraries can reference other files;
635 in particular, system library subroutines that
636 .i sendmail
637 calls probably reference
638 .i /etc/passwd
639 and
640 .i /etc/resolv.conf .
641 .)f
642 .pp
643 The configuration file is normally created
644 using the distribution files described above.
645 If you have a particularly unusual system configuration
646 you may need to create a special version.
647 The format of this file is detailed in later sections
648 of this document.
649 .sh 3 "/etc/mail/submit.cf"
650 .pp
651 This is the configuration file for
652 .i sendmail
653 when it is used for initial mail submission, in which case
654 it is also called ``Mail Submission Program'' (MSP)
655 in contrast to ``Mail Transfer Agent'' (MTA).
656 Starting with version 8.12,
657 .i sendmail
658 uses one of two different configuration files based on its operation mode
659 (or the new
660 .b \-A
661 option).
662 For initial mail submission, i.e., if one of the options
663 .b \-bm
664 (default),
665 .b \-bs ,
666 or
667 .b \-t
668 is specified, submit.cf is used (if available),
669 for other operations sendmail.cf is used.
670 Details can be found in
671 .i sendmail/SECURITY .
672 submit.cf is shipped with sendmail (in cf/cf/) and is installed by default.
673 If changes to the configuration need to be made, start with
674 cf/cf/submit.mc and follow the instruction in cf/README.
675 .sh 3 "/usr/\*(SB/newaliases"
676 .pp
677 The
678 .i newaliases
679 command should just be a link to
680 .i sendmail :
681 .(b
682 rm \-f /usr/\*(SB/newaliases
683 ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
684 .)b
685 This can be installed in whatever search path you prefer
686 for your system.
687 .sh 3 "/usr/\*(SB/hoststat"
688 .pp
689 The
690 .i hoststat
691 command should just be a link to
692 .i sendmail ,
693 in a fashion similar to
694 .i newaliases .
695 This command lists the status of the last mail transaction
696 with all remote hosts.  The
697 .b \-v
698 flag will prevent the status display from being truncated.
699 It functions only when the
700 .b HostStatusDirectory
701 option is set.
702 .sh 3 "/usr/\*(SB/purgestat"
703 .pp
704 This command is also a link to
705 .i sendmail .
706 It flushes expired (Timeout.hoststatus) information that is stored in the
707 .b HostStatusDirectory
708 tree.
709 .sh 3 "/var/spool/mqueue"
710 .pp
711 The directory
712 .i /var/spool/mqueue
713 should be created to hold the mail queue.
714 This directory should be mode 0700
715 and owned by root.
716 .pp
717 The actual path of this directory
718 is defined by the
719 .b QueueDirectory
720 option of the
721 .i sendmail.cf
722 file.
723 To use multiple queues,
724 supply a value ending with an asterisk.
725 For example,
726 .i /var/spool/mqueue/qd*
727 will use all of the directories or symbolic links to directories
728 beginning with `qd' in
729 .i /var/spool/mqueue
730 as queue directories.
731 Do not change the queue directory structure
732 while sendmail is running.
733 .pp
734 If these directories have subdirectories or symbolic links to directories
735 named `qf', `df', and `xf', then these will be used for the different
736 queue file types.
737 That is, the data files are stored in the `df' subdirectory,
738 the transcript files are stored in the `xf' subdirectory, and
739 all others are stored in the `qf' subdirectory.
740 .pp
741 If shared memory support is compiled in,
742 .i sendmail
743 stores the available diskspace in a shared memory segment
744 to make the values readily available to all children without
745 incurring system overhead.
746 In this case, only the daemon updates the data;
747 i.e., the sendmail daemon creates the shared memory segment
748 and deletes it if it is terminated.
749 To use this,
750 .i sendmail
751 must have been compiled with support for shared memory
752 (-DSM_CONF_SHM)
753 and the option
754 .b SharedMemoryKey
755 must be set.
756 Notice: do not use the same key for
757 .i sendmail
758 invocations with different queue directories
759 or different queue group declarations.
760 Access to shared memory is not controlled by locks,
761 i.e., there is a race condition when data in the shared memory is updated.
762 However, since operation of
763 .i sendmail
764 does not rely on the data in the shared memory, this does not negatively
765 influence the behavior.
766 .sh 3 "/var/spool/clientmqueue"
767 .pp
768 The directory
769 .i /var/spool/clientmqueue
770 should be created to hold the mail queue.
771 This directory should be mode 0770
772 and owned by user smmsp, group smmsp.
773 .pp
774 The actual path of this directory
775 is defined by the
776 .b QueueDirectory
777 option of the
778 .i submit.cf
779 file.
780 .sh 3 "/var/spool/mqueue/.hoststat"
781 .pp
782 This is a typical value for the
783 .b HostStatusDirectory
784 option,
785 containing one file per host
786 that this sendmail has chatted with recently.
787 It is normally a subdirectory of
788 .i mqueue .
789 .sh 3 "/etc/mail/aliases*"
790 .pp
791 The system aliases are held in
792 .q /etc/mail/aliases .
793 A sample is given in
794 .q sendmail/aliases
795 which includes some aliases which
796 .i must
797 be defined:
798 .(b
799 cp sendmail/aliases /etc/mail/aliases
800 .i "edit /etc/mail/aliases"
801 .)b
802 You should extend this file with any aliases that are apropos to your system.
803 .pp
804 Normally
805 .i sendmail
806 looks at a database version of the files,
807 stored either in
808 .q /etc/mail/aliases.dir
809 and
810 .q /etc/mail/aliases.pag
811 or
812 .q /etc/mail/aliases.db
813 depending on which database package you are using.
814 The actual path of this file
815 is defined in the
816 .b AliasFile
817 option of the
818 .i sendmail.cf
819 file.
820 .pp
821 The permissions of the alias file and the database versions
822 should be 0640 to prevent local denial of service attacks
823 as explained in the top level
824 .b README
825 in the sendmail distribution.
826 If the permissions 0640 are used, be sure that only trusted users belong
827 to the group assigned to those files.  Otherwise, files should not even
828 be group readable.
829 .sh 3 "/etc/rc or /etc/init.d/sendmail"
830 .pp
831 It will be necessary to start up the
832 .i sendmail
833 daemon when your system reboots.
834 This daemon performs two functions:
835 it listens on the SMTP socket for connections
836 (to receive mail from a remote system)
837 and it processes the queue periodically
838 to insure that mail gets delivered when hosts come up.
839 .pp
840 If necessary, add the following lines to
841 .q /etc/rc
842 (or
843 .q /etc/rc.local
844 as appropriate)
845 in the area where it is starting up the daemons
846 on a BSD-base system,
847 or on a System-V-based system
848 in one of the startup files, typically
849 .q /etc/init.d/sendmail :
850 .(b
851 if [ \-f /usr/\*(SD/sendmail \-a \-f /etc/mail/sendmail.cf ]; then
852         (cd /var/spool/mqueue; rm \-f xf*)
853         /usr/\*(SD/sendmail \-bd \-q30m &
854         echo \-n ' sendmail' >/dev/console
855 fi
856 .)b
857 The
858 .q cd
859 and
860 .q rm
861 commands insure that all transcript files have been removed;
862 extraneous transcript files may be left around
863 if the system goes down in the middle of processing a message.
864 The line that actually invokes
865 .i sendmail
866 has two flags:
867 .q \-bd
868 causes it to listen on the SMTP port,
869 and
870 .q \-q30m
871 causes it to run the queue every half hour.
872 .pp
873 Some people use a more complex startup script,
874 removing zero length qf/hf/Qf files and df files for which there is no
875 qf/hf/Qf file.
876 Note this is not advisable.
877 For example, see Figure 1
878 for an example of a complex script which does this clean up.
879 .(z
880 .hl
881 #!/bin/sh
882 # remove zero length qf/hf/Qf files
883 for qffile in qf* hf* Qf*
884 do
885         if [ \-r $qffile ]
886         then
887                 if [ ! \-s $qffile ]
888                 then
889                         echo \-n " <zero: $qffile>" > /dev/console
890                         rm \-f $qffile
891                 fi
892         fi
893 done
894 # rename tf files to be qf if the qf does not exist
895 for tffile in tf*
896 do
897         qffile=`echo $tffile | sed 's/t/q/'`
898         if [ \-r $tffile \-a ! \-f $qffile ]
899         then
900                 echo \-n " <recovering: $tffile>" > /dev/console
901                 mv $tffile $qffile
902         else
903                 if [ \-f $tffile ]
904                 then
905                         echo \-n " <extra: $tffile>" > /dev/console
906                         rm \-f $tffile
907                 fi
908         fi
909 done
910 # remove df files with no corresponding qf/hf/Qf files
911 for dffile in df*
912 do
913         qffile=`echo $dffile | sed 's/d/q/'`
914         hffile=`echo $dffile | sed 's/d/h/'`
915         Qffile=`echo $dffile | sed 's/d/Q/'`
916         if [ \-r $dffile \-a ! \-f $qffile \-a ! \-f $hffile \-a ! \-f $Qffile ]
917         then
918                 echo \-n " <incomplete: $dffile>" > /dev/console
919                 mv $dffile `echo $dffile | sed 's/d/D/'`
920         fi
921 done
922 # announce files that have been saved during disaster recovery
923 for xffile in [A-Z]f*
924 do
925         if [ \-f $xffile ]
926         then
927                 echo \-n " <panic: $xffile>" > /dev/console
928         fi
929 done
930 .sp
931 .ce
932 Figure 1 \(em A complex startup script
933 .hl
934 .)z
935 .sh 3 "/etc/mail/helpfile"
936 .pp
937 This is the help file used by the SMTP
938 .b HELP
939 command.
940 It should be copied from
941 .q sendmail/helpfile :
942 .(b
943 cp sendmail/helpfile /etc/mail/helpfile
944 .)b
945 The actual path of this file
946 is defined in the
947 .b HelpFile
948 option of the
949 .i sendmail.cf
950 file.
951 .sh 3 "/etc/mail/statistics"
952 .pp
953 If you wish to collect statistics
954 about your mail traffic,
955 you should create the file
956 .q /etc/mail/statistics :
957 .(b
958 cp /dev/null /etc/mail/statistics
959 chmod 0600 /etc/mail/statistics
960 .)b
961 This file does not grow.
962 It is printed with the program
963 .q mailstats/mailstats.c.
964 The actual path of this file
965 is defined in the
966 .b S
967 option of the
968 .i sendmail.cf
969 file.
970 .sh 3 "/usr/\*(SB/mailq"
971 .pp
972 If
973 .i sendmail
974 is invoked as
975 .q mailq,
976 it will simulate the
977 .b \-bp
978 flag
979 (i.e.,
980 .i sendmail
981 will print the contents of the mail queue;
982 see below).
983 This should be a link to /usr/\*(SD/sendmail.
984 .sh 3 "sendmail.pid"
985 .pp
986 .i sendmail
987 stores its current pid in the file specified by the
988 .b PidFile
989 option (default is _PATH_SENDMAILPID).
990 .i sendmail
991 uses
992 .b TempFileMode
993 (which defaults to 0600) as
994 the permissions of that file
995 to prevent local denial of service attacks
996 as explained in the top level
997 .b README
998 in the sendmail distribution.
999 If the file already exists, then it might be necessary to
1000 change the permissions accordingly, e.g.,
1001 .(b
1002 chmod 0600 /var/run/sendmail.pid
1003 .)b
1004 Note that as of version 8.13, this file is unlinked when
1005 .i sendmail
1006 exits.
1007 As a result of this change, a script such as the following,
1008 which may have worked prior to 8.13, will no longer work:
1009 .(b
1010 # stop & start sendmail
1011 PIDFILE=/var/run/sendmail.pid
1012 kill `head -1 $PIDFILE`
1013 `tail -1 $PIDFILE`
1014 .)b
1015 because it assumes that the pidfile will still exist even
1016 after killing the process to which it refers.
1017 Below is a script which will work correctly
1018 on both newer and older versions:
1019 .(b
1020 # stop & start sendmail
1021 PIDFILE=/var/run/sendmail.pid
1022 pid=`head -1 $PIDFILE`
1023 cmd=`tail -1 $PIDFILE`
1024 kill $pid
1025 $cmd
1026 .)b
1027 This is just an example script, it does not perform any error checks,
1028 e.g., whether the pidfile exists at all.
1029 .sh 3 "Map Files"
1030 .pp
1031 To prevent local denial of service attacks
1032 as explained in the top level
1033 .b README
1034 in the sendmail distribution,
1035 the permissions of map files created by
1036 .i makemap
1037 should be 0640.
1038 The use of 0640 implies that only trusted users belong to the group
1039 assigned to those files.
1040 If those files already exist, then it might be necessary to
1041 change the permissions accordingly, e.g.,
1042 .(b
1043 cd /etc/mail
1044 chmod 0640 *.db *.pag *.dir
1045 .)b
1046 .sh 1 "NORMAL OPERATIONS"
1047 .sh 2 "The System Log"
1048 .pp
1049 The system log is supported by the
1050 .i syslogd \|(8)
1051 program.
1052 All messages from
1053 .i sendmail
1054 are logged under the
1055 .sm LOG_MAIL
1056 facility\**.
1057 .(f
1058 \**Except on Ultrix,
1059 which does not support facilities in the syslog.
1060 .)f
1061 .sh 3 "Format"
1062 .pp
1063 Each line in the system log
1064 consists of a timestamp,
1065 the name of the machine that generated it
1066 (for logging from several machines
1067 over the local area network),
1068 the word
1069 .q sendmail: ,
1070 and a message\**.
1071 .(f
1072 \**This format may vary slightly if your vendor has changed
1073 the syntax.
1074 .)f
1075 Most messages are a sequence of
1076 .i name \c
1077 =\c
1078 .i value
1079 pairs.
1080 .pp
1081 The two most common lines are logged when a message is processed.
1082 The first logs the receipt of a message;
1083 there will be exactly one of these per message.
1084 Some fields may be omitted if they do not contain interesting information.
1085 Fields are:
1086 .ip from
1087 The envelope sender address.
1088 .ip size
1089 The size of the message in bytes.
1090 .ip class
1091 The class (i.e., numeric precedence) of the message.
1092 .ip pri
1093 The initial message priority (used for queue sorting).
1094 .ip nrcpts
1095 The number of envelope recipients for this message
1096 (after aliasing and forwarding).
1097 .ip msgid
1098 The message id of the message (from the header).
1099 .ip bodytype
1100 The message body type (7BIT or 8BITMIME),
1101 as determined from the envelope.
1102 .ip proto
1103 The protocol used to receive this message (e.g., ESMTP or UUCP)
1104 .ip daemon
1105 The daemon name from the
1106 .b DaemonPortOptions
1107 setting.
1108 .ip relay
1109 The machine from which it was received.
1110 .lp
1111 There is also one line logged per delivery attempt
1112 (so there can be several per message if delivery is deferred
1113 or there are multiple recipients).
1114 Fields are:
1115 .ip to
1116 A comma-separated list of the recipients to this mailer.
1117 .ip ctladdr
1118 The ``controlling user'', that is, the name of the user
1119 whose credentials we use for delivery.
1120 .ip delay
1121 The total delay between the time this message was received
1122 and the current delivery attempt.
1123 .ip xdelay
1124 The amount of time needed in this delivery attempt
1125 (normally indicative of the speed of the connection).
1126 .ip mailer
1127 The name of the mailer used to deliver to this recipient.
1128 .ip relay
1129 The name of the host that actually accepted (or rejected) this recipient.
1130 .ip dsn
1131 The enhanced error code (RFC 2034) if available.
1132 .ip stat
1133 The delivery status.
1134 .lp
1135 Not all fields are present in all messages;
1136 for example, the relay is usually not listed for local deliveries.
1137 .sh 3 "Levels"
1138 .pp
1139 If you have
1140 .i syslogd \|(8)
1141 or an equivalent installed,
1142 you will be able to do logging.
1143 There is a large amount of information that can be logged.
1144 The log is arranged as a succession of levels.
1145 At the lowest level
1146 only extremely strange situations are logged.
1147 At the highest level,
1148 even the most mundane and uninteresting events
1149 are recorded for posterity.
1150 As a convention,
1151 log levels under ten
1152 are considered generally
1153 .q useful;
1154 log levels above 64
1155 are reserved for debugging purposes.
1156 Levels from 11\-64 are reserved for verbose information
1157 that some sites might want.
1158 .pp
1159 A complete description of the log levels
1160 is given in section ``Log Level''.
1161 .sh 2 "Dumping State"
1162 .pp
1163 You can ask
1164 .i sendmail
1165 to log a dump of the open files
1166 and the connection cache
1167 by sending it a
1168 .sm SIGUSR1
1169 signal.
1170 The results are logged at
1171 .sm LOG_DEBUG
1172 priority.
1173 .sh 2 "The Mail Queues"
1174 .pp
1175 Mail messages may either be delivered immediately or be held for later
1176 delivery.
1177 Held messages are placed into a holding directory called a mail queue.
1178 .pp
1179 A mail message may be queued for these reasons:
1180 .bu
1181 If a mail message is temporarily undeliverable, it is queued
1182 and delivery is attempted later.
1183 If the message is addressed to multiple recipients, it is queued
1184 only for those recipients to whom delivery is not immediately possible.
1185 .bu
1186 If the SuperSafe option is set to true,
1187 all mail messages are queued while delivery is attempted.
1188 .bu
1189 If the DeliveryMode option is set to queue-only or defer,
1190 all mail is queued, and no immediate delivery is attempted.
1191 .bu
1192 If the load average becomes higher than the value of the QueueLA option
1193 and the
1194 .b QueueFactor
1195 (\c
1196 .b q )
1197 option divided by the difference in the current load average and the
1198 .b QueueLA
1199 option plus one
1200 is less than the priority of the message,
1201 messages are queued rather than immediately delivered.
1202 .bu
1203 One or more addresses are marked as expensive and delivery is postponed
1204 until the next queue run or one or more address are marked as held via
1205 mailer which uses the hold mailer flag.
1206 .bu
1207 The mail message has been marked as quarantined via a mail filter or
1208 rulesets.
1209 .sh 3 "Queue Groups and Queue Directories"
1210 .pp
1211 There are one or more mail queues.
1212 Each mail queue belongs to a queue group.
1213 There is always a default queue group that is called ``mqueue''
1214 (which is where messages go by default unless otherwise specified).
1215 The directory or directories which comprise the default queue group
1216 are specified by the QueueDirectory option.
1217 There are zero or more
1218 additional named queue groups declared using the
1219 .b Q
1220 command in the configuration file.
1221 .pp
1222 By default, a queued message is placed in the queue group
1223 associated with the first recipient in the recipient list.
1224 A recipient address is mapped to a queue group as follows.
1225 First, if there is a ruleset called ``queuegroup'',
1226 and if this ruleset maps the address to a queue group name,
1227 then that queue group is chosen.
1228 That is, the argument for the ruleset is
1229 the recipient address
1230 (i.e., the address part of the resolved triple)
1231 and the result should be
1232 .b $#
1233 followed by the name of a queue group.
1234 Otherwise, if the mailer associated with the address specifies
1235 a queue group, then that queue group is chosen.
1236 Otherwise, the default queue group is chosen.
1237 .pp
1238 A message with multiple recipients will be split
1239 if different queue groups are chosen
1240 by the mapping of recipients to queue groups.
1241 .pp
1242 When a message is placed in a queue group, and the queue group has
1243 more than one queue, a queue is selected randomly.
1244 .pp
1245 If a message with multiple recipients is placed into a queue group
1246 with the 'r' option (maximum number of recipients per message)
1247 set to a positive value
1248 .i N ,
1249 and if there are more than
1250 .i N
1251 recipients
1252 in the message, then the message will be split into multiple messages,
1253 each of which have at most
1254 .i N
1255 recipients.
1256 .pp
1257 Notice: if multiple queue groups are used, do
1258 .b not
1259 move queue files around, e.g., into a different queue directory.
1260 This may have weird effects and can cause mail not to be delivered.
1261 Queue files and directories should be treated as opaque
1262 and should not be manipulated directly.
1263 .sh 3 "Queue Runs"
1264 .pp
1265 .i sendmail
1266 has two different ways to process the queue(s).
1267 The first one is to start queue runners after certain intervals
1268 (``normal'' queue runners),
1269 the second one is to keep queue runner processes around
1270 (``persistent'' queue runners).
1271 How to select either of these types is discussed in the appendix
1272 ``COMMAND LINE FLAGS''.
1273 Persistent queue runners have the advantage that no new processes
1274 need to be spawned at certain intervals; they just sleep for
1275 a specified time after they finished a queue run.
1276 Another advantage of persistent queue runners is that only one process
1277 belonging to a workgroup (a workgroup is a set of queue groups)
1278 collects the data for a queue run
1279 and then multiple queue runner may go ahead using that data.
1280 This can significantly reduce the disk I/O necessary to read the
1281 queue files compared to starting multiple queue runners directly.
1282 Their disadvantage is that a new queue run is only started
1283 after all queue runners belonging to a group finished their tasks.
1284 In case one of the queue runners tries delivery to a slow recipient site
1285 at the end of a queue run, the next queue run may be substantially delayed.
1286 In general this should be smoothed out due to the distribution of
1287 those slow jobs, however, for sites with small number of
1288 queue entries this might introduce noticeable delays.
1289 In general, persistent queue runners are only useful for
1290 sites with big queues.
1291 .sh 3 "Manual Intervention"
1292 .pp
1293 Under normal conditions the mail queue will be processed transparently.
1294 However, you may find that manual intervention is sometimes necessary.
1295 For example,
1296 if a major host is down for a period of time
1297 the queue may become clogged.
1298 Although
1299 .i sendmail
1300 ought to recover gracefully when the host comes up,
1301 you may find performance unacceptably bad in the meantime.
1302 In that case you want to check the content of the queue
1303 and manipulate it as explained in the next two sections.
1304 .sh 3 "Printing the queue"
1305 .pp
1306 The contents of the queue(s) can be printed
1307 using the
1308 .i mailq
1309 command
1310 (or by specifying the
1311 .b \-bp
1312 flag to
1313 .i sendmail ):
1314 .(b
1315 mailq
1316 .)b
1317 This will produce a listing of the queue id's,
1318 the size of the message,
1319 the date the message entered the queue,
1320 and the sender and recipients.
1321 If shared memory support is compiled in,
1322 the flag
1323 .b \-bP
1324 can be used to print the number of entries in the queue(s),
1325 provided a process updates the data.
1326 However, as explained earlier, the output might be slightly wrong,
1327 since access to the shared memory is not locked.
1328 For example,
1329 ``unknown number of entries''
1330 might be shown.
1331 The internal counters are updated after each queue run
1332 to the correct value again.
1333 .sh 3 "Forcing the queue"
1334 .pp
1335 .i Sendmail
1336 should run the queue automatically at intervals.
1337 When using multiple queues,
1338 a separate process will by default be created to
1339 run each of the queues
1340 unless the queue run is initiated by a user
1341 with the verbose flag.
1342 The algorithm is to read and sort the queue,
1343 and then to attempt to process all jobs in order.
1344 When it attempts to run the job,
1345 .i sendmail
1346 first checks to see if the job is locked.
1347 If so, it ignores the job.
1348 .pp
1349 There is no attempt to insure that only one queue processor
1350 exists at any time,
1351 since there is no guarantee that a job cannot take forever
1352 to process
1353 (however,
1354 .i sendmail
1355 does include heuristics to try to abort jobs
1356 that are taking absurd amounts of time;
1357 technically, this violates RFC 821, but is blessed by RFC 1123).
1358 Due to the locking algorithm,
1359 it is impossible for one job to freeze the entire queue.
1360 However,
1361 an uncooperative recipient host
1362 or a program recipient
1363 that never returns
1364 can accumulate many processes in your system.
1365 Unfortunately,
1366 there is no completely general way to solve this.
1367 .pp
1368 In some cases,
1369 you may find that a major host going down
1370 for a couple of days
1371 may create a prohibitively large queue.
1372 This will result in
1373 .i sendmail
1374 spending an inordinate amount of time
1375 sorting the queue.
1376 This situation can be fixed by moving the queue to a temporary place
1377 and creating a new queue.
1378 The old queue can be run later when the offending host returns to service.
1379 .pp
1380 To do this,
1381 it is acceptable to move the entire queue directory:
1382 .(b
1383 cd /var/spool
1384 mv mqueue omqueue; mkdir mqueue; chmod 0700 mqueue
1385 .)b
1386 You should then kill the existing daemon
1387 (since it will still be processing in the old queue directory)
1388 and create a new daemon.
1389 .pp
1390 To run the old mail queue, issue the following command:
1391 .(b
1392 /usr/\*(SD/sendmail \-C /etc/mail/queue.cf \-q
1393 .)b
1394 The
1395 .b \-C
1396 flag specifies an alternate configuration file
1397 .b queue.cf
1398 which should refer to the moved queue directory
1399 .(b
1400 O QueueDirectory=/var/spool/omqueue
1401 .)b
1402 and the
1403 .b \-q
1404 flag says to just run every job in the queue.
1405 You can also specify the moved queue directory on the command line
1406 .(b
1407 /usr/\*(SD/sendmail \-oQ/var/spool/omqueue \-q
1408 .)b
1409 but this requires that you do not have
1410 queue groups in the configuration file,
1411 because those are not subdirectories of the moved directory.
1412 See the section about ``Queue Group Declaration'' for details;
1413 you most likely need a different configuration file to correctly deal
1414 with this problem.
1415 However, a proper configuration of queue groups should avoid
1416 filling up queue directories, so you shouldn't run into
1417 this problem.
1418 If you have a tendency toward voyeurism,
1419 you can use the
1420 .b \-v
1421 flag to watch what is going on.
1422 .pp
1423 When the queue is finally emptied,
1424 you can remove the directory:
1425 .(b
1426 rmdir /var/spool/omqueue
1427 .)b
1428 .sh 3 "Quarantined Queue Items"
1429 .pp
1430 It is possible to "quarantine" mail messages,
1431 otherwise known as envelopes.
1432 Envelopes (queue files) are stored but not considered for delivery or
1433 display unless the "quarantine" state of the envelope is undone or
1434 delivery or display of quarantined items is requested.
1435 Quarantined messages are tagged by using a different name for the queue
1436 file, 'hf' instead of 'qf', and by adding the quarantine reason to the
1437 queue file.
1438 .pp
1439 Delivery or display of quarantined items can be requested using the
1440 .b \-qQ
1441 flag to
1442 .i sendmail
1443 or
1444 .i mailq .
1445 Additionally, messages already in the queue can be quarantined or
1446 unquarantined using the new
1447 .b \-Q
1448 flag to sendmail.
1449 For example,
1450 .(b
1451 sendmail -Qreason -q[!][I|R|S][matchstring]
1452 .)b
1453 Quarantines the normal queue items matching the criteria specified by the
1454 .b "-q[!][I|R|S][matchstring]"
1455 using the reason given on the
1456 .b \-Q
1457 flag.
1458 Likewise,
1459 .(b
1460 sendmail -qQ -Q[reason] -q[!][I|R|S|Q][matchstring]
1461 .)b
1462 Change the quarantine reason for the quarantined items matching the
1463 criteria specified by the
1464 .b "-q[!][I|R|S|Q][matchstring]"
1465 using the reason given on the
1466 .b \-Q
1467 flag.
1468 If there is no reason,
1469  unquarantine the matching items and make them normal queue items.
1470 Note that the
1471 .b \-qQ
1472 flag tells sendmail to operate on quarantined items instead of normal items.
1473 .sh 2 "Disk Based Connection Information"
1474 .pp
1475 .i Sendmail
1476 stores a large amount of information about each remote system it
1477 has connected to in memory. It is possible to preserve some
1478 of this information on disk as well, by using the
1479 .b HostStatusDirectory
1480 option, so that it may be shared between several invocations of
1481 .i sendmail .
1482 This allows mail to be queued immediately or skipped during a queue run if
1483 there has been a recent failure in connecting to a remote machine.
1484 Note: information about a remote system is stored in a file
1485 whose pathname consists of the components of the hostname in reverse order.
1486 For example, the information for
1487 .b host.example.com
1488 is stored in
1489 .b com./example./host .
1490 For top-level domains like
1491 .b com
1492 this can create a large number of subdirectories
1493 which on some filesystems can exhaust some limits.
1494 Moreover, the performance of lookups in directory with thousands of entries
1495 can be fairly slow depending on the filesystem implementation.
1496 .pp
1497 Additionally enabling
1498 .b SingleThreadDelivery
1499 has the added effect of single-threading mail delivery to a destination.
1500 This can be quite helpful
1501 if the remote machine is running an SMTP server that is easily overloaded
1502 or cannot accept more than a single connection at a time,
1503 but can cause some messages to be punted to a future queue run.
1504 It also applies to
1505 .i all
1506 hosts, so setting this because you have one machine on site
1507 that runs some software that is easily overrun
1508 can cause mail to other hosts to be slowed down.
1509 If this option is set,
1510 you probably want to set the
1511 .b MinQueueAge
1512 option as well and run the queue fairly frequently;
1513 this way jobs that are skipped because another
1514 .i sendmail
1515 is talking to the same host will be tried again quickly
1516 rather than being delayed for a long time.
1517 .pp
1518 The disk based host information is stored in a subdirectory of the
1519 .b mqueue
1520 directory called
1521 .b \&.hoststat \**.
1522 .(f
1523 \**This is the usual value of the
1524 .b HostStatusDirectory
1525 option;
1526 it can, of course, go anywhere you like in your filesystem.
1527 .)f
1528 Removing this directory and its subdirectories has an effect similar to
1529 the
1530 .i purgestat
1531 command and is completely safe.
1532 However,
1533 .i purgestat
1534 only removes expired (Timeout.hoststatus) data.
1535 The information in these directories can
1536 be perused with the
1537 .i hoststat
1538 command, which will indicate the host name, the last access, and the
1539 status of that access.
1540 An asterisk in the left most column indicates that a
1541 .i sendmail
1542 process currently has the host locked for mail delivery.
1543 .pp
1544 The disk based connection information is treated the same way as memory based
1545 connection information for the purpose of timeouts.
1546 By default, information about host failures is valid for 30 minutes.
1547 This can be adjusted with
1548 the
1549 .b Timeout.hoststatus
1550 option.
1551 .pp
1552 The connection information stored on disk may be expired at any time
1553 with the
1554 .i purgestat
1555 command or by invoking sendmail with the
1556 .b \-bH
1557 switch.
1558 The connection information may be viewed with the
1559 .i hoststat
1560 command or by invoking sendmail with the
1561 .b \-bh
1562 switch.
1563 .sh 2 "The Service Switch"
1564 .pp
1565 The implementation of certain system services
1566 such as host and user name lookup
1567 is controlled by the service switch.
1568 If the host operating system supports such a switch,
1569 and sendmail knows about it,
1570 .i sendmail
1571 will use the native version.
1572 Ultrix, Solaris, and DEC OSF/1 are examples of such systems\**.
1573 .(f
1574 \**HP-UX 10 has service switch support,
1575 but since the APIs are apparently not available in the libraries
1576 .i sendmail
1577 does not use the native service switch in this release.
1578 .)f
1579 .pp
1580 If the underlying operating system does not support a service switch
1581 (e.g., SunOS 4.X, HP-UX, BSD)
1582 then
1583 .i sendmail
1584 will provide a stub implementation.
1585 The
1586 .b ServiceSwitchFile
1587 option points to the name of a file that has the service definitions.
1588 Each line has the name of a service
1589 and the possible implementations of that service.
1590 For example, the file:
1591 .(b
1592 hosts   dns files nis
1593 aliases files nis
1594 .)b
1595 will ask
1596 .i sendmail
1597 to look for hosts in the Domain Name System first.
1598 If the requested host name is not found, it tries local files,
1599 and if that fails it tries NIS.
1600 Similarly, when looking for aliases
1601 it will try the local files first followed by NIS.
1602 .pp
1603 Notice: since
1604 .i sendmail
1605 must access MX records for correct operation, it will use
1606 DNS if it is configured in the
1607 .b ServiceSwitchFile
1608 file.
1609 Hence an entry like
1610 .(b
1611 hosts   files dns
1612 .)b
1613 will not avoid DNS lookups even if a host can be found
1614 in /etc/hosts.
1615 .pp
1616 Service switches are not completely integrated.
1617 For example, despite the fact that the host entry listed in the above example
1618 specifies to look in NIS,
1619 on SunOS this won't happen because the system implementation of
1620 .i gethostbyname \|(3)
1621 doesn't understand this.
1622 .sh 2 "The Alias Database"
1623 .pp
1624 After recipient addresses are read from the SMTP connection
1625 or command line
1626 they are parsed by ruleset 0,
1627 which must resolve to a
1628 {\c
1629 .i mailer ,
1630 .i host ,
1631 .i address }
1632 triple.
1633 If the flags selected by the
1634 .i mailer
1635 include the
1636 .b A
1637 (aliasable) flag,
1638 the
1639 .i address
1640 part of the triple is looked up as the key
1641 (i.e., the left hand side)
1642 in the alias database.
1643 If there is a match, the address is deleted from the send queue
1644 and all addresses on the right hand side of the alias
1645 are added in place of the alias that was found.
1646 This is a recursive operation,
1647 so aliases found in the right hand side of the alias
1648 are similarly expanded.
1649 .pp
1650 The alias database exists in two forms.
1651 One is a text form,
1652 maintained in the file
1653 .i /etc/mail/aliases.
1654 The aliases are of the form
1655 .(b
1656 name: name1, name2, ...
1657 .)b
1658 Only local names may be aliased;
1659 e.g.,
1660 .(b
1661 eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU
1662 .)b
1663 will not have the desired effect
1664 (except on prep.ai.MIT.EDU,
1665 and they probably don't want me)\**.
1666 .(f
1667 \**Actually, any mailer that has the `A' mailer flag set
1668 will permit aliasing;
1669 this is normally limited to the local mailer.
1670 .)f
1671 Aliases may be continued by starting any continuation lines
1672 with a space or a tab or by putting a backslash directly before
1673 the newline.
1674 Blank lines and lines beginning with a sharp sign
1675 (\c
1676 .q # )
1677 are comments.
1678 .pp
1679 The second form is processed by the
1680 .i ndbm \|(3)\**
1681 .(f
1682 \**The
1683 .i gdbm
1684 package does not work.
1685 .)f
1686 or the Berkeley DB library.
1687 This form is in the file
1688 .i /etc/mail/aliases.db
1689 (if using NEWDB)
1690 or
1691 .i /etc/mail/aliases.dir
1692 and
1693 .i /etc/mail/aliases.pag
1694 (if using NDBM).
1695 This is the form that
1696 .i sendmail
1697 actually uses to resolve aliases.
1698 This technique is used to improve performance.
1699 .pp
1700 The control of search order is actually set by the service switch.
1701 Essentially, the entry
1702 .(b
1703 O AliasFile=switch:aliases
1704 .)b
1705 is always added as the first alias entry;
1706 also, the first alias file name without a class
1707 (e.g., without
1708 .q nis:
1709 on the front)
1710 will be used as the name of the file for a ``files'' entry
1711 in the aliases switch.
1712 For example, if the configuration file contains
1713 .(b
1714 O AliasFile=/etc/mail/aliases
1715 .)b
1716 and the service switch contains
1717 .(b
1718 aliases nis files nisplus
1719 .)b
1720 then aliases will first be searched in the NIS database,
1721 then in /etc/mail/aliases,
1722 then in the NIS+ database.
1723 .pp
1724 You can also use
1725 .sm NIS -based
1726 alias files.
1727 For example, the specification:
1728 .(b
1729 O AliasFile=/etc/mail/aliases
1730 O AliasFile=nis:mail.aliases@my.nis.domain
1731 .)b
1732 will first search the /etc/mail/aliases file
1733 and then the map named
1734 .q mail.aliases
1735 in
1736 .q my.nis.domain .
1737 Warning: if you build your own
1738 .sm NIS -based
1739 alias files,
1740 be sure to provide the
1741 .b \-l
1742 flag to
1743 .i makedbm (8)
1744 to map upper case letters in the keys to lower case;
1745 otherwise, aliases with upper case letters in their names
1746 won't match incoming addresses.
1747 .pp
1748 Additional flags can be added after the colon
1749 exactly like a
1750 .b K
1751 line \(em for example:
1752 .(b
1753 O AliasFile=nis:\-N mail.aliases@my.nis.domain
1754 .)b
1755 will search the appropriate NIS map and always include null bytes in the key.
1756 Also:
1757 .(b
1758 O AliasFile=nis:\-f mail.aliases@my.nis.domain
1759 .)b
1760 will prevent sendmail from downcasing the key before the alias lookup.
1761 .sh 3 "Rebuilding the alias database"
1762 .pp
1763 The
1764 .i hash
1765 or
1766 .i dbm
1767 version of the database
1768 may be rebuilt explicitly by executing the command
1769 .(b
1770 newaliases
1771 .)b
1772 This is equivalent to giving
1773 .i sendmail
1774 the
1775 .b \-bi
1776 flag:
1777 .(b
1778 /usr/\*(SD/sendmail \-bi
1779 .)b
1780 .pp
1781 If you have multiple aliases databases specified,
1782 the
1783 .b \-bi
1784 flag rebuilds all the database types it understands
1785 (for example, it can rebuild NDBM databases but not NIS databases).
1786 .sh 3 "Potential problems"
1787 .pp
1788 There are a number of problems that can occur
1789 with the alias database.
1790 They all result from a
1791 .i sendmail
1792 process accessing the DBM version
1793 while it is only partially built.
1794 This can happen under two circumstances:
1795 One process accesses the database
1796 while another process is rebuilding it,
1797 or the process rebuilding the database dies
1798 (due to being killed or a system crash)
1799 before completing the rebuild.
1800 .pp
1801 Sendmail has three techniques to try to relieve these problems.
1802 First, it ignores interrupts while rebuilding the database;
1803 this avoids the problem of someone aborting the process
1804 leaving a partially rebuilt database.
1805 Second,
1806 it locks the database source file during the rebuild \(em
1807 but that may not work over NFS or if the file is unwritable.
1808 Third,
1809 at the end of the rebuild
1810 it adds an alias of the form
1811 .(b
1812 @: @
1813 .)b
1814 (which is not normally legal).
1815 Before
1816 .i sendmail
1817 will access the database,
1818 it checks to insure that this entry exists\**.
1819 .(f
1820 \**The
1821 .b AliasWait
1822 option is required in the configuration
1823 for this action to occur.
1824 This should normally be specified.
1825 .)f
1826 .sh 3 "List owners"
1827 .pp
1828 If an error occurs on sending to a certain address,
1829 say
1830 .q \fIx\fP ,
1831 .i sendmail
1832 will look for an alias
1833 of the form
1834 .q owner-\fIx\fP
1835 to receive the errors.
1836 This is typically useful
1837 for a mailing list
1838 where the submitter of the list
1839 has no control over the maintenance of the list itself;
1840 in this case the list maintainer would be the owner of the list.
1841 For example:
1842 .(b
1843 unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser,
1844         sam@matisse
1845 owner-unix-wizards: unix-wizards-request
1846 unix-wizards-request: eric@ucbarpa
1847 .)b
1848 would cause
1849 .q eric@ucbarpa
1850 to get the error that will occur
1851 when someone sends to
1852 unix-wizards
1853 due to the inclusion of
1854 .q nosuchuser
1855 on the list.
1856 .pp
1857 List owners also cause the envelope sender address to be modified.
1858 The contents of the owner alias are used if they point to a single user,
1859 otherwise the name of the alias itself is used.
1860 For this reason, and to obey Internet conventions,
1861 the
1862 .q owner-
1863 address normally points at the
1864 .q -request
1865 address; this causes messages to go out with the typical Internet convention
1866 of using ``\c
1867 .i list -request''
1868 as the return address.
1869 .sh 2 "User Information Database"
1870 .pp
1871 This option is deprecated, use virtusertable and genericstable instead
1872 as explained in
1873 .i cf/README .
1874 If you have a version of
1875 .i sendmail
1876 with the user information database
1877 compiled in,
1878 and you have specified one or more databases using the
1879 .b U
1880 option,
1881 the databases will be searched for a
1882 .i user :maildrop
1883 entry.
1884 If found, the mail will be sent to the specified address.
1885 .sh 2 "Per-User Forwarding (.forward Files)"
1886 .pp
1887 As an alternative to the alias database,
1888 any user may put a file with the name
1889 .q .forward
1890 in his or her home directory.
1891 If this file exists,
1892 .i sendmail
1893 redirects mail for that user
1894 to the list of addresses listed in the .forward file.
1895 Note that aliases are fully expanded before forward files are referenced.
1896 For example, if the home directory for user
1897 .q mckusick
1898 has a .forward file with contents:
1899 .(b
1900 mckusick@ernie
1901 kirk@calder
1902 .)b
1903 then any mail arriving for
1904 .q mckusick
1905 will be redirected to the specified accounts.
1906 .pp
1907 Actually, the configuration file defines a sequence of filenames to check.
1908 By default, this is the user's .forward file,
1909 but can be defined to be more generally using the
1910 .b ForwardPath
1911 option.
1912 If you change this,
1913 you will have to inform your user base of the change;
1914 \&.forward is pretty well incorporated into the collective subconscious.
1915 .sh 2 "Special Header Lines"
1916 .pp
1917 Several header lines have special interpretations
1918 defined by the configuration file.
1919 Others have interpretations built into
1920 .i sendmail
1921 that cannot be changed without changing the code.
1922 These built-ins are described here.
1923 .sh 3 "Errors-To:"
1924 .pp
1925 If errors occur anywhere during processing,
1926 this header will cause error messages to go to
1927 the listed addresses.
1928 This is intended for mailing lists.
1929 .pp
1930 The Errors-To: header was created in the bad old days
1931 when UUCP didn't understand the distinction between an envelope and a header;
1932 this was a hack to provide what should now be passed
1933 as the envelope sender address.
1934 It should go away.
1935 It is only used if the
1936 .b UseErrorsTo
1937 option is set.
1938 .pp
1939 The Errors-To: header is officially deprecated
1940 and will go away in a future release.
1941 .sh 3 "Apparently-To:"
1942 .pp
1943 RFC 822 requires at least one recipient field
1944 (To:, Cc:, or Bcc: line)
1945 in every message.
1946 If a message comes in with no recipients listed in the message
1947 then
1948 .i sendmail
1949 will adjust the header based on the
1950 .q NoRecipientAction
1951 option.
1952 One of the possible actions is to add an
1953 .q "Apparently-To:"
1954 header line for any recipients it is aware of.
1955 .pp
1956 The Apparently-To: header is non-standard
1957 and is both deprecated and strongly discouraged.
1958 .sh 3 "Precedence"
1959 .pp
1960 The Precedence: header can be used as a crude control of message priority.
1961 It tweaks the sort order in the queue
1962 and can be configured to change the message timeout values.
1963 The precedence of a message also controls how
1964 delivery status notifications (DSNs)
1965 are processed for that message.
1966 .sh 2 "IDENT Protocol Support"
1967 .pp
1968 .i Sendmail
1969 supports the IDENT protocol as defined in RFC 1413.
1970 Note that the RFC states
1971 a client should wait at least 30 seconds for a response.
1972 The default Timeout.ident is 5 seconds
1973 as many sites have adopted the practice of dropping IDENT queries.
1974 This has lead to delays processing mail.
1975 Although this enhances identification
1976 of the author of an email message
1977 by doing a ``call back'' to the originating system to include
1978 the owner of a particular TCP connection
1979 in the audit trail
1980 it is in no sense perfect;
1981 a determined forger can easily spoof the IDENT protocol.
1982 The following description is excerpted from RFC 1413:
1983 .ba +5
1984 .lp
1985 6.  Security Considerations
1986 .lp
1987 The information returned by this protocol is at most as trustworthy
1988 as the host providing it OR the organization operating the host.  For
1989 example, a PC in an open lab has few if any controls on it to prevent
1990 a user from having this protocol return any identifier the user
1991 wants.  Likewise, if the host has been compromised the information
1992 returned may be completely erroneous and misleading.
1993 .lp
1994 The Identification Protocol is not intended as an authorization or
1995 access control protocol.  At best, it provides some additional
1996 auditing information with respect to TCP connections.  At worst, it
1997 can provide misleading, incorrect, or maliciously incorrect
1998 information.
1999 .lp
2000 The use of the information returned by this protocol for other than
2001 auditing is strongly discouraged.  Specifically, using Identification
2002 Protocol information to make access control decisions - either as the
2003 primary method (i.e., no other checks) or as an adjunct to other
2004 methods may result in a weakening of normal host security.
2005 .lp
2006 An Identification server may reveal information about users,
2007 entities, objects or processes which might normally be considered
2008 private.  An Identification server provides service which is a rough
2009 analog of the CallerID services provided by some phone companies and
2010 many of the same privacy considerations and arguments that apply to
2011 the CallerID service apply to Identification.  If you wouldn't run a
2012 "finger" server due to privacy considerations you may not want to run
2013 this protocol.
2014 .ba
2015 .lp
2016 In some cases your system may not work properly with IDENT support
2017 due to a bug in the TCP/IP implementation.
2018 The symptoms will be that for some hosts
2019 the SMTP connection will be closed
2020 almost immediately.
2021 If this is true or if you do not want to use IDENT,
2022 you should set the IDENT timeout to zero;
2023 this will disable the IDENT protocol.
2024 .sh 1 "ARGUMENTS"
2025 .pp
2026 The complete list of arguments to
2027 .i sendmail
2028 is described in detail in Appendix A.
2029 Some important arguments are described here.
2030 .sh 2 "Queue Interval"
2031 .pp
2032 The amount of time between forking a process
2033 to run through the queue is defined by the
2034 .b \-q
2035 flag.
2036 If you run with delivery mode set to
2037 .b i
2038 or
2039 .b b
2040 this can be relatively large, since it will only be relevant
2041 when a host that was down comes back up.
2042 If you run in
2043 .b q
2044 mode it should be relatively short,
2045 since it defines the maximum amount of time that a message
2046 may sit in the queue.
2047 (See also the MinQueueAge option.)
2048 .pp
2049 RFC 1123 section 5.3.1.1 says that this value should be at least 30 minutes
2050 (although that probably doesn't make sense if you use ``queue-only'' mode).
2051 .pp
2052 Notice: the meaning of the interval time depends on whether normal
2053 queue runners or persistent queue runners are used.
2054 For the former, it is the time between subsequent starts of a queue run.
2055 For the latter, it is the time sendmail waits after a persistent queue
2056 runner has finished its work to start the next one.
2057 Hence for persistent queue runners this interval should be very low,
2058 typically no more than two minutes.
2059 .sh 2 "Daemon Mode"
2060 .pp
2061 If you allow incoming mail over an IPC connection,
2062 you should have a daemon running.
2063 This should be set by your
2064 .i /etc/rc
2065 file using the
2066 .b \-bd
2067 flag.
2068 The
2069 .b \-bd
2070 flag and the
2071 .b \-q
2072 flag may be combined in one call:
2073 .(b
2074 /usr/\*(SD/sendmail \-bd \-q30m
2075 .)b
2076 .pp
2077 An alternative approach is to invoke sendmail from
2078 .i inetd (8)
2079 (use the
2080 .b \-bs \ \-Am
2081 flags to ask sendmail to speak SMTP on its standard input and output
2082 and to run as MTA).
2083 This works and allows you to wrap
2084 .i sendmail
2085 in a TCP wrapper program,
2086 but may be a bit slower since the configuration file
2087 has to be re-read on every message that comes in.
2088 If you do this, you still need to have a
2089 .i sendmail
2090 running to flush the queue:
2091 .(b
2092 /usr/\*(SD/sendmail \-q30m
2093 .)b
2094 .sh 2 "Forcing the Queue"
2095 .pp
2096 In some cases you may find that the queue has gotten clogged for some reason.
2097 You can force a queue run
2098 using the
2099 .b \-q
2100 flag (with no value).
2101 It is entertaining to use the
2102 .b \-v
2103 flag (verbose)
2104 when this is done to watch what happens:
2105 .(b
2106 /usr/\*(SD/sendmail \-q \-v
2107 .)b
2108 .pp
2109 You can also limit the jobs to those with a particular queue identifier,
2110 recipient, sender, quarantine reason, or queue group
2111 using one of the queue modifiers.
2112 For example,
2113 .q \-qRberkeley
2114 restricts the queue run to jobs that have the string
2115 .q berkeley
2116 somewhere in one of the recipient addresses.
2117 Similarly,
2118 .q \-qSstring
2119 limits the run to particular senders,
2120 .q \-qIstring
2121 limits it to particular queue identifiers, and
2122 .q \-qQstring
2123 limits it to particular quarantined reasons and only operated on
2124 quarantined queue items, and
2125 .q \-qGstring
2126 limits it to a particular queue group.
2127 The named queue group will be run even if it is set to have 0 runners.
2128 You may also place an
2129 .b !
2130 before the
2131 .b I
2132 or
2133 .b R
2134 or
2135 .b S
2136 or
2137 .b Q
2138 to indicate that jobs are limited to not including a particular queue
2139 identifier, recipient or sender.
2140 For example,
2141 .q \-q!Rseattle
2142 limits the queue run to jobs that do not have the string
2143 .q seattle
2144 somewhere in one of the recipient addresses.
2145 Should you need to terminate the queue jobs currently active then a SIGTERM
2146 to the parent of the process (or processes) will cleanly stop the jobs.
2147 .sh 2 "Debugging"
2148 .pp
2149 There are a fairly large number of debug flags
2150 built into
2151 .i sendmail .
2152 Each debug flag has a category and a level.
2153 Higher levels increase the level of debugging activity;
2154 in most cases, this means to print out more information.
2155 The convention is that levels greater than nine are
2156 .q absurd,
2157 i.e.,
2158 they print out so much information that you wouldn't normally
2159 want to see them except for debugging that particular piece of code.
2160 .pp
2161 You should
2162 .b never
2163 run a production sendmail server in debug mode.
2164 Many of the debug flags will result in debug output being sent over the
2165 SMTP channel unless the option
2166 .b \-D
2167 is used.
2168 This will confuse many mail programs.
2169 However, for testing purposes, it can be useful
2170 when sending mail manually via
2171 telnet to the port you are using while debugging.
2172 .pp
2173 A debug category is either an integer, like 42,
2174 or a name, like ANSI.
2175 You can specify a range of numeric debug categories
2176 using the syntax 17-42.
2177 You can specify a set of named debug categories using
2178 a glob pattern like
2179 .q sm_trace_* .
2180 At present, only
2181 .q *
2182 and
2183 .q ?
2184 are supported in these glob patterns.
2185 .pp
2186 Debug flags are set using the
2187 .b \-d
2188 option;
2189 the syntax is:
2190 .(b
2191 .ta \w'debug-categories:M 'u
2192 debug-flag:     \fB\-d\fP debug-list
2193 debug-list:     debug-option [ , debug-option ]*
2194 debug-option:   debug-categories [ . debug-level ]
2195 debug-categories:       integer | integer \- integer | category-pattern
2196 category-pattern:       [a-zA-Z_*?][a-zA-Z0-9_*?]*
2197 debug-level:    integer
2198 .)b
2199 where spaces are for reading ease only.
2200 For example,
2201 .(b
2202 \-d12   Set category 12 to level 1
2203 \-d12.3 Set category 12 to level 3
2204 \-d3\-17        Set categories 3 through 17 to level 1
2205 \-d3\-17.4      Set categories 3 through 17 to level 4
2206 \-dANSI Set category ANSI to level 1
2207 \-dsm_trace_*.3 Set all named categories matching sm_trace_* to level 3
2208 .)b
2209 For a complete list of the available debug flags
2210 you will have to look at the code
2211 and the
2212 .i TRACEFLAGS
2213 file in the sendmail distribution
2214 (they are too dynamic to keep this document up to date).
2215 For a list of named debug categories in the sendmail binary, use
2216 .(b
2217 ident /usr/sbin/sendmail | grep Debug
2218 .)b
2219 .sh 2 "Changing the Values of Options"
2220 .pp
2221 Options can be overridden using the
2222 .b \-o
2223 or
2224 .b \-O
2225 command line flags.
2226 For example,
2227 .(b
2228 /usr/\*(SD/sendmail \-oT2m
2229 .)b
2230 sets the
2231 .b T
2232 (timeout) option to two minutes
2233 for this run only;
2234 the equivalent line using the long option name is
2235 .(b
2236 /usr/\*(SD/sendmail -OTimeout.queuereturn=2m
2237 .)b
2238 .pp
2239 Some options have security implications.
2240 Sendmail allows you to set these,
2241 but relinquishes its set-user-ID or set-group-ID permissions thereafter\**.
2242 .(f
2243 \**That is, it sets its effective uid to the real uid;
2244 thus, if you are executing as root,
2245 as from root's crontab file or during system startup
2246 the root permissions will still be honored.
2247 .)f
2248 .sh 2 "Trying a Different Configuration File"
2249 .pp
2250 An alternative configuration file
2251 can be specified using the
2252 .b \-C
2253 flag; for example,
2254 .(b
2255 /usr/\*(SD/sendmail \-Ctest.cf \-oQ/tmp/mqueue
2256 .)b
2257 uses the configuration file
2258 .i test.cf
2259 instead of the default
2260 .i /etc/mail/sendmail.cf.
2261 If the
2262 .b \-C
2263 flag has no value
2264 it defaults to
2265 .i sendmail.cf
2266 in the current directory.
2267 .pp
2268 .i Sendmail
2269 gives up set-user-ID root permissions
2270 (if it has been installed set-user-ID root)
2271 when you use this flag, so it is common to use a publicly writable directory
2272 (such as /tmp)
2273 as the queue directory (QueueDirectory or Q option) while testing.
2274 .sh 2 "Logging Traffic"
2275 .pp
2276 Many SMTP implementations do not fully implement the protocol.
2277 For example, some personal computer based SMTPs
2278 do not understand continuation lines in reply codes.
2279 These can be very hard to trace.
2280 If you suspect such a problem, you can set traffic logging using the
2281 .b \-X
2282 flag.
2283 For example,
2284 .(b
2285 /usr/\*(SD/sendmail \-X /tmp/traffic \-bd
2286 .)b
2287 will log all traffic in the file
2288 .i /tmp/traffic .
2289 .pp
2290 This logs a lot of data very quickly and should
2291 .b NEVER
2292 be used
2293 during normal operations.
2294 After starting up such a daemon,
2295 force the errant implementation to send a message to your host.
2296 All message traffic in and out of
2297 .i sendmail ,
2298 including the incoming SMTP traffic,
2299 will be logged in this file.
2300 .sh 2 "Testing Configuration Files"
2301 .pp
2302 When you build a configuration table,
2303 you can do a certain amount of testing
2304 using the
2305 .q "test mode"
2306 of
2307 .i sendmail .
2308 For example,
2309 you could invoke
2310 .i sendmail
2311 as:
2312 .(b
2313 sendmail \-bt \-Ctest.cf
2314 .)b
2315 which would read the configuration file
2316 .q test.cf
2317 and enter test mode.
2318 In this mode,
2319 you enter lines of the form:
2320 .(b
2321 rwset address
2322 .)b
2323 where
2324 .i rwset
2325 is the rewriting set you want to use
2326 and
2327 .i address
2328 is an address to apply the set to.
2329 Test mode shows you the steps it takes
2330 as it proceeds,
2331 finally showing you the address it ends up with.
2332 You may use a comma separated list of rwsets
2333 for sequential application of rules to an input.
2334 For example:
2335 .(b
2336 3,1,21,4 monet:bollard
2337 .)b
2338 first applies ruleset three to the input
2339 .q monet:bollard.
2340 Ruleset one is then applied to the output of ruleset three,
2341 followed similarly by rulesets twenty-one and four.
2342 .pp
2343 If you need more detail,
2344 you can also use the
2345 .q \-d21
2346 flag to turn on more debugging.
2347 For example,
2348 .(b
2349 sendmail \-bt \-d21.99
2350 .)b
2351 turns on an incredible amount of information;
2352 a single word address
2353 is probably going to print out several pages worth of information.
2354 .pp
2355 You should be warned that internally,
2356 .i sendmail
2357 applies ruleset 3 to all addresses.
2358 In test mode
2359 you will have to do that manually.
2360 For example, older versions allowed you to use
2361 .(b
2362 0 bruce@broadcast.sony.com
2363 .)b
2364 This version requires that you use:
2365 .(b
2366 3,0 bruce@broadcast.sony.com
2367 .)b
2368 .pp
2369 As of version 8.7,
2370 some other syntaxes are available in test mode:
2371 .nr ii 1i
2372 .ip \&.D\|x\|value
2373 defines macro
2374 .i x
2375 to have the indicated
2376 .i value .
2377 This is useful when debugging rules that use the
2378 .b $& \c
2379 .i x
2380 syntax.
2381 .ip \&.C\|c\|value
2382 adds the indicated
2383 .i value
2384 to class
2385 .i c .
2386 .ip \&=S\|ruleset
2387 dumps the contents of the indicated ruleset.
2388 .ip \-d\|debug-spec
2389 is equivalent to the command-line flag.
2390 .lp
2391 Version 8.9 introduced more features:
2392 .nr ii 1i
2393 .ip ?
2394 shows a help message.
2395 .ip =M
2396 display the known mailers.
2397 .ip $m
2398 print the value of macro m.
2399 .ip $=c
2400 print the contents of class c.
2401 .ip /mx\ host
2402 returns the MX records for `host'.
2403 .ip /parse\ address
2404 parse address, returning the value of
2405 .i crackaddr ,
2406 and the parsed address.
2407 .ip /try\ mailer\ addr
2408 rewrite address into the form it will have when
2409 presented to the indicated mailer.
2410 .ip /tryflags\ flags
2411 set flags used by parsing.  The flags can be `H' for
2412 Header or `E' for Envelope, and `S' for Sender or `R'
2413 for Recipient.  These can be combined, `HR' sets
2414 flags for header recipients.
2415 .ip /canon\ hostname
2416 try to canonify hostname.
2417 .ip /map\ mapname\ key
2418 look up `key' in the indicated `mapname'.
2419 .ip /quit
2420 quit address test mode.
2421 .lp
2422 .sh 2 "Persistent Host Status Information"
2423 .pp
2424 When
2425 .b HostStatusDirectory
2426 is enabled,
2427 information about the status of hosts is maintained on disk
2428 and can thus be shared between different instantiations of
2429 .i sendmail .
2430 The status of the last connection with each remote host
2431 may be viewed with the command:
2432 .(b
2433 sendmail \-bh
2434 .)b
2435 This information may be flushed with the command:
2436 .(b
2437 sendmail \-bH
2438 .)b
2439 Flushing the information prevents new
2440 .i sendmail
2441 processes from loading it,
2442 but does not prevent existing processes from using the status information
2443 that they already have.
2444 .sh 1 "TUNING"
2445 .pp
2446 There are a number of configuration parameters
2447 you may want to change,
2448 depending on the requirements of your site.
2449 Most of these are set
2450 using an option in the configuration file.
2451 For example,
2452 the line
2453 .q "O Timeout.queuereturn=5d"
2454 sets option
2455 .q Timeout.queuereturn
2456 to the value
2457 .q 5d
2458 (five days).
2459 .pp
2460 Most of these options have appropriate defaults for most sites.
2461 However,
2462 sites having very high mail loads may find they need to tune them
2463 as appropriate for their mail load.
2464 In particular,
2465 sites experiencing a large number of small messages,
2466 many of which are delivered to many recipients,
2467 may find that they need to adjust the parameters
2468 dealing with queue priorities.
2469 .pp
2470 All versions of
2471 .i sendmail
2472 prior to 8.7
2473 had single character option names.
2474 As of 8.7,
2475 options have long (multi-character names).
2476 Although old short names are still accepted,
2477 most new options do not have short equivalents.
2478 .pp
2479 This section only describes the options you are most likely
2480 to want to tweak;
2481 read section
2482 .\"XREF
2483 5
2484 for more details.
2485 .sh 2 "Timeouts"
2486 .pp
2487 All time intervals are set
2488 using a scaled syntax.
2489 For example,
2490 .q 10m
2491 represents ten minutes, whereas
2492 .q 2h30m
2493 represents two and a half hours.
2494 The full set of scales is:
2495 .(b
2496 .ta 4n
2497 s       seconds
2498 m       minutes
2499 h       hours
2500 d       days
2501 w       weeks
2502 .)b
2503 .sh 3 "Queue interval"
2504 .pp
2505 The argument to the
2506 .b \-q
2507 flag specifies how often a sub-daemon will run the queue.
2508 This is typically set to between fifteen minutes and one hour.
2509 If not set, or set to zero,
2510 the queue will not be run automatically.
2511 RFC 1123 section 5.3.1.1 recommends that this be at least 30 minutes.
2512 Should you need to terminate the queue jobs currently active then a SIGTERM
2513 to the parent of the process (or processes) will cleanly stop the jobs.
2514 .sh 3 "Read timeouts"
2515 .pp
2516 Timeouts all have option names
2517 .q Timeout.\fIsuboption\fP .
2518 Most of these control SMTP operations.
2519 The recognized
2520 .i suboption s,
2521 their default values, and the minimum values
2522 allowed by RFC 2821 section 4.5.3.2 (or RFC 1123 section 5.3.2) are:
2523 .nr ii 1i
2524 .ip connect
2525 The time to wait for an SMTP connection to open
2526 (the
2527 .i connect (2)
2528 system call)
2529 [0, unspecified].
2530 If zero, uses the kernel default.
2531 In no case can this option extend the timeout
2532 longer than the kernel provides, but it can shorten it.
2533 This is to get around kernels that provide an absurdly long connection timeout
2534 (90 minutes in one case).
2535 .ip iconnect
2536 The same as
2537 .i connect,
2538 except it applies only to the initial attempt to connect to a host
2539 for a given message
2540 [0, unspecified].
2541 The concept is that this should be very short (a few seconds);
2542 hosts that are well connected and responsive will thus be serviced immediately.
2543 Hosts that are slow will not hold up other deliveries in the initial
2544 delivery attempt.
2545 .ip aconnect
2546 [0, unspecified]
2547 The overall timeout waiting for all connection for a single delivery
2548 attempt to succeed.
2549 If 0, no overall limit is applied.
2550 This can be used to restrict the total amount of time trying to connect to
2551 a long list of host that could accept an e-mail for the recipient.
2552 This timeout does not apply to
2553 .b FallbackMXhost ,
2554 i.e., if the time is exhausted, the
2555 .b FallbackMXhost
2556 is tried next.
2557 .ip initial
2558 The wait for the initial 220 greeting message
2559 [5m, 5m].
2560 .ip helo
2561 The wait for a reply from a HELO or EHLO command
2562 [5m, unspecified].
2563 This may require a host name lookup, so
2564 five minutes is probably a reasonable minimum.
2565 .ip mail\(dg
2566 The wait for a reply from a MAIL command
2567 [10m, 5m].
2568 .ip rcpt\(dg
2569 The wait for a reply from a RCPT command
2570 [1h, 5m].
2571 This should be long
2572 because it could be pointing at a list
2573 that takes a long time to expand
2574 (see below).
2575 .ip datainit\(dg
2576 The wait for a reply from a DATA command
2577 [5m, 2m].
2578 .ip datablock\(dg\(dd
2579 The wait for reading a data block
2580 (that is, the body of the message).
2581 [1h, 3m].
2582 This should be long because it also applies to programs
2583 piping input to
2584 .i sendmail
2585 which have no guarantee of promptness.
2586 .ip datafinal\(dg
2587 The wait for a reply from the dot terminating a message.
2588 [1h, 10m].
2589 If this is shorter than the time actually needed
2590 for the receiver to deliver the message,
2591 duplicates will be generated.
2592 This is discussed in RFC 1047.
2593 .ip rset
2594 The wait for a reply from a RSET command
2595 [5m, unspecified].
2596 .ip quit
2597 The wait for a reply from a QUIT command
2598 [2m, unspecified].
2599 .ip misc
2600 The wait for a reply from miscellaneous (but short) commands
2601 such as NOOP (no-operation) and VERB (go into verbose mode).
2602 [2m, unspecified].
2603 .ip command\(dg\(dd
2604 In server SMTP,
2605 the time to wait for another command.
2606 [1h, 5m].
2607 .ip ident\(dd
2608 The timeout waiting for a reply to an IDENT query
2609 [5s\**, unspecified].
2610 .(f
2611 \**On some systems the default is zero to turn the protocol off entirely.
2612 .)f
2613 .ip lhlo
2614 The wait for a reply to an LMTP LHLO command
2615 [2m, unspecified].
2616 .ip auth
2617 The timeout for a reply in an SMTP AUTH dialogue
2618 [10m, unspecified].
2619 .ip starttls
2620 The timeout for a reply to an SMTP STARTTLS command and the TLS handshake
2621 [1h, unspecified].
2622 .ip fileopen\(dd
2623 The timeout for opening .forward and :include: files [60s, none].
2624 .ip control\(dd
2625 The timeout for a complete control socket transaction to complete [2m, none].
2626 .ip hoststatus\(dd
2627 How long status information about a host
2628 (e.g., host down)
2629 will be cached before it is considered stale
2630 [30m, unspecified].
2631 .ip resolver.retrans\(dd
2632 The resolver's
2633 retransmission time interval
2634 (in seconds)
2635 [varies].
2636 Sets both
2637 .i Timeout.resolver.retrans.first
2638 and
2639 .i Timeout.resolver.retrans.normal .
2640 .ip resolver.retrans.first\(dd
2641 The resolver's
2642 retransmission time interval
2643 (in seconds)
2644 for the first attempt to
2645 deliver a message
2646 [varies].
2647 .ip resolver.retrans.normal\(dd
2648 The resolver's
2649 retransmission time interval
2650 (in seconds)
2651 for all resolver lookups
2652 except the first delivery attempt
2653 [varies].
2654 .ip resolver.retry\(dd
2655 The number of times
2656 to retransmit a resolver query.
2657 Sets both
2658 .i Timeout.resolver.retry.first
2659 and
2660 .i Timeout.resolver.retry.normal
2661 [varies].
2662 .ip resolver.retry.first\(dd
2663 The number of times
2664 to retransmit a resolver query
2665 for the first attempt
2666 to deliver a message
2667 [varies].
2668 .ip resolver.retry.normal\(dd
2669 The number of times
2670 to retransmit a resolver query
2671 for all resolver lookups
2672  except the first delivery attempt
2673 [varies].
2674 .lp
2675 For compatibility with old configuration files,
2676 if no
2677 .i suboption
2678 is specified,
2679 all the timeouts marked with
2680 .DG
2681 (\(dg) are set to the indicated value.
2682 All but those marked with
2683 .DD
2684 (\(dd) apply to client SMTP.
2685 .pp
2686 For example, the lines:
2687 .(b
2688 O Timeout.command=25m
2689 O Timeout.datablock=3h
2690 .)b
2691 sets the server SMTP command timeout to 25 minutes
2692 and the input data block timeout to three hours.
2693 .sh 3 "Message timeouts"
2694 .pp
2695 After sitting in the queue for a few days,
2696 an undeliverable message will time out.
2697 This is to insure that at least the sender is aware
2698 of the inability to send a message.
2699 The timeout is typically set to five days.
2700 It is sometimes considered convenient to also send a warning message
2701 if the message is in the queue longer than a few hours
2702 (assuming you normally have good connectivity;
2703 if your messages normally took several hours to send
2704 you wouldn't want to do this because it wouldn't be an unusual event).
2705 These timeouts are set using the
2706 .b Timeout.queuereturn
2707 and
2708 .b Timeout.queuewarn
2709 options in the configuration file
2710 (previously both were set using the
2711 .b T
2712 option).
2713 .pp
2714 If the message is submitted using the
2715 .sm NOTIFY
2716 .sm SMTP
2717 extension,
2718 warning messages will only be sent if
2719 .sm NOTIFY=DELAY
2720 is specified.
2721 The queuereturn and queuewarn timeouts
2722 can be further qualified with a tag based on the Precedence: field
2723 in the message;
2724 they must be one of
2725 .q urgent
2726 (indicating a positive non-zero precedence),
2727 .q normal
2728 (indicating a zero precedence), or
2729 .q non-urgent
2730 (indicating negative precedences).
2731 For example, setting
2732 .q Timeout.queuewarn.urgent=1h
2733 sets the warning timeout for urgent messages only
2734 to one hour.
2735 The default if no precedence is indicated
2736 is to set the timeout for all precedences.
2737 If the message has a normal (default) precedence
2738 and it is a delivery status notification (DSN),
2739 .b Timeout.queuereturn.dsn
2740 and
2741 .b Timeout.queuewarn.dsn
2742 can be used to give an alternative warn and return time
2743 for DSNs.
2744 The value "now" can be used for
2745 -O Timeout.queuereturn
2746 to return entries immediately during a queue run,
2747 e.g., to bounce messages independent of their time in the queue.
2748 .pp
2749 Since these options are global,
2750 and since you cannot know
2751 .i "a priori"
2752 how long another host outside your domain will be down,
2753 a five day timeout is recommended.
2754 This allows a recipient to fix the problem even if it occurs
2755 at the beginning of a long weekend.
2756 RFC 1123 section 5.3.1.1 says that this parameter
2757 should be ``at least 4\-5 days''.
2758 .pp
2759 The
2760 .b Timeout.queuewarn
2761 value can be piggybacked on the
2762 .b T
2763 option by indicating a time after which
2764 a warning message should be sent;
2765 the two timeouts are separated by a slash.
2766 For example, the line
2767 .(b
2768 OT5d/4h
2769 .)b
2770 causes email to fail after five days,
2771 but a warning message will be sent after four hours.
2772 This should be large enough that the message will have been tried
2773 several times.
2774 .sh 2 "Forking During Queue Runs"
2775 .pp
2776 By setting the
2777 .b ForkEachJob
2778 (\c
2779 .b Y )
2780 option,
2781 .i sendmail
2782 will fork before each individual message
2783 while running the queue.
2784 This option was used with earlier releases to prevent
2785 .i sendmail
2786 from consuming large amounts of memory.
2787 It should no longer be necessary with
2788 .i sendmail
2789 8.12.
2790 If the
2791 .b ForkEachJob
2792 option is not set,
2793 .i sendmail
2794 will keep track of hosts that are down during a queue run,
2795 which can improve performance dramatically.
2796 .pp
2797 If the
2798 .b ForkEachJob
2799 option is set,
2800 .i sendmail
2801 cannot use connection caching.
2802 .sh 2 "Queue Priorities"
2803 .pp
2804 Every message is assigned a priority when it is first instantiated,
2805 consisting of the message size (in bytes)
2806 offset by the message class
2807 (which is determined from the Precedence: header)
2808 times the
2809 .q "work class factor"
2810 and the number of recipients times the
2811 .q "work recipient factor."
2812 The priority is used to order the queue.
2813 Higher numbers for the priority mean that the message will be processed later
2814 when running the queue.
2815 .pp
2816 The message size is included so that large messages are penalized
2817 relative to small messages.
2818 The message class allows users to send
2819 .q "high priority"
2820 messages by including a
2821 .q Precedence:
2822 field in their message;
2823 the value of this field is looked up in the
2824 .b P
2825 lines of the configuration file.
2826 Since the number of recipients affects the amount of load a message presents
2827 to the system,
2828 this is also included into the priority.
2829 .pp
2830 The recipient and class factors
2831 can be set in the configuration file using the
2832 .b RecipientFactor
2833 (\c
2834 .b y )
2835 and
2836 .b ClassFactor
2837 (\c
2838 .b z )
2839 options respectively.
2840 They default to 30000 (for the recipient factor)
2841 and 1800
2842 (for the class factor).
2843 The initial priority is:
2844 .EQ
2845 pri = msgsize - (class times bold ClassFactor) + (nrcpt times bold RecipientFactor)
2846 .EN
2847 (Remember, higher values for this parameter actually mean
2848 that the job will be treated with lower priority.)
2849 .pp
2850 The priority of a job can also be adjusted each time it is processed
2851 (that is, each time an attempt is made to deliver it)
2852 using the
2853 .q "work time factor,"
2854 set by the
2855 .b RetryFactor
2856 (\c
2857 .b Z )
2858 option.
2859 This is added to the priority,
2860 so it normally decreases the precedence of the job,
2861 on the grounds that jobs that have failed many times
2862 will tend to fail again in the future.
2863 The
2864 .b RetryFactor
2865 option defaults to 90000.
2866 .sh 2 "Load Limiting"
2867 .pp
2868 .i Sendmail
2869 can be asked to queue (but not deliver) mail
2870 if the system load average gets too high using the
2871 .b QueueLA
2872 (\c
2873 .b x )
2874 option.
2875 When the load average exceeds the value of the
2876 .b QueueLA
2877 option, the delivery mode is set to
2878 .b q
2879 (queue only) if the
2880 .b QueueFactor
2881 (\c
2882 .b q )
2883 option divided by the difference in the current load average and the
2884 .b QueueLA
2885 option plus one
2886 is less than the priority of the message \(em
2887 that is, the message is queued iff:
2888 .EQ
2889 pri > { bold QueueFactor } over { LA - { bold QueueLA } + 1 }
2890 .EN
2891 The
2892 .b QueueFactor
2893 option defaults to 600000,
2894 so each point of load average is worth 600000 priority points
2895 (as described above).
2896 .pp
2897 For drastic cases, the
2898 .b RefuseLA
2899 (\c
2900 .b X )
2901 option defines a load average at which
2902 .i sendmail
2903 will refuse to accept network connections.
2904 Locally generated mail, i.e., mail which is not submitted via SMTP
2905 (including incoming UUCP mail),
2906 is still accepted.
2907 Notice that the MSP submits mail to the MTA via SMTP, and hence
2908 mail will be queued in the client queue in such a case.
2909 Therefore it is necessary to run the client mail queue periodically.
2910 .sh 2 "Resource Limits"
2911 .pp
2912 .i Sendmail
2913 has several parameters to control resource usage.
2914 Besides those mentioned in the previous section, there are at least
2915 .b MaxDaemonChildren ,
2916 .b ConnectionRateThrottle ,
2917 .b MaxQueueChildren ,
2918 and
2919 .b MaxRunnersPerQueue .
2920 The latter two limit the number of
2921 .i sendmail
2922 processes that operate on the queue.
2923 These are discussed in the section
2924 ``Queue Group Declaration''.
2925 The former two can be used to limit the number of incoming connections.
2926 Their appropriate values depend on the host operating system and
2927 the hardware, e.g., amount of memory.
2928 In many situations it might be useful to set limits to prevent
2929 to have too many
2930 .i sendmail
2931 processes, however, these limits can be abused to mount a
2932 denial of service attack.
2933 For example, if
2934 .b MaxDaemonChildren=10
2935 then an attacker needs to open only 10 SMTP sessions to the server,
2936 leave them idle for most of the time,
2937 and no more connections will be accepted.
2938 If this option is set then the timeouts used in a SMTP session
2939 should be lowered from their default values to
2940 their minimum values as specified in RFC 2821 and listed in
2941 section
2942 .\"XREF
2943 4.1.2.
2944 .sh 2 "Measures against Denial of Service Attacks"
2945 .pp
2946 .i Sendmail
2947 has some built-in measures against simple denial of service (DoS) attacks.
2948 The SMTP server by default slows down if too many bad commands are
2949 issued or if some commands are repeated too often within a session.
2950 Details can be found in the source file
2951 .b sendmail/srvrsmtp.c
2952 by looking for the macro definitions of
2953 .b MAXBADCOMMANDS ,
2954 .b MAXNOOPCOMMANDS ,
2955 .b MAXHELOCOMMANDS ,
2956 .b MAXVRFYCOMMANDS ,
2957 and
2958 .b MAXETRNCOMMANDS .
2959 If an SMTP command is issued more often than the corresponding
2960 .b MAXcmdCOMMANDS
2961 value, then the response is delayed exponentially,
2962 starting with a sleep time of one second,
2963 up to a maximum of four minutes (as defined by
2964 .b MAXTIMEOUT ).
2965 If the option
2966 .b MaxDaemonChildren
2967 is set to a value greater than zero,
2968 then this could make a DoS attack even worse since it
2969 keeps a connection open longer than necessary.
2970 Therefore a connection is terminated with a 421 SMTP reply code
2971 if the number of commands exceeds the limit by a factor of two and
2972 .b MAXBADCOMMANDS
2973 is set to a value greater than zero (the default is 25).
2974 .sh 2 "Delivery Mode"
2975 .pp
2976 There are a number of delivery modes that
2977 .i sendmail
2978 can operate in,
2979 set by the
2980 .b DeliveryMode
2981 (\c
2982 .b d )
2983 configuration option.
2984 These modes
2985 specify how quickly mail will be delivered.
2986 Legal modes are:
2987 .(b
2988 .ta 4n
2989 i       deliver interactively (synchronously)
2990 b       deliver in background (asynchronously)
2991 q       queue only (don't deliver)
2992 d       defer delivery attempts (don't deliver)
2993 .)b
2994 There are tradeoffs.
2995 Mode
2996 .q i
2997 gives the sender the quickest feedback,
2998 but may slow down some mailers and
2999 is hardly ever necessary.
3000 Mode
3001 .q b
3002 delivers promptly but
3003 can cause large numbers of processes
3004 if you have a mailer that takes a long time to deliver a message.
3005 Mode
3006 .q q
3007 minimizes the load on your machine,
3008 but means that delivery may be delayed for up to the queue interval.
3009 Mode
3010 .q d
3011 is identical to mode
3012 .q q
3013 except that it also prevents lookups in maps including the
3014 .b -D
3015 flag from working during the initial queue phase;
3016 it is intended for ``dial on demand'' sites where DNS lookups
3017 might cost real money.
3018 Some simple error messages
3019 (e.g., host unknown during the SMTP protocol)
3020 will be delayed using this mode.
3021 Mode
3022 .q b
3023 is the usual default.
3024 .pp
3025 If you run in mode
3026 .q q
3027 (queue only),
3028 .q d
3029 (defer),
3030 or
3031 .q b
3032 (deliver in background)
3033 .i sendmail
3034 will not expand aliases and follow .forward files
3035 upon initial receipt of the mail.
3036 This speeds up the response to RCPT commands.
3037 Mode
3038 .q i
3039 should not be used by the SMTP server.
3040 .sh 2 "Log Level"
3041 .pp
3042 The level of logging can be set for
3043 .i sendmail .
3044 The default using a standard configuration is level 9.
3045 The levels are approximately as follows
3046 (some log types are using different level depending on various factors):
3047 .nr ii 0.5i
3048 .ip 0
3049 Minimal logging.
3050 .ip 1
3051 Serious system failures and potential security problems.
3052 .ip 2
3053 Lost communications (network problems) and protocol failures.
3054 .ip 3
3055 Other serious failures, malformed addresses, transient forward/include
3056 errors, connection timeouts.
3057 .ip 4
3058 Minor failures, out of date alias databases, connection rejections
3059 via check_ rulesets.
3060 .ip 5
3061 Message collection statistics.
3062 .ip 6
3063 Creation of error messages,
3064 VRFY and EXPN commands.
3065 .ip 7
3066 Delivery failures (host or user unknown, etc.).
3067 .ip 8
3068 Successful deliveries and alias database rebuilds.
3069 .ip 9
3070 Messages being deferred
3071 (due to a host being down, etc.).
3072 .ip 10
3073 Database expansion (alias, forward, and userdb lookups)
3074 and authentication information.
3075 .ip 11
3076 NIS errors and end of job processing.
3077 .ip 12
3078 Logs all SMTP connections.
3079 .ip 13
3080 Log bad user shells, files with improper permissions, and other
3081 questionable situations.
3082 .ip 14
3083 Logs refused connections.
3084 .ip 15
3085 Log all incoming SMTP commands.
3086 .ip 20
3087 Logs attempts to run locked queue files.
3088 These are not errors,
3089 but can be useful to note if your queue appears to be clogged.
3090 .ip 30
3091 Lost locks (only if using lockf instead of flock).
3092 .lp
3093 Additionally,
3094 values above 64 are reserved for extremely verbose debugging output.
3095 No normal site would ever set these.
3096 .sh 2 "File Modes"
3097 .pp
3098 The modes used for files depend on what functionality you want
3099 and the level of security you require.
3100 In many cases
3101 .i sendmail
3102 does careful checking of the modes
3103 of files and directories
3104 to avoid accidental compromise;
3105 if you want to make it possible to have group-writable support files
3106 you may need to use the
3107 .b DontBlameSendmail
3108 option to turn off some of these checks.
3109 .sh 3 "To suid or not to suid?"
3110 .pp
3111 .i Sendmail
3112 is no longer installed
3113 set-user-ID to root.
3114 sendmail/SECURITY
3115 explains how to configure and install
3116 .i sendmail
3117 without set-user-ID to root but set-group-ID
3118 which is the default configuration starting with 8.12.
3119 .pp
3120 The daemon usually runs as root, unless other measures are taken.
3121 At the point where
3122 .i sendmail
3123 is about to
3124 .i exec \|(2)
3125 a mailer,
3126 it checks to see if the userid is zero (root);
3127 if so,
3128 it resets the userid and groupid to a default
3129 (set by the
3130 .b U=
3131 equate in the mailer line;
3132 if that is not set, the
3133 .b DefaultUser
3134 option is used).
3135 This can be overridden
3136 by setting the
3137 .b S
3138 flag to the mailer
3139 for mailers that are trusted
3140 and must be called as root.
3141 However,
3142 this will cause mail processing
3143 to be accounted
3144 (using
3145 .i sa \|(8))
3146 to root
3147 rather than to the user sending the mail.
3148 .pp
3149 A middle ground is to set the
3150 .b RunAsUser
3151 option.
3152 This causes
3153 .i sendmail
3154 to become the indicated user as soon as it has done the startup
3155 that requires root privileges
3156 (primarily, opening the
3157 .sm SMTP
3158 socket).
3159 If you use
3160 .b RunAsUser ,
3161 the queue directory
3162 (normally
3163 .i /var/spool/mqueue )
3164 should be owned by that user,
3165 and all files and databases
3166 (including user
3167 .i \&.forward
3168 files,
3169 alias files,
3170 :include: files,
3171 and external databases)
3172 must be readable by that user.
3173 Also, since sendmail will not be able to change its uid,
3174 delivery to programs or files will be marked as unsafe,
3175 e.g., undeliverable,
3176 in
3177 .i \&.forward ,
3178 aliases,
3179 and :include: files.
3180 Administrators can override this by setting the
3181 .b DontBlameSendmail
3182 option to the setting
3183 .b NonRootSafeAddr .
3184 .b RunAsUser
3185 is probably best suited for firewall configurations
3186 that don't have regular user logins.
3187 If the option is used on a system which performs local delivery,
3188 then the local delivery agent must have the proper permissions
3189 (i.e., usually set-user-ID root)
3190 since it will be invoked by the
3191 .b RunAsUser ,
3192 not by root.
3193 .sh 3 "Turning off security checks"
3194 .pp
3195 .i Sendmail
3196 is very particular about the modes of files that it reads or writes.
3197 For example, by default it will refuse to read most files
3198 that are group writable
3199 on the grounds that they might have been tampered with
3200 by someone other than the owner;
3201 it will even refuse to read files in group writable directories.
3202 Also, sendmail will refuse to create a new aliases database in an
3203 unsafe directory.  You can get around this by manually creating the
3204 database file as a trusted user ahead of time and then rebuilding the
3205 aliases database with
3206 .b newaliases .
3207 .pp
3208 If you are
3209 .i quite
3210 sure that your configuration is safe and you want
3211 .i sendmail
3212 to avoid these security checks,
3213 you can turn off certain checks using the
3214 .b DontBlameSendmail
3215 option.
3216 This option takes one or more names that disable checks.
3217 In the descriptions that follow,
3218 .q "unsafe directory"
3219 means a directory that is writable by anyone other than the owner.
3220 The values are:
3221 .nr ii 0.5i
3222 .ip Safe
3223 No special handling.
3224 .ip AssumeSafeChown
3225 Assume that the
3226 .i chown
3227 system call is restricted to root.
3228 Since some versions of UNIX permit regular users
3229 to give away their files to other users on some filesystems,
3230 .i sendmail
3231 often cannot assume that a given file was created by the owner,
3232 particularly when it is in a writable directory.
3233 You can set this flag if you know that file giveaway is restricted
3234 on your system.
3235 .ip ClassFileInUnsafeDirPath
3236 When reading class files (using the
3237 .b F
3238 line in the configuration file),
3239 allow files that are in unsafe directories.
3240 .ip DontWarnForwardFileInUnsafeDirPath
3241 Prevent logging of
3242 unsafe directory path warnings
3243 for non-existent forward files.
3244 .ip ErrorHeaderInUnsafeDirPath
3245 Allow the file named in the
3246 .b ErrorHeader
3247 option to be in an unsafe directory.
3248 .ip FileDeliveryToHardLink
3249 Allow delivery to files that are hard links.
3250 .ip FileDeliveryToSymLink
3251 Allow delivery to files that are symbolic links.
3252 .ip ForwardFileInGroupWritableDirPath
3253 Allow
3254 .i \&.forward
3255 files in group writable directories.
3256 .ip ForwardFileInUnsafeDirPath
3257 Allow
3258 .i \&.forward
3259 files in unsafe directories.
3260 .ip ForwardFileInUnsafeDirPathSafe
3261 Allow a
3262 .i \&.forward
3263 file that is in an unsafe directory to include references
3264 to program and files.
3265 .ip GroupReadableKeyFile
3266 Accept a group-readable key file for STARTTLS.
3267 .ip GroupReadableSASLDBFile
3268 Accept a group-readable Cyrus SASL password file.
3269 .ip GroupReadableDefaultAuthInfoFile
3270 Accept a group-readable DefaultAuthInfo file for SASL.
3271 .ip GroupWritableAliasFile
3272 Allow group-writable alias files.
3273 .ip GroupWritableDirPathSafe
3274 Change the definition of
3275 .q "unsafe directory"
3276 to consider group-writable directories to be safe.
3277 World-writable directories are always unsafe.
3278 .ip GroupWritableForwardFile
3279 Allow group writable
3280 .i \&.forward
3281 files.
3282 .ip GroupWritableForwardFileSafe
3283 Accept group-writable
3284 .i \&.forward
3285 files as safe for program and file delivery.
3286 .ip GroupWritableIncludeFile
3287 Allow group writable
3288 .i :include:
3289 files.
3290 .ip GroupWritableIncludeFileSafe
3291 Accept group-writable
3292 .i :include:
3293 files as safe for program and file delivery.
3294 .ip GroupWritableSASLDBFile
3295 Accept a group-writable Cyrus SASL password file.
3296 .ip HelpFileInUnsafeDirPath
3297 Allow the file named in the
3298 .b HelpFile
3299 option to be in an unsafe directory.
3300 .ip IncludeFileInGroupWritableDirPath
3301 Allow
3302 .i :include:
3303 files in group writable directories.
3304 .ip IncludeFileInUnsafeDirPath
3305 Allow
3306 .i :include:
3307 files in unsafe directories.
3308 .ip IncludeFileInUnsafeDirPathSafe
3309 Allow a
3310 .i :include:
3311 file that is in an unsafe directory to include references
3312 to program and files.
3313 .ip InsufficientEntropy
3314 Try to use STARTTLS even if the PRNG for OpenSSL is not properly seeded
3315 despite the security problems.
3316 .ip LinkedAliasFileInWritableDir
3317 Allow an alias file that is a link in a writable directory.
3318 .ip LinkedClassFileInWritableDir
3319 Allow class files that are links in writable directories.
3320 .ip LinkedForwardFileInWritableDir
3321 Allow
3322 .i \&.forward
3323 files that are links in writable directories.
3324 .ip LinkedIncludeFileInWritableDir
3325 Allow
3326 .i :include:
3327 files that are links in writable directories.
3328 .ip LinkedMapInWritableDir
3329 Allow map files that are links in writable directories.
3330 This includes alias database files.
3331 .ip LinkedServiceSwitchFileInWritableDir
3332 Allow the service switch file to be a link
3333 even if the directory is writable.
3334 .ip MapInUnsafeDirPath
3335 Allow maps (e.g.,
3336 .i hash ,
3337 .i btree ,
3338 and
3339 .i dbm
3340 files)
3341 in unsafe directories.
3342 This includes alias database files.
3343 .ip NonRootSafeAddr
3344 Do not mark file and program deliveries as unsafe
3345 if sendmail is not running with root privileges.
3346 .ip RunProgramInUnsafeDirPath
3347 Run programs that are in writable directories without logging a warning.
3348 .ip RunWritableProgram
3349 Run programs that are group- or world-writable without logging a warning.
3350 .ip TrustStickyBit
3351 Allow group or world writable directories
3352 if the sticky bit is set on the directory.
3353 Do not set this on systems which do not honor
3354 the sticky bit on directories.
3355 .ip WorldWritableAliasFile
3356 Accept world-writable alias files.
3357 .ip WorldWritableForwardfile
3358 Allow world writable
3359 .i \&.forward
3360 files.
3361 .ip WorldWritableIncludefile
3362 Allow world writable
3363 .i :include:
3364 files.
3365 .ip WriteMapToHardLink
3366 Allow writes to maps that are hard links.
3367 .ip WriteMapToSymLink
3368 Allow writes to maps that are symbolic links.
3369 .ip WriteStatsToHardLink
3370 Allow the status file to be a hard link.
3371 .ip WriteStatsToSymLink
3372 Allow the status file to be a symbolic link.
3373 .sh 2 "Connection Caching"
3374 .pp
3375 When processing the queue,
3376 .i sendmail
3377 will try to keep the last few open connections open
3378 to avoid startup and shutdown costs.
3379 This only applies to IPC and LPC connections.
3380 .pp
3381 When trying to open a connection
3382 the cache is first searched.
3383 If an open connection is found, it is probed to see if it is still active
3384 by sending a
3385 .sm RSET
3386 command.
3387 It is not an error if this fails;
3388 instead, the connection is closed and reopened.
3389 .pp
3390 Two parameters control the connection cache.
3391 The
3392 .b ConnectionCacheSize
3393 (\c
3394 .b k )
3395 option defines the number of simultaneous open connections
3396 that will be permitted.
3397 If it is set to zero,
3398 connections will be closed as quickly as possible.
3399 The default is one.
3400 This should be set as appropriate for your system size;
3401 it will limit the amount of system resources that
3402 .i sendmail
3403 will use during queue runs.
3404 Never set this higher than 4.
3405 .pp
3406 The
3407 .b ConnectionCacheTimeout
3408 (\c
3409 .b K )
3410 option specifies the maximum time that any cached connection
3411 will be permitted to idle.
3412 When the idle time exceeds this value
3413 the connection is closed.
3414 This number should be small
3415 (under ten minutes)
3416 to prevent you from grabbing too many resources
3417 from other hosts.
3418 The default is five minutes.
3419 .sh 2 "Name Server Access"
3420 .pp
3421 Control of host address lookups is set by the
3422 .b hosts
3423 service entry in your service switch file.
3424 If you are on a system that has built-in service switch support
3425 (e.g., Ultrix, Solaris, or DEC OSF/1)
3426 then your system is probably configured properly already.
3427 Otherwise,
3428 .i sendmail
3429 will consult the file
3430 .b /etc/mail/service.switch ,
3431 which should be created.
3432 .i Sendmail
3433 only uses two entries:
3434 .b hosts
3435 and
3436 .b aliases ,
3437 although system routines may use other services
3438 (notably the
3439 .b passwd
3440 service for user name lookups by
3441 .i getpwname ).
3442 .pp
3443 However, some systems (such as SunOS 4.X)
3444 will do DNS lookups
3445 regardless of the setting of the service switch entry.
3446 In particular, the system routine
3447 .i gethostbyname (3)
3448 is used to look up host names,
3449 and many vendor versions try some combination of DNS, NIS,
3450 and file lookup in /etc/hosts
3451 without consulting a service switch.
3452 .i Sendmail
3453 makes no attempt to work around this problem,
3454 and the DNS lookup will be done anyway.
3455 If you do not have a nameserver configured at all,
3456 such as at a UUCP-only site,
3457 .i sendmail
3458 will get a
3459 .q "connection refused"
3460 message when it tries to connect to the name server.
3461 If the
3462 .b hosts
3463 switch entry has the service
3464 .q dns
3465 listed somewhere in the list,
3466 .i sendmail
3467 will interpret this to mean a temporary failure
3468 and will queue the mail for later processing;
3469 otherwise, it ignores the name server data.
3470 .pp
3471 The same technique is used to decide whether to do MX lookups.
3472 If you want MX support, you
3473 .i must
3474 have
3475 .q dns
3476 listed as a service in the
3477 .b hosts
3478 switch entry.
3479 .pp
3480 The
3481 .b ResolverOptions
3482 (\c
3483 .b I )
3484 option allows you to tweak name server options.
3485 The command line takes a series of flags as documented in
3486 .i resolver (3)
3487 (with the leading
3488 .q RES_
3489 deleted).
3490 Each can be preceded by an optional `+' or `\(mi'.
3491 For example, the line
3492 .(b
3493 O ResolverOptions=+AAONLY \(miDNSRCH
3494 .)b
3495 turns on the AAONLY (accept authoritative answers only)
3496 and turns off the DNSRCH (search the domain path) options.
3497 Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE
3498 flags on and all others off.
3499 If NETINET6 is enabled, most libraries default to USE_INET6 as well.
3500 You can also include
3501 .q HasWildcardMX
3502 to specify that there is a wildcard MX record matching your domain;
3503 this turns off MX matching when canonifying names,
3504 which can lead to inappropriate canonifications.
3505 Use
3506 .q WorkAroundBrokenAAAA
3507 when faced with a broken nameserver that returns SERVFAIL
3508 (a temporary failure)
3509 on T_AAAA (IPv6) lookups
3510 during hostname canonification.
3511 Notice: it might be necessary to apply the same (or similar) options to
3512 .i submit.cf
3513 too.
3514 .pp
3515 Version level 1 configurations (see the section about
3516 ``Configuration Version Level'')
3517 turn DNSRCH and DEFNAMES off when doing delivery lookups,
3518 but leave them on everywhere else.
3519 Version 8 of
3520 .i sendmail
3521 ignores them when doing canonification lookups
3522 (that is, when using $[ ... $]),
3523 and always does the search.
3524 If you don't want to do automatic name extension,
3525 don't call $[ ... $].
3526 .pp
3527 The search rules for $[ ... $] are somewhat different than usual.
3528 If the name being looked up
3529 has at least one dot, it always tries the unmodified name first.
3530 If that fails, it tries the reduced search path,
3531 and lastly tries the unmodified name
3532 (but only for names without a dot,
3533 since names with a dot have already been tried).
3534 This allows names such as
3535 ``utc.CS''
3536 to match the site in Czechoslovakia
3537 rather than the site in your local Computer Science department.
3538 It also prefers A and CNAME records over MX records \*-
3539 that is, if it finds an MX record it makes note of it,
3540 but keeps looking.
3541 This way, if you have a wildcard MX record matching your domain,
3542 it will not assume that all names match.
3543 .pp
3544 To completely turn off all name server access
3545 on systems without service switch support
3546 (such as SunOS 4.X)
3547 you will have to recompile with
3548 \-DNAMED_BIND=0
3549 and remove \-lresolv from the list of libraries to be searched
3550 when linking.
3551 .sh 2 "Moving the Per-User Forward Files"
3552 .pp
3553 Some sites mount each user's home directory
3554 from a local disk on their workstation,
3555 so that local access is fast.
3556 However, the result is that .forward file lookups
3557 from a central mail server are slow.
3558 In some cases,
3559 mail can even be delivered on machines inappropriately
3560 because of a file server being down.
3561 The performance can be especially bad if you run the automounter.
3562 .pp
3563 The
3564 .b ForwardPath
3565 (\c
3566 .b J )
3567 option allows you to set a path of forward files.
3568 For example, the config file line
3569 .(b
3570 O ForwardPath=/var/forward/$u:$z/.forward.$w
3571 .)b
3572 would first look for a file with the same name as the user's login
3573 in /var/forward;
3574 if that is not found (or is inaccessible)
3575 the file
3576 ``.forward.\c
3577 .i machinename ''
3578 in the user's home directory is searched.
3579 A truly perverse site could also search by sender
3580 by using $r, $s, or $f.
3581 .pp
3582 If you create a directory such as /var/forward,
3583 it should be mode 1777
3584 (that is, the sticky bit should be set).
3585 Users should create the files mode 0644.
3586 Note that you must use the
3587 ForwardFileInUnsafeDirPath and
3588 ForwardFileInUnsafeDirPathSafe
3589 flags with the
3590 .b DontBlameSendmail
3591 option to allow forward files in a world writable directory.
3592 This might also be used as a denial of service attack
3593 (users could create forward files for other users);
3594 a better approach might be to create
3595 /var/forward
3596 mode 0755
3597 and create empty files for each user,
3598 owned by that user,
3599 mode 0644.
3600 If you do this, you don't have to set the DontBlameSendmail options
3601 indicated above.
3602 .sh 2 "Free Space"
3603 .pp
3604 On systems that have one of the system calls in the
3605 .i statfs (2)
3606 family
3607 (including
3608 .i statvfs
3609 and
3610 .i ustat ),
3611 you can specify a minimum number of free blocks on the queue filesystem
3612 using the
3613 .b MinFreeBlocks
3614 (\c
3615 .b b )
3616 option.
3617 If there are fewer than the indicated number of blocks free
3618 on the filesystem on which the queue is mounted
3619 the SMTP server will reject mail
3620 with the
3621 452 error code.
3622 This invites the SMTP client to try again later.
3623 .pp
3624 Beware of setting this option too high;
3625 it can cause rejection of email
3626 when that mail would be processed without difficulty.
3627 .sh 2 "Maximum Message Size"
3628 .pp
3629 To avoid overflowing your system with a large message,
3630 the
3631 .b MaxMessageSize
3632 option can be set to set an absolute limit
3633 on the size of any one message.
3634 This will be advertised in the ESMTP dialogue
3635 and checked during message collection.
3636 .sh 2 "Privacy Flags"
3637 .pp
3638 The
3639 .b PrivacyOptions
3640 (\c
3641 .b p )
3642 option allows you to set certain
3643 ``privacy''
3644 flags.
3645 Actually, many of them don't give you any extra privacy,
3646 rather just insisting that client SMTP servers
3647 use the HELO command
3648 before using certain commands
3649 or adding extra headers to indicate possible spoof attempts.
3650 .pp
3651 The option takes a series of flag names;
3652 the final privacy is the inclusive or of those flags.
3653 For example:
3654 .(b
3655 O PrivacyOptions=needmailhelo, noexpn
3656 .)b
3657 insists that the HELO or EHLO command be used before a MAIL command is accepted
3658 and disables the EXPN command.
3659 .pp
3660 The flags are detailed in section
3661 .\"XREF
3662 5.6.
3663 .sh 2 "Send to Me Too"
3664 .pp
3665 Beginning with version 8.10,
3666 .i sendmail
3667 includes by default the (envelope) sender in any list expansions.
3668 For example, if
3669 .q matt
3670 sends to a list that contains
3671 .q matt
3672 as one of the members he will get a copy of the message.
3673 If the
3674 .b MeToo
3675 option is set to
3676 .sm FALSE
3677 (in the configuration file or via the command line),
3678 this behavior is changed, i.e.,
3679 the (envelope) sender is excluded in list expansions.
3680 .sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE"
3681 .pp
3682 This section describes the configuration file
3683 in detail.
3684 .pp
3685 There is one point that should be made clear immediately:
3686 the syntax of the configuration file
3687 is designed to be reasonably easy to parse,
3688 since this is done every time
3689 .i sendmail
3690 starts up,
3691 rather than easy for a human to read or write.
3692 The configuration file should be generated via the method described in
3693 .b cf/README ,
3694 it should not be edited directly unless someone is familiar
3695 with the internals of the syntax described here and it is
3696 not possible to achieve the desired result via the default method.
3697 .pp
3698 The configuration file is organized as a series of lines,
3699 each of which begins with a single character
3700 defining the semantics for the rest of the line.
3701 Lines beginning with a space or a tab
3702 are continuation lines
3703 (although the semantics are not well defined in many places).
3704 Blank lines and lines beginning with a sharp symbol
3705 (`#')
3706 are comments.
3707 .sh 2 "R and S \*- Rewriting Rules"
3708 .pp
3709 The core of address parsing
3710 are the rewriting rules.
3711 These are an ordered production system.
3712 .i Sendmail
3713 scans through the set of rewriting rules
3714 looking for a match on the left hand side
3715 (LHS)
3716 of the rule.
3717 When a rule matches,
3718 the address is replaced by the right hand side
3719 (RHS)
3720 of the rule.
3721 .pp
3722 There are several sets of rewriting rules.
3723 Some of the rewriting sets are used internally
3724 and must have specific semantics.
3725 Other rewriting sets
3726 do not have specifically assigned semantics,
3727 and may be referenced by the mailer definitions
3728 or by other rewriting sets.
3729 .pp
3730 The syntax of these two commands are:
3731 .(b F
3732 .b S \c
3733 .i n
3734 .)b
3735 Sets the current ruleset being collected to
3736 .i n .
3737 If you begin a ruleset more than once
3738 it appends to the old definition.
3739 .(b F
3740 .b R \c
3741 .i lhs
3742 .i rhs
3743 .i comments
3744 .)b
3745 The
3746 fields must be separated
3747 by at least one tab character;
3748 there may be embedded spaces
3749 in the fields.
3750 The
3751 .i lhs
3752 is a pattern that is applied to the input.
3753 If it matches,
3754 the input is rewritten to the
3755 .i rhs .
3756 The
3757 .i comments
3758 are ignored.
3759 .pp
3760 Macro expansions of the form
3761 .b $ \c
3762 .i x
3763 are performed when the configuration file is read.
3764 A literal
3765 .b $
3766 can be included using
3767 .b $$ .
3768 Expansions of the form
3769 .b $& \c
3770 .i x
3771 are performed at run time using a somewhat less general algorithm.
3772 This is intended only for referencing internally defined macros
3773 such as
3774 .b $h
3775 that are changed at runtime.
3776 .sh 3 "The left hand side"
3777 .pp
3778 The left hand side of rewriting rules contains a pattern.
3779 Normal words are simply matched directly.
3780 Metasyntax is introduced using a dollar sign.
3781 The metasymbols are:
3782 .(b
3783 .ta \w'\fB$=\fP\fIx\fP  'u
3784 \fB$*\fP        Match zero or more tokens
3785 \fB$+\fP        Match one or more tokens
3786 \fB$\-\fP       Match exactly one token
3787 \fB$=\fP\fIx\fP Match any phrase in class \fIx\fP
3788 \fB$~\fP\fIx\fP Match any word not in class \fIx\fP
3789 .)b
3790 If any of these match,
3791 they are assigned to the symbol
3792 .b $ \c
3793 .i n
3794 for replacement on the right hand side,
3795 where
3796 .i n
3797 is the index in the LHS.
3798 For example,
3799 if the LHS:
3800 .(b
3801 $\-:$+
3802 .)b
3803 is applied to the input:
3804 .(b
3805 UCBARPA:eric
3806 .)b
3807 the rule will match, and the values passed to the RHS will be:
3808 .(b
3809 .ta 4n
3810 $1      UCBARPA
3811 $2      eric
3812 .)b
3813 .pp
3814 Additionally, the LHS can include
3815 .b $@
3816 to match zero tokens.
3817 This is
3818 .i not
3819 bound to a
3820 .b $ \c
3821 .i n
3822 on the RHS, and is normally only used when it stands alone
3823 in order to match the null input.
3824 .sh 3 "The right hand side"
3825 .pp
3826 When the left hand side of a rewriting rule matches,
3827 the input is deleted and replaced by the right hand side.
3828 Tokens are copied directly from the RHS
3829 unless they begin with a dollar sign.
3830 Metasymbols are:
3831 .(b
3832 .ta \w'$#mailer\0\0\0'u
3833 \fB$\fP\fIn\fP  Substitute indefinite token \fIn\fP from LHS
3834 \fB$[\fP\fIname\fP\fB$]\fP      Canonicalize \fIname\fP
3835 \fB$(\fP\fImap key\fP \fB$@\fP\fIarguments\fP \fB$:\fP\fIdefault\fP \fB$)\fP
3836         Generalized keyed mapping function
3837 \fB$>\fP\fIn\fP \*(lqCall\*(rq ruleset \fIn\fP
3838 \fB$#\fP\fImailer\fP    Resolve to \fImailer\fP
3839 \fB$@\fP\fIhost\fP      Specify \fIhost\fP
3840 \fB$:\fP\fIuser\fP      Specify \fIuser\fP
3841 .)b
3842 .pp
3843 The
3844 .b $ \c
3845 .i n
3846 syntax substitutes the corresponding value from a
3847 .b $+ ,
3848 .b $\- ,
3849 .b $* ,
3850 .b $= ,
3851 or
3852 .b $~
3853 match on the LHS.
3854 It may be used anywhere.
3855 .pp
3856 A host name enclosed between
3857 .b $[
3858 and
3859 .b $]
3860 is looked up in the host database(s)
3861 and replaced by the canonical name\**.
3862 .(f
3863 \**This is actually
3864 completely equivalent
3865 to $(host \fIhostname\fP$).
3866 In particular, a
3867 .b $:
3868 default can be used.
3869 .)f
3870 For example,
3871 .q $[ftp$]
3872 might become
3873 .q ftp.CS.Berkeley.EDU
3874 and
3875 .q $[[128.32.130.2]$]
3876 would become
3877 .q vangogh.CS.Berkeley.EDU.
3878 .i Sendmail
3879 recognizes its numeric IP address
3880 without calling the name server
3881 and replaces it with its canonical name.
3882 .pp
3883 The
3884 .b $(
3885 \&...
3886 .b $)
3887 syntax is a more general form of lookup;
3888 it uses a named map instead of an implicit map.
3889 If no lookup is found, the indicated
3890 .i default
3891 is inserted;
3892 if no default is specified and no lookup matches,
3893 the value is left unchanged.
3894 The
3895 .i arguments
3896 are passed to the map for possible use.
3897 .pp
3898 The
3899 .b $> \c
3900 .i n
3901 syntax
3902 causes the remainder of the line to be substituted as usual
3903 and then passed as the argument to ruleset
3904 .i n .
3905 The final value of ruleset
3906 .i n
3907 then becomes
3908 the substitution for this rule.
3909 The
3910 .b $>
3911 syntax expands everything after the ruleset name
3912 to the end of the replacement string
3913 and then passes that as the initial input to the ruleset.
3914 Recursive calls are allowed.
3915 For example,
3916 .(b
3917 $>0 $>3 $1
3918 .)b
3919 expands $1, passes that to ruleset 3, and then passes the result
3920 of ruleset 3 to ruleset 0.
3921 .pp
3922 The
3923 .b $#
3924 syntax should
3925 .i only
3926 be used in ruleset zero,
3927 a subroutine of ruleset zero,
3928 or rulesets that return decisions (e.g., check_rcpt).
3929 It causes evaluation of the ruleset to terminate immediately,
3930 and signals to
3931 .i sendmail
3932 that the address has completely resolved.
3933 The complete syntax for ruleset 0 is:
3934 .(b
3935 \fB$#\fP\fImailer\fP \fB$@\fP\fIhost\fP \fB$:\fP\fIuser\fP
3936 .)b
3937 This specifies the
3938 {mailer, host, user}
3939 3-tuple (triple) necessary to direct the mailer.
3940 Note: the third element (
3941 .i user
3942 ) is often also called
3943 .i address
3944 part.
3945 If the mailer is local
3946 the host part may be omitted\**.
3947 .(f
3948 \**You may want to use it for special
3949 .q "per user"
3950 extensions.
3951 For example, in the address
3952 .q jgm+foo@CMU.EDU ;
3953 the
3954 .q +foo
3955 part is not part of the user name,
3956 and is passed to the local mailer for local use.
3957 .)f
3958 The
3959 .i mailer
3960 must be a single word,
3961 but the
3962 .i host
3963 and
3964 .i user
3965 may be multi-part.
3966 If the
3967 .i mailer
3968 is the built-in IPC mailer,
3969 the
3970 .i host
3971 may be a colon (or comma) separated list of hosts.
3972 Each is separately MX expanded and the results are concatenated
3973 to make (essentially) one long MX list.
3974 Hosts separated by a comma have the same MX preference,
3975 and for each colon separated host the MX preference is increased.
3976 The
3977 .i user
3978 is later rewritten by the mailer-specific envelope rewriting set
3979 and assigned to the
3980 .b $u
3981 macro.
3982 As a special case, if the mailer specified has the
3983 .b F=@
3984 flag specified
3985 and the first character of the
3986 .b $:
3987 value is
3988 .q @ ,
3989 the
3990 .q @
3991 is stripped off, and a flag is set in the address descriptor
3992 that causes sendmail to not do ruleset 5 processing.
3993 .pp
3994 Normally, a rule that matches is retried,
3995 that is,
3996 the rule loops until it fails.
3997 A RHS may also be preceded by a
3998 .b $@
3999 or a
4000 .b $:
4001 to change this behavior.
4002 A
4003 .b $@
4004 prefix causes the ruleset to return with the remainder of the RHS
4005 as the value.
4006 A
4007 .b $:
4008 prefix causes the rule to terminate immediately,
4009 but the ruleset to continue;
4010 this can be used to avoid continued application of a rule.
4011 The prefix is stripped before continuing.
4012 .pp
4013 The
4014 .b $@
4015 and
4016 .b $:
4017 prefixes may precede a
4018 .b $>
4019 spec;
4020 for example:
4021 .(b
4022 .ta 8n
4023 R$+     $: $>7 $1
4024 .)b
4025 matches anything,
4026 passes that to ruleset seven,
4027 and continues;
4028 the
4029 .b $:
4030 is necessary to avoid an infinite loop.
4031 .pp
4032 Substitution occurs in the order described,
4033 that is,
4034 parameters from the LHS are substituted,
4035 hostnames are canonicalized,
4036 .q subroutines
4037 are called,
4038 and finally
4039 .b $# ,
4040 .b $@ ,
4041 and
4042 .b $:
4043 are processed.
4044 .sh 3 "Semantics of rewriting rule sets"
4045 .pp
4046 There are six rewriting sets
4047 that have specific semantics.
4048 Five of these are related as depicted by figure 1.
4049 .(z
4050 .hl
4051 .ie n \{\
4052 .(c
4053                     +---+
4054                  -->| 0 |-->resolved address
4055                 /   +---+
4056                /            +---+   +---+
4057               /        ---->| 1 |-->| S |--
4058        +---+ / +---+  /     +---+   +---+  \e    +---+
4059 addr-->| 3 |-->| D |--                      --->| 4 |-->msg
4060        +---+   +---+  \e     +---+   +---+  /    +---+
4061                         --->| 2 |-->| R |--
4062                             +---+   +---+
4063 .)c
4064
4065 .\}
4066 .el \{\
4067 .ie !"\*(.T"" \{\
4068 .PS
4069 boxwid = 0.3i
4070 boxht = 0.3i
4071 movewid = 0.3i
4072 moveht = 0.3i
4073 linewid = 0.3i
4074 lineht = 0.3i
4075
4076         box invis "addr"; arrow
4077 Box3:   box "3"
4078 A1:     arrow
4079 BoxD:   box "D"; line; L1: Here
4080 C:      [
4081         C1:     arrow; box "1"; arrow; box "S"; line; E1: Here
4082                 move to C1 down 0.5; right
4083         C2:     arrow; box "2"; arrow; box "R"; line; E2: Here
4084         ] with .w at L1 + (0.5, 0)
4085         move to C.e right 0.5
4086 L4:     arrow; box "4"; arrow; box invis "msg"
4087         line from L1 to C.C1
4088         line from L1 to C.C2
4089         line from C.E1 to L4
4090         line from C.E2 to L4
4091         move to BoxD.n up 0.6; right
4092 Box0:   arrow; box "0"
4093         arrow; box invis "resolved address" width 1.3
4094         line from 1/3 of the way between A1 and BoxD.w to Box0
4095 .PE
4096 .\}
4097 .el .sp 2i
4098 .\}
4099 .ce
4100 Figure 1 \*- Rewriting set semantics
4101 .(c
4102 D \*- sender domain addition
4103 S \*- mailer-specific sender rewriting
4104 R \*- mailer-specific recipient rewriting
4105 .)c
4106 .hl
4107 .)z
4108 .pp
4109 Ruleset three
4110 should turn the address into
4111 .q "canonical form."
4112 This form should have the basic syntax:
4113 .(b
4114 local-part@host-domain-spec
4115 .)b
4116 Ruleset three
4117 is applied by
4118 .i sendmail
4119 before doing anything with any address.
4120 .pp
4121 If no
4122 .q @
4123 sign is specified,
4124 then the
4125 host-domain-spec
4126 .i may
4127 be appended (box
4128 .q D
4129 in Figure 1)
4130 from the
4131 sender address
4132 (if the
4133 .b C
4134 flag is set in the mailer definition
4135 corresponding to the
4136 .i sending
4137 mailer).
4138 .pp
4139 Ruleset zero
4140 is applied after ruleset three
4141 to addresses that are going to actually specify recipients.
4142 It must resolve to a
4143 .i "{mailer, host, address}"
4144 triple.
4145 The
4146 .i mailer
4147 must be defined in the mailer definitions
4148 from the configuration file.
4149 The
4150 .i host
4151 is defined into the
4152 .b $h
4153 macro
4154 for use in the argv expansion of the specified mailer.
4155 Notice: since the envelope sender address will be used if
4156 a delivery status notification must be send,
4157 i.e., it may specify a recipient,
4158 it is also run through ruleset zero.
4159 If ruleset zero returns a temporary error
4160 .b 4xy
4161 then delivery is deferred.
4162 This can be used to temporarily disable delivery,
4163 e.g., based on the time of the day or other varying parameters.
4164 It should not be used to quarantine e-mails.
4165 .pp
4166 Rulesets one and two
4167 are applied to all sender and recipient addresses respectively.
4168 They are applied before any specification
4169 in the mailer definition.
4170 They must never resolve.
4171 .pp
4172 Ruleset four is applied to all addresses
4173 in the message.
4174 It is typically used
4175 to translate internal to external form.
4176 .pp
4177 In addition,
4178 ruleset 5 is applied to all local addresses
4179 (specifically, those that resolve to a mailer with the `F=5'
4180 flag set)
4181 that do not have aliases.
4182 This allows a last minute hook for local names.
4183 .sh 3 "Ruleset hooks"
4184 .pp
4185 A few extra rulesets are defined as
4186 .q hooks
4187 that can be defined to get special features.
4188 They are all named rulesets.
4189 The
4190 .q check_*
4191 forms all give accept/reject status;
4192 falling off the end or returning normally is an accept,
4193 and resolving to
4194 .b $#error
4195 is a reject or quarantine.
4196 Quarantining is chosen by specifying
4197 .b quarantine
4198 in the second part of the mailer triplet:
4199 .(b
4200 $#error $@ quarantine $: Reason for quarantine
4201 .)b
4202 Many of these can also resolve to the special mailer name
4203 .b $#discard ;
4204 this accepts the message as though it were successful
4205 but then discards it without delivery.
4206 Note,
4207 this mailer cannot be chosen as a mailer in ruleset 0.
4208 Note also that all
4209 .q check_*
4210 rulesets have to deal with temporary failures, especially for map lookups,
4211 themselves, i.e., they should return a temporary error code
4212 or at least they should make a proper decision in those cases.
4213 .sh 4 "check_relay"
4214 .pp
4215 The
4216 .i check_relay
4217 ruleset is called after a connection is accepted by the daemon.
4218 It is not called when sendmail is started using the
4219 .b \-bs
4220 option.
4221 It is passed
4222 .(b
4223 client.host.name $| client.host.address
4224 .)b
4225 where
4226 .b $|
4227 is a metacharacter separating the two parts.
4228 This ruleset can reject connections from various locations.
4229 Note that it only checks the connecting SMTP client IP address and hostname.
4230 It does not check for third party message relaying.
4231 The
4232 .i check_rcpt
4233 ruleset discussed below usually does third party message relay checking.
4234 .sh 4 "check_mail"
4235 .pp
4236 The
4237 .i check_mail
4238 ruleset is passed the user name parameter of the
4239 .sm "SMTP MAIL"
4240 command.
4241 It can accept or reject the address.
4242 .sh 4 "check_rcpt"
4243 .pp
4244 The
4245 .i check_rcpt
4246 ruleset is passed the user name parameter of the
4247 .sm "SMTP RCPT"
4248 command.
4249 It can accept or reject the address.
4250 .sh 4 "check_data"
4251 .pp
4252 The
4253 .i check_data
4254 ruleset is called after the
4255 .sm "SMTP DATA"
4256 command, its parameter is the number of recipients.
4257 It can accept or reject the command.
4258 .sh 4 "check_compat"
4259 .pp
4260 The
4261 .i check_compat
4262 ruleset is passed
4263 .(b
4264 sender-address $| recipient-address
4265 .)b
4266 where
4267 .b $|
4268 is a metacharacter separating the addresses.
4269 It can accept or reject mail transfer between these two addresses
4270 much like the
4271 .i checkcompat()
4272 function.
4273 Note:
4274 while other
4275 .i check_*
4276 rulesets are invoked during the SMTP mail receiption stage
4277 (i.e., in the SMTP server),
4278 .i check_compat
4279 is invoked during the mail delivery stage.
4280 .sh 4 "check_eoh"
4281 .pp
4282 The
4283 .i check_eoh
4284 ruleset is passed
4285 .(b
4286 number-of-headers $| size-of-headers
4287 .)b
4288 where
4289 .b $|
4290 is a metacharacter separating the numbers.
4291 These numbers can be used for size comparisons with the
4292 .b arith
4293 map.
4294 The ruleset is triggered after
4295 all of the headers have been read.
4296 It can be used to correlate information gathered
4297 from those headers using the
4298 .b macro
4299 storage map.
4300 One possible use is to check for a missing header.
4301 For example:
4302 .(b
4303 .ta 1.5i
4304 Kstorage macro
4305 HMessage-Id: $>CheckMessageId
4306
4307 SCheckMessageId
4308 # Record the presence of the header
4309 R$*                     $: $(storage {MessageIdCheck} $@ OK $) $1
4310 R< $+ @ $+ >            $@ OK
4311 R$*                     $#error $: 553 Header Error
4312
4313 Scheck_eoh
4314 # Check the macro
4315 R$*                     $: < $&{MessageIdCheck} >
4316 # Clear the macro for the next message
4317 R$*                     $: $(storage {MessageIdCheck} $) $1
4318 # Has a Message-Id: header
4319 R< $+ >                 $@ OK
4320 # Allow missing Message-Id: from local mail
4321 R$*                     $: < $&{client_name} >
4322 R< >                    $@ OK
4323 R< $=w >                $@ OK
4324 # Otherwise, reject the mail
4325 R$*                     $#error $: 553 Header Error
4326 .)b
4327 Keep in mind the Message-Id: header is not a required header and
4328 is not a guaranteed spam indicator.
4329 This ruleset is an example and
4330 should probably not be used in production.
4331 .sh 4 "check_eom"
4332 .pp
4333 The
4334 .i check_eom
4335 ruleset is called after the end of a message,
4336 its parameter is the message size.
4337 It can accept or reject the message.
4338 .sh 4 "check_etrn"
4339 .pp
4340 The
4341 .i check_etrn
4342 ruleset is passed the parameter of the
4343 .sm "SMTP ETRN"
4344 command.
4345 It can accept or reject the command.
4346 .sh 4 "check_expn"
4347 .pp
4348 The
4349 .i check_expn
4350 ruleset is passed the user name parameter of the
4351 .sm "SMTP EXPN"
4352 command.
4353 It can accept or reject the address.
4354 .sh 4 "check_vrfy"
4355 .pp
4356 The
4357 .i check_vrfy
4358 ruleset is passed the user name parameter of the
4359 .sm "SMTP VRFY"
4360 command.
4361 It can accept or reject the command.
4362 .sh 4 "trust_auth"
4363 .pp
4364 The
4365 .i trust_auth
4366 ruleset is passed the AUTH= parameter of the
4367 .sm "SMTP MAIL"
4368 command.
4369 It is used to determine whether this value should be
4370 trusted. In order to make this decision, the ruleset
4371 may make use of the various
4372 .b ${auth_*}
4373 macros.
4374 If the ruleset does resolve to the
4375 .q error
4376 mailer the AUTH= parameter is not trusted and hence
4377 not passed on to the next relay.
4378 .sh 4 "tls_client"
4379 .pp
4380 The
4381 .i tls_client
4382 ruleset is called when sendmail acts as server, after a STARTTLS command
4383 has been issued, and from
4384 .i check_mail.
4385 The parameter is the value of
4386 .b ${verify}
4387 and STARTTLS or MAIL, respectively.
4388 If the ruleset does resolve to the
4389 .q error
4390 mailer, the appropriate error code is returned to the client.
4391 .sh 4 "tls_server"
4392 .pp
4393 The
4394 .i tls_server
4395 ruleset is called when sendmail acts as client after a STARTTLS command
4396 (should) have been issued.
4397 The parameter is the value of
4398 .b ${verify} .
4399 If the ruleset does resolve to the
4400 .q error
4401 mailer, the connection is aborted
4402 (treated as non-deliverable with a permanent or temporary error).
4403 .sh 4 "tls_rcpt"
4404 .pp
4405 The
4406 .i tls_rcpt
4407 ruleset is called each time before a RCPT TO command is sent.
4408 The parameter is the current recipient.
4409 If the ruleset does resolve to the
4410 .q error
4411 mailer, the RCPT TO command is suppressed
4412 (treated as non-deliverable with a permanent or temporary error).
4413 This ruleset allows to require encryption or verification of
4414 the recipient's MTA even if the mail is somehow redirected
4415 to another host.
4416 For example, sending mail to
4417 .i luke@endmail.org
4418 may get redirected to a host named
4419 .i death.star
4420 and hence the tls_server ruleset won't apply.
4421 By introducing per recipient restrictions such attacks
4422 (e.g., via DNS spoofing) can be made impossible.
4423 See
4424 .i cf/README
4425 how this ruleset can be used.
4426 .sh 4 "srv_features"
4427 .pp
4428 The
4429 .i srv_features
4430 ruleset is called with the connecting client's host name
4431 when a client connects to sendmail.
4432 This ruleset should return
4433 .b $#
4434 followed by a list of options (single characters
4435 delimited by white space).
4436 If the return value starts with anything else it is silently ignored.
4437 Generally upper case characters turn off a feature
4438 while lower case characters turn it on.
4439 Option `S' causes the server not to offer STARTTLS,
4440 which is useful to interact with MTAs/MUAs that have broken
4441 STARTTLS implementations by simply not offering it.
4442 `V' turns off the request for a client certificate during the TLS handshake.
4443 Options `A' and `P' suppress SMTP AUTH and PIPELINING, respectively.
4444 `c' is the equivalent to AuthOptions=p, i.e.,
4445 it doesn't permit mechanisms susceptible to simple
4446 passive attack (e.g., PLAIN, LOGIN), unless a security layer is active.
4447 Option `l' requires SMTP AUTH for a connection.
4448 Options 'B', 'D', 'E', and 'X' suppress SMTP VERB, DSN, ETRN, and EXPN,
4449 respectively.
4450 .(b
4451 .ta 9n
4452 A       Do not offer AUTH
4453 a       Offer AUTH (default)
4454 B       Do not offer VERB
4455 b       Offer VERB (default)
4456 C       Do not require security layer for
4457         plaintext AUTH (default)
4458 c       Require security layer for plaintext AUTH
4459 D       Do not offer DSN
4460 d       Offer DSN (default)
4461 E       Do not offer ETRN
4462 e       Offer ETRN (default)
4463 L       Do not require AUTH (default)
4464 l       Require AUTH
4465 P       Do not offer PIPELINING
4466 p       Offer PIPELINING (default)
4467 S       Do not offer STARTTLS
4468 s       Offer STARTTLS (default)
4469 V       Do not request a client certificate
4470 v       Request a client certificate (default)
4471 X       Do not offer EXPN
4472 x       Offer EXPN (default)
4473 .)b
4474 Note: the entries marked as ``(default)'' may require that some
4475 configuration has been made, e.g., SMTP AUTH is only available if
4476 properly configured.
4477 Moreover, many options can be changed on a global basis via other
4478 settings as explained in this document, e.g., via DaemonPortOptions.
4479 .pp
4480 The ruleset may return `$#temp' to indicate that there is a temporary
4481 problem determining the correct features, e.g., if a map is unavailable.
4482 In that case, the SMTP server issues a temporary failure and does not
4483 accept email.
4484 .sh 4 "try_tls"
4485 .pp
4486 The
4487 .i try_tls
4488 ruleset is called when sendmail connects to another MTA.
4489 If the ruleset does resolve to the
4490 .q error
4491 mailer, sendmail does not try STARTTLS even if it is offered.
4492 This is useful to deal with STARTTLS interoperability issues
4493 by simply not using it.
4494 .sh 4 "tls_srv_features and tls_clt_features"
4495 .pp
4496 The
4497 .i tls_clt_features
4498 ruleset is called when sendmail connects to another MTA
4499 and the
4500 .i tls_srv_features
4501 ruleset is called when a client connects to
4502 .i sendmail .
4503 The arguments for the rulesets are the host name and IP address
4504 of the other side separated by
4505 .b $|
4506 (which is a metacharacter).
4507 They should return a list of
4508 .i key=value
4509 pairs separated by semicolons;
4510 the list can be empty if no options should be applied to the connection.
4511 Available keys are and their allowed values are:
4512 .nr ii 0.2i
4513 .ip Options
4514 A comma separated list of SSL related options.
4515 See
4516 .i ServerSSLOptions
4517 and
4518 .i ClientSSLOptions
4519 for details, as well as
4520 .i SSL_set_options (3)
4521 and note this warning:
4522 Options already set before are not cleared!
4523 .ip CipherList
4524 Specify cipher list for STARTTLS (does not apply to TLSv1.3),
4525 see
4526 .i ciphers (1)
4527 for possible values.
4528 This overrides the global
4529 .i CipherList
4530 for the session.
4531 .ip CertFile
4532 File containing a certificate.
4533 .ip KeyFile
4534 File containing the private key for the certificate.
4535 .ip Flags
4536 Currently the only valid flags are
4537 .br
4538 .i R
4539 to require a CRL for each encountered certificate during verification
4540 (by default a missing CRL is ignored),
4541 .br
4542 .i c
4543 and
4544 .i C
4545 which basically clears/sets the option
4546 .i TLSFallbacktoClear
4547 for just this session, respectively,
4548 .br
4549 .i d
4550 to turn off DANE which is obviously only valid for
4551 .i tls_clt_features
4552 and requires DANE to be compiled in.
4553 This might be needed in case of a misconfiguration,
4554 e.g.,
4555 specifying invalid TLSA RRs.
4556 .br
4557 .lp
4558 .lp
4559 Example:
4560 .(b
4561 .ta 1.5i
4562 Stls_srv_features
4563 R$* $| 10.$+            $: cipherlist=HIGH
4564 .)b
4565 .lp
4566 Notes:
4567 .pp
4568 Errors in these features (e.g., unknown keys or invalid values)
4569 are logged
4570 and the current session is aborted to avoid using STARTTLS
4571 with features that should have been changed.
4572 .pp
4573 The keys are case-insensitive.
4574 .pp
4575 Both
4576 .i CertFile
4577 and
4578 .i KeyFile
4579 must be specified together;
4580 specifying only one is an error.
4581 .sh 4 "authinfo"
4582 .pp
4583 The
4584 .i authinfo
4585 ruleset is called when sendmail tries to authenticate to another MTA.
4586 It should return
4587 .b $#
4588 followed by a list of tokens that are used for SMTP AUTH.
4589 If the return value starts with anything else it is silently ignored.
4590 Each token is a tagged string of the form:
4591 "TDstring"
4592 (including the quotes), where
4593 .(b
4594 .ta 9n
4595 T       Tag which describes the item
4596 D       Delimiter: ':' simple text follows
4597         '=' string is base64 encoded
4598 string  Value of the item
4599 .)b
4600 Valid values for the tag are:
4601 .(b
4602 .ta 9n
4603 U       user (authorization) id
4604 I       authentication id
4605 P       password
4606 R       realm
4607 M       list of mechanisms delimited by spaces
4608 .)b
4609 If this ruleset is defined, the option
4610 .b DefaultAuthInfo
4611 is ignored (even if the ruleset does not return a ``useful'' result).
4612 .sh 4 "queuegroup"
4613 .pp
4614 The
4615 .i queuegroup
4616 ruleset is used to map a recipient address to a queue group name.
4617 The input for the ruleset is
4618 the recipient address
4619 (i.e., the address part of the resolved triple)
4620 The ruleset should return
4621 .b $#
4622 followed by the name of a queue group.
4623 If the return value starts with anything else it is silently ignored.
4624 See the section about ``Queue Groups and Queue Directories''
4625 for further information.
4626 .sh 4 "greet_pause"
4627 .pp
4628 The
4629 .i greet_pause
4630 ruleset is used to specify the amount of time to pause before sending the
4631 initial SMTP 220 greeting.
4632 If any traffic is received during that pause, an SMTP 554 rejection
4633 response is given instead of the 220 greeting and all SMTP commands are
4634 rejected during that connection.
4635 This helps protect sites from open proxies and SMTP slammers.
4636 The ruleset should return
4637 .b $#
4638 followed by the number of milliseconds (thousandths of a second) to
4639 pause.
4640 If the return value starts with anything else or is not a number,
4641 it is silently ignored.
4642 Note: this ruleset is not invoked (and hence the feature is disabled)
4643 when smtps (SMTP over SSL) is used, i.e.,
4644 the
4645 .i s
4646 modifier is set for the daemon via
4647 .b DaemonPortOptions ,
4648 because in this case the SSL handshake is performed before
4649 the greeting is sent.
4650 .sh 3 "IPC mailers"
4651 .pp
4652 Some special processing occurs
4653 if the ruleset zero resolves to an IPC mailer
4654 (that is, a mailer that has
4655 .q [IPC]
4656 listed as the Path in the
4657 .b M
4658 configuration line.
4659 The host name passed after
4660 .q $@
4661 has MX expansion performed if not delivering via a named socket;
4662 this looks the name up in DNS to find alternate delivery sites.
4663 .pp
4664 The host name can also be provided as a dotted quad
4665 or an IPv6 address in square brackets;
4666 for example:
4667 .(b
4668 [128.32.149.78]
4669 .)b
4670 or
4671 .(b
4672 [IPv6:2002:c0a8:51d2::23f4]
4673 .)b
4674 This causes direct conversion of the numeric value
4675 to an IP host address.
4676 .pp
4677 The host name passed in after the
4678 .q $@
4679 may also be a colon or comma separated list of hosts.
4680 Each is separately MX expanded and the results are concatenated
4681 to make (essentially) one long MX list.
4682 Hosts separated by a comma have the same MX preference,
4683 and for each colon separated host the MX preference is increased.
4684 The intent here is to create
4685 .q fake
4686 MX records that are not published in DNS
4687 for private internal networks.
4688 .pp
4689 As a final special case, the host name can be passed in
4690 as a text string
4691 in square brackets:
4692 .(b
4693 [ucbvax.berkeley.edu]
4694 .)b
4695 This form avoids the MX mapping.
4696 .b N.B.:
4697 .i
4698 This is intended only for situations where you have a network firewall
4699 or other host that will do special processing for all your mail,
4700 so that your MX record points to a gateway machine;
4701 this machine could then do direct delivery to machines
4702 within your local domain.
4703 Use of this feature directly violates RFC 1123 section 5.3.5:
4704 it should not be used lightly.
4705 .r
4706 .sh 2 "D \*- Define Macro"
4707 .pp
4708 Macros are named with a single character
4709 or with a word in {braces}.
4710 The names ``x'' and ``{x}'' denote the same macro
4711 for every single character ``x''.
4712 Single character names may be selected from the entire ASCII set,
4713 but user-defined macros
4714 should be selected from the set of upper case letters only.
4715 Lower case letters
4716 and special symbols
4717 are used internally.
4718 Long names beginning with a lower case letter or a punctuation character
4719 are reserved for use by sendmail,
4720 so user-defined long macro names should begin with an upper case letter.
4721 .pp
4722 The syntax for macro definitions is:
4723 .(b F
4724 .b D \c
4725 .i x\|val
4726 .)b
4727 where
4728 .i x
4729 is the name of the macro
4730 (which may be a single character
4731 or a word in braces)
4732 and
4733 .i val
4734 is the value it should have.
4735 There should be no spaces given
4736 that do not actually belong in the macro value.
4737 .pp
4738 Macros are interpolated
4739 using the construct
4740 .b $ \c
4741 .i x ,
4742 where
4743 .i x
4744 is the name of the macro to be interpolated.
4745 This interpolation is done when the configuration file is read,
4746 except in
4747 .b M
4748 lines.
4749 The special construct
4750 .b $& \c
4751 .i x
4752 can be used in
4753 .b R
4754 lines to get deferred interpolation.
4755 .pp
4756 Conditionals can be specified using the syntax:
4757 .(b
4758 $?x text1 $| text2 $.
4759 .)b
4760 This interpolates
4761 .i text1
4762 if the macro
4763 .b $x
4764 is set and non-null,
4765 and
4766 .i text2
4767 otherwise.
4768 The
4769 .q else
4770 (\c
4771 .b $| )
4772 clause may be omitted.
4773 .pp
4774 The following macros are defined and/or used internally by
4775 .i sendmail
4776 for interpolation into argv's for mailers
4777 or for other contexts.
4778 The ones marked \(dg are information passed into sendmail\**,
4779 .(f
4780 \**As of version 8.6,
4781 all of these macros have reasonable defaults.
4782 Previous versions required that they be defined.
4783 .)f
4784 the ones marked \(dd are information passed both in and out of sendmail,
4785 and the unmarked macros are passed out of sendmail
4786 but are not otherwise used internally.
4787 These macros are:
4788 .nr ii 5n
4789 .ip $a
4790 The origination date in RFC 822 format.
4791 This is extracted from the Date: line.
4792 .ip $b
4793 The current date in RFC 822 format.
4794 .ip $c
4795 The hop count.
4796 This is a count of the number of Received: lines
4797 plus the value of the
4798 .b \-h
4799 command line flag.
4800 .ip $d
4801 The current date in UNIX (ctime) format.
4802 .ip $e\(dg
4803 (Obsolete; use SmtpGreetingMessage option instead.)
4804 The SMTP entry message.
4805 This is printed out when SMTP starts up.
4806 The first word must be the
4807 .b $j
4808 macro as specified by RFC 821.
4809 Defaults to
4810 .q "$j Sendmail $v ready at $b" .
4811 Commonly redefined to include the configuration version number, e.g.,
4812 .q "$j Sendmail $v/$Z ready at $b"
4813 .ip $f
4814 The envelope sender (from) address.
4815 .ip $g
4816 The sender address relative to the recipient.
4817 For example, if
4818 .b $f
4819 is
4820 .q foo ,
4821 .b $g
4822 will be
4823 .q host!foo ,
4824 .q foo@host.domain ,
4825 or whatever is appropriate for the receiving mailer.
4826 .ip $h
4827 The recipient host.
4828 This is set in ruleset 0 from the $@ field of a parsed address.
4829 .ip $i
4830 The queue id,
4831 e.g.,
4832 .q f344MXxp018717 .
4833 .ip $j\(dd
4834 The \*(lqofficial\*(rq domain name for this site.
4835 This is fully qualified if the full qualification can be found.
4836 It
4837 .i must
4838 be redefined to be the fully qualified domain name
4839 if your system is not configured so that information can find
4840 it automatically.
4841 .ip $k
4842 The UUCP node name (from the uname system call).
4843 .ip $l\(dg
4844 (Obsolete; use UnixFromLine option instead.)
4845 The format of the UNIX from line.
4846 Unless you have changed the UNIX mailbox format,
4847 you should not change the default,
4848 which is
4849 .q "From $g $d" .
4850 .ip $m
4851 The domain part of the \fIgethostname\fP return value.
4852 Under normal circumstances,
4853 .b $j
4854 is equivalent to
4855 .b $w.$m .
4856 .ip $n\(dg
4857 The name of the daemon (for error messages).
4858 Defaults to
4859 .q MAILER-DAEMON .
4860 .ip $o\(dg
4861 (Obsolete: use OperatorChars option instead.)
4862 The set of \*(lqoperators\*(rq in addresses.
4863 A list of characters
4864 which will be considered tokens
4865 and which will separate tokens
4866 when doing parsing.
4867 For example, if
4868 .q @
4869 were in the
4870 .b $o
4871 macro, then the input
4872 .q a@b
4873 would be scanned as three tokens:
4874 .q a,
4875 .q @,
4876 and
4877 .q b.
4878 Defaults to
4879 .q ".:@[]" ,
4880 which is the minimum set necessary to do RFC 822 parsing;
4881 a richer set of operators is
4882 .q ".:%@!/[]" ,
4883 which adds support for UUCP, the %-hack, and X.400 addresses.
4884 .ip $p
4885 Sendmail's process id.
4886 .ip $q\(dg
4887 Default format of sender address.
4888 The
4889 .b $q
4890 macro specifies how an address should appear in a message
4891 when it is defaulted.
4892 Defaults to
4893 .q "<$g>" .
4894 It is commonly redefined to be
4895 .q "$?x$x <$g>$|$g$."
4896 or
4897 .q "$g$?x ($x)$." ,
4898 corresponding to the following two formats:
4899 .(b
4900 Eric Allman <eric@CS.Berkeley.EDU>
4901 eric@CS.Berkeley.EDU (Eric Allman)
4902 .)b
4903 .i Sendmail
4904 properly quotes names that have special characters
4905 if the first form is used.
4906 .ip $r
4907 Protocol used to receive the message.
4908 Set from the
4909 .b \-p
4910 command line flag or by the SMTP server code.
4911 .ip $s
4912 Sender's host name.
4913 Set from the
4914 .b \-p
4915 command line flag or by the SMTP server code
4916 (in which case it is set to the EHLO/HELO parameter).
4917 .ip $t
4918 A numeric representation of the current time in the format YYYYMMDDHHmm
4919 (4 digit year 1900-9999, 2 digit month 01-12, 2 digit day 01-31,
4920 2 digit hours 00-23, 2 digit minutes 00-59).
4921 .ip $u
4922 The recipient user.
4923 .ip $v
4924 The version number of the
4925 .i sendmail
4926 binary.
4927 .ip $w\(dd
4928 The hostname of this site.
4929 This is the root name of this host (but see below for caveats).
4930 .ip $x
4931 The full name of the sender.
4932 .ip $z
4933 The home directory of the recipient.
4934 .ip $_
4935 The validated sender address.
4936 See also
4937 .b ${client_resolve} .
4938 .ip ${addr_type}
4939 The type of the address which is currently being rewritten.
4940 This macro contains up to three characters, the first
4941 is either `e' or `h' for envelope/header address,
4942 the second is a space,
4943 and the third is either `s' or `r' for sender/recipient address.
4944 .ip ${alg_bits}
4945 The maximum keylength (in bits) of the symmetric encryption algorithm
4946 used for a TLS connection.
4947 This may be less than the effective keylength,
4948 which is stored in
4949 .b ${cipher_bits} ,
4950 for ``export controlled'' algorithms.
4951 .ip ${auth_authen}
4952 The client's authentication credentials as determined by authentication
4953 (only set if successful).
4954 The format depends on the mechanism used, it might be just `user',
4955 or `user@realm', or something similar (SMTP AUTH only).
4956 .ip ${auth_author}
4957 The authorization identity, i.e. the AUTH= parameter of the
4958 .sm "SMTP MAIL"
4959 command if supplied.
4960 .ip ${auth_type}
4961 The mechanism used for SMTP authentication
4962 (only set if successful).
4963 .ip ${auth_ssf}
4964 The keylength (in bits) of the symmetric encryption algorithm
4965 used for the security layer of a SASL mechanism.
4966 .ip ${bodytype}
4967 The message body type
4968 (7BIT or 8BITMIME),
4969 as determined from the envelope.
4970 .ip ${cert_fp}
4971 The fingerprint of the presented certificate (STARTTLS only).
4972 Note: this macro is only defined if the option
4973 .b CertFingerprintAlgorithm
4974 is set,
4975 in which case the specified fingerprint algorithm is used.
4976 The valid algorithms depend on the OpenSSL version,
4977 but usually md5, sha1, and sha256 are available.
4978 See
4979 .(b
4980 openssl dgst -h
4981 .)b
4982 for a list.
4983 .ip ${cert_issuer}
4984 The DN (distinguished name) of the CA (certificate authority)
4985 that signed the presented certificate (the cert issuer)
4986 (STARTTLS only).
4987 .ip ${cert_md5}
4988 The MD5 hash of the presented certificate (STARTTLS only).
4989 Note: this macro is only defined if the option
4990 .b CertFingerprintAlgorithm
4991 is not set.
4992 .ip ${cert_subject}
4993 The DN of the presented certificate (called the cert subject)
4994 (STARTTLS only).
4995 .ip ${cipher}
4996 The cipher suite used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
4997 EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA
4998 (STARTTLS only).
4999 .ip ${cipher_bits}
5000 The effective keylength (in bits) of the symmetric encryption algorithm
5001 used for a TLS connection.
5002 .ip ${client_addr}
5003 The IP address of the SMTP client.
5004 IPv6 addresses are tagged with "IPv6:" before the address.
5005 Defined in the SMTP server only.
5006 .ip ${client_connections}
5007 The number of open connections in the SMTP server for the client IP address.
5008 .ip ${client_flags}
5009 The flags specified by the
5010 Modifier= part of
5011 .b ClientPortOptions
5012 where flags are separated from each other by spaces
5013 and upper case flags are doubled.
5014 That is,
5015 Modifier=hA
5016 will be represented as
5017 "h AA" in
5018 .b ${client_flags} ,
5019 which is required for testing the flags in rulesets.
5020 .ip ${client_name}
5021 The host name of the SMTP client.
5022 This may be the client's bracketed IP address
5023 in the form [ nnn.nnn.nnn.nnn ] for IPv4
5024 and [ IPv6:nnnn:...:nnnn ] for IPv6
5025 if the client's
5026 IP address is not resolvable, or if it is resolvable
5027 but the IP address of the resolved hostname
5028 doesn't match the original IP address.
5029 Defined in the SMTP server only.
5030 See also
5031 .b ${client_resolve} .
5032 .ip ${client_port}
5033 The port number of the SMTP client.
5034 Defined in the SMTP server only.
5035 .ip ${client_ptr}
5036 The result of the PTR lookup for the client IP address.
5037 Note: this is the same as
5038 .b ${client_name}
5039 if and only if
5040 .b ${client_resolve}
5041 is OK.
5042 Defined in the SMTP server only.
5043 .ip ${client_rate}
5044 The number of incoming connections for the client IP address
5045 over the time interval specified by ConnectionRateWindowSize.
5046 .ip ${client_resolve}
5047 Holds the result of the resolve call for
5048 .b ${client_name} .
5049 Possible values are:
5050 .(b
5051 .ta 10n
5052 OK      resolved successfully
5053 FAIL    permanent lookup failure
5054 FORGED  forward lookup doesn't match reverse lookup
5055 TEMP    temporary lookup failure
5056 .)b
5057 Defined in the SMTP server only.
5058 .i sendmail
5059 performs a hostname lookup on the IP address of the connecting client.
5060 Next the IP addresses of that hostname are looked up.
5061 If the client IP address does not appear in that list,
5062 then the hostname is maybe forged.
5063 This is reflected as the value FORGED for
5064 .b ${client_resolve}
5065 and it also shows up in
5066 .b $_
5067 as "(may be forged)".
5068 .ip ${cn_issuer}
5069 The CN (common name) of the CA that signed the presented certificate
5070 (STARTTLS only).
5071 Note: if the CN cannot be extracted properly it will be replaced by
5072 one of these strings based on the encountered error:
5073 .(b
5074 .ta 25n
5075 BadCertificateContainsNUL       CN contains a NUL character
5076 BadCertificateTooLong   CN is too long
5077 BadCertificateUnknown   CN could not be extracted
5078 .)b
5079 In the last case, some other (unspecific) error occurred.
5080 .ip ${cn_subject}
5081 The CN (common name) of the presented certificate
5082 (STARTTLS only).
5083 See
5084 .b ${cn_issuer}
5085 for possible replacements.
5086 .ip ${currHeader}
5087 Header value as quoted string
5088 (possibly truncated to
5089 .b MAXNAME ).
5090 This macro is only available in header check rulesets.
5091 .ip ${daemon_addr}
5092 The IP address the daemon is listening on for connections.
5093 .ip ${daemon_family}
5094 The network family
5095 if the daemon is accepting network connections.
5096 Possible values include
5097 .q inet ,
5098 .q inet6 ,
5099 .q iso ,
5100 .q ns ,
5101 .q x.25
5102 .ip ${daemon_flags}
5103 The flags for the daemon as specified by the
5104 Modifier= part of
5105 .b DaemonPortOptions
5106 whereby the flags are separated from each other by spaces,
5107 and upper case flags are doubled.
5108 That is,
5109 Modifier=Ea
5110 will be represented as
5111 "EE a" in
5112 .b ${daemon_flags} ,
5113 which is required for testing the flags in rulesets.
5114 .ip ${daemon_info}
5115 Some information about a daemon as a text string.
5116 For example,
5117 .q SMTP+queueing@00:30:00 .
5118 .ip ${daemon_name}
5119 The name of the daemon from
5120 .b DaemonPortOptions
5121 Name= suboption.
5122 If this suboption is not set,
5123 "Daemon#",
5124 where # is the daemon number,
5125 is used.
5126 .ip ${daemon_port}
5127 The port the daemon is accepting connection on.
5128 Unless
5129 .b DaemonPortOptions
5130 is set, this will most likely be
5131 .q 25 .
5132 .ip ${deliveryMode}
5133 The current delivery mode sendmail is using.
5134 It is initially set to the value of the
5135 .b DeliveryMode
5136 option.
5137 .ip ${envid}
5138 The envelope id parameter (ENVID=) passed to sendmail as part of the envelope.
5139 .ip ${hdrlen}
5140 The length of the header value which is stored in
5141 ${currHeader} (before possible truncation).
5142 If this value is greater than or equal to
5143 .b MAXNAME
5144 the header has been truncated.
5145 .ip ${hdr_name}
5146 The name of the header field for which the current header
5147 check ruleset has been called.
5148 This is useful for a default header check ruleset to get
5149 the name of the header;
5150 the macro is only available in header check rulesets.
5151 .ip ${if_addr}
5152 The IP address of the interface of an incoming connection
5153 unless it is in the loopback net.
5154 IPv6 addresses are tagged with "IPv6:" before the address.
5155 .ip ${if_addr_out}
5156 The IP address of the interface of an outgoing connection
5157 unless it is in the loopback net.
5158 IPv6 addresses are tagged with "IPv6:" before the address.
5159 .ip ${if_family}
5160 The IP family of the interface of an incoming connection
5161 unless it is in the loopback net.
5162 .ip ${if_family_out}
5163 The IP family of the interface of an outgoing connection
5164 unless it is in the loopback net.
5165 .ip ${if_name}
5166 The hostname associated with the interface of an incoming connection.
5167 This macro can be used for
5168 SmtpGreetingMessage and HReceived for virtual hosting.
5169 For example:
5170 .(b
5171 O SmtpGreetingMessage=$?{if_name}${if_name}$|$j$. MTA
5172 .)b
5173 .ip ${if_name_out}
5174 The name of the interface of an outgoing connection.
5175 .ip ${load_avg}
5176 The current load average.
5177 .ip ${mail_addr}
5178 The address part of the resolved triple of the address given for the
5179 .sm "SMTP MAIL"
5180 command.
5181 Defined in the SMTP server only.
5182 .ip ${mail_host}
5183 The host from the resolved triple of the address given for the
5184 .sm "SMTP MAIL"
5185 command.
5186 Defined in the SMTP server only.
5187 .ip ${mail_mailer}
5188 The mailer from the resolved triple of the address given for the
5189 .sm "SMTP MAIL"
5190 command.
5191 Defined in the SMTP server only.
5192 .ip ${msg_id}
5193 The value of the Message-Id: header.
5194 .ip ${msg_size}
5195 The value of the SIZE= parameter,
5196 i.e., usually the size of the message (in an ESMTP dialogue),
5197 before the message has been collected, thereafter
5198 the message size as computed by
5199 .i sendmail
5200 (and can be used in check_compat).
5201 .ip ${nbadrcpts}
5202 The number of bad recipients for a single message.
5203 .ip ${nrcpts}
5204 The number of validated recipients for a single message.
5205 Note: since recipient validation happens after
5206 .i check_rcpt
5207 has been called, the value in this ruleset
5208 is one less than what might be expected.
5209 .ip ${ntries}
5210 The number of delivery attempts.
5211 .ip ${opMode}
5212 The current operation mode (from the
5213 .b \-b
5214 flag).
5215 .ip ${quarantine}
5216 The quarantine reason for the envelope,
5217 if it is quarantined.
5218 .ip ${queue_interval}
5219 The queue run interval given by the
5220 .b \-q
5221 flag.
5222 For example,
5223 .b \-q30m
5224 would set
5225 .b ${queue_interval}
5226 to
5227 .q 00:30:00 .
5228 .ip ${rcpt_addr}
5229 The address part of the resolved triple of the address given for the
5230 .sm "SMTP RCPT"
5231 command.
5232 Defined in the SMTP server only after a RCPT command.
5233 .ip ${rcpt_host}
5234 The host from the resolved triple of the address given for the
5235 .sm "SMTP RCPT"
5236 command.
5237 Defined in the SMTP server only after a RCPT command.
5238 .ip ${rcpt_mailer}
5239 The mailer from the resolved triple of the address given for the
5240 .sm "SMTP RCPT"
5241 command.
5242 Defined in the SMTP server only after a RCPT command.
5243 .ip ${server_addr}
5244 The address of the server of the current outgoing SMTP connection.
5245 For LMTP delivery the macro is set to the name of the mailer.
5246 .ip ${server_name}
5247 The name of the server of the current outgoing SMTP or LMTP connection.
5248 .ip ${time}
5249 The output of the
5250 .i time (3)
5251 function, i.e., the number of seconds since 0 hours, 0 minutes,
5252 0 seconds, January 1, 1970, Coordinated Universal Time (UTC).
5253 .ip ${tls_version}
5254 The TLS/SSL version used for the connection, e.g., TLSv1.2, TLSv1;
5255 defined after STARTTLS has been used.
5256 .ip ${total_rate}
5257 The total number of incoming connections over the time interval specified
5258 by ConnectionRateWindowSize.
5259 .ip ${verify}
5260 The result of the verification of the presented cert;
5261 only defined after STARTTLS has been used (or attempted).
5262 Possible values are:
5263 .(b
5264 .ta 13n
5265 OK      verification succeeded.
5266 NO      no cert presented.
5267 NOT     no cert requested.
5268 FAIL    cert presented but could not be verified,
5269         e.g., the signing CA is missing.
5270 NONE    STARTTLS has not been performed.
5271 CLEAR   STARTTLS has been disabled internally for a clear text delivery attempt.
5272 TEMP    temporary error occurred.
5273 PROTOCOL        some protocol error occurred
5274         at the ESMTP level (not TLS).
5275 SOFTWARE        STARTTLS handshake failed,
5276         which is a fatal error for this session,
5277         the e-mail will be queued.
5278 .)b
5279 .pp
5280 There are three types of dates that can be used.
5281 The
5282 .b $a
5283 and
5284 .b $b
5285 macros are in RFC 822 format;
5286 .b $a
5287 is the time as extracted from the
5288 .q Date:
5289 line of the message
5290 (if there was one),
5291 and
5292 .b $b
5293 is the current date and time
5294 (used for postmarks).
5295 If no
5296 .q Date:
5297 line is found in the incoming message,
5298 .b $a
5299 is set to the current time also.
5300 The
5301 .b $d
5302 macro is equivalent to the
5303 .b $b
5304 macro in UNIX
5305 (ctime)
5306 format.
5307 .pp
5308 The macros
5309 .b $w ,
5310 .b $j ,
5311 and
5312 .b $m
5313 are set to the identity of this host.
5314 .i Sendmail
5315 tries to find the fully qualified name of the host
5316 if at all possible;
5317 it does this by calling
5318 .i gethostname (2)
5319 to get the current hostname
5320 and then passing that to
5321 .i gethostbyname (3)
5322 which is supposed to return the canonical version of that host name.\**
5323 .(f
5324 \**For example, on some systems
5325 .i gethostname
5326 might return
5327 .q foo
5328 which would be mapped to
5329 .q foo.bar.com
5330 by
5331 .i gethostbyname .
5332 .)f
5333 Assuming this is successful,
5334 .b $j
5335 is set to the fully qualified name
5336 and
5337 .b $m
5338 is set to the domain part of the name
5339 (everything after the first dot).
5340 The
5341 .b $w
5342 macro is set to the first word
5343 (everything before the first dot)
5344 if you have a level 5 or higher configuration file;
5345 otherwise, it is set to the same value as
5346 .b $j .
5347 If the canonification is not successful,
5348 it is imperative that the config file set
5349 .b $j
5350 to the fully qualified domain name\**.
5351 .(f
5352 \**Older versions of sendmail didn't pre-define
5353 .b $j
5354 at all, so up until 8.6,
5355 config files
5356 .i always
5357 had to define
5358 .b $j .
5359 .)f
5360 .pp
5361 The
5362 .b $f
5363 macro is the id of the sender
5364 as originally determined;
5365 when mailing to a specific host
5366 the
5367 .b $g
5368 macro is set to the address of the sender
5369 .ul
5370 relative to the recipient.
5371 For example,
5372 if I send to
5373 .q bollard@matisse.CS.Berkeley.EDU
5374 from the machine
5375 .q vangogh.CS.Berkeley.EDU
5376 the
5377 .b $f
5378 macro will be
5379 .q eric
5380 and the
5381 .b $g
5382 macro will be
5383 .q eric@vangogh.CS.Berkeley.EDU.
5384 .pp
5385 The
5386 .b $x
5387 macro is set to the full name of the sender.
5388 This can be determined in several ways.
5389 It can be passed as flag to
5390 .i sendmail .
5391 It can be defined in the
5392 .sm NAME
5393 environment variable.
5394 The third choice is the value of the
5395 .q Full-Name:
5396 line in the header if it exists,
5397 and the fourth choice is the comment field
5398 of a
5399 .q From:
5400 line.
5401 If all of these fail,
5402 and if the message is being originated locally,
5403 the full name is looked up in the
5404 .i /etc/passwd
5405 file.
5406 .pp
5407 When sending,
5408 the
5409 .b $h ,
5410 .b $u ,
5411 and
5412 .b $z
5413 macros get set to the host, user, and home directory
5414 (if local)
5415 of the recipient.
5416 The first two are set from the
5417 .b $@
5418 and
5419 .b $:
5420 part of the rewriting rules, respectively.
5421 .pp
5422 The
5423 .b $p
5424 and
5425 .b $t
5426 macros are used to create unique strings
5427 (e.g., for the
5428 .q Message-Id:
5429 field).
5430 The
5431 .b $i
5432 macro is set to the queue id on this host;
5433 if put into the timestamp line
5434 it can be extremely useful for tracking messages.
5435 The
5436 .b $v
5437 macro is set to be the version number of
5438 .i sendmail ;
5439 this is normally put in timestamps
5440 and has been proven extremely useful for debugging.
5441 .pp
5442 The
5443 .b $c
5444 field is set to the
5445 .q "hop count,"
5446 i.e., the number of times this message has been processed.
5447 This can be determined
5448 by the
5449 .b \-h
5450 flag on the command line
5451 or by counting the timestamps in the message.
5452 .pp
5453 The
5454 .b $r
5455 and
5456 .b $s
5457 fields are set to the protocol used to communicate with
5458 .i sendmail
5459 and the sending hostname.
5460 They can be set together using the
5461 .b \-p
5462 command line flag or separately using the
5463 .b \-M
5464 or
5465 .b \-oM
5466 flags.
5467 .pp
5468 The
5469 .b $_
5470 is set to a validated sender host name.
5471 If the sender is running an RFC 1413 compliant IDENT server
5472 and the receiver has the IDENT protocol turned on,
5473 it will include the user name on that host.
5474 .pp
5475 The
5476 .b ${client_name} ,
5477 .b ${client_addr} ,
5478 and
5479 .b ${client_port}
5480 macros
5481 are set to the name, address, and port number of the SMTP client
5482 who is invoking
5483 .i sendmail
5484 as a server.
5485 These can be used in the
5486 .i check_*
5487 rulesets (using the
5488 .b $&
5489 deferred evaluation form, of course!).
5490 .sh 2 "C and F \*- Define Classes"
5491 .pp
5492 Classes of phrases may be defined
5493 to match on the left hand side of rewriting rules,
5494 where a
5495 .q phrase
5496 is a sequence of characters that does not contain space characters.
5497 For example
5498 a class of all local names for this site
5499 might be created
5500 so that attempts to send to oneself
5501 can be eliminated.
5502 These can either be defined directly in the configuration file
5503 or read in from another file.
5504 Classes are named as a single letter or a word in {braces}.
5505 Class names beginning with lower case letters
5506 and special characters are reserved for system use.
5507 Classes defined in config files may be given names
5508 from the set of upper case letters for short names
5509 or beginning with an upper case letter for long names.
5510 .pp
5511 The syntax is:
5512 .(b F
5513 .b C \c
5514 .i c\|phrase1
5515 .i phrase2...
5516 .br
5517 .b F \c
5518 .i c\|file
5519 .br
5520 .b F \c
5521 .i c\||program
5522 .br
5523 .b F \c
5524 .i c\|[mapkey]@mapclass:mapspec
5525 .)b
5526 The first form defines the class
5527 .i c
5528 to match any of the named words.
5529 If
5530 .i phrase1
5531 or
5532 .i phrase2
5533 is another class,
5534 e.g.,
5535 .i $=S ,
5536 the contents of class
5537 .i S
5538 are added to class
5539 .i c .
5540 It is permissible to split them among multiple lines;
5541 for example, the two forms:
5542 .(b
5543 CHmonet ucbmonet
5544 .)b
5545 and
5546 .(b
5547 CHmonet
5548 CHucbmonet
5549 .)b
5550 are equivalent.
5551 The ``F'' forms
5552 read the elements of the class
5553 .i c
5554 from the named
5555 .i file ,
5556 .i program ,
5557 or
5558 .i "map specification" .
5559 Each element should be listed on a separate line.
5560 To specify an optional file, use ``\-o'' between the class
5561 name and the file name, e.g.,
5562 .(b
5563 Fc \-o /path/to/file
5564 .)b
5565 If the file can't be used,
5566 .i sendmail
5567 will not complain but silently ignore it.
5568 The map form should be an optional map key, an at sign,
5569 and a map class followed by the specification for that map.
5570 Examples include:
5571 .(b
5572 F{VirtHosts}@ldap:\-k (&(objectClass=virtHosts)(host=*)) \-v host
5573 F{MyClass}foo@hash:/etc/mail/classes
5574 .)b
5575 will fill the class
5576 .b $={VirtHosts}
5577 from an LDAP map lookup and
5578 .b $={MyClass}
5579 from a hash database map lookup of the
5580 .b foo .
5581 There is also a built-in schema that can be accessed by only specifying:
5582 .(b
5583 F{\c
5584 .i ClassName }@LDAP
5585 .)b
5586 This will tell sendmail to use the default schema:
5587 .(b
5588 \-k (&(objectClass=sendmailMTAClass)
5589      (sendmailMTAClassName=\c
5590 .i ClassName )
5591      (|(sendmailMTACluster=${sendmailMTACluster})
5592        (sendmailMTAHost=$j)))
5593 \-v sendmailMTAClassValue
5594 .)b
5595 Note that the lookup is only done when sendmail is initially started.
5596 .pp
5597 Elements of classes can be accessed in rules using
5598 .b $=
5599 or
5600 .b $~ .
5601 The
5602 .b $~
5603 (match entries not in class)
5604 only matches a single word;
5605 multi-word entries in the class are ignored in this context.
5606 .pp
5607 Some classes have internal meaning to
5608 .i sendmail :
5609 .nr ii 0.5i
5610 .\".ip $=b
5611 .\"A set of Content-Types that will not have the newline character
5612 .\"translated to CR-LF before encoding into base64 MIME.
5613 .\"The class can have major times
5614 .\"(e.g.,
5615 .\".q image )
5616 .\"or full types
5617 .\"(such as
5618 .\".q application/octet-stream ).
5619 .\"The class is initialized with
5620 .\".q application/octet-stream ,
5621 .\".q image ,
5622 .\".q audio ,
5623 .\"and
5624 .\".q video .
5625 .ip $=e
5626 contains the Content-Transfer-Encodings that can be 8\(->7 bit encoded.
5627 It is predefined to contain
5628 .q 7bit ,
5629 .q 8bit ,
5630 and
5631 .q binary .
5632 .ip $=k
5633 set to be the same as
5634 .b $k ,
5635 that is, the UUCP node name.
5636 .ip $=m
5637 set to the set of domains by which this host is known,
5638 initially just
5639 .b $m .
5640 .ip $=n
5641 can be set to the set of MIME body types
5642 that can never be eight to seven bit encoded.
5643 It defaults to
5644 .q multipart/signed .
5645 Message types
5646 .q message/*
5647 and
5648 .q multipart/*
5649 are never encoded directly.
5650 Multipart messages are always handled recursively.
5651 The handling of message/* messages
5652 are controlled by class
5653 .b $=s .
5654 .ip $=q
5655 A set of Content-Types that will never be encoded as base64
5656 (if they have to be encoded, they will be encoded as quoted-printable).
5657 It can have primary types
5658 (e.g.,
5659 .q text )
5660 or full types
5661 (such as
5662 .q text/plain ).
5663 .ip $=s
5664 contains the set of subtypes of message that can be treated recursively.
5665 By default it contains only
5666 .q rfc822 .
5667 Other
5668 .q message/*
5669 types cannot be 8\(->7 bit encoded.
5670 If a message containing eight bit data is sent to a seven bit host,
5671 and that message cannot be encoded into seven bits,
5672 it will be stripped to 7 bits.
5673 .ip $=t
5674 set to the set of trusted users by the
5675 .b T
5676 configuration line.
5677 If you want to read trusted users from a file, use
5678 .b Ft \c
5679 .i /file/name .
5680 .ip $=w
5681 set to be the set of all names
5682 this host is known by.
5683 This can be used to match local hostnames.
5684 .ip $={persistentMacros}
5685 set to the macros that should be saved across queue runs.
5686 Care should be taken when adding macro names to this class.
5687 .pp
5688 .i Sendmail
5689 can be compiled to allow a
5690 .i scanf (3)
5691 string on the
5692 .b F
5693 line.
5694 This lets you do simplistic parsing of text files.
5695 For example, to read all the user names in your system
5696 .i /etc/passwd
5697 file into a class, use
5698 .(b
5699 FL/etc/passwd %[^:]
5700 .)b
5701 which reads every line up to the first colon.
5702 .sh 2 "M \*- Define Mailer"
5703 .pp
5704 Programs and interfaces to mailers
5705 are defined in this line.
5706 The format is:
5707 .(b F
5708 .b M \c
5709 .i name ,
5710 {\c
5711 .i field =\c
5712 .i value \|}*
5713 .)b
5714 where
5715 .i name
5716 is the name of the mailer
5717 (used internally only)
5718 and the
5719 .q field=name
5720 pairs define attributes of the mailer.
5721 Fields are:
5722 .(b
5723 .ta 1i
5724 Path    The pathname of the mailer
5725 Flags   Special flags for this mailer
5726 Sender  Rewriting set(s) for sender addresses
5727 Recipient       Rewriting set(s) for recipient addresses
5728 recipients      Maximum number of recipients per connection
5729 Argv    An argument vector to pass to this mailer
5730 Eol     The end-of-line string for this mailer
5731 Maxsize The maximum message length to this mailer
5732 maxmessages     The maximum message deliveries per connection
5733 Linelimit       The maximum line length in the message body
5734 Directory       The working directory for the mailer
5735 Userid  The default user and group id to run as
5736 Nice    The nice(2) increment for the mailer
5737 Charset The default character set for 8-bit characters
5738 Type    Type information for DSN diagnostics
5739 Wait    The maximum time to wait for the mailer
5740 Queuegroup      The default queue group for the mailer
5741 /       The root directory for the mailer
5742 .)b
5743 Only the first character of the field name is checked
5744 (it's case-sensitive).
5745 .pp
5746 The following flags may be set in the mailer description.
5747 Any other flags may be used freely
5748 to conditionally assign headers to messages
5749 destined for particular mailers.
5750 Flags marked with \(dg
5751 are not interpreted by the
5752 .i sendmail
5753 binary;
5754 these are the conventionally used to correlate to the flags portion
5755 of the
5756 .b H
5757 line.
5758 Flags marked with \(dd
5759 apply to the mailers for the sender address
5760 rather than the usual recipient mailers.
5761 .nr ii 4n
5762 .ip a
5763 Run Extended SMTP (ESMTP) protocol (defined in RFCs 1869, 1652, and 1870).
5764 This flag defaults on if the SMTP greeting message includes the word
5765 .q ESMTP .
5766 .ip A
5767 Look up the user (address) part of the resolved mailer triple,
5768 in the alias database.
5769 Normally this is only set for local mailers.
5770 .ip b
5771 Force a blank line on the end of a message.
5772 This is intended to work around some stupid versions of
5773 /bin/mail
5774 that require a blank line, but do not provide it themselves.
5775 It would not normally be used on network mail.
5776 .ip B
5777 Strip leading backslashes (\e) off of the address;
5778 this is a subset of the functionality of the
5779 .b s
5780 flag.
5781 .ip c
5782 Do not include comments in addresses.
5783 This should only be used if you have to work around
5784 a remote mailer that gets confused by comments.
5785 This strips addresses of the form
5786 .q "Phrase <address>"
5787 or
5788 .q "address (Comment)"
5789 down to just
5790 .q address .
5791 .ip C\(dd
5792 If mail is
5793 .i received
5794 from a mailer with this flag set,
5795 any addresses in the header that do not have an at sign
5796 (\c
5797 .q @ )
5798 after being rewritten by ruleset three
5799 will have the
5800 .q @domain
5801 clause from the sender envelope address
5802 tacked on.
5803 This allows mail with headers of the form:
5804 .(b
5805 From: usera@hosta
5806 To: userb@hostb, userc
5807 .)b
5808 to be rewritten as:
5809 .(b
5810 From: usera@hosta
5811 To: userb@hostb, userc@hosta
5812 .)b
5813 automatically.
5814 However, it doesn't really work reliably.
5815 .ip d
5816 Do not include angle brackets around route-address syntax addresses.
5817 This is useful on mailers that are going to pass addresses to a shell
5818 that might interpret angle brackets as I/O redirection.
5819 However, it does not protect against other shell metacharacters.
5820 Therefore, passing addresses to a shell should not be considered secure.
5821 .ip D\(dg
5822 This mailer wants a
5823 .q Date:
5824 header line.
5825 .ip e
5826 This mailer is expensive to connect to,
5827 so try to avoid connecting normally;
5828 any necessary connection will occur during a queue run.
5829 See also option
5830 .b HoldExpensive .
5831 .ip E
5832 Escape lines beginning with
5833 .q From\0
5834 in the message with a `>' sign.
5835 .ip f
5836 The mailer wants a
5837 .b \-f
5838 .i from
5839 flag,
5840 but only if this is a network forward operation
5841 (i.e.,
5842 the mailer will give an error
5843 if the executing user
5844 does not have special permissions).
5845 .ip F\(dg
5846 This mailer wants a
5847 .q From:
5848 header line.
5849 .ip g
5850 Normally,
5851 .i sendmail
5852 sends internally generated email (e.g., error messages)
5853 using the null return address
5854 as required by RFC 1123.
5855 However, some mailers don't accept a null return address.
5856 If necessary,
5857 you can set the
5858 .b g
5859 flag to prevent
5860 .i sendmail
5861 from obeying the standards;
5862 error messages will be sent as from the MAILER-DAEMON
5863 (actually, the value of the
5864 .b $n
5865 macro).
5866 .ip h
5867 Upper case should be preserved in host names
5868 (the $@ portion of the mailer triplet resolved from ruleset 0)
5869 for this mailer.
5870 .ip i
5871 Do User Database rewriting on envelope sender address.
5872 .ip I
5873 This flag is deprecated
5874 and will be removed from a future version.
5875 This mailer will be speaking SMTP
5876 to another
5877 .i sendmail
5878 \*-
5879 as such it can use special protocol features.
5880 This flag should not be used except for debugging purposes
5881 because it uses
5882 .b VERB
5883 as SMTP command.
5884 .ip j
5885 Do User Database rewriting on recipients as well as senders.
5886 .ip k
5887 Normally when
5888 .i sendmail
5889 connects to a host via SMTP,
5890 it checks to make sure that this isn't accidentally the same host name
5891 as might happen if
5892 .i sendmail
5893 is misconfigured or if a long-haul network interface is set in loopback mode.
5894 This flag disables the loopback check.
5895 It should only be used under very unusual circumstances.
5896 .ip K
5897 Currently unimplemented.
5898 Reserved for chunking.
5899 .ip l
5900 This mailer is local
5901 (i.e.,
5902 final delivery will be performed).
5903 .ip L
5904 Limit the line lengths as specified in RFC 821.
5905 This deprecated option should be replaced by the
5906 .b L=
5907 mail declaration.
5908 For historic reasons, the
5909 .b L
5910 flag also sets the
5911 .b 7
5912 flag.
5913 .ip m
5914 This mailer can send to multiple users
5915 on the same host
5916 in one transaction.
5917 When a
5918 .b $u
5919 macro occurs in the
5920 .i argv
5921 part of the mailer definition,
5922 that field will be repeated as necessary
5923 for all qualifying users.
5924 Removing this flag can defeat duplicate suppression on a remote site
5925 as each recipient is sent in a separate transaction.
5926 .ip M\(dg
5927 This mailer wants a
5928 .q Message-Id:
5929 header line.
5930 .ip n
5931 Do not insert a UNIX-style
5932 .q From
5933 line on the front of the message.
5934 .ip o
5935 Always run as the owner of the recipient mailbox.
5936 Normally
5937 .i sendmail
5938 runs as the sender for locally generated mail
5939 or as
5940 .q daemon
5941 (actually, the user specified in the
5942 .b u
5943 option)
5944 when delivering network mail.
5945 The normal behavior is required by most local mailers,
5946 which will not allow the envelope sender address
5947 to be set unless the mailer is running as daemon.
5948 This flag is ignored if the
5949 .b S
5950 flag is set.
5951 .ip p
5952 Use the route-addr style reverse-path in the SMTP
5953 .q "MAIL FROM:"
5954 command
5955 rather than just the return address;
5956 although this is required in RFC 821 section 3.1,
5957 many hosts do not process reverse-paths properly.
5958 Reverse-paths are officially discouraged by RFC 1123.
5959 .ip P\(dg
5960 This mailer wants a
5961 .q Return-Path:
5962 line.
5963 .ip q
5964 When an address that resolves to this mailer is verified
5965 (SMTP VRFY command),
5966 generate 250 responses instead of 252 responses.
5967 This will imply that the address is local.
5968 .ip r
5969 Same as
5970 .b f ,
5971 but sends a
5972 .b \-r
5973 flag.
5974 .ip R
5975 Open SMTP connections from a
5976 .q secure
5977 port.
5978 Secure ports aren't
5979 (secure, that is)
5980 except on UNIX machines,
5981 so it is unclear that this adds anything.
5982 .i sendmail
5983 must be running as root to be able to use this flag.
5984 .ip s
5985 Strip quote characters (" and \e) off of the address
5986 before calling the mailer.
5987 .ip S
5988 Don't reset the userid
5989 before calling the mailer.
5990 This would be used in a secure environment
5991 where
5992 .i sendmail
5993 ran as root.
5994 This could be used to avoid forged addresses.
5995 If the
5996 .b U=
5997 field is also specified,
5998 this flag causes the effective user id to be set to that user.
5999 .ip u
6000 Upper case should be preserved in user names for this mailer.  Standards
6001 require preservation of case in the local part of addresses, except for
6002 those address for which your system accepts responsibility.
6003 RFC 2142 provides a long list of addresses which should be case
6004 insensitive.
6005 If you use this flag, you may be violating RFC 2142.
6006 Note that postmaster is always treated as a case insensitive address
6007 regardless of this flag.
6008 .ip U
6009 This mailer wants UUCP-style
6010 .q From
6011 lines with the ugly
6012 .q "remote from <host>"
6013 on the end.
6014 .ip w
6015 The user must have a valid account on this machine,
6016 i.e.,
6017 .i getpwnam
6018 must succeed.
6019 If not, the mail is bounced.
6020 See also the
6021 .b MailBoxDatabase
6022 option.
6023 This is required to get
6024 .q \&.forward
6025 capability.
6026 .ip W
6027 Ignore long term host status information (see Section
6028 "Persistent Host Status Information").
6029 .ip x\(dg
6030 This mailer wants a
6031 .q Full-Name:
6032 header line.
6033 .ip X
6034 This mailer wants to use the hidden dot algorithm as specified in RFC 821;
6035 basically, any line beginning with a dot will have an extra dot prepended
6036 (to be stripped at the other end).
6037 This insures that lines in the message containing a dot
6038 will not terminate the message prematurely.
6039 .ip z
6040 Run Local Mail Transfer Protocol (LMTP)
6041 between
6042 .i sendmail
6043 and the local mailer.
6044 This is a variant on SMTP
6045 defined in RFC 2033
6046 that is specifically designed for delivery to a local mailbox.
6047 .ip Z
6048 Apply DialDelay (if set) to this mailer.
6049 .ip 0
6050 Don't look up MX records for hosts sent via SMTP/LMTP.
6051 Do not apply
6052 .b FallbackMXhost
6053 either.
6054 .ip 1
6055 Don't send null characters ('\\0') to this mailer.
6056 .ip 2
6057 Don't use ESMTP even if offered; this is useful for broken
6058 systems that offer ESMTP but fail on EHLO (without recovering
6059 when HELO is tried next).
6060 .ip 3
6061 Extend the list of characters converted to =XX notation
6062 when converting to Quoted-Printable
6063 to include those that don't map cleanly between ASCII and EBCDIC.
6064 Useful if you have IBM mainframes on site.
6065 .ip 5
6066 If no aliases are found for this address,
6067 pass the address through ruleset 5 for possible alternate resolution.
6068 This is intended to forward the mail to an alternate delivery spot.
6069 .ip 6
6070 Strip headers to seven bits.
6071 .ip 7
6072 Strip all output to seven bits.
6073 This is the default if the
6074 .b L
6075 flag is set.
6076 Note that clearing this option is not
6077 sufficient to get full eight bit data passed through
6078 .i sendmail .
6079 If the
6080 .b 7
6081 option is set, this is essentially always set,
6082 since the eighth bit was stripped on input.
6083 Note that this option will only impact messages
6084 that didn't have 8\(->7 bit MIME conversions performed.
6085 .ip 8
6086 If set,
6087 it is acceptable to send eight bit data to this mailer;
6088 the usual attempt to do 8\(->7 bit MIME conversions will be bypassed.
6089 .ip 9
6090 If set,
6091 do
6092 .i limited
6093 7\(->8 bit MIME conversions.
6094 These conversions are limited to text/plain data.
6095 .ip :
6096 Check addresses to see if they begin
6097 .q :include: ;
6098 if they do, convert them to the
6099 .q *include*
6100 mailer.
6101 .ip |
6102 Check addresses to see if they begin with a `|';
6103 if they do, convert them to the
6104 .q prog
6105 mailer.
6106 .ip /
6107 Check addresses to see if they begin with a `/';
6108 if they do, convert them to the
6109 .q *file*
6110 mailer.
6111 .ip @
6112 Look up addresses in the user database.
6113 .ip %
6114 Do not attempt delivery on initial receipt of a message
6115 or on queue runs
6116 unless the queued message is selected
6117 using one of the -qI/-qR/-qS queue run modifiers
6118 or an ETRN request.
6119 .ip !
6120 Disable an MH hack that drops an explicit
6121 From: header
6122 if it is the same as what sendmail would generate.
6123 .pp
6124 Configuration files prior to level 6
6125 assume the `A', `w', `5', `:', `|', `/', and `@' options
6126 on the mailer named
6127 .q local .
6128 .pp
6129 The mailer with the special name
6130 .q error
6131 can be used to generate a user error.
6132 The (optional) host field is an exit status to be returned,
6133 and the user field is a message to be printed.
6134 The exit status may be numeric or one of the values
6135 USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
6136 to return the corresponding EX_ exit code,
6137 or an enhanced error code as described in RFC 1893,
6138 .ul
6139 Enhanced Mail System Status Codes.
6140 For example, the entry:
6141 .(b
6142 $#error $@ NOHOST $: Host unknown in this domain
6143 .)b
6144 on the RHS of a rule
6145 will cause the specified error to be generated
6146 and the
6147 .q "Host unknown"
6148 exit status to be returned
6149 if the LHS matches.
6150 This mailer is only functional in rulesets 0, 5,
6151 or one of the check_* rulesets.
6152 The host field can also contain the special token
6153 .b quarantine
6154 which instructs sendmail to quarantine the current message.
6155 .pp
6156 The mailer with the special name
6157 .q discard
6158 causes any mail sent to it to be discarded
6159 but otherwise treated as though it were successfully delivered.
6160 This mailer cannot be used in ruleset 0,
6161 only in the various address checking rulesets.
6162 .pp
6163 The mailer named
6164 .q local
6165 .i must
6166 be defined in every configuration file.
6167 This is used to deliver local mail,
6168 and is treated specially in several ways.
6169 Additionally, three other mailers named
6170 .q prog ,
6171 .q *file* ,
6172 and
6173 .q *include*
6174 may be defined to tune the delivery of messages to programs,
6175 files,
6176 and :include: lists respectively.
6177 They default to:
6178 .(b
6179 Mprog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh \-c $u
6180 M*file*, P=[FILE], F=lsDFMPEouq9, T=DNS/RFC822/X-Unix, A=FILE $u
6181 M*include*, P=/dev/null, F=su, A=INCLUDE $u
6182 .)b
6183 .pp
6184 Builtin pathnames are [FILE] and [IPC], the former is used for
6185 delivery to files, the latter for delivery via interprocess communication.
6186 For mailers that use [IPC] as pathname the argument vector (A=)
6187 must start with TCP or FILE for delivery via a TCP or a Unix domain socket.
6188 If TCP is used, the second argument must be the name of the host
6189 to contact.
6190 Optionally a third argument can be used to specify a port,
6191 the default is smtp (port 25).
6192 If FILE is used, the second argument must be the name of
6193 the Unix domain socket.
6194 .pp
6195 If the argument vector does not contain $u then
6196 .i sendmail
6197 will speak SMTP (or LMTP if the mailer flag z is specified) to the mailer.
6198 .pp
6199 If no Eol field is defined, then the default is "\\r\\n" for
6200 SMTP mailers and "\\n" of others.
6201 .pp
6202 The Sender and Recipient rewriting sets
6203 may either be a simple ruleset id
6204 or may be two ids separated by a slash;
6205 if so, the first rewriting set is applied to envelope
6206 addresses
6207 and the second is applied to headers.
6208 Setting any value to zero disables corresponding mailer-specific rewriting.
6209 .pp
6210 The Directory
6211 is actually a colon-separated path of directories to try.
6212 For example, the definition
6213 .q D=$z:/
6214 first tries to execute in the recipient's home directory;
6215 if that is not available,
6216 it tries to execute in the root of the filesystem.
6217 This is intended to be used only on the
6218 .q prog
6219 mailer,
6220 since some shells (such as
6221 .i csh )
6222 refuse to execute if they cannot read the current directory.
6223 Since the queue directory is not normally readable by unprivileged users
6224 .i csh
6225 scripts as recipients can fail.
6226 .pp
6227 The Userid
6228 specifies the default user and group id to run as,
6229 overriding the
6230 .b DefaultUser
6231 option (q.v.).
6232 If the
6233 .b S
6234 mailer flag is also specified,
6235 this user and group will be set as the
6236 effective uid and gid for the process.
6237 This may be given as
6238 .i user:group
6239 to set both the user and group id;
6240 either may be an integer or a symbolic name to be looked up
6241 in the
6242 .i passwd
6243 and
6244 .i group
6245 files respectively.
6246 If only a symbolic user name is specified,
6247 the group id in the
6248 .i passwd
6249 file for that user is used as the group id.
6250 .pp
6251 The Charset field
6252 is used when converting a message to MIME;
6253 this is the character set used in the
6254 Content-Type: header.
6255 If this is not set, the
6256 .b DefaultCharset
6257 option is used,
6258 and if that is not set, the value
6259 .q unknown-8bit
6260 is used.
6261 .b WARNING:
6262 this field applies to the sender's mailer,
6263 not the recipient's mailer.
6264 For example, if the envelope sender address
6265 lists an address on the local network
6266 and the recipient is on an external network,
6267 the character set will be set from the Charset= field
6268 for the local network mailer,
6269 not that of the external network mailer.
6270 .pp
6271 The Type= field
6272 sets the type information
6273 used in MIME error messages
6274 as defined by
6275 RFC 1894.
6276 It is actually three values separated by slashes:
6277 the MTA-type (that is, the description of how hosts are named),
6278 the address type (the description of e-mail addresses),
6279 and the diagnostic type (the description of error diagnostic codes).
6280 Each of these must be a registered value
6281 or begin with
6282 .q X\- .
6283 The default is
6284 .q dns/rfc822/smtp .
6285 .pp
6286 The m= field specifies the maximum number of messages
6287 to attempt to deliver on a single SMTP or LMTP connection.
6288 The default is infinite.
6289 .pp
6290 The r= field specifies the maximum number of recipients
6291 to attempt to deliver in a single envelope.
6292 It defaults to 100.
6293 .pp
6294 The /= field specifies a new root directory for the mailer.  The path is
6295 macro expanded and then passed to the
6296 .q chroot
6297 system call.  The root directory is changed before the Directory field is
6298 consulted or the uid is changed.
6299 .pp
6300 The Wait= field specifies the maximum time to wait for the
6301 mailer to return after sending all data to it.
6302 This applies to mailers that have been forked by
6303 .i sendmail .
6304 .pp
6305 The Queuegroup= field specifies the default queue group in which
6306 received mail should be queued.
6307 This can be overridden by other means as explained in section
6308 ``Queue Groups and Queue Directories''.
6309 .sh 2 "H \*- Define Header"
6310 .pp
6311 The format of the header lines that
6312 .i sendmail
6313 inserts into the message
6314 are defined by the
6315 .b H
6316 line.
6317 The syntax of this line is one of the following:
6318 .(b F
6319 .b H \c
6320 .i hname \c
6321 .b :
6322 .i htemplate
6323 .)b
6324 .(b F
6325 .b H [\c
6326 .b ? \c
6327 .i mflags \c
6328 .b ? \c
6329 .b ]\c
6330 .i hname \c
6331 .b :
6332 .i htemplate
6333 .)b
6334 .(b F
6335 .b H [\c
6336 .b ?$ \c
6337 .i {macro} \c
6338 .b ? \c
6339 .b ]\c
6340 .i hname \c
6341 .b :
6342 .i htemplate
6343 .)b
6344 Continuation lines in this spec
6345 are reflected directly into the outgoing message.
6346 The
6347 .i htemplate
6348 is macro-expanded before insertion into the message.
6349 If the
6350 .i mflags
6351 (surrounded by question marks)
6352 are specified,
6353 at least one of the specified flags
6354 must be stated in the mailer definition
6355 for this header to be automatically output.
6356 If a
6357 .i ${macro}
6358 (surrounded by question marks)
6359 is specified,
6360 the header will be automatically output
6361 if the macro is set.
6362 The macro may be set using any of the normal methods,
6363 including using the
6364 .b macro
6365 storage map in a ruleset.
6366 If one of these headers is in the input
6367 it is reflected to the output
6368 regardless of these flags or macros.
6369 Notice:
6370 If a
6371 .i ${macro}
6372 is used to set a header, then it is useful to add that macro to class
6373 .i $={persistentMacros}
6374 which consists of the macros that should be saved across queue runs.
6375 .pp
6376 Some headers have special semantics
6377 that will be described later.
6378 .pp
6379 A secondary syntax allows validation of headers as they are being read.
6380 To enable validation, use:
6381 .(b
6382 .b H \c
6383 .i Header \c
6384 .b ": $>" \c
6385 .i Ruleset
6386 .b H \c
6387 .i Header \c
6388 .b ": $>+" \c
6389 .i Ruleset
6390 .)b
6391 The indicated
6392 .i Ruleset
6393 is called for the specified
6394 .i Header ,
6395 and can return
6396 .b $#error
6397 to reject or quarantine the message or
6398 .b $#discard
6399 to discard the message
6400 (as with the other
6401 .b check_ *
6402 rulesets).
6403 The ruleset receives the header field-body as argument,
6404 i.e., not the header field-name; see also
6405 ${hdr_name} and ${currHeader}.
6406 The header is treated as a structured field,
6407 that is,
6408 text in parentheses is deleted before processing,
6409 unless the second form
6410 .b $>+
6411 is used.
6412 Note: only one ruleset can be associated with a header;
6413 .i sendmail
6414 will silently ignore multiple entries.
6415 .pp
6416 For example, the configuration lines:
6417 .(b
6418 HMessage-Id: $>CheckMessageId
6419
6420 SCheckMessageId
6421 R< $+ @ $+  >   $@ OK
6422 R$*             $#error $: Illegal Message-Id header
6423 .)b
6424 would refuse any message that had a Message-Id: header of any of the
6425 following forms:
6426 .(b
6427 Message-Id: <>
6428 Message-Id: some text
6429 Message-Id: <legal text@domain> extra crud
6430 .)b
6431 A default ruleset that is called for headers which don't have a
6432 specific ruleset defined for them can be specified by:
6433 .(b
6434 .b H \c
6435 .i * \c
6436 .b ": $>" \c
6437 .i Ruleset
6438 .)b
6439 or
6440 .(b
6441 .b H \c
6442 .i * \c
6443 .b ": $>+" \c
6444 .i Ruleset
6445 .)b
6446 .sh 2 "O \*- Set Option"
6447 .pp
6448 There are a number of global options that
6449 can be set from a configuration file.
6450 Options are represented by full words;
6451 some are also representable as single characters for back compatibility.
6452 The syntax of this line is:
6453 .(b F
6454 .b O \0
6455 .i option \c
6456 .b = \c
6457 .i value
6458 .)b
6459 This sets option
6460 .i option
6461 to be
6462 .i value .
6463 Note that there
6464 .i must
6465 be a space between the letter `O' and the name of the option.
6466 An older version is:
6467 .(b F
6468 .b O \c
6469 .i o\|value
6470 .)b
6471 where the option
6472 .i o
6473 is a single character.
6474 Depending on the option,
6475 .i value
6476 may be a string, an integer,
6477 a boolean
6478 (with legal values
6479 .q t ,
6480 .q T ,
6481 .q f ,
6482 or
6483 .q F ;
6484 the default is TRUE),
6485 or
6486 a time interval.
6487 .pp
6488 All filenames used in options should be absolute paths,
6489 i.e., starting with '/'.
6490 Relative filenames most likely cause surprises during operation
6491 (unless otherwise noted).
6492 .pp
6493 The options supported (with the old, one character names in brackets) are:
6494 .nr ii 1i
6495 .ip "AliasFile=\fIspec, spec, ...\fP"
6496 [A]
6497 Specify possible alias file(s).
6498 Each
6499 .i spec
6500 should be in the format
6501 ``\c
6502 .i class \c
6503 .b :
6504 .i info ''
6505 where
6506 .i class \c
6507 .b :
6508 is optional and defaults to ``implicit''.
6509 Note that
6510 .i info
6511 is required for all
6512 .i class es
6513 except
6514 .q ldap .
6515 For the
6516 .q ldap
6517 class,
6518 if
6519 .i info
6520 is not specified,
6521 a default
6522 .i info
6523 value is used as follows:
6524 .(b
6525 \-k (&(objectClass=sendmailMTAAliasObject)
6526      (sendmailMTAAliasName=aliases)
6527      (|(sendmailMTACluster=${sendmailMTACluster})
6528        (sendmailMTAHost=$j))
6529      (sendmailMTAKey=%0))
6530 \-v sendmailMTAAliasValue
6531 .)b
6532 Depending on how
6533 .i sendmail
6534 is compiled, valid classes are
6535 .q implicit
6536 (search through a compiled-in list of alias file types,
6537 for back compatibility),
6538 .q hash
6539 (if
6540 .sm NEWDB
6541 is specified),
6542 .q btree
6543 (if
6544 .sm NEWDB
6545 is specified),
6546 .q dbm
6547 (if
6548 .sm NDBM
6549 is specified),
6550 .q cdb
6551 (if
6552 .sm CDB
6553 is specified),
6554 .q stab
6555 (internal symbol table \*- not normally used
6556 unless you have no other database lookup),
6557 .q sequence
6558 (use a sequence of maps
6559 previously declared),
6560 .q ldap
6561 (if
6562 .sm LDAPMAP
6563 is specified),
6564 or
6565 .q nis
6566 (if
6567 .sm NIS
6568 is specified).
6569 If a list of
6570 .i spec s
6571 are provided,
6572 .i sendmail
6573 searches them in order.
6574 .ip AliasWait=\fItimeout\fP
6575 [a]
6576 If set,
6577 wait up to
6578 .i timeout
6579 (units default to minutes)
6580 for an
6581 .q @:@
6582 entry to exist in the alias database
6583 before starting up.
6584 If it does not appear in the
6585 .i timeout
6586 interval issue a warning.
6587 .ip AllowBogusHELO
6588 [no short name]
6589 If set, allow HELO SMTP commands that don't include a host name.
6590 Setting this violates RFC 1123 section 5.2.5,
6591 but is necessary to interoperate with several SMTP clients.
6592 If there is a value, it is still checked for legitimacy.
6593 .ip AuthMaxBits=\fIN\fP
6594 [no short name]
6595 Limit the maximum encryption strength for the security layer in
6596 SMTP AUTH (SASL). Default is essentially unlimited.
6597 This allows to turn off additional encryption in SASL if
6598 STARTTLS is already encrypting the communication, because the
6599 existing encryption strength is taken into account when choosing
6600 an algorithm for the security layer.
6601 For example, if STARTTLS is used and the symmetric cipher is 3DES,
6602 then the the keylength (in bits) is 168.
6603 Hence setting
6604 .b AuthMaxBits
6605 to 168 will disable any encryption in SASL.
6606 .ip AuthMechanisms
6607 [no short name]
6608 List of authentication mechanisms for AUTH (separated by spaces).
6609 The advertised list of authentication mechanisms will be the
6610 intersection of this list and the list of available mechanisms as
6611 determined by the Cyrus SASL library.
6612 If STARTTLS is active, EXTERNAL will be added to this list.
6613 In that case, the value of {cert_subject} is used as authentication id.
6614 .ip AuthOptions
6615 [no short name]
6616 List of options for SMTP AUTH consisting of single characters
6617 with intervening white space or commas.
6618 .(b
6619 .ta 4n
6620 A       Use the AUTH= parameter for the MAIL FROM
6621         command only when authentication succeeded.
6622         This can be used as a workaround for broken
6623         MTAs that do not implement RFC 2554 correctly.
6624 a       protection from active (non-dictionary) attacks
6625         during authentication exchange.
6626 c       require mechanisms which pass client credentials,
6627         and allow mechanisms which can pass credentials
6628         to do so.
6629 d       don't permit mechanisms susceptible to passive
6630         dictionary attack.
6631 f       require forward secrecy between sessions
6632         (breaking one won't help break next).
6633 m       require mechanisms which provide mutual authentication
6634         (only available if using Cyrus SASL v2 or later).
6635 p       don't permit mechanisms susceptible to simple
6636         passive attack (e.g., PLAIN, LOGIN), unless a
6637         security layer is active.
6638 y       don't permit mechanisms that allow anonymous login.
6639 .)b
6640 The first option applies to sendmail as a client, the others to a server.
6641 Example:
6642 .(b
6643 O AuthOptions=p,y
6644 .)b
6645 would disallow ANONYMOUS as AUTH mechanism and would
6646 allow PLAIN and LOGIN only if a security layer (e.g.,
6647 provided by STARTTLS) is already active.
6648 The options 'a', 'c', 'd', 'f', 'p', and 'y' refer to properties of the
6649 selected SASL mechanisms.
6650 Explanations of these properties can be found in the Cyrus SASL documentation.
6651 .ip AuthRealm
6652 [no short name]
6653 The authentication realm that is passed to the Cyrus SASL library.
6654 If no realm is specified,
6655 .b $j
6656 is used.
6657 See also KNOWNBUGS.
6658 .ip BadRcptThrottle=\fIN\fP
6659 [no short name]
6660 If set and the specified number of recipients in a single SMTP
6661 transaction have been rejected, sleep for one second after each subsequent
6662 RCPT command in that transaction.
6663 .ip BlankSub=\fIc\fP
6664 [B]
6665 Set the blank substitution character to
6666 .i c .
6667 Unquoted spaces in addresses are replaced by this character.
6668 Defaults to space (i.e., no change is made).
6669 .ip CACertPath
6670 [no short name]
6671 Path to directory with certificates of CAs.
6672 This directory directory must contain the hashes of each CA certificate
6673 as filenames (or as links to them).
6674 .ip CACertFile
6675 [no short name]
6676 File containing one or more CA certificates;
6677 see section about STARTTLS for more information.
6678 .ip CertFingerprintAlgorithm
6679 Specify the fingerprint algorithm (digest) to use for the presented cert.
6680 If the option is not set,
6681 md5 is used and the macro
6682 .b ${cert_md5}
6683 contains the cert fingerprint.
6684 If the option is explicitly set,
6685 the specified algorithm (e.g., sha1) is used
6686 and the macro
6687 .b ${cert_fp}
6688 contains the cert fingerprint.
6689 .ip CipherList
6690 Specify cipher list for STARTTLS (does not apply to TLSv1.3).
6691 See
6692 .i ciphers (1)
6693 for possible values.
6694 .ip CheckAliases
6695 [n]
6696 Validate the RHS of aliases when rebuilding the alias database.
6697 .ip CheckpointInterval=\fIN\fP
6698 [C]
6699 Checkpoints the queue every
6700 .i N
6701 (default 10)
6702 addresses sent.
6703 If your system crashes during delivery to a large list,
6704 this prevents retransmission to any but the last
6705 .i N
6706 recipients.
6707 .ip ClassFactor=\fIfact\fP
6708 [z]
6709 The indicated
6710 .i fact or
6711 is multiplied by the message class
6712 (determined by the Precedence: field in the user header
6713 and the
6714 .b P
6715 lines in the configuration file)
6716 and subtracted from the priority.
6717 Thus, messages with a higher Priority: will be favored.
6718 Defaults to 1800.
6719 .ip ClientCertFile
6720 [no short name]
6721 File containing the certificate of the client, i.e., this certificate
6722 is used when
6723 .i sendmail
6724 acts as client (for STARTTLS).
6725 .ip ClientKeyFile
6726 [no short name]
6727 File containing the private key belonging to the client certificate
6728 (for STARTTLS if
6729 .i sendmail
6730 runs as client).
6731 .ip ClientPortOptions=\fIoptions\fP
6732 [O]
6733 Set client SMTP options.
6734 The options are
6735 .i key=value
6736 pairs separated by commas.
6737 Known keys are:
6738 .(b
6739 .ta 1i
6740 Port    Name/number of source port for connection (defaults to any free port)
6741 Addr    Address mask (defaults INADDR_ANY)
6742 Family  Address family (defaults to INET)
6743 SndBufSize      Size of TCP send buffer
6744 RcvBufSize      Size of TCP receive buffer
6745 Modifier        Options (flags) for the client
6746 .)b
6747 The
6748 .i Addr ess
6749 mask may be a numeric address in IPv4 dot notation or IPv6 colon notation
6750 or a network name.
6751 Note that if a network name is specified,
6752 only the first IP address returned for it will be used.
6753 This may cause indeterminate behavior for network names
6754 that resolve to multiple addresses.
6755 Therefore, use of an address is recommended.
6756 .i Modifier
6757 can be the following character:
6758 .(b
6759 .ta 1i
6760 h       use name of interface for HELO command
6761 A       don't use AUTH when sending e-mail
6762 S       don't use STARTTLS when sending e-mail
6763 .)b
6764 If ``h'' is set, the name corresponding to the outgoing interface
6765 address (whether chosen via the Connection parameter or
6766 the default) is used for the HELO/EHLO command.
6767 However, the name must not start with a square bracket
6768 and it must contain at least one dot.
6769 This is a simple test whether the name is not
6770 an IP address (in square brackets) but a qualified hostname.
6771 Note that multiple ClientPortOptions settings are allowed
6772 in order to give settings for each protocol family
6773 (e.g., one for Family=inet and one for Family=inet6).
6774 A restriction placed on one family only affects
6775 outgoing connections on that particular family.
6776 .ip ClientSSLOptions
6777 A space or comma separated list of SSL related options for the client side.
6778 See
6779 .i SSL_CTX_set_options (3)
6780 for a list;
6781 the available values depend on the OpenSSL version against which
6782 .i sendmail
6783 is compiled.
6784 By default,
6785 .i SSL_OP_ALL
6786 .i SSL_OP_NO_SSLv2
6787 .i SSL_OP_NO_TICKET
6788 .i -SSL_OP_TLSEXT_PADDING
6789 are used
6790 (if those options are available).
6791 Options can be cleared by preceding them with a minus sign.
6792 It is also possible to specify numerical values, e.g.,
6793 .b -0x0010 .
6794 .ip ColonOkInAddr
6795 [no short name]
6796 If set, colons are acceptable in e-mail addresses
6797 (e.g.,
6798 .q host:user ).
6799 If not set, colons indicate the beginning of a RFC 822 group construct
6800 (\c
6801 .q "groupname: member1, member2, ... memberN;" ).
6802 Doubled colons are always acceptable
6803 (\c
6804 .q nodename::user )
6805 and proper route-addr nesting is understood
6806 (\c
6807 .q <@relay:user@host> ).
6808 Furthermore, this option defaults on if the configuration version level
6809 is less than 6 (for back compatibility).
6810 However, it must be off for full compatibility with RFC 822.
6811 .ip ConnectionCacheSize=\fIN\fP
6812 [k]
6813 The maximum number of open connections that will be cached at a time.
6814 The default is one.
6815 This delays closing the current connection until
6816 either this invocation of
6817 .i sendmail
6818 needs to connect to another host
6819 or it terminates.
6820 Setting it to zero defaults to the old behavior,
6821 that is, connections are closed immediately.
6822 Since this consumes file descriptors,
6823 the connection cache should be kept small:
6824 4 is probably a practical maximum.
6825 .ip ConnectionCacheTimeout=\fItimeout\fP
6826 [K]
6827 The maximum amount of time a cached connection will be permitted to idle
6828 without activity.
6829 If this time is exceeded,
6830 the connection is immediately closed.
6831 This value should be small (on the order of ten minutes).
6832 Before
6833 .i sendmail
6834 uses a cached connection,
6835 it always sends a RSET command
6836 to check the connection;
6837 if this fails, it reopens the connection.
6838 This keeps your end from failing if the other end times out.
6839 The point of this option is to be a good network neighbor
6840 and avoid using up excessive resources
6841 on the other end.
6842 The default is five minutes.
6843 .ip ConnectOnlyTo=\fIaddress\fP
6844 [no short name]
6845 This can be used to
6846 override the connection address (for testing purposes).
6847 .ip ConnectionRateThrottle=\fIN\fP
6848 [no short name]
6849 If set to a positive value,
6850 allow no more than
6851 .i N
6852 incoming connections in a one second period per daemon.
6853 This is intended to flatten out peaks
6854 and allow the load average checking to cut in.
6855 Defaults to zero (no limits).
6856 .ip ConnectionRateWindowSize=\fIN\fP
6857 [no short name]
6858 Define the length of the interval for which
6859 the number of incoming connections is maintained.
6860 The default is 60 seconds.
6861 .ip ControlSocketName=\fIname\fP
6862 [no short name]
6863 Name of the control socket for daemon management.
6864 A running
6865 .i sendmail
6866 daemon can be controlled through this named socket.
6867 Available commands are:
6868 .i help,
6869 .i mstat,
6870 .i restart,
6871 .i shutdown,
6872 and
6873 .i status.
6874 The
6875 .i status
6876 command returns the current number of daemon children,
6877 the maximum number of daemon children,
6878 the free disk space (in blocks) of the queue directory,
6879 and the load average of the machine expressed as an integer.
6880 If not set, no control socket will be available.
6881 Solaris and pre-4.4BSD kernel users should see the note in sendmail/README .
6882 .ip CRLFile=\fIname\fP
6883 [no short name]
6884 Name of file that contains certificate
6885 revocation status, useful for X.509v3 authentication.
6886 Note: if a CRLFile is specified but the file is unusable,
6887 STARTTLS is disabled.
6888 .ip CRLPath=\fIname\fP
6889 [no short name]
6890 Name of directory that contains hashes pointing to
6891 certificate revocation status files.
6892 Symbolic links can be generated with the following
6893 two (Bourne) shell commands:
6894 .(b
6895 C=FileName_of_CRL
6896 ln -s $C `openssl crl -noout -hash < $C`.r0
6897 .)b
6898 .ip DHParameters
6899 This option applies to the server side only.
6900 Possible values are:
6901 .(b
6902 .ta 2i
6903 5       use precomputed 512 bit prime.
6904 1       generate 1024 bit prime
6905 2       generate 2048 bit prime.
6906 i       use included precomputed 2048 bit prime (default).
6907 none    do not use Diffie-Hellman.
6908 /path/to/file   load prime from file.
6909 .)b
6910 This is only required if a ciphersuite containing DSA/DH is used.
6911 The default is ``i'' which selects a precomputed, fixed 2048 bit prime.
6912 If ``5'' is selected, then precomputed, fixed primes are used.
6913 Note: this option should not be used
6914 (unless necessary for compatibility with old implementations).
6915 If ``1'' or ``2'' is selected, then prime values are computed during startup.
6916 Note: this operation can take a significant amount of time on a
6917 slow machine (several seconds), but it is only done once at startup.
6918 If ``none'' is selected, then TLS ciphersuites containing DSA/DH
6919 cannot be used.
6920 If a file name is specified (which must be an absolute path),
6921 then the primes are read from it.
6922 It is recommended to generate such a file using a command like this:
6923 .(b
6924         openssl dhparam -out /etc/mail/dhparams.pem 2048
6925 .)b
6926 If the file is not readable or contains unusable data,
6927 the default ``i'' is used instead.
6928 .ip DaemonPortOptions=\fIoptions\fP
6929 [O]
6930 Set server SMTP options.
6931 Each instance of
6932 .b DaemonPortOptions
6933 leads to an additional incoming socket.
6934 The options are
6935 .i key=value
6936 pairs.
6937 Known keys are:
6938 .(b
6939 .ta 1i
6940 Name    User-definable name for the daemon (defaults to "Daemon#")
6941 Port    Name/number of listening port (defaults to "smtp")
6942 Addr    Address mask (defaults INADDR_ANY)
6943 Family  Address family (defaults to INET)
6944 InputMailFilters        List of input mail filters for the daemon
6945 Listen  Size of listen queue (defaults to 10)
6946 Modifier        Options (flags) for the daemon
6947 SndBufSize      Size of TCP send buffer
6948 RcvBufSize      Size of TCP receive buffer
6949 children        maximum number of children per daemon, see \fBMaxDaemonChildren\fP.
6950 DeliveryMode    Delivery mode per daemon, see \fBDeliveryMode\fP.
6951 refuseLA        RefuseLA per daemon
6952 delayLA         DelayLA per daemon
6953 queueLA         QueueLA per daemon
6954 .)b
6955 The
6956 .i Name
6957 key is used for error messages and logging.
6958 The
6959 .i Addr ess
6960 mask may be
6961 a numeric address in IPv4 dot notation or IPv6 colon notation,
6962 or a network name,
6963 or a path to a local socket.
6964 Note that if a network name is specified,
6965 only the first IP address returned for it will be used.
6966 This may cause indeterminate behavior for network names
6967 that resolve to multiple addresses.
6968 Therefore, use of an address is recommended.
6969 The
6970 .i Family
6971 key defaults to INET (IPv4).
6972 IPv6 users who wish to also accept IPv6 connections
6973 should add additional Family=inet6
6974 .b DaemonPortOptions
6975 lines.
6976 For a local socket, use
6977 Family=local
6978 or
6979 Family=unix.
6980 The
6981 .i InputMailFilters
6982 key overrides the default list of input mail filters listed in the
6983 .b InputMailFilters
6984 option.
6985 If multiple input mail filters are required, they must be separated
6986 by semicolons (not commas).
6987 .i Modifier
6988 can be a sequence (without any delimiters)
6989 of the following characters:
6990 .(b
6991 .ta 1i
6992 a       always require AUTH
6993 b       bind to interface through which mail has been received
6994 c       perform hostname canonification (.cf)
6995 f       require fully qualified hostname (.cf)
6996 s       Run smtps (SMTP over SSL) instead of smtp
6997 u       allow unqualified addresses (.cf)
6998 A       disable AUTH (overrides 'a' modifier)
6999 C       don't perform hostname canonification
7000 E       disallow ETRN (see RFC 2476)
7001 O       optional; if opening the socket fails ignore it
7002 S       don't offer STARTTLS
7003 .)b
7004 That is, one way to specify a message submission agent (MSA) that
7005 always requires AUTH is:
7006 .(b
7007 O DaemonPortOptions=Name=MSA, Port=587, M=Ea
7008 .)b
7009 The modifiers that are marked with "(.cf)" have only
7010 effect in the standard configuration file, in which
7011 they are available via
7012 .b ${daemon_flags} .
7013 Notice: Do
7014 .b not
7015 use the ``a'' modifier on a public accessible MTA!
7016 It should only be used for a MSA that is accessed by authorized
7017 users for initial mail submission.
7018 Users must authenticate to use a MSA which has this option turned on.
7019 The flags ``c'' and ``C'' can change the default for
7020 hostname canonification in the
7021 .i sendmail.cf
7022 file.
7023 See the relevant documentation for
7024 .sm FEATURE(nocanonify) .
7025 The modifier ``f'' disallows addresses of the form
7026 .b user@host
7027 unless they are submitted directly.
7028 The flag ``u'' allows unqualified sender addresses,
7029 i.e., those without @host.
7030 ``b'' forces sendmail to bind to the interface
7031 through which the e-mail has been
7032 received for the outgoing connection.
7033 .b WARNING:
7034 Use ``b''
7035 only if outgoing mail can be routed through the incoming connection's
7036 interface to its destination. No attempt is made to catch problems due to a
7037 misconfiguration of this parameter, use it only for virtual hosting
7038 where each virtual interface can connect to every possible location.
7039 This will also override possible settings via
7040 .b ClientPortOptions.
7041 Note,
7042 .i sendmail
7043 will listen on a new socket
7044 for each occurrence of the
7045 .b DaemonPortOptions
7046 option in a configuration file.
7047 The modifier ``O'' causes sendmail to ignore a socket
7048 if it can't be opened.
7049 This applies to failures from the socket(2) and bind(2) calls.
7050 .ip DefaultAuthInfo
7051 [no short name]
7052 Filename that contains default authentication information for outgoing
7053 connections. This file must contain the user id, the authorization id,
7054 the password (plain text), the realm and the list of mechanisms to use
7055 on separate lines and must be readable by
7056 root (or the trusted user) only.
7057 If no realm is specified,
7058 .b $j
7059 is used.
7060 If no mechanisms are specified, the list given by
7061 .b AuthMechanisms
7062 is used.
7063 Notice: this option is deprecated and will be removed in future versions.
7064 Moreover, it doesn't work for the MSP since it can't read the file
7065 (the file must not be group/world-readable otherwise
7066 .i sendmail
7067 will complain).
7068 Use the authinfo ruleset instead which provides more control over
7069 the usage of the data anyway.
7070 .ip DefaultCharSet=\fIcharset\fP
7071 [no short name]
7072 When a message that has 8-bit characters but is not in MIME format
7073 is converted to MIME
7074 (see the EightBitMode option)
7075 a character set must be included in the Content-Type: header.
7076 This character set is normally set from the Charset= field
7077 of the mailer descriptor.
7078 If that is not set, the value of this option is used.
7079 If this option is not set, the value
7080 .q unknown-8bit
7081 is used.
7082 .ip DataFileBufferSize=\fIthreshold\fP
7083 [no short name]
7084 Set the
7085 .i threshold ,
7086 in bytes,
7087 before a memory-based
7088 queue data file
7089 becomes disk-based.
7090 The default is 4096 bytes.
7091 .ip DeadLetterDrop=\fIfile\fP
7092 [no short name]
7093 Defines the location of the system-wide dead.letter file,
7094 formerly hardcoded to /usr/tmp/dead.letter.
7095 If this option is not set (the default),
7096 sendmail will not attempt to save to a system-wide dead.letter file
7097 in the event
7098 it cannot bounce the mail to the user or postmaster.
7099 Instead, it will rename the qf file
7100 as it has in the past
7101 when the dead.letter file could not be opened.
7102 .ip DefaultUser=\fIuser:group\fP
7103 [u]
7104 Set the default userid for mailers to
7105 .i user:group .
7106 If
7107 .i group
7108 is omitted and
7109 .i user
7110 is a user name
7111 (as opposed to a numeric user id)
7112 the default group listed in the /etc/passwd file for that user is used
7113 as the default group.
7114 Both
7115 .i user
7116 and
7117 .i group
7118 may be numeric.
7119 Mailers without the
7120 .i S
7121 flag in the mailer definition
7122 will run as this user.
7123 Defaults to 1:1.
7124 The value can also be given as a symbolic user name.\**
7125 .(f
7126 \**The old
7127 .b g
7128 option has been combined into the
7129 .b DefaultUser
7130 option.
7131 .)f
7132 .ip DelayLA=\fILA\fP
7133 [no short name]
7134 When the system load average exceeds
7135 .i LA ,
7136 .i sendmail
7137 will sleep for one second on most SMTP commands and
7138 before accepting connections.
7139 .ip DeliverByMin=\fItime\fP
7140 [0]
7141 Set minimum time for Deliver By SMTP Service Extension (RFC 2852).
7142 If 0, no time is listed, if less than 0, the extension is not offered,
7143 if greater than 0, it is listed as minimum time
7144 for the EHLO keyword DELIVERBY.
7145 .ip DeliveryMode=\fIx\fP
7146 [d]
7147 Deliver in mode
7148 .i x .
7149 Legal modes are:
7150 .(b
7151 .ta 4n
7152 i       Deliver interactively (synchronously)
7153 b       Deliver in background (asynchronously)
7154 q       Just queue the message (deliver during queue run)
7155 d       Defer delivery and all map lookups (deliver during queue run)
7156 .)b
7157 Defaults to ``b'' if no option is specified,
7158 ``i'' if it is specified but given no argument
7159 (i.e., ``Od'' is equivalent to ``Odi'').
7160 The
7161 .b \-v
7162 command line flag sets this to
7163 .b i .
7164 Note: for internal reasons,
7165 ``i'' does not work
7166 if a milter is enabled which can reject or delete recipients.
7167 In that case the mode will be changed to ``b''.
7168 .ip DialDelay=\fIsleeptime\fP
7169 [no short name]
7170 Dial-on-demand network connections can see timeouts
7171 if a connection is opened before the call is set up.
7172 If this is set to an interval and a connection times out
7173 on the first connection being attempted
7174 .i sendmail
7175 will sleep for this amount of time and try again.
7176 This should give your system time to establish the connection
7177 to your service provider.
7178 Units default to seconds, so
7179 .q DialDelay=5
7180 uses a five second delay.
7181 Defaults to zero
7182 (no retry).
7183 This delay only applies to mailers which have the
7184 Z flag set.
7185 .ip DirectSubmissionModifiers=\fImodifiers\fP
7186 Defines
7187 .b ${daemon_flags}
7188 for direct (command line) submissions.
7189 If not set,
7190 .b ${daemon_flags}
7191 is either "CC f" if the option
7192 .b \-G
7193 is used or "c u" otherwise.
7194 Note that only the the "CC", "c", "f", and "u" flags are checked.
7195 .ip DontBlameSendmail=\fIoption,option,...\fP
7196 [no short name]
7197 In order to avoid possible cracking attempts
7198 caused by world- and group-writable files and directories,
7199 .i sendmail
7200 does paranoid checking when opening most of its support files.
7201 If for some reason you absolutely must run with,
7202 for example,
7203 a group-writable
7204 .i /etc
7205 directory,
7206 then you will have to turn off this checking
7207 (at the cost of making your system more vulnerable to attack).
7208 The possible arguments have been described earlier.
7209 The details of these flags are described above.
7210 .\"XXX should have more here!!!  XXX
7211 .b "Use of this option is not recommended."
7212 .ip DontExpandCnames
7213 [no short name]
7214 The standards say that all host addresses used in a mail message
7215 must be fully canonical.
7216 For example, if your host is named
7217 .q Cruft.Foo.ORG
7218 and also has an alias of
7219 .q FTP.Foo.ORG ,
7220 the former name must be used at all times.
7221 This is enforced during host name canonification
7222 ($[ ... $] lookups).
7223 If this option is set, the protocols are ignored and the
7224 .q wrong
7225 thing is done.
7226 However, the IETF is moving toward changing this standard,
7227 so the behavior may become acceptable.
7228 Please note that hosts downstream may still rewrite the address
7229 to be the true canonical name however.
7230 .ip DontInitGroups
7231 [no short name]
7232 If set,
7233 .i sendmail
7234 will avoid using the initgroups(3) call.
7235 If you are running NIS,
7236 this causes a sequential scan of the groups.byname map,
7237 which can cause your NIS server to be badly overloaded in a large domain.
7238 The cost of this is that the only group found for users
7239 will be their primary group (the one in the password file),
7240 which will make file access permissions somewhat more restrictive.
7241 Has no effect on systems that don't have group lists.
7242 .ip DontProbeInterfaces
7243 [no short name]
7244 .i Sendmail
7245 normally finds the names of all interfaces active on your machine
7246 when it starts up
7247 and adds their name to the
7248 .b $=w
7249 class of known host aliases.
7250 If you have a large number of virtual interfaces
7251 or if your DNS inverse lookups are slow
7252 this can be time consuming.
7253 This option turns off that probing.
7254 However, you will need to be certain to include all variant names
7255 in the
7256 .b $=w
7257 class by some other mechanism.
7258 If set to
7259 .b loopback ,
7260 loopback interfaces (e.g., lo0) will not be probed.
7261 .ip DontPruneRoutes
7262 [R]
7263 Normally,
7264 .i sendmail
7265 tries to eliminate any unnecessary explicit routes
7266 when sending an error message
7267 (as discussed in RFC 1123 \(sc 5.2.6).
7268 For example,
7269 when sending an error message to
7270 .(b
7271 <@known1,@known2,@known3:user@unknown>
7272 .)b
7273 .i sendmail
7274 will strip off the
7275 .q @known1,@known2
7276 in order to make the route as direct as possible.
7277 However, if the
7278 .b R
7279 option is set, this will be disabled,
7280 and the mail will be sent to the first address in the route,
7281 even if later addresses are known.
7282 This may be useful if you are caught behind a firewall.
7283 .ip DoubleBounceAddress=\fIerror-address\fP
7284 [no short name]
7285 If an error occurs when sending an error message,
7286 send the error report
7287 (termed a
7288 .q "double bounce"
7289 because it is an error
7290 .q bounce
7291 that occurs when trying to send another error
7292 .q bounce )
7293 to the indicated address.
7294 The address is macro expanded
7295 at the time of delivery.
7296 If not set, defaults to
7297 .q postmaster .
7298 If set to an empty string, double bounces are dropped.
7299 .ip EightBitMode=\fIaction\fP
7300 [8]
7301 Set handling of eight-bit data.
7302 There are two kinds of eight-bit data:
7303 that declared as such using the
7304 .b BODY=8BITMIME
7305 ESMTP declaration or the
7306 .b \-B8BITMIME
7307 command line flag,
7308 and undeclared 8-bit data, that is,
7309 input that just happens to be eight bits.
7310 There are three basic operations that can happen:
7311 undeclared 8-bit data can be automatically converted to 8BITMIME,
7312 undeclared 8-bit data can be passed as-is without conversion to MIME
7313 (``just send 8''),
7314 and declared 8-bit data can be converted to 7-bits
7315 for transmission to a non-8BITMIME mailer.
7316 The possible
7317 .i action s
7318 are:
7319 .(b
7320 .\"  r  Reject undeclared 8-bit data;
7321 .\"     don't convert 8BITMIME\(->7BIT (``reject'')
7322   s     Reject undeclared 8-bit data (``strict'')
7323 .\"     do convert 8BITMIME\(->7BIT (``strict'')
7324 .\"  c  Convert undeclared 8-bit data to MIME;
7325 .\"     don't convert 8BITMIME\(->7BIT (``convert'')
7326   m     Convert undeclared 8-bit data to MIME (``mime'')
7327 .\"     do convert 8BITMIME\(->7BIT (``mime'')
7328 .\"  j  Pass undeclared 8-bit data;
7329 .\"     don't convert 8BITMIME\(->7BIT (``just send 8'')
7330   p     Pass undeclared 8-bit data (``pass'')
7331 .\"     do convert 8BITMIME\(->7BIT (``pass'')
7332 .\"  a  Adaptive algorithm: see below
7333 .)b
7334 .\"The adaptive algorithm is to accept 8-bit data,
7335 .\"converting it to 8BITMIME only if the receiver understands that,
7336 .\"otherwise just passing it as undeclared 8-bit data;
7337 .\"8BITMIME\(->7BIT conversions are done.
7338 In all cases properly declared 8BITMIME data will be converted to 7BIT
7339 as needed.
7340 .p
7341 Note: if an automatic conversion is performed, a header with
7342 the following format will be added:
7343 .(b
7344 X-MIME-Autoconverted: from OLD to NEW by $j id $i
7345 .)b
7346 where
7347 .\" format?
7348 OLD
7349 and
7350 NEW
7351 describe the original format and the converted format, respectively.
7352 .ip ErrorHeader=\fIfile-or-message\fP
7353 [E]
7354 Prepend error messages with the indicated message.
7355 If it begins with a slash,
7356 it is assumed to be the pathname of a file
7357 containing a message (this is the recommended setting).
7358 Otherwise, it is a literal message.
7359 The error file might contain the name, email address, and/or phone number
7360 of a local postmaster who could provide assistance
7361 to end users.
7362 If the option is missing or null,
7363 or if it names a file which does not exist or which is not readable,
7364 no message is printed.
7365 .ip ErrorMode=\fIx\fP
7366 [e]
7367 Dispose of errors using mode
7368 .i x .
7369 The values for
7370 .i x
7371 are:
7372 .(b
7373 p       Print error messages (default)
7374 q       No messages, just give exit status
7375 m       Mail back errors
7376 w       Write back errors (mail if user not logged in)
7377 e       Mail back errors (when applicable) and give zero exit stat always
7378 .)b
7379 Note that the last mode,
7380 .q e ,
7381 is for Berknet error processing and
7382 should not be used in normal circumstances.
7383 Note, too, that mode
7384 .q q ,
7385 only applies to errors recognized before sendmail forks for
7386 background delivery.
7387 .ip FallbackMXhost=\fIfallbackhost\fP
7388 [V]
7389 If specified, the
7390 .i fallbackhost
7391 acts like a very low priority MX
7392 on every host.
7393 MX records will be looked up for this host,
7394 unless the name is surrounded by square brackets.
7395 This is intended to be used by sites with poor network connectivity.
7396 Messages which are undeliverable due to temporary address failures
7397 (e.g., DNS failure)
7398 also go to the FallbackMXhost.
7399 .ip FallBackSmartHost=\fIhostname\fP
7400 If specified, the
7401 .i FallBackSmartHost
7402 will be used in a last-ditch effort for each host.
7403 This is intended to be used by sites with "fake internal DNS",
7404 e.g., a company whose DNS accurately reflects the world
7405 inside that company's domain but not outside.
7406 .ip FastSplit
7407 [no short name]
7408 If set to a value greater than zero (the default is one),
7409 it suppresses the MX lookups on addresses
7410 when they are initially sorted, i.e., for the first delivery attempt.
7411 This usually results in faster envelope splitting unless the MX records
7412 are readily available in a local DNS cache.
7413 To enforce initial sorting based on MX records set
7414 .b FastSplit
7415 to zero.
7416 If the mail is submitted directly from the command line, then
7417 the value also limits the number of processes to deliver the envelopes;
7418 if more envelopes are created they are only queued up
7419 and must be taken care of by a queue run.
7420 Since the default submission method is via SMTP (either from a MUA
7421 or via the MSP), the value of
7422 .b FastSplit
7423 is seldom used to limit the number of processes to deliver the envelopes.
7424 .ip ForkEachJob
7425 [Y]
7426 If set,
7427 deliver each job that is run from the queue in a separate process.
7428 .ip ForwardPath=\fIpath\fP
7429 [J]
7430 Set the path for searching for users' .forward files.
7431 The default is
7432 .q $z/.forward .
7433 Some sites that use the automounter may prefer to change this to
7434 .q /var/forward/$u
7435 to search a file with the same name as the user in a system directory.
7436 It can also be set to a sequence of paths separated by colons;
7437 .i sendmail
7438 stops at the first file it can successfully and safely open.
7439 For example,
7440 .q /var/forward/$u:$z/.forward
7441 will search first in /var/forward/\c
7442 .i username
7443 and then in
7444 .i ~username /.forward
7445 (but only if the first file does not exist).
7446 .ip HeloName=\fIname\fP
7447 [no short name]
7448 Set the name to be used for HELO/EHLO (instead of $j).
7449 .ip HelpFile=\fIfile\fP
7450 [H]
7451 Specify the help file for SMTP.
7452 If no file name is specified, "helpfile" is used.
7453 .ip HoldExpensive
7454 [c]
7455 If an outgoing mailer is marked as being expensive,
7456 don't connect immediately.
7457 .ip HostsFile=\fIpath\fP
7458 [no short name]
7459 The path to the hosts database,
7460 normally
7461 .q /etc/hosts .
7462 This option is only consulted when sendmail
7463 is canonifying addresses,
7464 and then only when
7465 .q files
7466 is in the
7467 .q hosts
7468 service switch entry.
7469 In particular, this file is
7470 .i never
7471 used when looking up host addresses;
7472 that is under the control of the system
7473 .i gethostbyname (3)
7474 routine.
7475 .ip HostStatusDirectory=\fIpath\fP
7476 [no short name]
7477 The location of the long term host status information.
7478 When set,
7479 information about the status of hosts
7480 (e.g., host down or not accepting connections)
7481 will be shared between all
7482 .i sendmail
7483 processes;
7484 normally, this information is only held within a single queue run.
7485 This option requires a connection cache of at least 1 to function.
7486 If the option begins with a leading `/',
7487 it is an absolute pathname;
7488 otherwise,
7489 it is relative to the mail queue directory.
7490 A suggested value for sites desiring persistent host status is
7491 .q \&.hoststat
7492 (i.e., a subdirectory of the queue directory).
7493 .ip IgnoreDots
7494 [i]
7495 Ignore dots in incoming messages.
7496 This is always disabled (that is, dots are always accepted)
7497 when reading SMTP mail.
7498 .ip InputMailFilters=\fIname,name,...\fP
7499 A comma separated list of filters which determines which filters
7500 (see the "X \*- Mail Filter (Milter) Definitions" section)
7501 and the invocation sequence are contacted for incoming SMTP messages.
7502 If none are set, no filters will be contacted.
7503 .ip LDAPDefaultSpec=\fIspec\fP
7504 [no short name]
7505 Sets a default map specification for LDAP maps.
7506 The value should only contain LDAP specific settings
7507 such as
7508 .q "-h host -p port -d bindDN" .
7509 The settings will be used for all LDAP maps
7510 unless the individual map specification overrides a setting.
7511 This option should be set before any LDAP maps are defined.
7512 .ip LogLevel=\fIn\fP
7513 [L]
7514 Set the log level to
7515 .i n .
7516 Defaults to 9.
7517 .ip M\fIx\|value\fP
7518 [no long version]
7519 Set the macro
7520 .i x
7521 to
7522 .i value .
7523 This is intended only for use from the command line.
7524 The
7525 .b \-M
7526 flag is preferred.
7527 .ip MailboxDatabase
7528 [no short name]
7529 Type of lookup to find information about local mailboxes,
7530 defaults to ``pw'' which uses
7531 .i getpwnam .
7532 Other types can be introduced by adding them to the source code,
7533 see libsm/mbdb.c for details.
7534 .ip UseMSP
7535 [no short name]
7536 Use as mail submission program, i.e.,
7537 allow group writable queue files
7538 if the group is the same as that of a set-group-ID sendmail binary.
7539 See the file
7540 .b sendmail/SECURITY
7541 in the distribution tarball.
7542 .ip MatchGECOS
7543 [G]
7544 Allow fuzzy matching on the GECOS field.
7545 If this flag is set,
7546 and the usual user name lookups fail
7547 (that is, there is no alias with this name and a
7548 .i getpwnam
7549 fails),
7550 sequentially search the password file
7551 for a matching entry in the GECOS field.
7552 This also requires that MATCHGECOS
7553 be turned on during compilation.
7554 This option is not recommended.
7555 .ip MaxAliasRecursion=\fIN\fP
7556 [no short name]
7557 The maximum depth of alias recursion (default: 10).
7558 .ip MaxDaemonChildren=\fIN\fP
7559 [no short name]
7560 If set,
7561 .i sendmail
7562 will refuse connections when it has more than
7563 .i N
7564 children processing incoming mail or automatic queue runs.
7565 This does not limit the number of outgoing connections.
7566 If the default
7567 .b DeliveryMode
7568 (background) is used, then
7569 .i sendmail
7570 may create an almost unlimited number of children
7571 (depending on the number of transactions and the
7572 relative execution times of mail receiption and mail delivery).
7573 If the limit should be enforced, then a
7574 .b DeliveryMode
7575 other than background must be used.
7576 If not set, there is no limit to the number of children --
7577 that is, the system load average controls this.
7578 .ip MaxHeadersLength=\fIN\fP
7579 [no short name]
7580 If set to a value greater than zero it specifies
7581 the maximum length of the sum of all headers.
7582 This can be used to prevent a denial of service attack.
7583 The default is 32K.
7584 .ip MaxHopCount=\fIN\fP
7585 [h]
7586 The maximum hop count.
7587 Messages that have been processed more than
7588 .i N
7589 times are assumed to be in a loop and are rejected.
7590 Defaults to 25.
7591 .ip MaxMessageSize=\fIN\fP
7592 [no short name]
7593 Specify the maximum message size
7594 to be advertised in the ESMTP EHLO response.
7595 Messages larger than this will be rejected.
7596 If set to a value greater than zero,
7597 that value will be listed in the SIZE response,
7598 otherwise SIZE is advertised in the ESMTP EHLO response
7599 without a parameter.
7600 .ip MaxMimeHeaderLength=\fIN[/M]\fP
7601 [no short name]
7602 Sets the maximum length of certain MIME header field values to
7603 .i N
7604 characters.
7605 These MIME header fields are determined by being a member of
7606 class {checkMIMETextHeaders}, which currently contains only
7607 the header Content-Description.
7608 For some of these headers which take parameters,
7609 the maximum length of each parameter is set to
7610 .i M
7611 if specified.  If
7612 .i /M
7613 is not specified, one half of
7614 .i N
7615 will be used.
7616 By default,
7617 these values are 2048 and 1024, respectively.
7618 To allow any length, a value of 0 can be specified.
7619 .ip MaxNOOPCommands=\fIN\fP
7620 Override the default of
7621 .b MAXNOOPCOMMANDS
7622 for the number of
7623 .i useless
7624 commands, see Section
7625 "Measures against Denial of Service Attacks".
7626 .ip MaxQueueChildren=\fIN\fP
7627 [no short name]
7628 When set, this limits the number of concurrent queue runner processes to
7629 .i N.
7630 This helps to control the amount of system resources used when processing
7631 the queue.  When there are multiple queue groups defined and the total number
7632 of queue runners for these queue groups would exceed
7633 .i MaxQueueChildren
7634 then the queue groups will not all run concurrently. That is, some portion
7635 of the queue groups will run concurrently such that
7636 .i MaxQueueChildren
7637 will not be exceeded, while the remaining queue groups will be run later (in
7638 round robin order). See also
7639 .i MaxRunnersPerQueue
7640 and the section \fBQueue Group Declaration\fP.
7641 Notice:
7642 .i sendmail
7643 does not count individual queue runners, but only sets of processes
7644 that act on a workgroup.
7645 Hence the actual number of queue runners may be lower than the limit
7646 imposed by
7647 .i MaxQueueChildren .
7648 This discrepancy can be large if some queue runners have to wait
7649 for a slow server and if short intervals are used.
7650 .ip MaxQueueRunSize=\fIN\fP
7651 [no short name]
7652 The maximum number of jobs that will be processed
7653 in a single queue run.
7654 If not set, there is no limit on the size.
7655 If you have very large queues or a very short queue run interval
7656 this could be unstable.
7657 However, since the first
7658 .i N
7659 jobs in queue directory order are run (rather than the
7660 .i N
7661 highest priority jobs)
7662 this should be set as high as possible to avoid
7663 .q losing
7664 jobs that happen to fall late in the queue directory.
7665 Note: this option also restricts the number of entries printed by
7666 .i mailq .
7667 That is, if
7668 .i MaxQueueRunSize
7669 is set to a value
7670 .b N
7671 larger than zero,
7672 then only
7673 .b N
7674 entries are printed per queue group.
7675 .ip MaxRecipientsPerMessage=\fIN\fP
7676 [no short name]
7677 The maximum number of recipients that will be accepted per message
7678 in an SMTP transaction.
7679 Note: setting this too low can interfere with sending mail from
7680 MUAs that use SMTP for initial submission.
7681 If not set, there is no limit on the number of recipients per envelope.
7682 .ip MaxRunnersPerQueue=\fIN\fP
7683 [no short name]
7684 This sets the default maximum number of queue runners for queue groups.
7685 Up to
7686 .i N
7687 queue runners will work in parallel on a queue group's messages.
7688 This is useful where the processing of a message in the queue might
7689 delay the processing of subsequent messages. Such a delay may be the result
7690 of non-erroneous situations such as a low bandwidth connection.
7691 May be overridden on a per queue group basis by setting the
7692 .i Runners
7693 option; see the section \fBQueue Group Declaration\fP.
7694 The default is 1 when not set.
7695 .ip MeToo
7696 [m]
7697 Send to me too,
7698 even if I am in an alias expansion.
7699 This option is deprecated
7700 and will be removed from a future version.
7701 .ip Milter
7702 [no short name]
7703 This option has several sub(sub)options.
7704 The names of the suboptions are separated by dots.
7705 At the first level the following options are available:
7706 .(b
7707 .ta \w'LogLevel'u+3n
7708 LogLevel        Log level for input mail filter actions, defaults to LogLevel.
7709 macros          Specifies list of macro to transmit to filters.
7710                 See list below.
7711 .)b
7712 The ``macros'' option has the following suboptions
7713 which specify the list of macro to transmit to milters
7714 after a certain event occurred.
7715 .(b
7716 .ta \w'envfrom'u+3n
7717 connect After session connection start
7718 helo    After EHLO/HELO command
7719 envfrom After MAIL From command
7720 envrcpt After RCPT To command
7721 data    After DATA command.
7722 eoh     After DATA command and header
7723 eom     After DATA command and terminating ``.''
7724 .)b
7725 By default the lists of macros are empty.
7726 Example:
7727 .(b
7728 O Milter.LogLevel=12
7729 O Milter.macros.connect=j, _, {daemon_name}
7730 .)b
7731 .ip MinFreeBlocks=\fIN\fP
7732 [b]
7733 Insist on at least
7734 .i N
7735 blocks free on the filesystem that holds the queue files
7736 before accepting email via SMTP.
7737 If there is insufficient space
7738 .i sendmail
7739 gives a 452 response
7740 to the MAIL command.
7741 This invites the sender to try again later.
7742 .ip MaxQueueAge=\fIage\fP
7743 [no short name]
7744 If this is set to a value greater than zero,
7745 entries in the queue will be retried during a queue run
7746 only if the individual retry time has been reached
7747 which is doubled for each attempt.
7748 The maximum retry time is limited by the specified value.
7749 .ip MinQueueAge=\fIage\fP
7750 [no short name]
7751 Don't process any queued jobs
7752 that have been in the queue less than the indicated time interval.
7753 This is intended to allow you to get responsiveness
7754 by processing the queue fairly frequently
7755 without thrashing your system by trying jobs too often.
7756 The default units are minutes.
7757 Note:
7758 This option is ignored for queue runs that select a subset
7759 of the queue, i.e.,
7760 .q \-q[!][I|R|S|Q][string]
7761 .ip MustQuoteChars=\fIs\fP
7762 [no short name]
7763 Sets the list of characters that must be quoted if used in a full name
7764 that is in the phrase part of a ``phrase <address>'' syntax.
7765 The default is ``\'.''.
7766 The characters ``@,;:\e()[]'' are always added to this list.
7767 Note: To avoid potential breakage of
7768 DKIM signatures it is useful to set
7769 .(b
7770 O MustQuoteChars=.
7771 .)b
7772 Moreover, relaxed header signing should be used for DKIM signatures.
7773 .ip NiceQueueRun
7774 [no short name]
7775 The priority of queue runners (nice(3)).
7776 This value must be greater or equal zero.
7777 .ip NoRecipientAction
7778 [no short name]
7779 The action to take when you receive a message that has no valid
7780 recipient headers (To:, Cc:, Bcc:, or Apparently-To: \(em
7781 the last included for back compatibility with old
7782 .i sendmail s).
7783 It can be
7784 .b None
7785 to pass the message on unmodified,
7786 which violates the protocol,
7787 .b Add-To
7788 to add a To: header with any recipients it can find in the envelope
7789 (which might expose Bcc: recipients),
7790 .b Add-Apparently-To
7791 to add an Apparently-To: header
7792 (this is only for back-compatibility
7793 and is officially deprecated),
7794 .b Add-To-Undisclosed
7795 to add a header
7796 .q "To: undisclosed-recipients:;"
7797 to make the header legal without disclosing anything,
7798 or
7799 .b Add-Bcc
7800 to add an empty Bcc: header.
7801 .ip OldStyleHeaders
7802 [o]
7803 Assume that the headers may be in old format,
7804 i.e.,
7805 spaces delimit names.
7806 This actually turns on
7807 an adaptive algorithm:
7808 if any recipient address contains a comma, parenthesis,
7809 or angle bracket,
7810 it will be assumed that commas already exist.
7811 If this flag is not on,
7812 only commas delimit names.
7813 Headers are always output with commas between the names.
7814 Defaults to off.
7815 .ip OperatorChars=\fIcharlist\fP
7816 [$o macro]
7817 The list of characters that are considered to be
7818 .q operators ,
7819 that is, characters that delimit tokens.
7820 All operator characters are tokens by themselves;
7821 sequences of non-operator characters are also tokens.
7822 White space characters separate tokens
7823 but are not tokens themselves \(em for example,
7824 .q AAA.BBB
7825 has three tokens, but
7826 .q "AAA BBB"
7827 has two.
7828 If not set, OperatorChars defaults to
7829 .q \&.\|:\|@\|[\|] ;
7830 additionally, the characters
7831 .q (\|)\|<\|>\|,\|;
7832 are always operators.
7833 Note that OperatorChars must be set in the
7834 configuration file before any rulesets.
7835 .ip PidFile=\fIfilename\fP
7836 [no short name]
7837 Filename of the pid file.
7838 (default is _PATH_SENDMAILPID).
7839 The
7840 .i filename
7841 is macro-expanded before it is opened, and unlinked when
7842 .i sendmail
7843 exits.
7844 .ip PostmasterCopy=\fIpostmaster\fP
7845 [P]
7846 If set,
7847 copies of error messages will be sent to the named
7848 .i postmaster .
7849 Only the header of the failed message is sent.
7850 Errors resulting from messages with a negative precedence will not be sent.
7851 Since most errors are user problems,
7852 this is probably not a good idea on large sites,
7853 and arguably contains all sorts of privacy violations,
7854 but it seems to be popular with certain operating systems vendors.
7855 The address is macro expanded
7856 at the time of delivery.
7857 Defaults to no postmaster copies.
7858 .ip PrivacyOptions=\fI\|opt,opt,...\fP
7859 [p]
7860 Set the privacy
7861 .i opt ions.
7862 ``Privacy'' is really a misnomer;
7863 many of these are just a way of insisting on stricter adherence
7864 to the SMTP protocol.
7865 The
7866 .i opt ions
7867 can be selected from:
7868 .(b
7869 .ta \w'noactualrecipient'u+3n
7870 public  Allow open access
7871 needmailhelo    Insist on HELO or EHLO command before MAIL
7872 needexpnhelo    Insist on HELO or EHLO command before EXPN
7873 noexpn  Disallow EXPN entirely, implies noverb.
7874 needvrfyhelo    Insist on HELO or EHLO command before VRFY
7875 novrfy  Disallow VRFY entirely
7876 noetrn  Disallow ETRN entirely
7877 noverb  Disallow VERB entirely
7878 restrictmailq   Restrict mailq command
7879 restrictqrun    Restrict \-q command line flag
7880 restrictexpand  Restrict \-bv and \-v command line flags
7881 noreceipts      Don't return success DSNs\**
7882 nobodyreturn    Don't return the body of a message with DSNs
7883 goaway  Disallow essentially all SMTP status queries
7884 authwarnings    Put X-Authentication-Warning: headers in messages
7885                 and log warnings
7886 noactualrecipient       Don't put X-Actual-Recipient lines in DSNs
7887                 which reveal the actual account that addresses map to.
7888 .)b
7889 .(f
7890 \**N.B.:
7891 the
7892 .b noreceipts
7893 flag turns off support for RFC 1891
7894 (Delivery Status Notification).
7895 .)f
7896 The
7897 .q goaway
7898 pseudo-flag sets all flags except
7899 .q noreceipts ,
7900 .q restrictmailq ,
7901 .q restrictqrun ,
7902 .q restrictexpand ,
7903 .q noetrn ,
7904 and
7905 .q nobodyreturn .
7906 If mailq is restricted,
7907 only people in the same group as the queue directory
7908 can print the queue.
7909 If queue runs are restricted,
7910 only root and the owner of the queue directory
7911 can run the queue.
7912 The
7913 .q restrictexpand
7914 pseudo-flag instructs
7915 .i sendmail
7916 to drop privileges when the
7917 .b \-bv
7918 option is given by users who are neither root nor the TrustedUser
7919 so users cannot read private aliases, forwards, or :include: files.
7920 It will add the
7921 .q NonRootSafeAddr
7922 to the
7923 .q DontBlameSendmail
7924 option to prevent misleading unsafe address warnings.
7925 It also overrides the
7926 .b \-v
7927 (verbose) command line option to prevent information leakage.
7928 Authentication Warnings add warnings about various conditions
7929 that may indicate attempts to spoof the mail system,
7930 such as using a non-standard queue directory.
7931 .ip ProcessTitlePrefix=\fIstring\fP
7932 [no short name]
7933 Prefix the process title shown on 'ps' listings with
7934 .i string .
7935 The
7936 .i string
7937 will be macro processed.
7938 .ip QueueDirectory=\fIdir\fP
7939 [Q]
7940 The QueueDirectory option serves two purposes.
7941 First, it specifies the directory or set of directories that comprise
7942 the default queue group.
7943 Second, it specifies the directory D which is the ancestor of all queue
7944 directories, and which sendmail uses as its current working directory.
7945 When sendmail dumps core, it leaves its core files in D.
7946 There are two cases.
7947 If \fIdir\fR ends with an asterisk (eg, \fI/var/spool/mqueue/qd*\fR),
7948 then all of the directories or symbolic links to directories
7949 beginning with `qd' in
7950 .i /var/spool/mqueue
7951 will be used as queue directories of the default queue group,
7952 and
7953 .i /var/spool/mqueue
7954 will be used as the working directory D.
7955 Otherwise,
7956 \fIdir\fR must name a directory (usually \fI/var/spool/mqueue\fR):
7957 the default queue group consists of the single queue directory \fIdir\fR,
7958 and the working directory D is set to \fIdir\fR.
7959 To define additional groups of queue directories,
7960 use the configuration file `Q' command.
7961 Do not change the queue directory structure
7962 while sendmail is running.
7963 .ip QueueFactor=\fIfactor\fP
7964 [q]
7965 Use
7966 .i factor
7967 as the multiplier in the map function
7968 to decide when to just queue up jobs rather than run them.
7969 This value is divided by the difference between the current load average
7970 and the load average limit
7971 (\c
7972 .b QueueLA
7973 option)
7974 to determine the maximum message priority
7975 that will be sent.
7976 Defaults to 600000.
7977 .ip QueueLA=\fILA\fP
7978 [x]
7979 When the system load average exceeds
7980 .i LA
7981 and the
7982 .b QueueFactor
7983 (\c
7984 .b q )
7985 option divided by the difference in the current load average and the
7986 .b QueueLA
7987 option plus one
7988 is less than the priority of the message,
7989 just queue messages
7990 (i.e., don't try to send them).
7991 Defaults to 8 multiplied by
7992 the number of processors online on the system
7993 (if that can be determined).
7994 .ip QueueFileMode=\fImode\fP
7995 [no short name]
7996 Default permissions for queue files (octal).
7997 If not set, sendmail uses 0600 unless its real
7998 and effective uid are different in which case it uses 0644.
7999 .ip QueueSortOrder=\fIalgorithm\fP
8000 [no short name]
8001 Sets the
8002 .i algorithm
8003 used for sorting the queue.
8004 Only the first character of the value is used.
8005 Legal values are
8006 .q host
8007 (to order by the name of the first host name of the first recipient),
8008 .q filename
8009 (to order by the name of the queue file name),
8010 .q time
8011 (to order by the submission/creation time),
8012 .q random
8013 (to order randomly),
8014 .q modification
8015 (to order by the modification time of the qf file (older entries first)),
8016 .q none
8017 (to not order),
8018 and
8019 .q priority
8020 (to order by message priority).
8021 Host ordering makes better use of the connection cache,
8022 but may tend to process low priority messages
8023 that go to a single host
8024 over high priority messages that go to several hosts;
8025 it probably shouldn't be used on slow network links.
8026 Filename and modification time ordering saves the overhead of
8027 reading all of the queued items
8028 before starting the queue run.
8029 Creation (submission) time ordering is almost always a bad idea,
8030 since it allows large, bulk mail to go out
8031 before smaller, personal mail,
8032 but may have applicability on some hosts with very fast connections.
8033 Random is useful if several queue runners are started by hand
8034 which try to drain the same queue since odds are they will be working
8035 on different parts of the queue at the same time.
8036 Priority ordering is the default.
8037 .ip QueueTimeout=\fItimeout\fP
8038 [T]
8039 A synonym for
8040 .q Timeout.queuereturn .
8041 Use that form instead of the
8042 .q QueueTimeout
8043 form.
8044 .ip RandFile
8045 [no short name]
8046 Name of file containing random data or the name of the UNIX socket
8047 if EGD is used.
8048 A (required) prefix "egd:" or "file:" specifies the type.
8049 STARTTLS requires this filename if the compile flag HASURANDOMDEV is not set
8050 (see sendmail/README).
8051 .ip ResolverOptions=\fIoptions\fP
8052 [I]
8053 Set resolver options.
8054 Values can be set using
8055 .b + \c
8056 .i flag
8057 and cleared using
8058 .b \- \c
8059 .i flag ;
8060 the
8061 .i flag s
8062 can be
8063 .q debug ,
8064 .q aaonly ,
8065 .q usevc ,
8066 .q primary ,
8067 .q igntc ,
8068 .q recurse ,
8069 .q defnames ,
8070 .q stayopen ,
8071 .q use_inet6 ,
8072 or
8073 .q dnsrch .
8074 The string
8075 .q HasWildcardMX
8076 (without a
8077 .b +
8078 or
8079 .b \- )
8080 can be specified to turn off matching against MX records
8081 when doing name canonifications.
8082 The string
8083 .q WorkAroundBrokenAAAA
8084 (without a
8085 .b +
8086 or
8087 .b \- )
8088 can be specified to work around some broken nameservers
8089 which return SERVFAIL (a temporary failure) on T_AAAA (IPv6) lookups.
8090 Notice: it might be necessary to apply the same (or similar) options to
8091 .i submit.cf
8092 too.
8093 .ip RequiresDirfsync
8094 [no short name]
8095 This option can be used to override the compile time flag
8096 .b REQUIRES_DIR_FSYNC
8097 at runtime by setting it to
8098 .sm false .
8099 If the compile time flag is not set, the option is ignored.
8100 The flag turns on support for file systems that require to call
8101 .i fsync()
8102 for a directory if the meta-data in it has been changed.
8103 This should be turned on at least for older versions of ReiserFS;
8104 it is enabled by default for Linux.
8105 According to some information this flag is not needed
8106 anymore for kernel 2.4.16 and newer.
8107 .ip RrtImpliesDsn
8108 [R]
8109 If this option is set, a
8110 .q Return-Receipt-To:
8111 header causes the request of a DSN, which is sent to
8112 the envelope sender as required by RFC 1891,
8113 not to the address given in the header.
8114 .ip RunAsUser=\fIuser\fP
8115 [no short name]
8116 The
8117 .i user
8118 parameter may be a user name
8119 (looked up in
8120 .i /etc/passwd )
8121 or a numeric user id;
8122 either form can have
8123 .q ":group"
8124 attached
8125 (where group can be numeric or symbolic).
8126 If set to a non-zero (non-root) value,
8127 .i sendmail
8128 will change to this user id shortly after startup\**.
8129 .(f
8130 \**When running as a daemon,
8131 it changes to this user after accepting a connection
8132 but before reading any
8133 .sm SMTP
8134 commands.
8135 .)f
8136 This avoids a certain class of security problems.
8137 However, this means that all
8138 .q \&.forward
8139 and
8140 .q :include:
8141 files must be readable by the indicated
8142 .i user
8143 and all files to be written must be writable by
8144 .i user
8145 Also, all file and program deliveries will be marked unsafe
8146 unless the option
8147 .b DontBlameSendmail=NonRootSafeAddr
8148 is set,
8149 in which case the delivery will be done as
8150 .i user .
8151 It is also incompatible with the
8152 .b SafeFileEnvironment
8153 option.
8154 In other words, it may not actually add much to security on an average system,
8155 and may in fact detract from security
8156 (because other file permissions must be loosened).
8157 However, it should be useful on firewalls and other
8158 places where users don't have accounts and the aliases file is
8159 well constrained.
8160 .ip RecipientFactor=\fIfact\fP
8161 [y]
8162 The indicated
8163 .i fact or
8164 is added to the priority (thus
8165 .i lowering
8166 the priority of the job)
8167 for each recipient,
8168 i.e., this value penalizes jobs with large numbers of recipients.
8169 Defaults to 30000.
8170 .ip RefuseLA=\fILA\fP
8171 [X]
8172 When the system load average exceeds
8173 .i LA ,
8174 refuse incoming SMTP connections.
8175 Defaults to 12 multiplied by
8176 the number of processors online on the system
8177 (if that can be determined).
8178 .ip RejectLogInterval=\fItimeout\fP
8179 [no short name]
8180 Log interval when refusing connections for this long
8181 (default: 3h).
8182 .ip RetryFactor=\fIfact\fP
8183 [Z]
8184 The
8185 .i fact or
8186 is added to the priority
8187 every time a job is processed.
8188 Thus,
8189 each time a job is processed,
8190 its priority will be decreased by the indicated value.
8191 In most environments this should be positive,
8192 since hosts that are down are all too often down for a long time.
8193 Defaults to 90000.
8194 .ip SafeFileEnvironment=\fIdir\fP
8195 [no short name]
8196 If this option is set,
8197 .i sendmail
8198 will do a
8199 .i chroot (2)
8200 call into the indicated
8201 .i dir ectory
8202 before doing any file writes.
8203 If the file name specified by the user begins with
8204 .i dir ,
8205 that partial path name will be stripped off before writing,
8206 so (for example)
8207 if the SafeFileEnvironment variable is set to
8208 .q /safe
8209 then aliases of
8210 .q /safe/logs/file
8211 and
8212 .q /logs/file
8213 actually indicate the same file.
8214 Additionally, if this option is set,
8215 .i sendmail
8216 refuses to deliver to symbolic links.
8217 .ip SaveFromLine
8218 [f]
8219 Save
8220 UNIX-style
8221 .q From
8222 lines at the front of headers.
8223 Normally they are assumed redundant
8224 and discarded.
8225 .ip SendMimeErrors
8226 [j]
8227 If set, send error messages in MIME format
8228 (see RFC 2045 and RFC 1344 for details).
8229 If disabled,
8230 .i sendmail
8231 will not return the DSN keyword in response to an EHLO
8232 and will not do Delivery Status Notification processing as described in
8233 RFC 1891.
8234 .ip ServerCertFile
8235 [no short name]
8236 File containing the certificate of the server, i.e., this certificate
8237 is used when sendmail acts as server
8238 (used for STARTTLS).
8239 .ip ServerKeyFile
8240 [no short name]
8241 File containing the private key belonging to the server certificate
8242 (used for STARTTLS).
8243 .ip ServerSSLOptions
8244 A space or comma separated list of SSL related options for the server side.
8245 See
8246 .i SSL_CTX_set_options (3)
8247 for a list;
8248 the available values depend on the OpenSSL version against which
8249 .i sendmail
8250 is compiled.
8251 By default,
8252 .i SSL_OP_ALL
8253 .i -SSL_OP_TLSEXT_PADDING
8254 are used
8255 (if those options are available).
8256 Options can be cleared by preceding them with a minus sign.
8257 It is also possible to specify numerical values, e.g.,
8258 .b -0x0010 .
8259 .ip ServiceSwitchFile=\fIfilename\fP
8260 [no short name]
8261 If your host operating system has a service switch abstraction
8262 (e.g., /etc/nsswitch.conf on Solaris
8263 or /etc/svc.conf on Ultrix and DEC OSF/1)
8264 that service will be consulted and this option is ignored.
8265 Otherwise, this is the name of a file
8266 that provides the list of methods used to implement particular services.
8267 The syntax is a series of lines,
8268 each of which is a sequence of words.
8269 The first word is the service name,
8270 and following words are service types.
8271 The services that
8272 .i sendmail
8273 consults directly are
8274 .q aliases
8275 and
8276 .q hosts.
8277 Service types can be
8278 .q dns ,
8279 .q nis ,
8280 .q nisplus ,
8281 or
8282 .q files
8283 (with the caveat that the appropriate support
8284 must be compiled in
8285 before the service can be referenced).
8286 If ServiceSwitchFile is not specified, it defaults to
8287 /etc/mail/service.switch.
8288 If that file does not exist, the default switch is:
8289 .(b
8290 aliases files
8291 hosts   dns nis files
8292 .)b
8293 The default file is
8294 .q /etc/mail/service.switch .
8295 .ip SevenBitInput
8296 [7]
8297 Strip input to seven bits for compatibility with old systems.
8298 This shouldn't be necessary.
8299 .ip SharedMemoryKey
8300 [no short name]
8301 Key to use for shared memory segment;
8302 if not set (or 0), shared memory will not be used.
8303 If set to
8304 -1
8305 .i sendmail
8306 can select a key itself provided that also
8307 .b SharedMemoryKeyFile
8308 is set.
8309 Requires support for shared memory to be compiled into
8310 .i sendmail .
8311 If this option is set,
8312 .i sendmail
8313 can share some data between different instances.
8314 For example, the number of entries in a queue directory
8315 or the available space in a file system.
8316 This allows for more efficient program execution, since only
8317 one process needs to update the data instead of each individual
8318 process gathering the data each time it is required.
8319 .ip SharedMemoryKeyFile
8320 [no short name]
8321 If
8322 .b SharedMemoryKey
8323 is set to
8324 -1
8325 then the automatically selected shared memory key will be stored
8326 in the specified file.
8327 .ip SingleLineFromHeader
8328 [no short name]
8329 If set, From: lines that have embedded newlines are unwrapped
8330 onto one line.
8331 This is to get around a botch in Lotus Notes
8332 that apparently cannot understand legally wrapped RFC 822 headers.
8333 .ip SingleThreadDelivery
8334 [no short name]
8335 If set, a client machine will never try to open two SMTP connections
8336 to a single server machine at the same time,
8337 even in different processes.
8338 That is, if another
8339 .i sendmail
8340 is already talking to some host a new
8341 .i sendmail
8342 will not open another connection.
8343 This property is of mixed value;
8344 although this reduces the load on the other machine,
8345 it can cause mail to be delayed
8346 (for example, if one
8347 .i sendmail
8348 is delivering a huge message, other
8349 .i sendmail s
8350 won't be able to send even small messages).
8351 Also, it requires another file descriptor
8352 (for the lock file)
8353 per connection, so you may have to reduce the
8354 .b ConnectionCacheSize
8355 option to avoid running out of per-process file descriptors.
8356 Requires the
8357 .b HostStatusDirectory
8358 option.
8359 .ip SmtpGreetingMessage=\fImessage\fP
8360 [$e macro]
8361 The message printed when the SMTP server starts up.
8362 Defaults to
8363 .q "$j Sendmail $v ready at $b".
8364 .ip SoftBounce
8365 If set, issue temporary errors (4xy) instead of permanent errors (5xy).
8366 This can be useful during testing of a new configuration to avoid
8367 erroneous bouncing of mails.
8368 .ip SSLEngine
8369 Name of SSL engine to use.
8370 The available values depend on the OpenSSL version against which
8371 .i sendmail
8372 is compiled,
8373 see
8374 .(b
8375 openssl engine -v
8376 .)b
8377 for some information.
8378 .ip SSLEnginePath
8379 Path to dynamic library for SSL engine.
8380 This option is only useful if
8381 .i SSLEngine
8382 is set.
8383 If both are set, the engine will be loaded dynamically at runtime
8384 using the concatenation of the path,
8385 a slash "/",
8386 the string "lib",
8387 the value of
8388 .i SSLEngine ,
8389 and the string ".so".
8390 If only
8391 .i SSLEngine
8392 is set then the static version of the engine is used.
8393 .ip StatusFile=\fIfile\fP
8394 [S]
8395 Log summary statistics in the named
8396 .i file .
8397 If no file name is specified, "statistics" is used.
8398 If not set,
8399 no summary statistics are saved.
8400 This file does not grow in size.
8401 It can be printed using the
8402 .i mailstats (8)
8403 program.
8404 .ip SuperSafe
8405 [s]
8406 This option can be set to True, False, Interactive, or PostMilter.
8407 If set to True,
8408 .i sendmail
8409 will be super-safe when running things,
8410 i.e., always instantiate the queue file,
8411 even if you are going to attempt immediate delivery.
8412 .i Sendmail
8413 always instantiates the queue file
8414 before returning control to the client
8415 under any circumstances.
8416 This should really
8417 .i always
8418 be set to True.
8419 The Interactive value has been introduced in 8.12 and can
8420 be used together with
8421 .b DeliveryMode=i .
8422 It skips some synchronization calls which are effectively
8423 doubled in the code execution path for this mode.
8424 If set to PostMilter,
8425 .i sendmail
8426 defers synchronizing the queue file until any milters have
8427 signaled acceptance of the message.
8428 PostMilter is useful only when
8429 .i sendmail
8430 is running as an SMTP server; in all other situations it
8431 acts the same as True.
8432 .ip TLSFallbacktoClear
8433 [no short name]
8434 If set,
8435 .i sendmail
8436 immediately tries an outbound connection again without STARTTLS
8437 after a TLS handshake failure.
8438 Note:
8439 this applies to all connections even if TLS specific requirements are set
8440 (see rulesets
8441 .i tls_rcpt
8442 and
8443 .i tls_client
8444 ).
8445 Hence such requirements will cause an error on a retry without STARTTLS.
8446 Therefore they should only trigger a temporary failure so the connection
8447 is later on tried again.
8448 .ip TLSSrvOptions
8449 [no short name]
8450 List of options for SMTP STARTTLS for the server
8451 consisting of single characters
8452 with intervening white space or commas.
8453 The flag ``V'' disables client verification, and hence
8454 it is not possible to use a client certificate for relaying.
8455 The flag ``C'' removes the requirement for the TLS server
8456 to have a cert.
8457 This only works under very specific circumstances
8458 and should only be used if the consequences are understood,
8459 e.g., clients may not work with a server using this.
8460 .ip TempFileMode=\fImode\fP
8461 [F]
8462 The file mode for transcript files, files to which
8463 .i sendmail
8464 delivers directly, files in the
8465 .b HostStatusDirectory ,
8466 and
8467 .b StatusFile .
8468 It is interpreted in octal by default.
8469 Defaults to 0600.
8470 .ip Timeout.\fItype\fP=\|\fItimeout\fP
8471 [r; subsumes old T option as well]
8472 Set timeout values.
8473 For more information,
8474 see section
8475 .\" XREF
8476 4.1.
8477 .ip TimeZoneSpec=\fItzinfo\fP
8478 [t]
8479 Set the local time zone info to
8480 .i tzinfo
8481 \*- for example,
8482 .q PST8PDT .
8483 Actually, if this is not set,
8484 the TZ environment variable is cleared (so the system default is used);
8485 if set but null, the user's TZ variable is used,
8486 and if set and non-null the TZ variable is set to this value.
8487 .ip TrustedUser=\fIuser\fP
8488 [no short name]
8489 The
8490 .i user
8491 parameter may be a user name
8492 (looked up in
8493 .i /etc/passwd )
8494 or a numeric user id.
8495 Trusted user for file ownership and starting the daemon.  If set, generated
8496 alias databases and the control socket (if configured) will automatically
8497 be owned by this user.
8498 .ip TryNullMXList
8499 [w]
8500 If this system is the
8501 .q best
8502 (that is, lowest preference)
8503 MX for a given host,
8504 its configuration rules should normally detect this situation
8505 and treat that condition specially
8506 by forwarding the mail to a UUCP feed,
8507 treating it as local,
8508 or whatever.
8509 However, in some cases (such as Internet firewalls)
8510 you may want to try to connect directly to that host
8511 as though it had no MX records at all.
8512 Setting this option causes
8513 .i sendmail
8514 to try this.
8515 The downside is that errors in your configuration
8516 are likely to be diagnosed as
8517 .q "host unknown"
8518 or
8519 .q "message timed out"
8520 instead of something more meaningful.
8521 This option is disrecommended.
8522 .ip UnixFromLine=\fIfromline\fP
8523 [$l macro]
8524 Defines the format used when
8525 .i sendmail
8526 must add a UNIX-style From_ line
8527 (that is, a line beginning
8528 .q From<space>user ).
8529 Defaults to
8530 .q "From $g  $d" .
8531 Don't change this unless your system uses a different UNIX mailbox format
8532 (very unlikely).
8533 .ip UnsafeGroupWrites
8534 [no short name]
8535 If set (default),
8536 :include: and .forward files that are group writable are considered
8537 .q unsafe ,
8538 that is,
8539 they cannot reference programs or write directly to files.
8540 World writable :include: and .forward files
8541 are always unsafe.
8542 Note: use
8543 .b DontBlameSendmail
8544 instead; this option is deprecated.
8545 .ip UseCompressedIPv6Addresses
8546 [no short name]
8547 If set, the compressed format of IPv6 addresses,
8548 such as IPV6:::1, will be used,
8549 instead of the uncompressed format,
8550 such as IPv6:0:0:0:0:0:0:0:1.
8551 .ip UseErrorsTo
8552 [l]
8553 If there is an
8554 .q Errors-To:
8555 header, send error messages to the addresses listed there.
8556 They normally go to the envelope sender.
8557 Use of this option causes
8558 .i sendmail
8559 to violate RFC 1123.
8560 This option is disrecommended and deprecated.
8561 .ip UserDatabaseSpec=\fIudbspec\fP
8562 [U]
8563 The user database specification.
8564 .ip Verbose
8565 [v]
8566 Run in verbose mode.
8567 If this is set,
8568 .i sendmail
8569 adjusts options
8570 .b HoldExpensive
8571 (old
8572 .b c )
8573 and
8574 .b DeliveryMode
8575 (old
8576 .b d )
8577 so that all mail is delivered completely
8578 in a single job
8579 so that you can see the entire delivery process.
8580 Option
8581 .b Verbose
8582 should
8583 .i never
8584 be set in the configuration file;
8585 it is intended for command line use only.
8586 Note that the use of option
8587 .b Verbose
8588 can cause authentication information to leak, if you use a
8589 sendmail client to authenticate to a server.
8590 If the authentication mechanism uses plain text passwords
8591 (as with LOGIN or PLAIN),
8592 then the password could be compromised.
8593 To avoid this, do not install sendmail set-user-ID root,
8594 and disable the
8595 .b VERB
8596 SMTP command with a suitable
8597 .b PrivacyOptions
8598 setting.
8599 .ip XscriptFileBufferSize=\fIthreshold\fP
8600 [no short name]
8601 Set the
8602 .i threshold ,
8603 in bytes,
8604 before a memory-based
8605 queue transcript file
8606 becomes disk-based.
8607 The default is 4096 bytes.
8608 .lp
8609 All options can be specified on the command line using the
8610 \-O or \-o flag,
8611 but most will cause
8612 .i sendmail
8613 to relinquish its set-user-ID permissions.
8614 The options that will not cause this are
8615 SevenBitInput [7],
8616 EightBitMode [8],
8617 MinFreeBlocks [b],
8618 CheckpointInterval [C],
8619 DeliveryMode [d],
8620 ErrorMode [e],
8621 IgnoreDots [i],
8622 SendMimeErrors [j],
8623 LogLevel [L],
8624 MeToo [m],
8625 OldStyleHeaders [o],
8626 PrivacyOptions [p],
8627 SuperSafe [s],
8628 Verbose [v],
8629 QueueSortOrder,
8630 MinQueueAge,
8631 DefaultCharSet,
8632 Dial Delay,
8633 NoRecipientAction,
8634 ColonOkInAddr,
8635 MaxQueueRunSize,
8636 SingleLineFromHeader,
8637 and
8638 AllowBogusHELO.
8639 Actually, PrivacyOptions [p] given on the command line
8640 are added to those already specified in the
8641 .i sendmail.cf
8642 file, i.e., they can't be reset.
8643 Also, M (define macro) when defining the r or s macros
8644 is also considered
8645 .q safe .
8646 .sh 2 "P \*- Precedence Definitions"
8647 .pp
8648 Values for the
8649 .q "Precedence:"
8650 field may be defined using the
8651 .b P
8652 control line.
8653 The syntax of this field is:
8654 .(b
8655 \fBP\fP\fIname\fP\fB=\fP\fInum\fP
8656 .)b
8657 When the
8658 .i name
8659 is found in a
8660 .q Precedence:
8661 field,
8662 the message class is set to
8663 .i num .
8664 Higher numbers mean higher precedence.
8665 Numbers less than zero
8666 have the special property
8667 that if an error occurs during processing
8668 the body of the message will not be returned;
8669 this is expected to be used for
8670 .q "bulk"
8671 mail such as through mailing lists.
8672 The default precedence is zero.
8673 For example,
8674 our list of precedences is:
8675 .(b
8676 Pfirst-class=0
8677 Pspecial-delivery=100
8678 Plist=\-30
8679 Pbulk=\-60
8680 Pjunk=\-100
8681 .)b
8682 People writing mailing list exploders
8683 are encouraged to use
8684 .q "Precedence: list" .
8685 Older versions of
8686 .i sendmail
8687 (which discarded all error returns for negative precedences)
8688 didn't recognize this name, giving it a default precedence of zero.
8689 This allows list maintainers to see error returns
8690 on both old and new versions of
8691 .i sendmail .
8692 .sh 2 "V \*- Configuration Version Level"
8693 .pp
8694 To provide compatibility with old configuration files,
8695 the
8696 .b V
8697 line has been added to define some very basic semantics
8698 of the configuration file.
8699 These are not intended to be long term supports;
8700 rather, they describe compatibility features
8701 which will probably be removed in future releases.
8702 .pp
8703 .b N.B.:
8704 these version
8705 .i levels
8706 have nothing
8707 to do with the version
8708 .i number
8709 on the files.
8710 For example,
8711 as of this writing
8712 version 10 config files
8713 (specifically, 8.10)
8714 used version level 9 configurations.
8715 .pp
8716 .q Old
8717 configuration files are defined as version level one.
8718 Version level two files make the following changes:
8719 .np
8720 Host name canonification ($[ ... $])
8721 appends a dot if the name is recognized;
8722 this gives the config file a way of finding out if anything matched.
8723 (Actually, this just initializes the
8724 .q host
8725 map with the
8726 .q \-a.
8727 flag \*- you can reset it to anything you prefer
8728 by declaring the map explicitly.)
8729 .np
8730 Default host name extension is consistent throughout processing;
8731 version level one configurations turned off domain extension
8732 (that is, adding the local domain name)
8733 during certain points in processing.
8734 Version level two configurations are expected to include a trailing dot
8735 to indicate that the name is already canonical.
8736 .np
8737 Local names that are not aliases
8738 are passed through a new distinguished ruleset five;
8739 this can be used to append a local relay.
8740 This behavior can be prevented by resolving the local name
8741 with an initial `@'.
8742 That is, something that resolves to a local mailer and a user name of
8743 .q vikki
8744 will be passed through ruleset five,
8745 but a user name of
8746 .q @vikki
8747 will have the `@' stripped,
8748 will not be passed through ruleset five,
8749 but will otherwise be treated the same as the prior example.
8750 The expectation is that this might be used to implement a policy
8751 where mail sent to
8752 .q vikki
8753 was handled by a central hub,
8754 but mail sent to
8755 .q vikki@localhost
8756 was delivered directly.
8757 .pp
8758 Version level three files
8759 allow # initiated comments on all lines.
8760 Exceptions are backslash escaped # marks
8761 and the $# syntax.
8762 .pp
8763 Version level four configurations
8764 are completely equivalent to level three
8765 for historical reasons.
8766 .pp
8767 Version level five configuration files
8768 change the default definition of
8769 .b $w
8770 to be just the first component of the hostname.
8771 .pp
8772 Version level six configuration files
8773 change many of the local processing options
8774 (such as aliasing and matching the beginning of the address for
8775 `|' characters)
8776 to be mailer flags;
8777 this allows fine-grained control over the special local processing.
8778 Level six configuration files may also use long option names.
8779 The
8780 .b ColonOkInAddr
8781 option (to allow colons in the local-part of addresses)
8782 defaults
8783 .b on
8784 for lower numbered configuration files;
8785 the configuration file requires some additional intelligence
8786 to properly handle the RFC 822 group construct.
8787 .pp
8788 Version level seven configuration files
8789 used new option names to replace old macros
8790 (\c
8791 .b $e
8792 became
8793 .b SmtpGreetingMessage ,
8794 .b $l
8795 became
8796 .b UnixFromLine ,
8797 and
8798 .b $o
8799 became
8800 .b OperatorChars .
8801 Also, prior to version seven,
8802 the
8803 .b F=q
8804 flag (use 250 instead of 252 return value for
8805 .sm "SMTP VRFY"
8806 commands)
8807 was assumed.
8808 .pp
8809 Version level eight configuration files allow
8810 .b $#
8811 on the left hand side of ruleset lines.
8812 .pp
8813 Version level nine configuration files allow
8814 parentheses in rulesets, i.e. they are not treated
8815 as comments and hence removed.
8816 .pp
8817 Version level ten configuration files allow
8818 queue group definitions.
8819 .pp
8820 The
8821 .b V
8822 line may have an optional
8823 .b / \c
8824 .i vendor
8825 to indicate that this configuration file uses modifications
8826 specific to a particular vendor\**.
8827 .(f
8828 \**And of course, vendors are encouraged to add themselves
8829 to the list of recognized vendors by editing the routine
8830 .i setvendor
8831 in
8832 .i conf.c .
8833 Please send e-mail to sendmail@Sendmail.ORG
8834 to register your vendor dialect.
8835 .)f
8836 You may use
8837 .q /Berkeley
8838 to emphasize that this configuration file
8839 uses the Berkeley dialect of
8840 .i sendmail .
8841 .sh 2 "K \*- Key File Declaration"
8842 .pp
8843 Special maps can be defined using the line:
8844 .(b
8845 Kmapname mapclass arguments
8846 .)b
8847 The
8848 .i mapname
8849 is the handle by which this map is referenced in the rewriting rules.
8850 The
8851 .i mapclass
8852 is the name of a type of map;
8853 these are compiled in to
8854 .i sendmail .
8855 The
8856 .i arguments
8857 are interpreted depending on the class;
8858 typically,
8859 there would be a single argument naming the file containing the map.
8860 .pp
8861 Maps are referenced using the syntax:
8862 .(b
8863 $( \fImap\fP \fIkey\fP $@ \fIarguments\fP $: \fIdefault\fP $)
8864 .)b
8865 where either or both of the
8866 .i arguments
8867 or
8868 .i default
8869 portion may be omitted.
8870 The
8871 .i "$@ arguments"
8872 may appear more than once.
8873 The indicated
8874 .i key
8875 and
8876 .i arguments
8877 are passed to the appropriate mapping function.
8878 If it returns a value, it replaces the input.
8879 If it does not return a value and the
8880 .i default
8881 is specified, the
8882 .i default
8883 replaces the input.
8884 Otherwise, the input is unchanged.
8885 .pp
8886 The
8887 .i arguments
8888 are passed to the map for arbitrary use.
8889 Most map classes can interpolate these arguments
8890 into their values using the syntax
8891 .q %\fIn\fP
8892 (where
8893 .i n
8894 is a digit)
8895 to indicate the corresponding
8896 .i argument .
8897 Argument
8898 .q %0
8899 indicates the database key.
8900 For example, the rule
8901 .(b
8902 .ta 1.5i
8903 R$\- ! $+       $: $(uucp $1 $@ $2 $: $2 @ $1 . UUCP $)
8904 .)b
8905 Looks up the UUCP name in a (user defined) UUCP map;
8906 if not found it turns it into
8907 .q \&.UUCP
8908 form.
8909 The database might contain records like:
8910 .(b
8911 decvax  %1@%0.DEC.COM
8912 research        %1@%0.ATT.COM
8913 .)b
8914 Note that
8915 .i default
8916 clauses never do this mapping.
8917 .pp
8918 The built-in map with both name and class
8919 .q host
8920 is the host name canonicalization lookup.
8921 Thus,
8922 the syntax:
8923 .(b
8924 $(host \fIhostname\fP$)
8925 .)b
8926 is equivalent to:
8927 .(b
8928 $[\fIhostname\fP$]
8929 .)b
8930 .pp
8931 There are many defined classes.
8932 .ip cdb
8933 Database lookups using the cdb(3) library.
8934 .i Sendmail
8935 must be compiled with
8936 .b CDB
8937 defined.
8938 .ip dbm
8939 Database lookups using the ndbm(3) library.
8940 .i Sendmail
8941 must be compiled with
8942 .b NDBM
8943 defined.
8944 .ip btree
8945 Database lookups using the btree interface to the Berkeley DB
8946 library.
8947 .i Sendmail
8948 must be compiled with
8949 .b NEWDB
8950 defined.
8951 .ip hash
8952 Database lookups using the hash interface to the Berkeley DB
8953 library.
8954 .i Sendmail
8955 must be compiled with
8956 .b NEWDB
8957 defined.
8958 .ip nis
8959 NIS lookups.
8960 .i Sendmail
8961 must be compiled with
8962 .b NIS
8963 defined.
8964 .ip nisplus
8965 NIS+ lookups.
8966 .i Sendmail
8967 must be compiled with
8968 .b NISPLUS
8969 defined.
8970 The argument is the name of the table to use for lookups,
8971 and the
8972 .b \-k
8973 and
8974 .b \-v
8975 flags may be used to set the key and value columns respectively.
8976 .ip hesiod
8977 Hesiod lookups.
8978 .i Sendmail
8979 must be compiled with
8980 .b HESIOD
8981 defined.
8982 .ip ldap
8983 LDAP X500 directory lookups.
8984 .i Sendmail
8985 must be compiled with
8986 .b LDAPMAP
8987 defined.
8988 The map supports most of the standard arguments
8989 and most of the command line arguments of the
8990 .i ldapsearch
8991 program.
8992 Note that,
8993 by default,
8994 if a single query matches multiple values,
8995 only the first value will be returned
8996 unless the
8997 .b \-z
8998 (value separator)
8999 map option is set.
9000 Also, the
9001 .b \-1
9002 map flag will treat a multiple value return
9003 as if there were no matches.
9004 .ip netinfo
9005 NeXT NetInfo lookups.
9006 .i Sendmail
9007 must be compiled with
9008 .b NETINFO
9009 defined.
9010 .ip text
9011 Text file lookups.
9012 The format of the text file is defined by the
9013 .b \-k
9014 (key field number),
9015 .b \-v
9016 (value field number),
9017 and
9018 .b \-z
9019 (field delimiter)
9020 options.
9021 .ip ph
9022 PH query map.
9023 Contributed and supported by
9024 Mark Roth, roth@uiuc.edu.
9025 .ip nsd
9026 nsd map for IRIX 6.5 and later.
9027 Contributed and supported by Bob Mende of SGI,
9028 mende@sgi.com.
9029 .ip stab
9030 Internal symbol table lookups.
9031 Used internally for aliasing.
9032 .ip implicit
9033 Sequentially try a list of available map types:
9034 .i hash ,
9035 .i dbm ,
9036 and
9037 .i cdb .
9038 It is the default for alias files if no class is specified.
9039 If is no matching map type is found,
9040 the text version is used for the alias file,
9041 but other maps fail to open.
9042 .ip user
9043 Looks up users using
9044 .i getpwnam (3).
9045 The
9046 .b \-v
9047 flag can be used to specify the name of the field to return
9048 (although this is normally used only to check the existence
9049 of a user).
9050 .ip host
9051 Canonifies host domain names.
9052 Given a host name it calls the name server
9053 to find the canonical name for that host.
9054 .ip bestmx
9055 Returns the best MX record for a host name given as the key.
9056 The current machine is always preferred \*-
9057 that is, if the current machine is one of the hosts listed as a
9058 lowest-preference MX record, then it will be guaranteed to be returned.
9059 This can be used to find out if this machine is the target for an MX record,
9060 and mail can be accepted on that basis.
9061 If the
9062 .b \-z
9063 option is given, then all MX names are returned,
9064 separated by the given delimiter.
9065 Note: the return value is deterministic,
9066 i.e., even if multiple MX records have the same preference,
9067 they will be returned in the same order.
9068 .ip dns
9069 This map requires the option -R to specify the DNS resource record
9070 type to lookup.
9071 The following types are supported:
9072 A, AAAA, AFSDB, CNAME, MX, NS, PTR, SRV, and TXT.
9073 A map lookup will return only one record
9074 unless the
9075 .b \-z
9076 (value separator)
9077 option is set.
9078 Hence for some types, e.g., MX records, the return value might be a random
9079 element of the results due to randomizing in the DNS resolver,
9080 if only one element is returned.
9081 .ip arpa
9082 Returns the ``reverse'' for the given IP (IPv4 or IPv6) address,
9083 i.e., the string for the PTR lookup,
9084 but without trailing
9085 .b ip6.arpa
9086 or
9087 .b in-addr.arpa .
9088 For example, the following configuration lines:
9089 .(b
9090 Karpa arpa
9091 SArpa
9092 R$+     $: $(arpa $1 $)
9093 .)b
9094 work like this in test mode:
9095 .(b
9096 sendmail -bt
9097 ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
9098 Enter <ruleset> <address>
9099 > Arpa IPv6:1:2:dead:beef:9876:0:0:1
9100 Arpa               input: IPv6 : 1 : 2 : dead : beef : 9876 : 0 : 0 : 1
9101 Arpa             returns: 1 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 6 . 7 . 8 . 9 . f . e . e . b . d . a . e . d . 2 . 0 . 0 . 0 . 1 . 0 . 0 . 0
9102 > Arpa 1.2.3.4
9103 Arpa               input: 1 . 2 . 3 . 4
9104 Arpa             returns: 4 . 3 . 2 . 1
9105 .)b
9106 .ip sequence
9107 The arguments on the `K' line are a list of maps;
9108 the resulting map searches the argument maps in order
9109 until it finds a match for the indicated key.
9110 For example, if the key definition is:
9111 .(b
9112 Kmap1 ...
9113 Kmap2 ...
9114 Kseqmap sequence map1 map2
9115 .)b
9116 then a lookup against
9117 .q seqmap
9118 first does a lookup in map1.
9119 If that is found, it returns immediately.
9120 Otherwise, the same key is used for map2.
9121 .ip syslog
9122 the key is logged via
9123 .i syslogd \|(8).
9124 The lookup returns the empty string.
9125 .ip switch
9126 Much like the
9127 .q sequence
9128 map except that the order of maps is determined by the service switch.
9129 The argument is the name of the service to be looked up;
9130 the values from the service switch are appended to the map name
9131 to create new map names.
9132 For example, consider the key definition:
9133 .(b
9134 Kali switch aliases
9135 .)b
9136 together with the service switch entry:
9137 .(b
9138 aliases nis files
9139 .)b
9140 This causes a query against the map
9141 .q ali
9142 to search maps named
9143 .q ali.nis
9144 and
9145 .q ali.files
9146 in that order.
9147 .ip dequote
9148 Strip double quotes (") from a name.
9149 It does not strip backslashes,
9150 and will not strip quotes if the resulting string
9151 would contain unscannable syntax
9152 (that is, basic errors like unbalanced angle brackets;
9153 more sophisticated errors such as unknown hosts are not checked).
9154 The intent is for use when trying to accept mail from systems such as
9155 DECnet
9156 that routinely quote odd syntax such as
9157 .(b
9158 "49ers::ubell"
9159 .)b
9160 A typical usage is probably something like:
9161 .(b
9162 Kdequote dequote
9163
9164 \&...
9165
9166 R$\-    $: $(dequote $1 $)
9167 R$\- $+ $: $>3 $1 $2
9168 .)b
9169 Care must be taken to prevent unexpected results;
9170 for example,
9171 .(b
9172 "|someprogram < input > output"
9173 .)b
9174 will have quotes stripped,
9175 but the result is probably not what you had in mind.
9176 Fortunately these cases are rare.
9177 .ip regex
9178 The map definition on the
9179 .b K
9180 line contains a regular expression.
9181 Any key input is compared to that expression using the
9182 POSIX regular expressions routines regcomp(), regerr(), and regexec().
9183 Refer to the documentation for those routines for more information
9184 about the regular expression matching.
9185 No rewriting of the key is done if the
9186 .b \-m
9187 flag is used.  Without it, the key is discarded or if
9188 .b \-s
9189 if used, it is substituted by the substring matches, delimited by
9190 .b $|
9191 or the string specified with the the
9192 .b \-d
9193 option.
9194 The options available for the map are
9195 .(b
9196 .ta 4n
9197 -n      not
9198 -f      case sensitive
9199 -b      basic regular expressions (default is extended)
9200 -s      substring match
9201 -d      set the delimiter string used for -s
9202 -a      append string to key
9203 -m      match only, do not replace/discard value
9204 -D      perform no lookup in deferred delivery mode.
9205 .)b
9206 The
9207 .b \-s
9208 option can include an optional parameter which can be used
9209 to select the substrings in the result of the lookup.
9210 For example,
9211 .(b
9212 -s1,3,4
9213 .)b
9214 The delimiter string specified via the
9215 .b \-d
9216 option is the sequence of characters after
9217 .b d
9218 ending at the first space.
9219 Hence it isn't possible to specify a space as delimiter,
9220 so if the option is immediately followed by a space
9221 the delimiter string is empty,
9222 which means the substrings are joined.
9223
9224 Notes: to match a
9225 .b $
9226 in a string,
9227 \\$$
9228 must be used.
9229 If the pattern contains spaces,
9230 they must be replaced with the blank substitution character,
9231 unless it is space itself.
9232 .ip program
9233 The arguments on the
9234 .b K
9235 line are the pathname to a program and any initial parameters to be passed.
9236 When the map is called,
9237 the key is added to the initial parameters
9238 and the program is invoked
9239 as the default user/group id.
9240 The first line of standard output is returned as the value of the lookup.
9241 This has many potential security problems,
9242 and has terrible performance;
9243 it should be used only when absolutely necessary.
9244 .ip macro
9245 Set or clear a macro value.
9246 To set a macro,
9247 pass the value as the first argument in the map lookup.
9248 To clear a macro,
9249 do not pass an argument in the map lookup.
9250 The map always returns the empty string.
9251 Example of typical usage include:
9252 .(b
9253 Kstorage macro
9254
9255 \&...
9256
9257 # set macro ${MyMacro} to the ruleset match
9258 R$+     $: $(storage {MyMacro} $@ $1 $) $1
9259 # set macro ${MyMacro} to an empty string
9260 R$*     $: $(storage {MyMacro} $@ $) $1
9261 # clear macro ${MyMacro}
9262 R$\-    $: $(storage {MyMacro} $) $1
9263 .)b
9264 .ip arith
9265 Perform simple arithmetic operations.
9266 The operation is given as key, currently
9267 +, -, *, /, %,
9268 |, & (bitwise OR, AND),
9269 l (for less than), =,
9270 and r (for random) are supported.
9271 The two operands are given as arguments.
9272 The lookup returns the result of the computation,
9273 i.e.,
9274 .sm TRUE
9275 or
9276 .sm FALSE
9277 for comparisons, integer values otherwise.
9278 The r operator returns a pseudo-random number whose value
9279 lies between the first and second operand
9280 (which requires that the first operand is smaller than the second).
9281 All options which are possible for maps are ignored.
9282 A simple example is:
9283 .(b
9284 Kcomp arith
9285
9286 \&...
9287
9288 Scheck_etrn
9289 R$*     $: $(comp l $@ $&{load_avg} $@ 7 $) $1
9290 RFALSE  $# error \&...
9291 .)b
9292 .ip socket
9293 The socket map uses a simple request/reply protocol over TCP or UNIX domain
9294 sockets to query an external server.
9295 Both requests and replies are text based and encoded as netstrings,
9296 i.e., a string "hello there" becomes:
9297 .(b
9298 11:hello there,
9299 .)b
9300 Note: neither requests nor replies end with CRLF.
9301
9302 The request consists of the database map name and the lookup key separated
9303 by a space character:
9304
9305 .(b
9306 <mapname> ' ' <key>
9307 .)b
9308
9309 The server responds with a status indicator and the result (if any):
9310
9311 .(b
9312 <status> ' ' <result>
9313 .)b
9314
9315 The status indicator specifies the result of the lookup operation itself
9316 and is one of the following upper case words:
9317 .(b
9318 .ta 9n
9319 OK      the key was found, result contains the looked up value
9320 NOTFOUND        the key was not found, the result is empty
9321 TEMP    a temporary failure occurred
9322 TIMEOUT a timeout occurred on the server side
9323 PERM    a permanent failure occurred
9324 .)b
9325
9326 In case of errors (status TEMP, TIMEOUT or PERM) the result field may
9327 contain an explanatory message.
9328 However, the explanatory message is not used any further by
9329 .i sendmail .
9330
9331 Example replies:
9332 .(b
9333 31:OK resolved.address@example.com,
9334 .)b
9335
9336 .(b
9337 56:OK error:550 5.7.1 User does not accept mail from sender,
9338 .)b
9339
9340 in case of successful lookups, or:
9341 .(b
9342 8:NOTFOUND,
9343 .)b
9344
9345 in case the key was not found, or:
9346 .(b
9347 55:TEMP this text explains that we had a temporary failure,
9348 .)b
9349
9350 in case of a temporary map lookup failure.
9351
9352 The socket map uses the same syntax as milters
9353 (see Section "X \*- Mail Filter (Milter) Definitions")
9354 to specify the remote endpoint, e.g.,
9355 .(b
9356 Ksocket mySocketMap inet:12345@127.0.0.1
9357 .)b
9358
9359 If multiple socket maps define the same remote endpoint, they will share
9360 a single connection to this endpoint.
9361 .pp
9362 Most of these accept as arguments the same optional flags
9363 and a filename
9364 (or a mapname for NIS;
9365 the filename is the root of the database path,
9366 so that
9367 .q .db
9368 or some other extension appropriate for the database type
9369 will be added to get the actual database name).
9370 Known flags are:
9371 .ip "\-o"
9372 Indicates that this map is optional \*- that is,
9373 if it cannot be opened,
9374 no error is produced,
9375 and
9376 .i sendmail
9377 will behave as if the map existed but was empty.
9378 .ip "\-N, \-O"
9379 If neither
9380 .b \-N
9381 or
9382 .b \-O
9383 are specified,
9384 .i sendmail
9385 uses an adaptive algorithm to decide whether or not to look for null bytes
9386 on the end of keys.
9387 It starts by trying both;
9388 if it finds any key with a null byte it never tries again without a null byte
9389 and vice versa.
9390 If
9391 .b \-N
9392 is specified it never tries without a null byte and
9393 if
9394 .b \-O
9395 is specified it never tries with a null byte.
9396 Setting one of
9397 these can speed matches but are never necessary.
9398 If both
9399 .b \-N
9400 and
9401 .b \-O
9402 are specified,
9403 .i sendmail
9404 will never try any matches at all \(em
9405 that is, everything will appear to fail.
9406 .ip "\-a\fIx\fP"
9407 Append the string
9408 .i x
9409 on successful matches.
9410 For example, the default
9411 .i host
9412 map appends a dot on successful matches.
9413 .ip "\-T\fIx\fP"
9414 Append the string
9415 .i x
9416 on temporary failures.
9417 For example,
9418 .i x
9419 would be appended if a DNS lookup returned
9420 .q "server failed"
9421 or an NIS lookup could not locate a server.
9422 See also the
9423 .b \-t
9424 flag.
9425 .ip "\-f"
9426 Do not fold upper to lower case before looking up the key.
9427 .ip "\-m"
9428 Match only (without replacing the value).
9429 If you only care about the existence of a key and not the value
9430 (as you might when searching the NIS map
9431 .q hosts.byname
9432 for example),
9433 this flag prevents the map from substituting the value.
9434 However,
9435 The \-a argument is still appended on a match,
9436 and the default is still taken if the match fails.
9437 .ip "\-k\fIkeycol\fP"
9438 The key column name (for NIS+) or number
9439 (for text lookups).
9440 For LDAP maps this is an LDAP filter string
9441 in which %s is replaced with the literal contents of the lookup key
9442 and %0 is replaced with the LDAP escaped contents of the lookup key
9443 according to RFC 2254.
9444 If the flag
9445 .b \-K
9446 is used, then %1 through %9 are replaced with the LDAP escaped contents
9447 of the arguments specified in the map lookup.
9448 .ip "\-v\fIvalcol\fP"
9449 The value column name (for NIS+) or number
9450 (for text lookups).
9451 For LDAP maps this is the name of one or more
9452 attributes to be returned;
9453 multiple attributes can be separated by commas.
9454 If not specified, all attributes found in the match
9455 will be returned.
9456 The attributes listed can also include a type and one or more
9457 objectClass values for matching as described in the LDAP section.
9458 .ip "\-z\fIdelim\fP"
9459 The column delimiter (for text lookups).
9460 It can be a single character or one of the special strings
9461 .q \|\en
9462 or
9463 .q \|\et
9464 to indicate newline or tab respectively.
9465 If omitted entirely,
9466 the column separator is any sequence of white space.
9467 For LDAP and some other maps this is the separator character
9468 to combine multiple values
9469 into a single return string.
9470 If not set,
9471 the LDAP lookup will only return the first match found.
9472 For DNS maps this is the separator character at which
9473 the result of a query is cut off if is too long.
9474 .ip "\-t"
9475 Normally, when a map attempts to do a lookup
9476 and the server fails
9477 (e.g.,
9478 .i sendmail
9479 couldn't contact any name server;
9480 this is
9481 .i not
9482 the same as an entry not being found in the map),
9483 the message being processed is queued for future processing.
9484 The
9485 .b \-t
9486 flag turns off this behavior,
9487 letting the temporary failure (server down)
9488 act as though it were a permanent failure (entry not found).
9489 It is particularly useful for DNS lookups,
9490 where someone else's misconfigured name server can cause problems
9491 on your machine.
9492 However, care must be taken to ensure that you don't bounce mail
9493 that would be resolved correctly if you tried again.
9494 A common strategy is to forward such mail
9495 to another, possibly better connected, mail server.
9496 .ip "\-D"
9497 Perform no lookup in deferred delivery mode.
9498 This flag is set by default for the
9499 .i host
9500 map.
9501 .ip "\-S\fIspacesub\fP
9502 The character to use to replace space characters
9503 after a successful map lookup (esp. useful for regex
9504 and syslog maps).
9505 .ip "\-s\fIspacesub\fP
9506 For the dequote map only,
9507 the character to use to replace space characters
9508 after a successful dequote.
9509 .ip "\-q"
9510 Don't dequote the key before lookup.
9511 .ip "\-L\fIlevel\fP
9512 For the syslog map only, it specifies the level
9513 to use for the syslog call.
9514 .ip "\-A"
9515 When rebuilding an alias file,
9516 the
9517 .b \-A
9518 flag causes duplicate entries in the text version
9519 to be merged.
9520 For example, two entries:
9521 .(b
9522 list:   user1, user2
9523 list:   user3
9524 .)b
9525 would be treated as though it were the single entry
9526 .(b
9527 list:   user1, user2, user3
9528 .)b
9529 in the presence of the
9530 .b \-A
9531 flag.
9532 .pp
9533 Some additional flags are available for the host and dns maps:
9534 .ip "\-d"
9535 delay: specify the resolver's retransmission time interval (in seconds).
9536 .ip "\-r"
9537 retry: specify the number of times to retransmit a resolver query.
9538 .pp
9539 The dns map has another flag:
9540 .ip "\-B"
9541 basedomain: specify a domain that is always appended to queries.
9542 .pp
9543 Socket maps have an optional flag:
9544 .ip "\-d"
9545 timeout: specify the timeout (in seconds) for communication
9546 with the socket map server.
9547 .pp
9548 The following additional flags are present in the ldap map only:
9549 .ip "\-c\fItimeout\fP"
9550 Set the LDAP network timeout.
9551 sendmail must be compiled with
9552 .b \-DLDAP_OPT_NETWORK_TIMEOUT
9553 to use this flag.
9554 .ip "\-R"
9555 Do not auto chase referrals.  sendmail must be compiled with
9556 .b \-DLDAP_REFERRALS
9557 to use this flag.
9558 .ip "\-n"
9559 Retrieve attribute names only.
9560 .ip "\-V\fIsep\fP"
9561 Retrieve both attributes name and value(s),
9562 separated by
9563 .i sep .
9564 .ip "\-r\fIderef\fP"
9565 Set the alias dereference option to one of never, always, search, or find.
9566 .ip "\-s\fIscope\fP"
9567 Set search scope to one of base, one (one level), or sub (subtree).
9568 .ip "\-h\fIhost\fP"
9569 LDAP server hostname.
9570 Some LDAP libraries allow you to specify multiple, space-separated hosts for
9571 redundancy.
9572 In addition, each of the hosts listed can be followed by a colon and a port
9573 number to override the default LDAP port.
9574 .ip "\-p\fIport\fP"
9575 LDAP service port.
9576 .ip "\-H \fILDAPURI\fP"
9577 Use the specified LDAP URI instead of specifying the hostname and port
9578 separately with the the
9579 .b \-h
9580 and
9581 .b \-p
9582 options shown above.
9583 For example,
9584 .(b
9585 -h server.example.com -p 389 -b dc=example,dc=com
9586 .)b
9587 is equivalent to
9588 .(b
9589 -H ldap://server.example.com:389 -b dc=example,dc=com
9590 .)b
9591 If the LDAP library supports it,
9592 the LDAP URI format however can also request LDAP over SSL by using
9593 .b ldaps://
9594 instead of
9595 .b ldap:// .
9596 For example:
9597 .(b
9598 O LDAPDefaultSpec=-H ldaps://ldap.example.com -b dc=example,dc=com
9599 .)b
9600 Similarly, if the LDAP library supports it,
9601 It can also be used to specify a UNIX domain socket using
9602 .b ldapi:// :
9603 .(b
9604 O LDAPDefaultSpec=-H ldapi://socketfile -b dc=example,dc=com
9605 .)b
9606 .ip "\-b\fIbase\fP"
9607 LDAP search base.
9608 .ip "\-l\fItimelimit\fP"
9609 Time limit for LDAP queries.
9610 .ip "\-Z\fIsizelimit\fP"
9611 Size (number of matches) limit for LDAP or DNS queries.
9612 .ip "\-d\fIdistinguished_name\fP"
9613 The distinguished name to use to login to the LDAP server.
9614 .ip "\-M\fImethod\fP"
9615 The method to authenticate to the LDAP server.
9616 Should be one of
9617 .b LDAP_AUTH_NONE ,
9618 .b LDAP_AUTH_SIMPLE ,
9619 or
9620 .b LDAP_AUTH_KRBV4 .
9621 The leading
9622 .b LDAP_AUTH_
9623 can be omitted and the value is case-insensitive.
9624 .ip "\-P\fIpasswordfile\fP"
9625 The file containing the secret key for the
9626 .b LDAP_AUTH_SIMPLE
9627 authentication method
9628 or the name of the Kerberos ticket file for
9629 .b LDAP_AUTH_KRBV4 .
9630 .ip "\-1"
9631 Force LDAP searches to only succeed if a single match is found.
9632 If multiple values are found,
9633 the search is treated as if no match was found.
9634 .ip "\-w\fIversion\fP"
9635 Set the LDAP API/protocol version to use.
9636 The default depends on the LDAP client libraries in use.
9637 For example,
9638 .b "\-w 3"
9639 will cause
9640 .i sendmail
9641 to use LDAPv3 when communicating with the LDAP server.
9642 .ip "\-K"
9643 Treat the LDAP search key as multi-argument and
9644 replace %1 through %9 in the key with
9645 the LDAP escaped contents of the lookup arguments specified in the map lookup.
9646 .pp
9647 The
9648 .i dbm
9649 map appends the strings
9650 .q \&.pag
9651 and
9652 .q \&.dir
9653 to the given filename;
9654 the
9655 .i hash
9656 and
9657 .i btree
9658 maps append
9659 .q \&.db .
9660 For example, the map specification
9661 .(b
9662 Kuucp dbm \-o \-N /etc/mail/uucpmap
9663 .)b
9664 specifies an optional map named
9665 .q uucp
9666 of class
9667 .q dbm ;
9668 it always has null bytes at the end of every string,
9669 and the data is located in
9670 /etc/mail/uucpmap.{dir,pag}.
9671 .pp
9672 The program
9673 .i makemap (8)
9674 can be used to build database-oriented maps.
9675 It takes at least the following flags
9676 (for a complete list see its man page):
9677 .ip \-f
9678 Do not fold upper to lower case in the map.
9679 .ip \-N
9680 Include null bytes in keys.
9681 .ip \-o
9682 Append to an existing (old) file.
9683 .ip \-r
9684 Allow replacement of existing keys;
9685 normally, re-inserting an existing key is an error.
9686 .ip \-v
9687 Print what is happening.
9688 .lp
9689 The
9690 .i sendmail
9691 daemon does not have to be restarted to read the new maps
9692 as long as you change them in place;
9693 file locking is used so that the maps won't be read
9694 while they are being updated.
9695 .pp
9696 New classes can be added in the routine
9697 .b setupmaps
9698 in file
9699 .b conf.c .
9700 .sh 2 "Q \*- Queue Group Declaration"
9701 .pp
9702 In addition to the option
9703 .i QueueDirectory,
9704 queue groups can be declared that define a (group of) queue directories
9705 under a common name.
9706 The syntax is as follows:
9707 .(b F
9708 .b Q \c
9709 .i name
9710 {, \c
9711 .i field =\c
9712 .i value \|}+
9713 .)b
9714 where
9715 .i name
9716 is the symbolic name of the queue group under which
9717 it can be referenced in various places
9718 and the
9719 .q field=value
9720 pairs define attributes of the queue group.
9721 The name must only consist of alphanumeric characters.
9722 Fields are:
9723 .ip Flags
9724 Flags for this queue group.
9725 .ip Nice
9726 The nice(2) increment for the queue group.
9727 This value must be greater or equal zero.
9728 .ip Interval
9729 The time between two queue runs.
9730 .ip Path
9731 The queue directory of the group (required).
9732 .ip Runners
9733 The number of parallel runners processing the queue.
9734 Note that
9735 .b F=f
9736 must be set if this value is greater than one.
9737 .ip Jobs
9738 The maximum number of jobs (messages delivered) per queue run.
9739 .ip recipients
9740 The maximum number of recipients per envelope.
9741 Envelopes with more than this number of recipients will be split
9742 into multiple envelopes in the same queue directory.
9743 The default value 0 means no limit.
9744 .lp
9745 Only the first character of the field name is checked.
9746 .pp
9747 By default, a queue group named
9748 .i mqueue
9749 is defined that uses the value of the
9750 .i QueueDirectory
9751 option as path.
9752 Notice: all paths that are used for queue groups must
9753 be subdirectories of
9754 .i QueueDirectory .
9755 Since they can be symbolic links, this isn't a real restriction,
9756 If
9757 .i QueueDirectory
9758 uses a wildcard, then the directory one level up is considered
9759 the ``base'' directory which all other queue directories must share.
9760 Please make sure that the queue directories do not overlap,
9761 e.g., do not specify
9762 .(b
9763 O QueueDirectory=/var/spool/mqueue/*
9764 Qone, P=/var/spool/mqueue/dir1
9765 Qtwo, P=/var/spool/mqueue/dir2
9766 .)b
9767 because this also includes
9768 .q dir1
9769 and
9770 .q dir2
9771 in the default queue group.
9772 However,
9773 .(b
9774 O QueueDirectory=/var/spool/mqueue/main*
9775 Qone, P=/var/spool/mqueue/dir
9776 Qtwo, P=/var/spool/mqueue/other*
9777 .)b
9778 is a valid queue group specification.
9779 .pp
9780 Options listed in the ``Flags'' field can be used to modify
9781 the behavior of a queue group.
9782 The ``f'' flag must be set if multiple queue runners are
9783 supposed to work on the entries in a queue group.
9784 Otherwise
9785 .i sendmail
9786 will work on the entries strictly sequentially.
9787 .pp
9788 The ``Interval'' field sets the time between queue runs.
9789 If no queue group specific interval is set, then the parameter of the
9790 .b -q
9791 option from the command line is used.
9792 .pp
9793 To control the overall number of concurrently active queue runners
9794 the option
9795 .b MaxQueueChildren
9796 can be set.
9797 This limits the number of processes used for running the queues to
9798 .b MaxQueueChildren ,
9799 though at any one time fewer processes may be active
9800 as a result of queue options, completed queue runs, system load, etc.
9801 .pp
9802 The maximum number of queue runners for an individual queue group can be
9803 controlled via the
9804 .b Runners
9805 option.
9806 If set to 0, entries in the queue will not be processed, which
9807 is useful to ``quarantine'' queue files.
9808 The number of runners per queue group may also be set with the option
9809 .b MaxRunnersPerQueue ,
9810 which applies to queue groups that have no individual limit.
9811 That is, the default value for
9812 .b Runners
9813 is
9814 .b MaxRunnersPerQueue
9815 if set, otherwise 1.
9816 .pp
9817 The field Jobs describes the maximum number of jobs
9818 (messages delivered) per queue run, which is the queue group specific
9819 value of
9820 .b MaxQueueRunSize .
9821 .pp
9822 Notice: queue groups should be declared after all queue related options
9823 have been set because queue groups take their defaults from those options.
9824 If an option is set after a queue group declaration, the values of
9825 options in the queue group are set to the defaults of
9826 .i sendmail
9827 unless explicitly set in the declaration.
9828 .pp
9829 Each envelope is assigned to a queue group based on the algorithm
9830 described in section
9831 ``Queue Groups and Queue Directories''.
9832 .sh 2 "X \*- Mail Filter (Milter) Definitions"
9833 .pp
9834 The
9835 .i sendmail
9836 Mail Filter API (Milter) is designed to allow third-party programs access
9837 to mail messages as they are being processed in order to filter
9838 meta-information and content.
9839 They are declared in the configuration file as:
9840 .(b F
9841 .b X \c
9842 .i name
9843 {, \c
9844 .i field =\c
9845 .i value \|}*
9846 .)b
9847 where
9848 .i name
9849 is the name of the filter
9850 (used internally only)
9851 and the
9852 .q field=name
9853 pairs define attributes of the filter.
9854 Also see the documentation for the
9855 .b InputMailFilters
9856 option for more information.
9857 .pp
9858 Fields are:
9859 .(b
9860 .ta 1i
9861 Socket          The socket specification
9862 Flags           Special flags for this filter
9863 Timeouts        Timeouts for this filter
9864 .)b
9865 Only the first character of the field name is checked
9866 (it's case-sensitive).
9867 .pp
9868 The socket specification is one of the following forms:
9869 .(b F
9870 .b S= \c
9871 .b inet \c
9872 .b :
9873 .i port
9874 .b @
9875 .i host
9876 .)b
9877 .(b F
9878 .b S= \c
9879 .b inet6 \c
9880 .b :
9881 .i port
9882 .b @
9883 .i host
9884 .)b
9885 .(b F
9886 .b S= \c
9887 .b local \c
9888 .b :
9889 .i path
9890 .)b
9891 The first two describe an IPv4 or IPv6 socket listening on a certain
9892 .i port
9893 at a given
9894 .i host
9895 or IP address.
9896 The final form describes a named socket on the filesystem at the given
9897 .i path .
9898 .pp
9899 The following flags may be set in the filter description.
9900 .nr ii 4n
9901 .ip R
9902 Reject connection if filter unavailable.
9903 .ip T
9904 Temporary fail connection if filter unavailable.
9905 .pp
9906 If neither F=R nor F=T is specified, the message is passed through
9907 .i sendmail
9908 in case of filter errors as if the failing filters were not present.
9909 .pp
9910 The timeouts can be set using the four fields inside of the
9911 .b T=
9912 equate:
9913 .nr ii 4n
9914 .ip C
9915 Timeout for connecting to a filter.
9916 If set to 0, the system's
9917 .i connect()
9918 timeout will be used.
9919 .ip S
9920 Timeout for sending information from the MTA to a filter.
9921 .ip R
9922 Timeout for reading reply from the filter.
9923 .ip E
9924 Overall timeout between sending end-of-message to filter and waiting for
9925 the final acknowledgment.
9926 .pp
9927 Note the separator between each timeout field is a
9928 .b ';' .
9929 The default values (if not set) are:
9930 .b T=C:5m;S:10s;R:10s;E:5m
9931 where
9932 .b s
9933 is seconds and
9934 .b m
9935 is minutes.
9936 .pp
9937 Examples:
9938 .(b
9939 Xfilter1, S=local:/var/run/f1.sock, F=R
9940 Xfilter2, S=inet6:999@localhost, F=T, T=S:1s;R:1s;E:5m
9941 Xfilter3, S=inet:3333@localhost, T=C:2m
9942 .)b
9943 .sh 2 "The User Database"
9944 .pp
9945 The user database is deprecated in favor of ``virtusertable''
9946 and ``genericstable'' as explained in the file
9947 .b cf/README .
9948 If you have a version of
9949 .i sendmail
9950 with the user database package
9951 compiled in,
9952 the handling of sender and recipient addresses
9953 is modified.
9954 .pp
9955 The location of this database is controlled with the
9956 .b UserDatabaseSpec
9957 option.
9958 .sh 3 "Structure of the user database"
9959 .pp
9960 The database is a sorted (BTree-based) structure.
9961 User records are stored with the key:
9962 .(b
9963 \fIuser-name\fP\fB:\fP\fIfield-name\fP
9964 .)b
9965 The sorted database format ensures that user records are clustered together.
9966 Meta-information is always stored with a leading colon.
9967 .pp
9968 Field names define both the syntax and semantics of the value.
9969 Defined fields include:
9970 .nr ii 1i
9971 .ip maildrop
9972 The delivery address for this user.
9973 There may be multiple values of this record.
9974 In particular,
9975 mailing lists will have one
9976 .i maildrop
9977 record for each user on the list.
9978 .ip "mailname"
9979 The outgoing mailname for this user.
9980 For each outgoing name,
9981 there should be an appropriate
9982 .i maildrop
9983 record for that name to allow return mail.
9984 See also
9985 .i :default:mailname .
9986 .ip mailsender
9987 Changes any mail sent to this address to have the indicated envelope sender.
9988 This is intended for mailing lists,
9989 and will normally be the name of an appropriate -request address.
9990 It is very similar to the owner-\c
9991 .i list
9992 syntax in the alias file.
9993 .ip fullname
9994 The full name of the user.
9995 .ip office-address
9996 The office address for this user.
9997 .ip office-phone
9998 The office phone number for this user.
9999 .ip office-fax
10000 The office FAX number for this user.
10001 .ip home-address
10002 The home address for this user.
10003 .ip home-phone
10004 The home phone number for this user.
10005 .ip home-fax
10006 The home FAX number for this user.
10007 .ip project
10008 A (short) description of the project this person is affiliated with.
10009 In the University this is often just the name of their graduate advisor.
10010 .ip plan
10011 A pointer to a file from which plan information can be gathered.
10012 .pp
10013 As of this writing,
10014 only a few of these fields are actually being used by
10015 .i sendmail :
10016 .i maildrop
10017 and
10018 .i mailname .
10019 A
10020 .i finger
10021 program that uses the other fields is planned.
10022 .sh 3 "User database semantics"
10023 .pp
10024 When the rewriting rules submit an address to the local mailer,
10025 the user name is passed through the alias file.
10026 If no alias is found (or if the alias points back to the same address),
10027 the name (with
10028 .q :maildrop
10029 appended)
10030 is then used as a key in the user database.
10031 If no match occurs (or if the maildrop points at the same address),
10032 forwarding is tried.
10033 .pp
10034 If the first token of the user name returned by ruleset 0
10035 is an
10036 .q @
10037 sign, the user database lookup is skipped.
10038 The intent is that the user database will act as a set of defaults
10039 for a cluster (in our case, the Computer Science Division);
10040 mail sent to a specific machine should ignore these defaults.
10041 .pp
10042 When mail is sent,
10043 the name of the sending user is looked up in the database.
10044 If that user has a
10045 .q mailname
10046 record,
10047 the value of that record is used as their outgoing name.
10048 For example, I might have a record:
10049 .(b
10050 eric:mailname   Eric.Allman@CS.Berkeley.EDU
10051 .)b
10052 This would cause my outgoing mail to be sent as Eric.Allman.
10053 .pp
10054 If a
10055 .q maildrop
10056 is found for the user,
10057 but no corresponding
10058 .q mailname
10059 record exists,
10060 the record
10061 .q :default:mailname
10062 is consulted.
10063 If present, this is the name of a host to override the local host.
10064 For example, in our case we would set it to
10065 .q CS.Berkeley.EDU .
10066 The effect is that anyone known in the database
10067 gets their outgoing mail stamped as
10068 .q user@CS.Berkeley.EDU ,
10069 but people not listed in the database use the local hostname.
10070 .sh 3 "Creating the database\**"
10071 .(f
10072 \**These instructions are known to be incomplete.
10073 Other features are available which provide similar functionality,
10074 e.g., virtual hosting and mapping local addresses into a
10075 generic form as explained in cf/README.
10076 .)f
10077 .pp
10078 The user database is built from a text file
10079 using the
10080 .i makemap
10081 utility
10082 (in the distribution in the makemap subdirectory).
10083 The text file is a series of lines corresponding to userdb records;
10084 each line has a key and a value separated by white space.
10085 The key is always in the format described above \*-
10086 for example:
10087 .(b
10088 eric:maildrop
10089 .)b
10090 This file is normally installed in a system directory;
10091 for example, it might be called
10092 .i /etc/mail/userdb .
10093 To make the database version of the map, run the program:
10094 .(b
10095 makemap btree /etc/mail/userdb < /etc/mail/userdb
10096 .)b
10097 Then create a config file that uses this.
10098 For example, using the V8 M4 configuration, include the
10099 following line in your .mc file:
10100 .(b
10101 define(\`confUSERDB_SPEC\', /etc/mail/userdb)
10102 .)b
10103 .sh 1 "OTHER CONFIGURATION"
10104 .pp
10105 There are some configuration changes that can be made by
10106 recompiling
10107 .i sendmail .
10108 This section describes what changes can be made
10109 and what has to be modified to make them.
10110 In most cases this should be unnecessary
10111 unless you are porting
10112 .i sendmail
10113 to a new environment.
10114 .sh 2 "Parameters in devtools/OS/$oscf"
10115 .pp
10116 These parameters are intended to describe the compilation environment,
10117 not site policy,
10118 and should normally be defined in the operating system
10119 configuration file.
10120 .b "This section needs a complete rewrite."
10121 .ip NDBM
10122 If set,
10123 the new version of the DBM library
10124 that allows multiple databases will be used.
10125 If neither CDB, NDBM, nor NEWDB are set,
10126 a much less efficient method of alias lookup is used.
10127 .ip CWDB
10128 If set, use the cdb (tinycdb) package.
10129 .ip NEWDB
10130 If set, use the new database package from Berkeley (from 4.4BSD).
10131 This package is substantially faster than DBM or NDBM.
10132 If NEWDB and NDBM are both set,
10133 .i sendmail
10134 will read DBM files,
10135 but will create and use NEWDB files.
10136 .ip NIS
10137 Include support for NIS.
10138 If set together with
10139 .i both
10140 NEWDB and NDBM,
10141 .i sendmail
10142 will create both DBM and NEWDB files if and only if
10143 an alias file includes the substring
10144 .q /yp/
10145 in the name.
10146 This is intended for compatibility with Sun Microsystems'
10147 .i mkalias
10148 program used on YP masters.
10149 .ip NISPLUS
10150 Compile in support for NIS+.
10151 .ip NETINFO
10152 Compile in support for NetInfo (NeXT stations).
10153 .ip LDAPMAP
10154 Compile in support for LDAP X500 queries.
10155 Requires libldap and liblber
10156 from the Umich LDAP 3.2 or 3.3 release
10157 or equivalent libraries for other LDAP libraries
10158 such as OpenLDAP.
10159 .ip HESIOD
10160 Compile in support for Hesiod.
10161 .ip MAP_NSD
10162 Compile in support for IRIX NSD lookups.
10163 .ip MAP_REGEX
10164 Compile in support for regular expression matching.
10165 .ip DNSMAP
10166 Compile in support for DNS map lookups in the
10167 .i sendmail.cf
10168 file.
10169 .ip PH_MAP
10170 Compile in support for ph lookups.
10171 .ip SASL
10172 Compile in support for SASL,
10173 a required component for SMTP Authentication support.
10174 .ip STARTTLS
10175 Compile in support for STARTTLS.
10176 .ip EGD
10177 Compile in support for the "Entropy Gathering Daemon"
10178 to provide better random data for TLS.
10179 .ip TCPWRAPPERS
10180 Compile in support for TCP Wrappers.
10181 .ip _PATH_SENDMAILCF
10182 The pathname of the sendmail.cf file.
10183 .ip _PATH_SENDMAILPID
10184 The pathname of the sendmail.pid file.
10185 .ip SM_CONF_SHM
10186 Compile in support for shared memory, see section about
10187 "/var/spool/mqueue".
10188 .ip MILTER
10189 Compile in support for contacting external mail filters built with the
10190 Milter API.
10191 .pp
10192 There are also several compilation flags to indicate the environment
10193 such as
10194 .q _AIX3
10195 and
10196 .q _SCO_unix_ .
10197 See the sendmail/README
10198 file for the latest scoop on these flags.
10199 .sh 3 "For Future Releases"
10200 .pp
10201 .i sendmail
10202 often contains compile time options
10203 .i "For Future Releases"
10204 (prefix _FFR_)
10205 which might be enabled in a subsequent version
10206 or might simply be removed as they turned out not to be really useful.
10207 These features are usually not documented but if they are,
10208 then the required (FFR) compile
10209 time options are listed here for rulesets and macros,
10210 and in
10211 .i cf/README
10212 for mc/cf options.
10213 FFR compile times options must be enabled when the sendmail binary
10214 is built from source.
10215 Enabled FFRs in a binary can be listed with
10216 .(b
10217 sendmail -d0.13 < /dev/null | grep FFR
10218 .)b
10219 .sh 2 "Parameters in sendmail/conf.h"
10220 .pp
10221 Parameters and compilation options
10222 are defined in conf.h.
10223 Most of these need not normally be tweaked;
10224 common parameters are all in sendmail.cf.
10225 However, the sizes of certain primitive vectors, etc.,
10226 are included in this file.
10227 The numbers following the parameters
10228 are their default value.
10229 .pp
10230 This document is not the best source of information
10231 for compilation flags in conf.h \(em
10232 see sendmail/README or sendmail/conf.h itself.
10233 .nr ii 1.2i
10234 .ip "MAXLINE [2048]"
10235 The maximum line length of any input line.
10236 If message lines exceed this length
10237 they will still be processed correctly;
10238 however, header lines,
10239 configuration file lines,
10240 alias lines,
10241 etc.,
10242 must fit within this limit.
10243 .ip "MAXNAME [256]"
10244 The maximum length of any name,
10245 such as a host or a user name.
10246 .ip "MAXPV [256]"
10247 The maximum number of parameters to any mailer.
10248 This limits the number of recipients that may be passed in one transaction.
10249 It can be set to any arbitrary number above about 10,
10250 since
10251 .i sendmail
10252 will break up a delivery into smaller batches as needed.
10253 A higher number may reduce load on your system, however.
10254 .ip "MAXQUEUEGROUPS [50]"
10255 The maximum number of queue groups.
10256 .ip "MAXATOM [1000]"
10257 The maximum number of atoms
10258 (tokens)
10259 in a single address.
10260 For example,
10261 the address
10262 .q "eric@CS.Berkeley.EDU"
10263 is seven atoms.
10264 .ip "MAXMAILERS [25]"
10265 The maximum number of mailers that may be defined
10266 in the configuration file.
10267 This value is defined in include/sendmail/sendmail.h.
10268 .ip "MAXRWSETS [200]"
10269 The maximum number of rewriting sets
10270 that may be defined.
10271 The first half of these are reserved for numeric specification
10272 (e.g., ``S92''),
10273 while the upper half are reserved for auto-numbering
10274 (e.g., ``Sfoo'').
10275 Thus, with a value of 200 an attempt to use ``S99'' will succeed,
10276 but ``S100'' will fail.
10277 .ip "MAXPRIORITIES [25]"
10278 The maximum number of values for the
10279 .q Precedence:
10280 field that may be defined
10281 (using the
10282 .b P
10283 line in sendmail.cf).
10284 .ip "MAXUSERENVIRON [100]"
10285 The maximum number of items in the user environment
10286 that will be passed to subordinate mailers.
10287 .ip "MAXMXHOSTS [100]"
10288 The maximum number of MX records we will accept for any single host.
10289 .ip "MAXMAPSTACK [12]"
10290 The maximum number of maps that may be "stacked" in a
10291 .b sequence
10292 class map.
10293 .ip "MAXMIMEARGS [20]"
10294 The maximum number of arguments in a MIME Content-Type: header;
10295 additional arguments will be ignored.
10296 .ip "MAXMIMENESTING [20]"
10297 The maximum depth to which MIME messages may be nested
10298 (that is, nested Message or Multipart documents;
10299 this does not limit the number of components in a single Multipart document).
10300 .ip "MAXDAEMONS [10]"
10301 The maximum number of sockets sendmail will open for accepting connections
10302 on different ports.
10303 .ip "MAXMACNAMELEN [25]"
10304 The maximum length of a macro name.
10305 .lp
10306 A number of other compilation options exist.
10307 These specify whether or not specific code should be compiled in.
10308 Ones marked with \(dg
10309 are 0/1 valued.
10310 .nr ii 1.2i
10311 .ip NETINET\(dg
10312 If set,
10313 support for Internet protocol networking is compiled in.
10314 Previous versions of
10315 .i sendmail
10316 referred to this as
10317 .sm DAEMON ;
10318 this old usage is now incorrect.
10319 Defaults on;
10320 turn it off in the Makefile
10321 if your system doesn't support the Internet protocols.
10322 .ip NETINET6\(dg
10323 If set,
10324 support for IPv6 networking is compiled in.
10325 It must be separately enabled by adding
10326 .b DaemonPortOptions
10327 settings.
10328 .ip NETISO\(dg
10329 If set,
10330 support for ISO protocol networking is compiled in
10331 (it may be appropriate to #define this in the Makefile instead of conf.h).
10332 .ip NETUNIX\(dg
10333 If set,
10334 support for UNIX domain sockets is compiled in.
10335 This is used for control socket support.
10336 .ip LOG
10337 If set,
10338 the
10339 .i syslog
10340 routine in use at some sites is used.
10341 This makes an informational log record
10342 for each message processed,
10343 and makes a higher priority log record
10344 for internal system errors.
10345 .b "STRONGLY RECOMMENDED"
10346 \(em if you want no logging, turn it off in the configuration file.
10347 .ip MATCHGECOS\(dg
10348 Compile in the code to do ``fuzzy matching'' on the GECOS field
10349 in /etc/passwd.
10350 This also requires that the
10351 .b MatchGECOS
10352 option be turned on.
10353 .ip NAMED_BIND\(dg
10354 Compile in code to use the
10355 Berkeley Internet Name Domain (BIND) server
10356 to resolve TCP/IP host names.
10357 .ip NOTUNIX
10358 If you are using a non-UNIX mail format,
10359 you can set this flag to turn off special processing
10360 of UNIX-style
10361 .q "From "
10362 lines.
10363 .ip USERDB\(dg
10364 Include the
10365 .b experimental
10366 Berkeley user information database package.
10367 This adds a new level of local name expansion
10368 between aliasing and forwarding.
10369 It also uses the NEWDB package.
10370 This may change in future releases.
10371 .lp
10372 The following options are normally turned on
10373 in per-operating-system clauses in conf.h.
10374 .ip IDENTPROTO\(dg
10375 Compile in the IDENT protocol as defined in RFC 1413.
10376 This defaults on for all systems except Ultrix,
10377 which apparently has the interesting
10378 .q feature
10379 that when it receives a
10380 .q "host unreachable"
10381 message it closes all open connections to that host.
10382 Since some firewall gateways send this error code
10383 when you access an unauthorized port (such as 113, used by IDENT),
10384 Ultrix cannot receive email from such hosts.
10385 .ip SYSTEM5
10386 Set all of the compilation parameters appropriate for System V.
10387 .ip HASFLOCK\(dg
10388 Use Berkeley-style
10389 .b flock
10390 instead of System V
10391 .b lockf
10392 to do file locking.
10393 Due to the highly unusual semantics of locks
10394 across forks in
10395 .b lockf ,
10396 this should always be used if at all possible.
10397 .ip HASINITGROUPS
10398 Set this if your system has the
10399 .i initgroups()
10400 call
10401 (if you have multiple group support).
10402 This is the default if SYSTEM5 is
10403 .i not
10404 defined or if you are on HPUX.
10405 .ip HASUNAME
10406 Set this if you have the
10407 .i uname (2)
10408 system call (or corresponding library routine).
10409 Set by default if
10410 SYSTEM5
10411 is set.
10412 .ip HASGETDTABLESIZE
10413 Set this if you have the
10414 .i getdtablesize (2)
10415 system call.
10416 .ip HASWAITPID
10417 Set this if you have the
10418 .i haswaitpid (2)
10419 system call.
10420 .ip FAST_PID_RECYCLE
10421 Set this if your system can possibly
10422 reuse the same pid in the same second of time.
10423 .ip SFS_TYPE
10424 The mechanism that can be used to get file system capacity information.
10425 The values can be one of
10426 SFS_USTAT (use the ustat(2) syscall),
10427 SFS_4ARGS (use the four argument statfs(2) syscall),
10428 SFS_VFS (use the two argument statfs(2) syscall including <sys/vfs.h>),
10429 SFS_MOUNT (use the two argument statfs(2) syscall including <sys/mount.h>),
10430 SFS_STATFS (use the two argument statfs(2) syscall including <sys/statfs.h>),
10431 SFS_STATVFS (use the two argument statfs(2) syscall including <sys/statvfs.h>),
10432 or
10433 SFS_NONE (no way to get this information).
10434 .ip LA_TYPE
10435 The load average type.
10436 Details are described below.
10437 .lp
10438 The are several built-in ways of computing the load average.
10439 .i Sendmail
10440 tries to auto-configure them based on imperfect guesses;
10441 you can select one using the
10442 .i cc
10443 option
10444 .b \-DLA_TYPE= \c
10445 .i type ,
10446 where
10447 .i type
10448 is:
10449 .ip LA_INT
10450 The kernel stores the load average in the kernel as an array of long integers.
10451 The actual values are scaled by a factor FSCALE
10452 (default 256).
10453 .ip LA_SHORT
10454 The kernel stores the load average in the kernel as an array of short integers.
10455 The actual values are scaled by a factor FSCALE
10456 (default 256).
10457 .ip LA_FLOAT
10458 The kernel stores the load average in the kernel as an array of
10459 double precision floats.
10460 .ip LA_MACH
10461 Use MACH-style load averages.
10462 .ip LA_SUBR
10463 Call the
10464 .i getloadavg
10465 routine to get the load average as an array of doubles.
10466 .ip LA_ZERO
10467 Always return zero as the load average.
10468 This is the fallback case.
10469 .lp
10470 If type
10471 .sm LA_INT ,
10472 .sm LA_SHORT ,
10473 or
10474 .sm LA_FLOAT
10475 is specified,
10476 you may also need to specify
10477 .sm _PATH_UNIX
10478 (the path to your system binary)
10479 and
10480 .sm LA_AVENRUN
10481 (the name of the variable containing the load average in the kernel;
10482 usually
10483 .q _avenrun
10484 or
10485 .q avenrun ).
10486 .sh 2 "Configuration in sendmail/conf.c"
10487 .pp
10488 The following changes can be made in conf.c.
10489 .sh 3 "Built-in Header Semantics"
10490 .pp
10491 Not all header semantics are defined in the configuration file.
10492 Header lines that should only be included by certain mailers
10493 (as well as other more obscure semantics)
10494 must be specified in the
10495 .i HdrInfo
10496 table in
10497 .i conf.c .
10498 This table contains the header name
10499 (which should be in all lower case)
10500 and a set of header control flags (described below),
10501 The flags are:
10502 .ip H_ACHECK
10503 Normally when the check is made to see if a header line is compatible
10504 with a mailer,
10505 .i sendmail
10506 will not delete an existing line.
10507 If this flag is set,
10508 .i sendmail
10509 will delete
10510 even existing header lines.
10511 That is,
10512 if this bit is set and the mailer does not have flag bits set
10513 that intersect with the required mailer flags
10514 in the header definition in
10515 sendmail.cf,
10516 the header line is
10517 .i always
10518 deleted.
10519 .ip H_EOH
10520 If this header field is set,
10521 treat it like a blank line,
10522 i.e.,
10523 it will signal the end of the header
10524 and the beginning of the message text.
10525 .ip H_FORCE
10526 Add this header entry
10527 even if one existed in the message before.
10528 If a header entry does not have this bit set,
10529 .i sendmail
10530 will not add another header line if a header line
10531 of this name already existed.
10532 This would normally be used to stamp the message
10533 by everyone who handled it.
10534 .ip H_TRACE
10535 If set,
10536 this is a timestamp
10537 (trace)
10538 field.
10539 If the number of trace fields in a message
10540 exceeds a preset amount
10541 the message is returned
10542 on the assumption that it has an aliasing loop.
10543 .ip H_RCPT
10544 If set,
10545 this field contains recipient addresses.
10546 This is used by the
10547 .b \-t
10548 flag to determine who to send to
10549 when it is collecting recipients from the message.
10550 .ip H_FROM
10551 This flag indicates that this field
10552 specifies a sender.
10553 The order of these fields in the
10554 .i HdrInfo
10555 table specifies
10556 .i sendmail 's
10557 preference
10558 for which field to return error messages to.
10559 .ip H_ERRORSTO
10560 Addresses in this header should receive error messages.
10561 .ip H_CTE
10562 This header is a Content-Transfer-Encoding header.
10563 .ip H_CTYPE
10564 This header is a Content-Type header.
10565 .ip H_BCC
10566 Strip the value from the header (for Bcc:).
10567 .nr ii 5n
10568 .lp
10569 Let's look at a sample
10570 .i HdrInfo
10571 specification:
10572 .(b
10573 .ta 4n +\w'"content-transfer-encoding",  'u
10574 struct hdrinfo  HdrInfo[] =
10575 \&{
10576              /* originator fields, most to least significant  */
10577         "resent-sender",        H_FROM,
10578         "resent-from",  H_FROM,
10579         "sender",       H_FROM,
10580         "from", H_FROM,
10581         "full-name",    H_ACHECK,
10582         "errors-to",    H_FROM\^|\^H_ERRORSTO,
10583              /* destination fields */
10584         "to",   H_RCPT,
10585         "resent-to",    H_RCPT,
10586         "cc",   H_RCPT,
10587         "bcc",  H_RCPT\^|\^H_BCC,
10588              /* message identification and control */
10589         "message",      H_EOH,
10590         "text", H_EOH,
10591              /* trace fields */
10592         "received",     H_TRACE\^|\^H_FORCE,
10593              /* miscellaneous fields */
10594         "content-transfer-encoding",    H_CTE,
10595         "content-type", H_CTYPE,
10596
10597         NULL,   0,
10598 };
10599 .)b
10600 This structure indicates that the
10601 .q To: ,
10602 .q Resent-To: ,
10603 and
10604 .q Cc:
10605 fields
10606 all specify recipient addresses.
10607 Any
10608 .q Full-Name:
10609 field will be deleted unless the required mailer flag
10610 (indicated in the configuration file)
10611 is specified.
10612 The
10613 .q Message:
10614 and
10615 .q Text:
10616 fields will terminate the header;
10617 these are used by random dissenters around the network world.
10618 The
10619 .q Received:
10620 field will always be added,
10621 and can be used to trace messages.
10622 .pp
10623 There are a number of important points here.
10624 First,
10625 header fields are not added automatically just because they are in the
10626 .i HdrInfo
10627 structure;
10628 they must be specified in the configuration file
10629 in order to be added to the message.
10630 Any header fields mentioned in the configuration file but not
10631 mentioned in the
10632 .i HdrInfo
10633 structure have default processing performed;
10634 that is,
10635 they are added unless they were in the message already.
10636 Second,
10637 the
10638 .i HdrInfo
10639 structure only specifies cliched processing;
10640 certain headers are processed specially by ad hoc code
10641 regardless of the status specified in
10642 .i HdrInfo .
10643 For example,
10644 the
10645 .q Sender:
10646 and
10647 .q From:
10648 fields are always scanned on ARPANET mail
10649 to determine the sender\**;
10650 .(f
10651 \**Actually, this is no longer true in SMTP;
10652 this information is contained in the envelope.
10653 The older ARPANET protocols did not completely distinguish
10654 envelope from header.
10655 .)f
10656 this is used to perform the
10657 .q "return to sender"
10658 function.
10659 The
10660 .q "From:"
10661 and
10662 .q "Full-Name:"
10663 fields are used to determine the full name of the sender
10664 if possible;
10665 this is stored in the macro
10666 .b $x
10667 and used in a number of ways.
10668 .sh 3 "Restricting Use of Email"
10669 .pp
10670 If it is necessary to restrict mail through a relay,
10671 the
10672 .i checkcompat
10673 routine can be modified.
10674 This routine is called for every recipient address.
10675 It returns an exit status
10676 indicating the status of the message.
10677 The status
10678 .sm EX_OK
10679 accepts the address,
10680 .sm EX_TEMPFAIL
10681 queues the message for a later try,
10682 and other values
10683 (commonly
10684 .sm EX_UNAVAILABLE )
10685 reject the message.
10686 It is up to
10687 .i checkcompat
10688 to print an error message
10689 (using
10690 .i usrerr )
10691 if the message is rejected.
10692 For example,
10693 .i checkcompat
10694 could read:
10695 .(b
10696 .re
10697 .sz -1
10698 .ta 4n +4n +4n +4n +4n +4n +4n
10699 int
10700 checkcompat(to, e)
10701         register ADDRESS *to;
10702         register ENVELOPE *e;
10703 \&{
10704         register STAB *s;
10705
10706         s = stab("private", ST_MAILER, ST_FIND);
10707         if (s != NULL && e\->e_from.q_mailer != LocalMailer &&
10708             to->q_mailer == s->s_mailer)
10709         {
10710                 usrerr("No private net mail allowed through this machine");
10711                 return (EX_UNAVAILABLE);
10712         }
10713         if (MsgSize > 50000 && bitnset(M_LOCALMAILER, to\->q_mailer))
10714         {
10715                 usrerr("Message too large for non-local delivery");
10716                 e\->e_flags |= EF_NORETURN;
10717                 return (EX_UNAVAILABLE);
10718         }
10719         return (EX_OK);
10720 }
10721 .sz
10722 .)b
10723 This would reject messages greater than 50000 bytes
10724 unless they were local.
10725 The
10726 .i EF_NORETURN
10727 flag can be set in
10728 .i e\(->e_flags
10729 to suppress the return of the actual body
10730 of the message in the error return.
10731 The actual use of this routine is highly dependent on the
10732 implementation,
10733 and use should be limited.
10734 .sh 3 "New Database Map Classes"
10735 .pp
10736 New key maps can be added by creating a class initialization function
10737 and a lookup function.
10738 These are then added to the routine
10739 .i setupmaps.
10740 .pp
10741 The initialization function is called as
10742 .(b
10743 \fIxxx\fP_map_init(MAP *map, char *args)
10744 .)b
10745 The
10746 .i map
10747 is an internal data structure.
10748 The
10749 .i args
10750 is a pointer to the portion of the configuration file line
10751 following the map class name;
10752 flags and filenames can be extracted from this line.
10753 The initialization function must return
10754 .sm true
10755 if it successfully opened the map,
10756 .sm false
10757 otherwise.
10758 .pp
10759 The lookup function is called as
10760 .(b
10761 \fIxxx\fP_map_lookup(MAP *map, char buf[], char **av, int *statp)
10762 .)b
10763 The
10764 .i map
10765 defines the map internally.
10766 The
10767 .i buf
10768 has the input key.
10769 This may be (and often is) used destructively.
10770 The
10771 .i av
10772 is a list of arguments passed in from the rewrite line.
10773 The lookup function should return a pointer to the new value.
10774 If the map lookup fails,
10775 .i *statp
10776 should be set to an exit status code;
10777 in particular, it should be set to
10778 .sm EX_TEMPFAIL
10779 if recovery is to be attempted by the higher level code.
10780 .sh 3 "Queueing Function"
10781 .pp
10782 The routine
10783 .i shouldqueue
10784 is called to decide if a message should be queued
10785 or processed immediately.
10786 Typically this compares the message priority to the current load average.
10787 The default definition is:
10788 .(b
10789 bool
10790 shouldqueue(pri, ctime)
10791         long pri;
10792         time_t ctime;
10793 {
10794         if (CurrentLA < QueueLA)
10795                 return false;
10796         return (pri > (QueueFactor / (CurrentLA \- QueueLA + 1)));
10797 }
10798 .)b
10799 If the current load average
10800 (global variable
10801 .i CurrentLA ,
10802 which is set before this function is called)
10803 is less than the low threshold load average
10804 (option
10805 .b x ,
10806 variable
10807 .i QueueLA ),
10808 .i shouldqueue
10809 returns
10810 .sm false
10811 immediately
10812 (that is, it should
10813 .i not
10814 queue).
10815 If the current load average exceeds the high threshold load average
10816 (option
10817 .b X ,
10818 variable
10819 .i RefuseLA ),
10820 .i shouldqueue
10821 returns
10822 .sm true
10823 immediately.
10824 Otherwise, it computes the function based on the message priority,
10825 the queue factor
10826 (option
10827 .b q ,
10828 global variable
10829 .i QueueFactor ),
10830 and the current and threshold load averages.
10831 .pp
10832 An implementation wishing to take the actual age of the message into account
10833 can also use the
10834 .i ctime
10835 parameter,
10836 which is the time that the message was first submitted to
10837 .i sendmail .
10838 Note that the
10839 .i pri
10840 parameter is already weighted
10841 by the number of times the message has been tried
10842 (although this tends to lower the priority of the message with time);
10843 the expectation is that the
10844 .i ctime
10845 would be used as an
10846 .q "escape clause"
10847 to ensure that messages are eventually processed.
10848 .sh 3 "Refusing Incoming SMTP Connections"
10849 .pp
10850 The function
10851 .i refuseconnections
10852 returns
10853 .sm true
10854 if incoming SMTP connections should be refused.
10855 The current implementation is based exclusively on the current load average
10856 and the refuse load average option
10857 (option
10858 .b X ,
10859 global variable
10860 .i RefuseLA ):
10861 .(b
10862 bool
10863 refuseconnections()
10864 {
10865         return (RefuseLA > 0 && CurrentLA >= RefuseLA);
10866 }
10867 .)b
10868 A more clever implementation
10869 could look at more system resources.
10870 .sh 3 "Load Average Computation"
10871 .pp
10872 The routine
10873 .i getla
10874 returns the current load average (as a rounded integer).
10875 The distribution includes several possible implementations.
10876 If you are porting to a new environment
10877 you may need to add some new tweaks.\**
10878 .(f
10879 \**If you do, please send updates to
10880 sendmail@Sendmail.ORG.
10881 .)f
10882 .sh 2 "Configuration in sendmail/daemon.c"
10883 .pp
10884 The file
10885 .i sendmail/daemon.c
10886 contains a number of routines that are dependent
10887 on the local networking environment.
10888 The version supplied assumes you have BSD style sockets.
10889 .pp
10890 In previous releases,
10891 we recommended that you modify the routine
10892 .i maphostname
10893 if you wanted to generalize
10894 .b $[
10895 \&...\&
10896 .b $]
10897 lookups.
10898 We now recommend that you create a new keyed map instead.
10899 .sh 2 "LDAP"
10900 .pp
10901 In this section we assume that
10902 .i sendmail
10903 has been compiled with support for LDAP.
10904 .sh 3 "LDAP Recursion"
10905 .pp
10906 LDAP Recursion allows you to add types to the search attributes on an
10907 LDAP map specification.
10908 The syntax is:
10909 .ip "\-v \fIATTRIBUTE\fP[:\fITYPE\fP[:\fIOBJECTCLASS\fP[|\fIOBJECTCLASS\fP|...]]]
10910 .pp
10911 The new \fITYPE\fPs are:
10912 .nr ii 1i
10913 .ip NORMAL
10914 This attribute type specifies the attribute to add to the results string.
10915 This is the default.
10916 .ip DN
10917 Any matches for this attribute are expected to have a value of a
10918 fully qualified distinguished name.
10919 .i sendmail
10920 will lookup that DN and apply the attributes requested to the
10921 returned DN record.
10922 .ip FILTER
10923 Any matches for this attribute are expected to have a value of an
10924 LDAP search filter.
10925 .i sendmail
10926 will perform a lookup with the same parameters as the original
10927 search but replaces the search filter with the one specified here.
10928 .ip URL
10929 Any matches for this attribute are expected to have a value of an LDAP URL.
10930 .i sendmail
10931 will perform a lookup of that URL and use the results from the attributes
10932 named in that URL.
10933 Note however that the search is done using the current LDAP connection,
10934 regardless of what is specified as the scheme, LDAP host, and LDAP
10935 port in the LDAP URL.
10936 .lp
10937 Any untyped attributes are considered
10938 .sm NORMAL
10939 attributes as described above.
10940 .pp
10941 The optional \fIOBJECTCLASS\fP (| separated) list contains the
10942 objectClass values for which that attribute applies.
10943 If the list is given,
10944 the attribute named will only be used if the LDAP record being returned is a
10945 member of that object class.
10946 Note that if these new value attribute \fITYPE\fPs are used in an
10947 AliasFile
10948 option setting, it will need to be double quoted to prevent
10949 .i sendmail
10950 from misparsing the colons.
10951 .pp
10952 Note that LDAP recursion attributes which do not ultimately point to an
10953 LDAP record are not considered an error.
10954 .sh 4 "Example"
10955 .pp
10956 Since examples usually help clarify, here is an example which uses all
10957 four of the new types:
10958 .(b
10959 O LDAPDefaultSpec=-h ldap.example.com -b dc=example,dc=com
10960
10961 Kexample ldap
10962          -z,
10963          -k (&(objectClass=sendmailMTAAliasObject)(sendmailMTAKey=%0))
10964          -v sendmailMTAAliasValue,mail:NORMAL:inetOrgPerson,
10965             uniqueMember:DN:groupOfUniqueNames,
10966             sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,
10967             sendmailMTAAliasURL:URL:sendmailMTAAliasObject
10968 .)b
10969 .pp
10970 That definition specifies that:
10971 .bu
10972 Any value in a
10973 .sm sendmailMTAAliasValue
10974 attribute will be added to the result string regardless of object class.
10975 .bu
10976 The
10977 .sm mail
10978 attribute will be added to the result string if
10979 the LDAP record is a member of the
10980 .sm inetOrgPerson
10981 object class.
10982 .bu
10983 The
10984 .sm uniqueMember
10985 attribute is a recursive attribute, used only in
10986 .sm groupOfUniqueNames
10987 records, and should contain an LDAP DN pointing to another LDAP record.
10988 The desire here is to return the
10989 .sm mail
10990 attribute from those DNs.
10991 .bu
10992 The
10993 .sm sendmailMTAAliasSearch
10994 attribute and
10995 .sm sendmailMTAAliasURL
10996 are both used only if referenced in a
10997 .sm sendmailMTAAliasObject .
10998 They are both recursive, the first for a new LDAP search string and the
10999 latter for an LDAP URL.
11000 .sh 2 "STARTTLS"
11001 .pp
11002 In this section we assume that
11003 .i sendmail
11004 has been compiled with support for STARTTLS.
11005 To properly understand the use of STARTTLS in
11006 .i sendmail ,
11007 it is necessary to understand at least some basics about X.509 certificates
11008 and public key cryptography.
11009 This information can be found in books about SSL/TLS
11010 or on WWW sites, e.g.,
11011 .q https://www.OpenSSL.org/ .
11012 .sh 3 "Certificates for STARTTLS"
11013 .pp
11014 When acting as a server,
11015 .i sendmail
11016 requires X.509 certificates to support STARTTLS:
11017 one as certificate for the server (ServerCertFile and corresponding
11018 private ServerKeyFile)
11019 at least one root CA (CACertFile),
11020 i.e., a certificate that is used to sign other certificates,
11021 and a path to a directory which contains (zero or more) other CAs (CACertPath).
11022 The file specified via
11023 CACertFile
11024 can contain several certificates of CAs.
11025 The DNs of these certificates are sent
11026 to the client during the TLS handshake (as part of the
11027 CertificateRequest) as the list of acceptable CAs.
11028 However, do not list too many root CAs in that file, otherwise
11029 the TLS handshake may fail; e.g.,
11030 .(b
11031 error:14094417:SSL routines:SSL3_READ_BYTES:
11032 sslv3 alert illegal parameter:s3_pkt.c:964:SSL alert number 47
11033 .)b
11034 You should probably put only the CA cert into that file
11035 that signed your own cert(s), or at least only those you trust.
11036 The CACertPath directory must contain the hashes of each CA certificate
11037 as filenames (or as links to them).
11038 Symbolic links can be generated with the following
11039 two (Bourne) shell commands:
11040 .(b
11041 C=FileName_of_CA_Certificate
11042 ln -s $C `openssl x509 -noout -hash < $C`.0
11043 .)b
11044 A better way to do this is to use the
11045 .b c_rehash
11046 command that is part of the OpenSSL distribution
11047 because it handles subject hash collisions
11048 by incrementing the number in the suffix of the filename of the symbolic link,
11049 e.g.,
11050 .b \&.0
11051 to
11052 .b \&.1 ,
11053 and so on.
11054 An X.509 certificate is also required for authentication in client mode
11055 (ClientCertFile and corresponding private ClientKeyFile), however,
11056 .i sendmail
11057 will always use STARTTLS when offered by a server.
11058 The client and server certificates can be identical.
11059 Certificates can be obtained from a certificate authority
11060 or created with the help of OpenSSL.
11061 The required format for certificates and private keys is PEM.
11062 To allow for automatic startup of sendmail, private keys
11063 (ServerKeyFile, ClientKeyFile)
11064 must be stored unencrypted.
11065 The keys are only protected by the permissions of the file system.
11066 Never make a private key available to a third party.
11067 .pp
11068 The options
11069 .i ClientCertFile ,
11070 .i ClientKeyFile ,
11071 .i ServerCertFile ,
11072 and
11073 .i ServerKeyFile
11074 can take a second file name,
11075 which must be separated from the first with a comma
11076 (note: do not use any spaces)
11077 to set up a second cert/key pair.
11078 This can be used to have certs of different types,
11079 e.g., RSA and DSA.
11080 .sh 3 "PRNG for STARTTLS"
11081 .pp
11082 STARTTLS requires a strong pseudo random number generator (PRNG)
11083 to operate properly.
11084 Depending on the TLS library you use, it may be required to explicitly
11085 initialize the PRNG with random data.
11086 OpenSSL makes use of
11087 .b /dev/urandom(4)
11088 if available (this corresponds to the compile flag HASURANDOMDEV).
11089 On systems which lack this support, a random file must be specified in the
11090 .i sendmail.cf
11091 file using the option RandFile.
11092 It is
11093 .b strongly
11094 advised to use the "Entropy Gathering Daemon" EGD
11095 from Brian Warner on those systems to provide useful random data.
11096 In this case,
11097 .i sendmail
11098 must be compiled with the flag EGD, and the
11099 RandFile option must point to the EGD socket.
11100 If neither
11101 .b /dev/urandom(4)
11102 nor EGD are available, you have to make sure
11103 that useful random data is available all the time in RandFile.
11104 If the file hasn't been modified in the last 10 minutes before
11105 it is supposed to be used by
11106 .i sendmail
11107 the content is considered obsolete.
11108 One method for generating this file is:
11109 .(b
11110 openssl rand -out /etc/mail/randfile -rand \c
11111 .i /path/to/file:... \c
11112 256
11113 .)b
11114 See the OpenSSL documentation for more information.
11115 In this case, the PRNG for TLS is only
11116 seeded with other random data if the
11117 .b DontBlameSendmail
11118 option
11119 .b InsufficientEntropy
11120 is set.
11121 This is most likely not sufficient for certain actions, e.g.,
11122 generation of (temporary) keys.
11123 .pp
11124 Please see the OpenSSL documentation or other sources
11125 for further information about certificates, their creation and their usage,
11126 the importance of a good PRNG, and other aspects of TLS.
11127 .sh 2 "Encoding of STARTTLS and AUTH related Macros"
11128 .pp
11129 Macros that contain STARTTLS and AUTH related data which comes from outside
11130 sources, e.g., all macros containing information from certificates,
11131 are encoded to avoid problems with non-printable or special characters.
11132 The latter are '\\', '<', '>', '(', ')', '"', '+', and ' '.
11133 All of these characters are replaced by their value in hexadecimal
11134 with a leading '+'.
11135 For example:
11136 .(b
11137 /C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/
11138 Email=darth+cert@endmail.org
11139 .)b
11140 is encoded as:
11141 .(b
11142 /C=US/ST=California/O=endmail.org/OU=private/
11143 CN=Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
11144 .)b
11145 (line breaks have been inserted for readability).
11146 The macros which are subject to this encoding are
11147 {cert_subject}, {cert_issuer}, {cn_subject}, {cn_issuer},
11148 as well as
11149 {auth_authen} and {auth_author}.
11150 .sh 2 "DANE"
11151 .pp
11152 Initial support for DANE (see RFC 7672 et.al.)
11153 is available if
11154 .i sendmail
11155 is compiled with the option
11156 .b DANE .
11157 Only TLSA RR 3-1-x (DANE-EE) is currently implemented.
11158 The option
11159 .(b
11160 O DANE=true
11161 .)b
11162 enables this feature at run time
11163 and it automatically adds
11164 .b use_dnssec
11165 and
11166 .b use_edns0
11167 to
11168 .(b
11169 O ResolverOptions
11170 .)b
11171 This requires a (preferrably local)
11172 validating DNS resolver which supports those options.
11173
11174 If the client finds a usable TLSA RR and the check
11175 succeeds the macro
11176 .b ${verify}
11177 is set to
11178 .b TRUSTED .
11179 All non-DNS maps are considered
11180 .i secure
11181 just like DNS lookups with DNSSEC.
11182 Be aware that the implementation might not handle all
11183 error conditions as required by the RFCs.
11184 Moreover, TLSA RRs are not looked up for some features,
11185 e.g.,
11186 .i FallBackSmartHost .
11187 .sh 1 "ACKNOWLEDGEMENTS"
11188 .pp
11189 I've worked on
11190 .i sendmail
11191 for many years,
11192 and many employers have been remarkably patient
11193 about letting me work on a large project
11194 that was not part of my official job.
11195 This includes time on the INGRES Project at
11196 the University of California at Berkeley,
11197 at Britton Lee,
11198 and again on the Mammoth and Titan Projects at Berkeley.
11199 .pp
11200 Much of the second wave of improvements
11201 resulting in version 8.1
11202 should be credited to Bryan Costales of the
11203 International Computer Science Institute.
11204 As he passed me drafts of his book on
11205 .i sendmail
11206 I was inspired to start working on things again.
11207 Bryan was also available to bounce ideas off of.
11208 .pp
11209 Gregory Neil Shapiro
11210 of Worcester Polytechnic Institute
11211 has become instrumental in all phases of
11212 .i sendmail
11213 support and development,
11214 and was largely responsible for getting versions 8.8 and 8.9
11215 out the door.
11216 .pp
11217 Many, many people contributed chunks of code and ideas to
11218 .i sendmail .
11219 It has proven to be a group network effort.
11220 Version 8 in particular was a group project.
11221 The following people and organizations made notable contributions:
11222 .(l
11223 Claus Assmann
11224 John Beck, Hewlett-Packard & Sun Microsystems
11225 Keith Bostic, CSRG, University of California, Berkeley
11226 Andrew Cheng, Sun Microsystems
11227 Michael J. Corrigan, University of California, San Diego
11228 Bryan Costales, International Computer Science Institute & InfoBeat
11229 Pa\*:r (Pell) Emanuelsson
11230 Craig Everhart, Transarc Corporation
11231 Per Hedeland, Ericsson
11232 Tom Ivar Helbekkmo, Norwegian School of Economics
11233 Kari Hurtta, Finnish Meteorological Institute
11234 Allan E. Johannesen, WPI
11235 Jonathan Kamens, OpenVision Technologies, Inc.
11236 Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
11237 Brian Kantor, University of California, San Diego
11238 John Kennedy, Cal State University, Chico
11239 Murray S. Kucherawy, HookUp Communication Corp.
11240 Bruce Lilly, Sony U.S.
11241 Karl London
11242 Motonori Nakamura, Ritsumeikan University & Kyoto University
11243 John Gardiner Myers, Carnegie Mellon University
11244 Neil Rickert, Northern Illinois University
11245 Gregory Neil Shapiro, WPI
11246 Eric Schnoebelen, Convex Computer Corp.
11247 Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
11248 Randall Winchester, University of Maryland
11249 Christophe Wolfhugel, Pasteur Institute & Herve Schauer Consultants (Paris)
11250 Exactis.com, Inc.
11251 .)l
11252 I apologize for anyone I have omitted, misspelled, misattributed, or
11253 otherwise missed.
11254 At this point, I suspect that at least a hundred people
11255 have contributed code,
11256 and many more have contributed ideas, comments, and encouragement.
11257 I've tried to list them in the RELEASE_NOTES in the distribution directory.
11258 I appreciate their contribution as well.
11259 .pp
11260 Special thanks are reserved for Michael Corrigan and Christophe Wolfhugel,
11261 who besides being wonderful guinea pigs and contributors
11262 have also consented to be added to the ``sendmail@Sendmail.ORG'' list
11263 and, by answering the bulk of the questions sent to that list,
11264 have freed me up to do other work.
11265 .++ A
11266 .+c "COMMAND LINE FLAGS"
11267 .ba 0
11268 .nr ii 1i
11269 .pp
11270 Arguments must be presented with flags before addresses.
11271 The flags are:
11272 .ip \-A\fIx\fP
11273 Select an alternative .cf file which is either
11274 .i sendmail.cf
11275 for
11276 .b \-Am
11277 or
11278 .i submit.cf
11279 for
11280 .b \-Ac .
11281 By default the .cf file is chosen based on the operation mode.
11282 For
11283 .b -bm
11284 (default),
11285 .b -bs ,
11286 and
11287 .b -t
11288 it is
11289 .i submit.cf
11290 if it exists, for all others it is
11291 .i sendmail.cf .
11292 .ip \-b\fIx\fP
11293 Set operation mode to
11294 .i x .
11295 Operation modes are:
11296 .(b
11297 .ta 4n
11298 m       Deliver mail (default)
11299 s       Speak SMTP on input side
11300 a\(dg   ``Arpanet'' mode (get envelope sender information from header)
11301 C       Check the configuration file
11302 d       Run as a daemon in background
11303 D       Run as a daemon in foreground
11304 t       Run in test mode
11305 v       Just verify addresses, don't collect or deliver
11306 i       Initialize the alias database
11307 p       Print the mail queue
11308 P       Print overview over the mail queue (requires shared memory)
11309 h       Print the persistent host status database
11310 H       Purge expired entries from the persistent host status database
11311 .)b
11312 .(f
11313 \(dgDeprecated.
11314 .)f
11315 .ip \-B\fItype\fP
11316 Indicate body type.
11317 .ip \-C\fIfile\fP
11318 Use a different configuration file.
11319 .i Sendmail
11320 runs as the invoking user (rather than root)
11321 when this flag is specified.
11322 .ip "\-D \fIlogfile\fP"
11323 Send debugging output to the indicated
11324 .i logfile
11325 instead of stdout.
11326 .ip \-d\fIlevel\fP
11327 Set debugging level.
11328 .ip "\-f\ \fIaddr\fP"
11329 The envelope sender address is set to
11330 .i addr .
11331 This address may also be used in the From: header
11332 if that header is missing during initial submission.
11333 The envelope sender address is used as the recipient
11334 for delivery status notifications
11335 and may also appear in a Return-Path: header.
11336 .ip \-F\ \fIname\fP
11337 Sets the full name of this user to
11338 .i name .
11339 .ip \-G
11340 When accepting messages via the command line,
11341 indicate that they are for relay (gateway) submission.
11342 sendmail may complain about syntactically invalid messages,
11343 e.g., unqualified host names,
11344 rather than fixing them when this flag is set.
11345 sendmail will not do any canonicalization in this mode.
11346 .ip "\-h\ \fIcnt\fP"
11347 Sets the
11348 .q "hop count"
11349 to
11350 .i cnt .
11351 This represents the number of times this message has been processed
11352 by
11353 .i sendmail
11354 (to the extent that it is supported by the underlying networks).
11355 .i Cnt
11356 is incremented during processing,
11357 and if it reaches
11358 MAXHOP
11359 (currently 25)
11360 .i sendmail
11361 throws away the message with an error.
11362 .ip "\-L \fItag\fP"
11363 Sets the identifier used for syslog.
11364 Note that this identifier is set
11365 as early as possible.
11366 However,
11367 .i sendmail
11368 may be used
11369 if problems arise
11370 before the command line arguments
11371 are processed.
11372 .ip \-n
11373 Don't do aliasing or forwarding.
11374 .ip "\-N \fInotifications\fP"
11375 Tag all addresses being sent as wanting the indicated
11376 .i notifications ,
11377 which consists of the word
11378 .q NEVER
11379 or a comma-separated list of
11380 .q SUCCESS ,
11381 .q FAILURE ,
11382 and
11383 .q DELAY
11384 for successful delivery,
11385 failure,
11386 and a message that is stuck in a queue somewhere.
11387 The default is
11388 .q FAILURE,DELAY .
11389 .ip "\-r\ \fIaddr\fP"
11390 An obsolete form of
11391 .b \-f .
11392 .ip \-o\fIx\|value\fP
11393 Set option
11394 .i x
11395 to the specified
11396 .i value .
11397 These options are described in Section 5.6.
11398 .ip \-O\fIoption\fP\fB=\fP\fIvalue\fP
11399 Set
11400 .i option
11401 to the specified
11402 .i value
11403 (for long form option names).
11404 These options are described in Section 5.6.
11405 .ip \-M\fIx\|value\fP
11406 Set macro
11407 .i x
11408 to the specified
11409 .i value .
11410 .ip \-p\fIprotocol\fP
11411 Set the sending protocol.
11412 Programs are encouraged to set this.
11413 The protocol field can be in the form
11414 .i protocol \c
11415 .b : \c
11416 .i host
11417 to set both the sending protocol and sending host.
11418 For example,
11419 .q \-pUUCP:uunet
11420 sets the sending protocol to UUCP
11421 and the sending host to uunet.
11422 (Some existing programs use \-oM to set the r and s macros;
11423 this is equivalent to using \-p.)
11424 .ip \-q\fItime\fP
11425 Try to process the queued up mail.
11426 If the time is given,
11427 .i sendmail
11428 will start one or more processes to run through the queue(s) at the specified
11429 time interval to deliver queued mail; otherwise, it only runs once.
11430 Each of these processes acts on a workgroup.
11431 These processes are also known as workgroup processes or WGP's for short.
11432 Each workgroup is responsible for controlling the processing of one or
11433 more queues; workgroups help manage the use of system resources by sendmail.
11434 Each workgroup may have one or more children concurrently processing
11435 queues depending on the setting of \fIMaxQueueChildren\fP.
11436 .ip \-qp\fItime\fP
11437 Similar to \-q with a time argument,
11438 except that instead of periodically starting WGP's
11439 sendmail starts persistent WGP's
11440 that alternate between processing queues and sleeping.
11441 The sleep time is specified by the time argument; it defaults to 1 second,
11442 except that a WGP always sleeps at least 5 seconds if their queues were
11443 empty in the previous run.
11444 Persistent processes are managed by a queue control process (QCP).
11445 The QCP is the parent process of the WGP's.
11446 Typically the QCP will be the sendmail daemon (when started with \-bd or \-bD)
11447 or a special process (named Queue control) (when started without \-bd or \-bD).
11448 If a persistent WGP ceases to be active for some reason
11449 another WGP will be started by the QCP for the same workgroup
11450 in most cases. When a persistent WGP has core dumped, the debug flag
11451 \fIno_persistent_restart\fP is set or the specific persistent WGP has been
11452 restarted too many times already then the WGP will not be started again
11453 and a message will be logged to this effect.
11454 To stop (SIGTERM) or restart (SIGHUP) persistent WGP's the appropriate
11455 signal should be sent to the QCP. The QCP will propagate the signal to all of
11456 the WGP's and if appropriate restart the persistent WGP's.
11457 .ip \-q\fIGname\fP
11458 Run the jobs in the queue group
11459 .i name
11460 once.
11461 .ip \-q[!]\fIXstring\fP
11462 Run the queue once,
11463 limiting the jobs to those matching
11464 .i Xstring .
11465 The key letter
11466 .i X
11467 can be
11468 .b I
11469 to limit based on queue identifier,
11470 .b R
11471 to limit based on recipient,
11472 .b S
11473 to limit based on sender,
11474 or
11475 .b Q
11476 to limit based on quarantine reason for quarantined jobs.
11477 A particular queued job is accepted if one of the corresponding attributes
11478 contains the indicated
11479 .i string .
11480 The optional ! character negates the condition tested.
11481 Multiple
11482 .i \-q\fIX\fP
11483 flags are permitted,
11484 with items with the same key letter
11485 .q or'ed
11486 together, and items with different key letters
11487 .q and'ed
11488 together.
11489 .ip "\-Q[reason]"
11490 Quarantine normal queue items with the given reason or
11491 unquarantine quarantined queue items if no reason is given.
11492 This should only be used with some sort of item matching using
11493 .b \-q[!]\fIXstring\fP
11494 as described above.
11495 .ip "\-R ret"
11496 What information you want returned if the message bounces;
11497 .i ret
11498 can be
11499 .q HDRS
11500 for headers only or
11501 .q FULL
11502 for headers plus body.
11503 This is a request only;
11504 the other end is not required to honor the parameter.
11505 If
11506 .q HDRS
11507 is specified local bounces also return only the headers.
11508 .ip \-t
11509 Read the header for
11510 .q To: ,
11511 .q Cc: ,
11512 and
11513 .q Bcc:
11514 lines, and send to everyone listed in those lists.
11515 The
11516 .q Bcc:
11517 line will be deleted before sending.
11518 Any addresses in the argument vector will be deleted
11519 from the send list.
11520 .ip "\-V envid"
11521 The indicated
11522 .i envid
11523 is passed with the envelope of the message
11524 and returned if the message bounces.
11525 .ip "\-X \fIlogfile\fP"
11526 Log all traffic in and out of
11527 .i sendmail
11528 in the indicated
11529 .i logfile
11530 for debugging mailer problems.
11531 This produces a lot of data very quickly and should be used sparingly.
11532 .pp
11533 There are a number of options that may be specified as
11534 primitive flags.
11535 These are the e, i, m, and v options.
11536 Also,
11537 the f option
11538 may be specified as the
11539 .b \-s
11540 flag.
11541 The DSN related options
11542 .q "\-N" ,
11543 .q "\-R" ,
11544 and
11545 .q "\-V"
11546 have no effects on
11547 .i sendmail
11548 running as daemon.
11549 .+c "QUEUE FILE FORMATS"
11550 .pp
11551 This appendix describes the format of the queue files.
11552 These files live in a queue directory.
11553 The individual qf, hf, Qf, df, and xf files
11554 may be stored in separate
11555 .i qf/ ,
11556 .i df/ ,
11557 and
11558 .i xf/
11559 subdirectories
11560 if they are present in the queue directory.
11561 .pp
11562 All queue files have the name
11563 .i ttYMDhmsNNppppp
11564 where
11565 .i YMDhmsNNppppp
11566 is the
11567 .i id
11568 for this message
11569 and the
11570 .i tt
11571 is a type.
11572 The individual letters in the
11573 .i id
11574 are:
11575 .nr ii 0.5i
11576 .ip Y
11577 Encoded year
11578 .ip M
11579 Encoded month
11580 .ip D
11581 Encoded day
11582 .ip h
11583 Encoded hour
11584 .ip m
11585 Encoded minute
11586 .ip s
11587 Encoded second
11588 .ip NN
11589 Encoded envelope number
11590 .ip ppppp
11591 At least five decimal digits of the process ID
11592 .pp
11593 All files with the same id collectively define one message.
11594 Due to the use of memory-buffered files,
11595 some of these files may never appear on disk.
11596 .pp
11597 The types are:
11598 .nr ii 0.5i
11599 .ip qf
11600 The queue control file.
11601 This file contains the information necessary to process the job.
11602 .ip hf
11603 The same as a queue control file, but for a quarantined queue job.
11604 .ip df
11605 The data file.
11606 The message body (excluding the header) is kept in this file.
11607 Sometimes the df file is not stored in the same directory as the qf file;
11608 in this case,
11609 the qf file contains a `d' record which names the queue directory
11610 that contains the df file.
11611 .ip tf
11612 A temporary file.
11613 This is an image of the
11614 .b qf
11615 file when it is being rebuilt.
11616 It should be renamed to a
11617 .b qf
11618 file very quickly.
11619 .ip xf
11620 A transcript file,
11621 existing during the life of a session
11622 showing everything that happens
11623 during that session.
11624 Sometimes the xf file must be generated before a queue group has been selected;
11625 in this case,
11626 the xf file will be stored in a directory of the default queue group.
11627 .ip Qf
11628 A ``lost'' queue control file.
11629 .i sendmail
11630 renames a
11631 .b qf
11632 file to
11633 .b Qf
11634 if there is a severe (configuration) problem that cannot be solved without
11635 human intervention.
11636 Search the logfile for the queue file id to figure out what happened.
11637 After you resolved the problem, you can rename the
11638 .b Qf
11639 file to
11640 .b qf
11641 and send it again.
11642 .pp
11643 The queue control file is structured as a series of lines
11644 each beginning with a code letter.
11645 The lines are as follows:
11646 .ip V
11647 The version number of the queue file format,
11648 used to allow new
11649 .i sendmail
11650 binaries to read queue files created by older versions.
11651 Defaults to version zero.
11652 Must be the first line of the file if present.
11653 For 8.12 the version number is 6.
11654 .ip A
11655 The information given by the AUTH= parameter of the
11656 .q "MAIL FROM:"
11657 command or $f@$j
11658 if sendmail has been called directly.
11659 .ip H
11660 A header definition.
11661 There may be any number of these lines.
11662 The order is important:
11663 they represent the order in the final message.
11664 These use the same syntax
11665 as header definitions in the configuration file.
11666 .ip C
11667 The controlling address.
11668 The syntax is
11669 .q localuser:aliasname .
11670 Recipient addresses following this line
11671 will be flagged so that deliveries will be run as the
11672 .i localuser
11673 (a user name from the /etc/passwd file);
11674 .i aliasname
11675 is the name of the alias that expanded to this address
11676 (used for printing messages).
11677 .ip q
11678 The quarantine reason for quarantined queue items.
11679 .ip Q
11680 The ``original recipient'',
11681 specified by the ORCPT= field in an ESMTP transaction.
11682 Used exclusively for Delivery Status Notifications.
11683 It applies only to the following `R' line.
11684 .ip r
11685 The ``final recipient''
11686 used for Delivery Status Notifications.
11687 It applies only to the following `R' line.
11688 .ip R
11689 A recipient address.
11690 This will normally be completely aliased,
11691 but is actually realiased when the job is processed.
11692 There will be one line for each recipient.
11693 Version 1 qf files
11694 also include a leading colon-terminated list of flags,
11695 some of which are
11696 `S' to return a message on successful final delivery,
11697 `F' to return a message on failure,
11698 `D' to return a message if the message is delayed,
11699 `N' to suppress returning the body,
11700 and
11701 `P' to declare this as a ``primary'' (command line or SMTP-session) address.
11702 .ip S
11703 The sender address.
11704 There may only be one of these lines.
11705 .ip T
11706 The job creation time.
11707 This is used to compute when to time out the job.
11708 .ip P
11709 The current message priority.
11710 This is used to order the queue.
11711 Higher numbers mean lower priorities.
11712 The priority changes
11713 as the message sits in the queue.
11714 The initial priority depends on the message class
11715 and the size of the message.
11716 .ip M
11717 A message.
11718 This line is printed by the
11719 .i mailq
11720 command,
11721 and is generally used to store status information.
11722 It can contain any text.
11723 .ip F
11724 Flag bits, represented as one letter per flag.
11725 Defined flag bits are
11726 .b r
11727 indicating that this is a response message
11728 and
11729 .b w
11730 indicating that a warning message has been sent
11731 announcing that the mail has been delayed.
11732 Other flag bits are:
11733 .b 8 :
11734 the body contains 8bit data,
11735 .b b :
11736 a Bcc: header should be removed,
11737 .b d :
11738 the mail has RET parameters (see RFC 1894),
11739 .b n :
11740 the body of the message should not be returned
11741 in case of an error,
11742 .b s :
11743 the envelope has been split.
11744 .ip N
11745 The total number of delivery attempts.
11746 .ip K
11747 The time (as seconds since January 1, 1970)
11748 of the last delivery attempt.
11749 .ip d
11750 If the df file is in a different directory than the qf file,
11751 then a `d' record is present,
11752 specifying the directory in which the df file resides.
11753 .ip I
11754 The i-number of the data file;
11755 this can be used to recover your mail queue
11756 after a disastrous disk crash.
11757 .ip $
11758 A macro definition.
11759 The values of certain macros
11760 are passed through to the queue run phase.
11761 .ip B
11762 The body type.
11763 The remainder of the line is a text string defining the body type.
11764 If this field is missing,
11765 the body type is assumed to be
11766 .q "undefined"
11767 and no special processing is attempted.
11768 Legal values are
11769 .q 7BIT
11770 and
11771 .q 8BITMIME .
11772 .ip Z
11773 The original envelope id (from the ESMTP transaction).
11774 For Deliver Status Notifications only.
11775 .pp
11776 As an example,
11777 the following is a queue file sent to
11778 .q eric@mammoth.Berkeley.EDU
11779 and
11780 .q bostic@okeeffe.CS.Berkeley.EDU \**:
11781 .(f
11782 \**This example is contrived and probably inaccurate for your environment.
11783 Glance over it to get an idea;
11784 nothing can replace looking at what your own system generates.
11785 .)f
11786 .(b
11787 V4
11788 T711358135
11789 K904446490
11790 N0
11791 P2100941
11792 $_eric@localhost
11793 ${daemon_flags}
11794 Seric
11795 Ceric:100:1000:sendmail@vangogh.CS.Berkeley.EDU
11796 RPFD:eric@mammoth.Berkeley.EDU
11797 RPFD:bostic@okeeffe.CS.Berkeley.EDU
11798 H?P?Return-path: <^g>
11799 H??Received: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
11800         Fri, 17 Jul 1992 00:28:55 -0700
11801 H??Received: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
11802         id AAA06698; Fri, 17 Jul 1992 00:28:54 -0700
11803 H??Received: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
11804         id AA22777; Fri, 17 Jul 1992 03:29:14 -0400
11805 H??Received: by foo.bar.baz.de (5.57/Ultrix3.0-C)
11806         id AA22757; Fri, 17 Jul 1992 09:31:25 GMT
11807 H?F?From: eric@foo.bar.baz.de (Eric Allman)
11808 H?x?Full-name: Eric Allman
11809 H??Message-id: <9207170931.AA22757@foo.bar.baz.de>
11810 H??To: sendmail@vangogh.CS.Berkeley.EDU
11811 H??Subject: this is an example message
11812 .)b
11813 This shows
11814 the person who sent the message,
11815 the submission time
11816 (in seconds since January 1, 1970),
11817 the message priority,
11818 the message class,
11819 the recipients,
11820 and the headers for the message.
11821 .+c "SUMMARY OF SUPPORT FILES"
11822 .pp
11823 This is a summary of the support files
11824 that
11825 .i sendmail
11826 creates or generates.
11827 Many of these can be changed by editing the sendmail.cf file;
11828 check there to find the actual pathnames.
11829 .nr ii 1i
11830 .ip "/usr/\*(SD/sendmail"
11831 The binary of
11832 .i sendmail .
11833 .ip /usr/\*(SB/newaliases
11834 A link to /usr/\*(SD/sendmail;
11835 causes the alias database to be rebuilt.
11836 Running this program is completely equivalent to giving
11837 .i sendmail
11838 the
11839 .b \-bi
11840 flag.
11841 .ip /usr/\*(SB/mailq
11842 Prints a listing of the mail queue.
11843 This program is equivalent to using the
11844 .b \-bp
11845 flag to
11846 .i sendmail .
11847 .ip /etc/mail/sendmail.cf
11848 The configuration file,
11849 in textual form.
11850 .ip /etc/mail/helpfile
11851 The SMTP help file.
11852 .ip /etc/mail/statistics
11853 A statistics file; need not be present.
11854 .ip /etc/mail/sendmail.pid
11855 Created in daemon mode;
11856 it contains the process id of the current SMTP daemon.
11857 If you use this in scripts;
11858 use ``head \-1'' to get just the first line;
11859 the second line contains the command line used to invoke the daemon,
11860 and later versions of
11861 .i sendmail
11862 may add more information to subsequent lines.
11863 .ip /etc/mail/aliases
11864 The textual version of the alias file.
11865 .ip /etc/mail/aliases.db
11866 The alias file in
11867 .i hash \|(3)
11868 format.
11869 .ip /etc/mail/aliases.{pag,dir}
11870 The alias file in
11871 .i ndbm \|(3)
11872 format.
11873 .ip /var/spool/mqueue
11874 The directory in which the mail queue(s)
11875 and temporary files reside.
11876 .ip /var/spool/mqueue/qf*
11877 Control (queue) files for messages.
11878 .ip /var/spool/mqueue/df*
11879 Data files.
11880 .ip /var/spool/mqueue/tf*
11881 Temporary versions of the qf files,
11882 used during queue file rebuild.
11883 .ip /var/spool/mqueue/xf*
11884 A transcript of the current session.
11885 .if o \
11886 \{\
11887 .       bp
11888 .       rs
11889 .       sp |4i
11890 .       ce 2
11891 This page intentionally left blank;
11892 replace it with a blank sheet for double-sided output.
11893 .\}
11894 .\".ro
11895 .\".ls 1
11896 .\".tp
11897 .\".sp 2i
11898 .\".in 0
11899 .\".ce 100
11900 .\".sz 24
11901 .\".b SENDMAIL
11902 .\".sz 14
11903 .\".sp
11904 .\"INSTALLATION AND OPERATION GUIDE
11905 .\".sp
11906 .\".sz 10
11907 .\"Eric Allman
11908 .\".sp
11909 .\".ce 0
11910 .bp 3
11911 .ce
11912 .sz 12
11913 TABLE OF CONTENTS
11914 .sz 10
11915 .sp
11916 .\" remove some things to avoid "out of temp file space" problem
11917 .rm sh
11918 .rm (x
11919 .rm )x
11920 .rm ip
11921 .rm pp
11922 .rm lp
11923 .rm he
11924 .rm fo
11925 .rm eh
11926 .rm oh
11927 .rm ef
11928 .rm of
11929 .xp
11930 .if o \
11931 \{\
11932 .       bp
11933 .       rs
11934 .       sp |4i
11935 .       ce 2
11936 This page intentionally left blank;
11937 replace it with a blank sheet for double-sided output.
11938 .\}