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