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