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