|
|
1.1 root 1: .\"
2: .\" Copyright (c) 1983 Eric P. Allman
3: .\" Copyright (c) 1988 The Regents of the University of California.
4: .\" All rights reserved.
5: .\"
6: .\" Redistribution and use in source and binary forms are permitted
7: .\" provided that the above copyright notice and this paragraph are
8: .\" duplicated in all such forms and that any documentation,
9: .\" advertising materials, and other materials related to such
10: .\" distribution and use acknowledge that the software was developed
11: .\" by the University of California, Berkeley. The name of the
12: .\" University may not be used to endorse or promote products derived
13: .\" from this software without specific prior written permission.
14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: .\"
18: .\" @(#)op.me 5.12 (Berkeley) 4/23/90
19: .\"
20: .\" eqn % | troff -me
21: .\"if n .ls 2
22: .\".he 'Sendmail Installation and Operation Guide''%'
23: .\".fo 'Version 5.12''Last Mod 4/23/90'
24: .eh 'SMM:07-%''Sendmail Installation and Operation Guide'
25: .oh 'Sendmail Installation and Operation Guide''SMM:07-%'
26: .nr si 3n
27: .de $0
28: .(x
29: .in \\$3u*3n
30: .ti -3n
31: \\$2. \\$1
32: .)x
33: ..
34: .de $C
35: .(x
36: .in 0
37: \\$1 \\$2. \\$3
38: .)x
39: ..
40: .+c
41: .(l C
42: .sz 16
43: .b SENDMAIL
44: .sz 12
45: .sp
46: .b "INSTALLATION AND OPERATION GUIDE"
47: .sz 10
48: .sp
49: .r
50: Eric Allman
51: University of California, Berkeley
52: Mammoth Project
53: .sp
54: Version 5.12
55: .sp
56: For Sendmail Version 5.61
57: .)l
58: .sp 2
59: .pp
60: .i Sendmail
61: implements a general purpose internetwork mail routing facility
62: under the UNIX*
63: .(f
64: *UNIX is a trademark of Bell Laboratories.
65: .)f
66: operating system.
67: It is not tied to any one transport protocol \*-
68: its function may be likened to a crossbar switch,
69: relaying messages from one domain into another.
70: In the process,
71: it can do a limited amount of message header editing
72: to put the message into a format that is appropriate
73: for the receiving domain.
74: All of this is done under the control of a configuration file.
75: .pp
76: Due to the requirements of flexibility
77: for
78: .i sendmail ,
79: the configuration file can seem somewhat unapproachable.
80: However, there are only a few basic configurations
81: for most sites,
82: for which standard configuration files have been supplied.
83: Most other configurations
84: can be built by adjusting an existing configuration files
85: incrementally.
86: .pp
87: Although
88: .i sendmail
89: is intended to run
90: without the need for monitoring,
91: it has a number of features
92: that may be used to monitor or adjust the operation
93: under unusual circumstances.
94: These features are described.
95: .pp
96: Section one describes how to do a basic
97: .i sendmail
98: installation.
99: Section two
100: explains the day-to-day information you should know
101: to maintain your mail system.
102: If you have a relatively normal site,
103: these two sections should contain sufficient information
104: for you to install
105: .i sendmail
106: and keep it happy.
107: Section three
108: describes some parameters that may be safely tweaked.
109: Section four
110: has information regarding the command line arguments.
111: Section five
112: contains the nitty-gritty information about the configuration
113: file.
114: This section is for masochists
115: and people who must write their own configuration file.
116: The appendixes give a brief
117: but detailed explanation of a number of features
118: not described in the rest of the paper.
119: .pp
120: The references in this paper are actually found
121: in the companion paper
122: .ul
123: Sendmail \- An Internetwork Mail Router.
124: This other paper should be read before this manual
125: to gain a basic understanding
126: of how the pieces fit together.
127: .pn 4
128: .bp
129: .sh 1 "BASIC INSTALLATION"
130: .pp
131: There are two basic steps to installing sendmail.
132: The hard part is to build the configuration table.
133: This is a file that sendmail reads when it starts up
134: that describes the mailers it knows about,
135: how to parse addresses,
136: how to rewrite the message header,
137: and the settings of various options.
138: Although the configuration table is quite complex,
139: a configuration can usually be built
140: by adjusting an existing off-the-shelf configuration.
141: The second part is actually doing the installation,
142: i.e., creating the necessary files, etc.
143: .pp
144: The remainder of this section will describe the installation of sendmail
145: assuming you can use one of the existing configurations
146: and that the standard installation parameters are acceptable.
147: All pathnames and examples
148: are given from the root of the
149: .i sendmail
150: subtree,
151: normally
152: .i /usr/src/usr.lib/sendmail
153: on 4.3BSD.
154: .sh 2 "Off-The-Shelf Configurations"
155: .pp
156: Configuration files currently in use at Berkeley are in
157: the directory
158: .i cf
159: of the sendmail directory.
160: This directory contains three subdirectories:
161: .i cf ,
162: .i m4 ,
163: and
164: .i sitedep .
165: The directory
166: .i cf/m4
167: contains site-independent
168: .i m4 (1)
169: include files that have information common to all configuration files,
170: while
171: .i cf/sitedep
172: contains
173: .i m4 (1)
174: include files that have site-specific information in them.
175: These files are used by the master configuration (``.mc'')
176: in
177: .i cf/cf
178: and produce standard configuration files (with
179: .q .cf
180: suffix) when run through
181: .i m4 (1).
182: .pp
183: Three off the shelf configurations are supplied
184: to handle the basic cases:
185: .np
186: Internet sites running the nameserver
187: (or using host tables wherein the fully-qualfied domain
188: name of each host is listed first)
189: can use
190: .i cf/tcpproto.cf .
191: For simple sites,
192: you should be able to use this file without modification.
193: This file is not in
194: .i m4
195: format.
196: .np
197: UUCP only sites can use
198: .i cf/uucpproto.cf .
199: This file is not in
200: .i m4
201: format.
202: .np
203: A group of machines at a single site
204: connected by an ethernet (or other networking
205: that supports TCP/IP)
206: with (only) one host connected to the outside world
207: via UUCP
208: is represented by two configuration files:
209: .i cf/tcpuucpproto.cf
210: should be installed on the host with outside connections
211: and
212: .i cf/tcpproto.cf
213: should be installed on all other hosts.
214: .pp
215: Some configuration will be needed in each of the
216: above cases.
217: Just be sure to correctly fill in the
218: .q blanks
219: as shown in the instructions in the configuration file.
220: Then install the file as
221: .i /usr/lib/sendmail.cf .
222: .pp
223: If you are running a larger or more complex site, it
224: is to your advantage to read the
225: .q README
226: file in the
227: .i cf
228: subdirectory.
229: This file explains how to use
230: .i m4 (1)
231: to automatically create configuration files for
232: non-standard situations.
233: .sh 2 "Installation Using the Makefile"
234: .pp
235: A makefile exists in the root of the
236: .i sendmail
237: directory that will do all of these steps
238: for a 4.3BSD system.
239: It may have to be slightly tailored
240: for use on other systems.
241: .pp
242: Before using this makefile, you should create a symbolic link from
243: .i cf
244: to the directory containing your configuration files.
245: You should also have created your configuration file
246: and left it in the file
247: .q cf/\fIsystem\fP.cf
248: where
249: .i system
250: is the name of your system
251: (i.e., what is returned by
252: .i hostname \|(1)).
253: If you do not have
254: .i hostname
255: you can use the declaration
256: .q HOST=\fIsystem\fP
257: on the
258: .i make \|(1)
259: command line.
260: You should also examine the file
261: .i md/config.m4
262: and change the
263: .i m4
264: macros there to reflect any libraries and compilation flags
265: you may need.
266: .pp
267: The basic installation procedure is to type:
268: .(b
269: make
270: make install
271: make installcf
272: .)b
273: in the root directory of the
274: .i sendmail
275: distribution.
276: This will make all binaries
277: and install them in the standard places.
278: The second and third
279: .i make
280: commands must be executed as the superuser (root).
281: .sh 2 "Installation by Hand"
282: .pp
283: Along with building a configuration file,
284: you will have to install the
285: .i sendmail
286: startup into your UNIX system.
287: If you are doing this installation
288: in conjunction with a regular Berkeley UNIX install,
289: these steps will already be complete.
290: Many of these steps will have to be executed as the superuser (root).
291: .sh 3 "/usr/lib/sendmail"
292: .pp
293: The binary for sendmail is located in /usr/lib.
294: If it becomes necessary to recompile and reinstall the
295: entire system, the following sequence will do it:
296: .(b
297: cd src
298: make clean
299: make install
300: .)b
301: .sh 3 "/usr/lib/sendmail.cf"
302: .pp
303: The configuration file
304: that you created earlier
305: should be installed in /usr/lib/sendmail.cf:
306: .(b
307: cp cf/\fIsystem\fP.cf /usr/lib/sendmail.cf
308: .)b
309: .sh 3 "/usr/ucb/newaliases"
310: .pp
311: If you are running delivermail,
312: it is critical that the
313: .i newaliases
314: command be replaced.
315: This can just be a link to
316: .i sendmail :
317: .(b
318: rm \-f /usr/ucb/newaliases
319: ln /usr/lib/sendmail /usr/ucb/newaliases
320: .)b
321: .sh 3 "/usr/spool/mqueue"
322: .pp
323: The directory
324: .i /usr/spool/mqueue
325: should be created to hold the mail queue.
326: This directory should be mode 755
327: and owned by root.
328: .sh 3 "/usr/lib/aliases*"
329: .pp
330: The system aliases are held in three files.
331: The file
332: .q /usr/lib/aliases
333: is the master copy.
334: A sample is given in
335: .q lib/aliases
336: which includes some aliases which
337: .i must
338: be defined:
339: .(b
340: cp lib/aliases /usr/lib/aliases
341: .)b
342: You should extend this file with any aliases that are apropos to your system.
343: .pp
344: Normally
345: .i sendmail
346: looks at a version of these files maintained by the
347: .i dbm \|(3)
348: routines.
349: These are stored in
350: .q /usr/lib/aliases.dir
351: and
352: .q /usr/lib/aliases.pag.
353: These can initially be created as empty files,
354: but they will have to be initialized promptly.
355: These should be mode 644:
356: .(b
357: cp /dev/null /usr/lib/aliases.dir
358: cp /dev/null /usr/lib/aliases.pag
359: chmod 644 /usr/lib/aliases.*
360: newaliases
361: .)b
362: .sh 3 "/usr/lib/sendmail.fc"
363: .pp
364: If you intend to install the frozen version of the configuration file
365: (for quick startup)
366: you should create the file /usr/lib/sendmail.fc
367: and initialize it.
368: This step may be safely skipped.
369: .(b
370: cp /dev/null /usr/lib/sendmail.fc
371: /usr/lib/sendmail \-bz
372: .)b
373: .sh 3 "/etc/rc"
374: .pp
375: It will be necessary to start up the sendmail daemon when your system reboots.
376: This daemon performs two functions:
377: it listens on the SMTP socket for connections
378: (to receive mail from a remote system)
379: and it processes the queue periodically
380: to insure that mail gets delivered when hosts come up.
381: .pp
382: Add the following lines to
383: .q /etc/rc
384: (or
385: .q /etc/rc.local
386: as appropriate)
387: in the area where it is starting up the daemons:
388: .(b
389: if [ \-f /usr/lib/sendmail ]; then
390: (cd /usr/spool/mqueue; rm \-f [lnx]f*)
391: /usr/lib/sendmail \-bd \-q30m &
392: echo \-n ' sendmail' >/dev/console
393: fi
394: .)b
395: The
396: .q cd
397: and
398: .q rm
399: commands insure that all lock files have been removed;
400: extraneous lock files may be left around
401: if the system goes down in the middle of processing a message.
402: The line that actually invokes
403: .i sendmail
404: has two flags:
405: .q \-bd
406: causes it to listen on the SMTP port,
407: and
408: .q \-q30m
409: causes it to run the queue every half hour.
410: .pp
411: If you are not running a version of UNIX
412: that supports Berkeley TCP/IP,
413: do not include the
414: .b \-bd
415: flag.
416: .sh 3 "/usr/lib/sendmail.hf"
417: .pp
418: This is the help file used by the SMTP
419: .b HELP
420: command.
421: It should be copied from
422: .q lib/sendmail.hf :
423: .(b
424: cp lib/sendmail.hf /usr/lib
425: .)b
426: .sh 3 "/usr/lib/sendmail.st"
427: .pp
428: If you wish to collect statistics
429: about your mail traffic,
430: you should create the file
431: .q /usr/lib/sendmail.st :
432: .(b
433: cp /dev/null /usr/lib/sendmail.st
434: chmod 666 /usr/lib/sendmail.st
435: .)b
436: This file does not grow.
437: It is printed with the program
438: .q aux/mailstats.
439: .sh 3 "/usr/ucb/newaliases"
440: .pp
441: If
442: .i sendmail
443: is invoked as
444: .q newaliases,
445: it will simulate the
446: .b \-bi
447: flag
448: (i.e., will rebuild the alias database;
449: see below).
450: This should be a link to /usr/lib/sendmail.
451: .sh 3 "/usr/ucb/mailq"
452: .pp
453: If
454: .i sendmail
455: is invoked as
456: .q mailq,
457: it will simulate the
458: .b \-bp
459: flag
460: (i.e.,
461: .i sendmail
462: will print the contents of the mail queue;
463: see below).
464: This should be a link to /usr/lib/sendmail.
465: .sh 1 "NORMAL OPERATIONS"
466: .sh 2 "Quick Configuration Startup"
467: .pp
468: A fast version of the configuration file
469: may be set up by using the
470: .b \-bz
471: flag:
472: .(b
473: /usr/lib/sendmail \-bz
474: .)b
475: This creates the file
476: .i /usr/lib/sendmail.fc
477: (\c
478: .q "frozen configuration" ).
479: This file is an image of
480: .i sendmail 's
481: data space after reading in the configuration file.
482: If this file exists,
483: it is used instead of
484: .i /usr/lib/sendmail.cf
485: .i sendmail.fc
486: must be rebuilt manually every time
487: .i sendmail.cf
488: is changed.
489: .pp
490: The frozen configuration file will be ignored
491: if a
492: .b \-C
493: flag is specified
494: or if sendmail detects that it is out of date.
495: However, the heuristics are not strong
496: so this should not be trusted.
497: .sh 2 "The System Log"
498: .pp
499: The system log is supported by the
500: .i syslogd \|(8)
501: program.
502: .sh 3 "Format"
503: .pp
504: Each line in the system log
505: consists of a timestamp,
506: the name of the machine that generated it
507: (for logging from several machines
508: over the local area network),
509: the word
510: .q sendmail: ,
511: and a message.
512: .sh 3 "Levels"
513: .pp
514: If you have
515: .i syslogd \|(8)
516: or an equivalent installed,
517: you will be able to do logging.
518: There is a large amount of information that can be logged.
519: The log is arranged as a succession of levels.
520: At the lowest level
521: only extremely strange situations are logged.
522: At the highest level,
523: even the most mundane and uninteresting events
524: are recorded for posterity.
525: As a convention,
526: log levels under ten
527: are considered
528: .q useful;
529: log levels above ten
530: are usually for debugging purposes.
531: .pp
532: A complete description of the log levels
533: is given in section 4.6.
534: .sh 2 "The Mail Queue"
535: .pp
536: The mail queue should be processed transparently.
537: However, you may find that manual intervention is sometimes necessary.
538: For example,
539: if a major host is down for a period of time
540: the queue may become clogged.
541: Although sendmail ought to recover gracefully when the host comes up,
542: you may find performance unacceptably bad in the meantime.
543: .sh 3 "Printing the queue"
544: .pp
545: The contents of the queue can be printed
546: using the
547: .i mailq
548: command
549: (or by specifying the
550: .b \-bp
551: flag to sendmail):
552: .(b
553: mailq
554: .)b
555: This will produce a listing of the queue id's,
556: the size of the message,
557: the date the message entered the queue,
558: and the sender and recipients.
559: .sh 3 "Format of queue files"
560: .pp
561: All queue files have the form
562: \fIx\fP\|\fBf\fP\fIAA99999\fP
563: where
564: .i AA99999
565: is the
566: .i id
567: for this file
568: and the
569: .i x
570: is a type.
571: The types are:
572: .ip d
573: The data file.
574: The message body (excluding the header) is kept in this file.
575: .ip l
576: The lock file.
577: If this file exists,
578: the job is currently being processed,
579: and a queue run will not process the file.
580: For that reason,
581: an extraneous
582: .b lf
583: file can cause a job to apparently disappear
584: (it will not even time out!).
585: .ip n
586: This file is created when an id is being created.
587: It is a separate file to insure that no mail can ever be destroyed
588: due to a race condition.
589: It should exist for no more than a few milliseconds
590: at any given time.
591: .ip q
592: The queue control file.
593: This file contains the information necessary to process the job.
594: .ip t
595: A temporary file.
596: These are an image of the
597: .b qf
598: file when it is being rebuilt.
599: It should be renamed to a
600: .b qf
601: file very quickly.
602: .ip x
603: A transcript file,
604: existing during the life of a session
605: showing everything that happens
606: during that session.
607: .pp
608: The
609: .b qf
610: file is structured as a series of lines
611: each beginning with a code letter.
612: The lines are as follows:
613: .ip D
614: The name of the data file.
615: There may only be one of these lines.
616: .ip H
617: A header definition.
618: There may be any number of these lines.
619: The order is important:
620: they represent the order in the final message.
621: These use the same syntax
622: as header definitions in the configuration file.
623: .ip R
624: A recipient address.
625: This will normally be completely aliased,
626: but is actually realiased when the job is processed.
627: There will be one line
628: for each recipient.
629: .ip S
630: The sender address.
631: There may only be one of these lines.
632: .ip E
633: An error address.
634: If any such lines exist,
635: they represent the addresses that should receive error messages.
636: .ip T
637: The job creation time.
638: This is used to compute when to time out the job.
639: .ip P
640: The current message priority.
641: This is used to order the queue.
642: Higher numbers mean lower priorities.
643: The priority changes
644: as the message sits in the queue.
645: The initial priority depends on the message class
646: and the size of the message.
647: .ip M
648: A message.
649: This line is printed by the
650: .i mailq
651: command,
652: and is generally used to store status information.
653: It can contain any text.
654: .pp
655: As an example,
656: the following is a queue file sent to
657: .q mckusick@calder
658: and
659: .q wnj :
660: .(b
661: DdfA13557
662: Seric
663: T404261372
664: P132
665: Rmckusick@calder
666: Rwnj
667: H?D?date: 23-Oct-82 15:49:32-PDT (Sat)
668: H?F?from: eric (Eric Allman)
669: H?x?full-name: Eric Allman
670: Hsubject: this is an example message
671: Hmessage-id: <[email protected]>
672: Hreceived: by UCBARPA.BERKELEY.EDU (3.227 [10/22/82])
673: id A13557; 23-Oct-82 15:49:32-PDT (Sat)
674: HTo: mckusick@calder, wnj
675: .)b
676: This shows the name of the data file,
677: the person who sent the message,
678: the submission time
679: (in seconds since January 1, 1970),
680: the message priority,
681: the message class,
682: the recipients,
683: and the headers for the message.
684: .sh 3 "Forcing the queue"
685: .pp
686: .i Sendmail
687: should run the queue automatically
688: at intervals.
689: The algorithm is to read and sort the queue,
690: and then to attempt to process all jobs in order.
691: When it attempts to run the job,
692: .i sendmail
693: first checks to see if the job is locked.
694: If so, it ignores the job.
695: .pp
696: There is no attempt to insure that only one queue processor
697: exists at any time,
698: since there is no guarantee that a job cannot take forever
699: to process.
700: Due to the locking algorithm,
701: it is impossible for one job to freeze the queue.
702: However,
703: an uncooperative recipient host
704: or a program recipient
705: that never returns
706: can accumulate many processes in your system.
707: Unfortunately,
708: there is no way to resolve this
709: without violating the protocol.
710: .pp
711: In some cases,
712: you may find that a major host going down
713: for a couple of days
714: may create a prohibitively large queue.
715: This will result in
716: .i sendmail
717: spending an inordinate amount of time
718: sorting the queue.
719: This situation can be fixed by moving the queue to a temporary place
720: and creating a new queue.
721: The old queue can be run later when the offending host returns to service.
722: .pp
723: To do this,
724: it is acceptable to move the entire queue directory:
725: .(b
726: cd /usr/spool
727: mv mqueue omqueue; mkdir mqueue; chmod 755 mqueue
728: .)b
729: You should then kill the existing daemon
730: (since it will still be processing in the old queue directory)
731: and create a new daemon.
732: .pp
733: To run the old mail queue,
734: run the following command:
735: .(b
736: /usr/lib/sendmail \-oQ/usr/spool/omqueue \-q
737: .)b
738: The
739: .b \-oQ
740: flag specifies an alternate queue directory
741: and the
742: .b \-q
743: flag says to just run every job in the queue.
744: If you have a tendency toward voyeurism,
745: you can use the
746: .b \-v
747: flag to watch what is going on.
748: .pp
749: When the queue is finally emptied,
750: you can remove the directory:
751: .(b
752: rmdir /usr/spool/omqueue
753: .)b
754: .sh 2 "The Alias Database"
755: .pp
756: The alias database exists in two forms.
757: One is a text form,
758: maintained in the file
759: .i /usr/lib/aliases.
760: The aliases are of the form
761: .(b
762: name: name1, name2, ...
763: .)b
764: Only local names may be aliased;
765: e.g.,
766: .(b
767: eric@mit-xx: [email protected]
768: .)b
769: will not have the desired effect.
770: Aliases may be continued by starting any continuation lines
771: with a space or a tab.
772: Blank lines and lines beginning with a sharp sign
773: (\c
774: .q # )
775: are comments.
776: .pp
777: The second form is processed by the
778: .i dbm \|(3)
779: library.
780: This form is in the files
781: .i /usr/lib/aliases.dir
782: and
783: .i /usr/lib/aliases.pag.
784: This is the form that
785: .i sendmail
786: actually uses to resolve aliases.
787: This technique is used to improve performance.
788: .sh 3 "Rebuilding the alias database"
789: .pp
790: The DBM version of the database
791: may be rebuilt explicitly by executing the command
792: .(b
793: newaliases
794: .)b
795: This is equivalent to giving
796: .i sendmail
797: the
798: .b \-bi
799: flag:
800: .(b
801: /usr/lib/sendmail \-bi
802: .)b
803: .pp
804: If the
805: .q D
806: option is specified in the configuration,
807: .i sendmail
808: will rebuild the alias database automatically
809: if possible
810: when it is out of date.
811: The conditions under which it will do this are:
812: .np
813: The DBM version of the database is mode 666. -or-
814: .np
815: .i Sendmail
816: is running setuid to root.
817: .lp
818: Auto-rebuild can be dangerous
819: on heavily loaded machines
820: with large alias files;
821: if it might take more than five minutes
822: to rebuild the database,
823: there is a chance that several processes will start the rebuild process
824: simultaneously.
825: .sh 3 "Potential problems"
826: .pp
827: There are a number of problems that can occur
828: with the alias database.
829: They all result from a
830: .i sendmail
831: process accessing the DBM version
832: while it is only partially built.
833: This can happen under two circumstances:
834: One process accesses the database
835: while another process is rebuilding it,
836: or the process rebuilding the database dies
837: (due to being killed or a system crash)
838: before completing the rebuild.
839: .pp
840: Sendmail has two techniques to try to relieve these problems.
841: First, it ignores interrupts while rebuilding the database;
842: this avoids the problem of someone aborting the process
843: leaving a partially rebuilt database.
844: Second,
845: at the end of the rebuild
846: it adds an alias of the form
847: .(b
848: @: @
849: .)b
850: (which is not normally legal).
851: Before sendmail will access the database,
852: it checks to insure that this entry exists\**.
853: .(f
854: \**The
855: .q a
856: option is required in the configuration
857: for this action to occur.
858: This should normally be specified
859: unless you are running
860: .i delivermail
861: in parallel with
862: .i sendmail.
863: .)f
864: .i Sendmail
865: will wait for this entry to appear,
866: at which point it will force a rebuild itself\**.
867: .(f
868: \**Note:
869: the
870: .q D
871: option must be specified in the configuration file
872: for this operation to occur.
873: If the
874: .q D
875: option is not specified,
876: a warning message is generated and
877: .i sendmail
878: continues.
879: .)f
880: .sh 3 "List owners"
881: .pp
882: If an error occurs on sending to a certain address,
883: say
884: .q \fIx\fP ,
885: .i sendmail
886: will look for an alias
887: of the form
888: .q owner-\fIx\fP
889: to receive the errors.
890: This is typically useful
891: for a mailing list
892: where the submitter of the list
893: has no control over the maintenance of the list itself;
894: in this case the list maintainer would be the owner of the list.
895: For example:
896: .(b
897: unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser,
898: sam@matisse
899: owner-unix-wizards: eric@ucbarpa
900: .)b
901: would cause
902: .q eric@ucbarpa
903: to get the error that will occur
904: when someone sends to
905: unix-wizards
906: due to the inclusion of
907: .q nosuchuser
908: on the list.
909: .sh 2 "Per-User Forwarding (.forward Files)"
910: .pp
911: As an alternative to the alias database,
912: any user may put a file with the name
913: .q .forward
914: in his or her home directory.
915: If this file exists,
916: .i sendmail
917: redirects mail for that user
918: to the list of addresses listed in the .forward file.
919: For example, if the home directory for user
920: .q mckusick
921: has a .forward file with contents:
922: .(b
923: mckusick@ernie
924: kirk@calder
925: .)b
926: then any mail arriving for
927: .q mckusick
928: will be redirected to the specified accounts.
929: .sh 2 "Special Header Lines"
930: .pp
931: Several header lines have special interpretations
932: defined by the configuration file.
933: Others have interpretations built into
934: .i sendmail
935: that cannot be changed without changing the code.
936: These builtins are described here.
937: .sh 3 "Return-Receipt-To:"
938: .pp
939: If this header is sent,
940: a message will be sent to any specified addresses
941: when the final delivery is complete,
942: that is,
943: when successfully delivered to a mailer with the
944: .b l
945: flag (local delivery) set in the mailer descriptor.
946: .sh 3 "Errors-To:"
947: .pp
948: If errors occur anywhere during processing,
949: this header will cause error messages to go to
950: the listed addresses
951: rather than to the sender.
952: This is intended for mailing lists.
953: .sh 3 "Apparently-To:"
954: .pp
955: If a message comes in with no recipients listed in the message
956: (in a To:, Cc:, or Bcc: line)
957: then
958: .i sendmail
959: will add an
960: .q "Apparently-To:"
961: header line for any recipients it is aware of.
962: This is not put in as a standard recipient line
963: to warn any recipients that the list is not complete.
964: .pp
965: At least one recipient line is required under RFC 822.
966: .sh 1 "ARGUMENTS"
967: .pp
968: The complete list of arguments to
969: .i sendmail
970: is described in detail in Appendix A.
971: Some important arguments are described here.
972: .sh 2 "Queue Interval"
973: .pp
974: The amount of time between forking a process
975: to run through the queue
976: is defined by the
977: .b \-q
978: flag.
979: If you run in mode
980: .b f
981: or
982: .b a
983: this can be relatively large,
984: since it will only be relevant
985: when a host that was down comes back up.
986: If you run in
987: .b q
988: mode
989: it should be relatively short,
990: since it defines the maximum amount of time that a message
991: may sit in the queue.
992: .sh 2 "Daemon Mode"
993: .pp
994: If you allow incoming mail over an IPC connection,
995: you should have a daemon running.
996: This should be set by your
997: .i /etc/rc
998: file using the
999: .b \-bd
1000: flag.
1001: The
1002: .b \-bd
1003: flag and the
1004: .b \-q
1005: flag may be combined in one call:
1006: .(b
1007: /usr/lib/sendmail \-bd \-q30m
1008: .)b
1009: .sh 2 "Forcing the Queue"
1010: .pp
1011: In some cases you may find that the queue has gotten clogged for some reason.
1012: You can force a queue run
1013: using the
1014: .b \-q
1015: flag (with no value).
1016: It is entertaining to use the
1017: .b \-v
1018: flag (verbose)
1019: when this is done to watch what happens:
1020: .(b
1021: /usr/lib/sendmail \-q \-v
1022: .)b
1023: .sh 2 "Debugging"
1024: .pp
1025: There are a fairly large number of debug flags
1026: built into
1027: .i sendmail .
1028: Each debug flag has a number and a level,
1029: where higher levels means to print out more information.
1030: The convention is that levels greater than nine are
1031: .q absurd,
1032: i.e.,
1033: they print out so much information that you wouldn't normally
1034: want to see them except for debugging that particular piece of code.
1035: Debug flags are set using the
1036: .b \-d
1037: option;
1038: the syntax is:
1039: .(b
1040: .ta \w'debug-option 'u
1041: debug-flag: \fB\-d\fP debug-list
1042: debug-list: debug-option [ , debug-option ]
1043: debug-option: debug-range [ . debug-level ]
1044: debug-range: integer | integer \- integer
1045: debug-level: integer
1046: .)b
1047: where spaces are for reading ease only.
1048: For example,
1049: .(b
1050: \-d12 Set flag 12 to level 1
1051: \-d12.3 Set flag 12 to level 3
1052: \-d3-17 Set flags 3 through 17 to level 1
1053: \-d3-17.4 Set flags 3 through 17 to level 4
1054: .)b
1055: For a complete list of the available debug flags
1056: you will have to look at the code
1057: (they are too dynamic to keep this documentation up to date).
1058: .sh 2 "Trying a Different Configuration File"
1059: .pp
1060: An alternative configuration file
1061: can be specified using the
1062: .b \-C
1063: flag; for example,
1064: .(b
1065: /usr/lib/sendmail \-Ctest.cf
1066: .)b
1067: uses the configuration file
1068: .i test.cf
1069: instead of the default
1070: .i /usr/lib/sendmail.cf.
1071: If the
1072: .b \-C
1073: flag has no value
1074: it defaults to
1075: .i sendmail.cf
1076: in the current directory.
1077: .sh 2 "Changing the Values of Options"
1078: .pp
1079: Options can be overridden using the
1080: .b \-o
1081: flag.
1082: For example,
1083: .(b
1084: /usr/lib/sendmail \-oT2m
1085: .)b
1086: sets the
1087: .b T
1088: (timeout) option to two minutes
1089: for this run only.
1090: .sh 1 "TUNING"
1091: .pp
1092: There are a number of configuration parameters
1093: you may want to change,
1094: depending on the requirements of your site.
1095: Most of these are set
1096: using an option in the configuration file.
1097: For example,
1098: the line
1099: .q OT3d
1100: sets option
1101: .q T
1102: to the value
1103: .q 3d
1104: (three days).
1105: .pp
1106: Most of these options default appropriately for most sites.
1107: However,
1108: sites having very high mail loads may find they need to tune them
1109: as appropriate for their mail load.
1110: In particular,
1111: sites experiencing a large number of small messages,
1112: many of which are delivered to many recipients,
1113: may find that they need to adjust the parameters
1114: dealing with queue priorities.
1115: .sh 2 "Timeouts"
1116: .pp
1117: All time intervals are set
1118: using a scaled syntax.
1119: For example,
1120: .q 10m
1121: represents ten minutes, whereas
1122: .q 2h30m
1123: represents two and a half hours.
1124: The full set of scales is:
1125: .(b
1126: .ta 4n
1127: s seconds
1128: m minutes
1129: h hours
1130: d days
1131: w weeks
1132: .)b
1133: .sh 3 "Queue interval"
1134: .pp
1135: The argument to the
1136: .b \-q
1137: flag
1138: specifies how often a subdaemon will run the queue.
1139: This is typically set to between fifteen minutes
1140: and one hour.
1141: .sh 3 "Read timeouts"
1142: .pp
1143: It is possible to time out when reading the standard input
1144: or when reading from a remote SMTP server.
1145: Technically,
1146: this is not acceptable within the published protocols.
1147: However,
1148: it might be appropriate to set it to something large
1149: in certain environments
1150: (such as an hour).
1151: This will reduce the chance of large numbers of idle daemons
1152: piling up on your system.
1153: This timeout is set using the
1154: .b r
1155: option in the configuration file.
1156: .sh 3 "Message timeouts"
1157: .pp
1158: After sitting in the queue for a few days,
1159: a message will time out.
1160: This is to insure that at least the sender is aware
1161: of the inability to send a message.
1162: The timeout is typically set to three days.
1163: This timeout is set using the
1164: .b T
1165: option in the configuration file.
1166: .pp
1167: The time of submission is set in the queue,
1168: rather than the amount of time left until timeout.
1169: As a result, you can flush messages that have been hanging
1170: for a short period
1171: by running the queue
1172: with a short message timeout.
1173: For example,
1174: .(b
1175: /usr/lib/sendmail \-oT1d \-q
1176: .)b
1177: will run the queue
1178: and flush anything that is one day old.
1179: .sh 2 "Forking During Queue Runs"
1180: .pp
1181: By setting the
1182: .b Y
1183: option,
1184: .i sendmail
1185: will fork before each individual message
1186: while running the queue.
1187: This will prevent
1188: .i sendmail
1189: from consuming large amounts of memory,
1190: so it may be useful in memory-poor environments.
1191: However, if the
1192: .b Y
1193: option is not set,
1194: .i sendmail
1195: will keep track of hosts that are down during a queue run,
1196: which can improve performance dramatically.
1197: .sh 2 "Queue Priorities"
1198: .pp
1199: Every message is assigned a priority when it is first instantiated,
1200: consisting of the message size (in bytes)
1201: offset by the message class times the
1202: .q "work class factor"
1203: and the number of recipients times the
1204: .q "work recipient factor."
1205: The priority plus the creation time of the message
1206: (in seconds since January 1, 1970)
1207: are used to order the queue.
1208: Higher numbers for the priority mean that the message will be processed later
1209: when running the queue.
1210: .pp
1211: The message size is included so that large messages are penalized
1212: relative to small messages.
1213: The message class allows users to send
1214: .q "high priority"
1215: messages by including a
1216: .q Precedence:
1217: field in their message;
1218: the value of this field is looked up in the
1219: .b P
1220: lines of the configuration file.
1221: Since the number of recipients affects the amount of load a message presents
1222: to the system,
1223: this is also included into the priority.
1224: .pp
1225: The recipient and class factors
1226: can be set in the configuration file using the
1227: .b y
1228: and
1229: .b z
1230: options respectively.
1231: They default to 1000 (for the recipient factor)
1232: and 1800
1233: (for the class factor).
1234: The initial priority is:
1235: .(b
1236: pri = size \- (class * z) + (nrcpt * y)
1237: .)b
1238: (Remember, higher values for this parameter actually mean
1239: that the job will be treated with lower priority.)
1240: .pp
1241: The priority of a job can also be adjusted each time it is processed
1242: (that is, each time an attempt is made to deliver it)
1243: using the
1244: .q "work time factor,"
1245: set by the
1246: .b Z
1247: option.
1248: This is added to the priority,
1249: so it normally decreases the precedence of the job,
1250: on the grounds that jobs that have failed many times
1251: will tend to fail again in the future.
1252: .sh 2 "Load Limiting"
1253: .pp
1254: .i Sendmail
1255: can be asked to queue (but not deliver)
1256: mail if the system load average gets too high
1257: using the
1258: .b x
1259: option.
1260: When the load average exceeds the value of the
1261: .b x
1262: option,
1263: the delivery mode is set to
1264: .b q
1265: (queue only)
1266: if the
1267: .i "Queue Factor"
1268: (\c
1269: .b q
1270: option)
1271: divided by the difference in the current load average and the
1272: .b x
1273: option
1274: plus one
1275: exceeds the priority of the message \(em
1276: that is, the message is queued iff:
1277: .EQ
1278: pri > QF over { LA - x + 1 }
1279: .EN
1280: The
1281: .b q
1282: option defaults to 10000,
1283: so each point of load average is worth 10000
1284: priority points
1285: (as described above, that is, bytes + seconds + offsets).
1286: .pp
1287: For drastic cases,
1288: the
1289: .b X
1290: option defines a load average at which sendmail will refuse
1291: to accept network connections.
1292: Locally generated mail
1293: (including incoming UUCP mail)
1294: is still accepted.
1295: .sh 2 "Delivery Mode"
1296: .pp
1297: There are a number of delivery modes that
1298: .i sendmail
1299: can operate in,
1300: set by the
1301: .q d
1302: configuration option.
1303: These modes
1304: specify how quickly mail will be delivered.
1305: Legal modes are:
1306: .(b
1307: .ta 4n
1308: i deliver interactively (synchronously)
1309: b deliver in background (asynchronously)
1310: q queue only (don't deliver)
1311: .)b
1312: There are tradeoffs.
1313: Mode
1314: .q i
1315: passes the maximum amount of information to the sender,
1316: but is hardly ever necessary.
1317: Mode
1318: .q q
1319: puts the minimum load on your machine,
1320: but means that delivery may be delayed for up to the queue interval.
1321: Mode
1322: .q b
1323: is probably a good compromise.
1324: However, this mode can cause large numbers of processes
1325: if you have a mailer that takes a long time to deliver a message.
1326: .sh 2 "Log Level"
1327: .pp
1328: The level of logging can be set for sendmail.
1329: The default using a standard configuration table is level 9.
1330: The levels are as follows:
1331: .ip 0
1332: No logging.
1333: .ip 1
1334: Major problems only.
1335: .ip 2
1336: Message collections and failed deliveries.
1337: .ip 3
1338: Successful deliveries.
1339: .ip 4
1340: Messages being deferred
1341: (due to a host being down, etc.).
1342: .ip 5
1343: Normal message queueups.
1344: .ip 6
1345: Unusual but benign incidents,
1346: e.g.,
1347: trying to process a locked queue file.
1348: .ip 9
1349: Log internal queue id to external message id mappings.
1350: This can be useful for tracing a message
1351: as it travels between several hosts.
1352: .ip 12
1353: Several messages that are basically only of interest
1354: when debugging.
1355: .ip 16
1356: Verbose information regarding the queue.
1357: .sh 2 "File Modes"
1358: .pp
1359: There are a number of files
1360: that may have a number of modes.
1361: The modes depend on what functionality you want
1362: and the level of security you require.
1363: .sh 3 "To suid or not to suid?"
1364: .pp
1365: .i Sendmail
1366: can safely be made
1367: setuid to root.
1368: At the point where it is about to
1369: .i exec \|(2)
1370: a mailer,
1371: it checks to see if the userid is zero;
1372: if so,
1373: it resets the userid and groupid to a default
1374: (set by the
1375: .b u
1376: and
1377: .b g
1378: options).
1379: (This can be overridden
1380: by setting the
1381: .b S
1382: flag to the mailer
1383: for mailers that are trusted
1384: and must be called as root.)
1385: However,
1386: this will cause mail processing
1387: to be accounted
1388: (using
1389: .i sa \|(8))
1390: to root
1391: rather than to the user sending the mail.
1392: .sh 3 "Should my alias database be writable?"
1393: .pp
1394: At Berkeley
1395: we have the alias database
1396: (/usr/lib/aliases*)
1397: mode 644.
1398: While this is not as flexible as if the database
1399: were more 666, it avoids potential security problems
1400: with a globally writable database.
1401: .pp
1402: The database that
1403: .i sendmail
1404: actually used
1405: is represented by the two files
1406: .i aliases.dir
1407: and
1408: .i aliases.pag
1409: (both in /usr/lib).
1410: The mode on these files should match the mode
1411: on /usr/lib/aliases.
1412: If
1413: .i aliases
1414: is writable
1415: and the
1416: DBM
1417: files
1418: (\c
1419: .i aliases.dir
1420: and
1421: .i aliases.pag )
1422: are not,
1423: users will be unable to reflect their desired changes
1424: through to the actual database.
1425: However,
1426: if
1427: .i aliases
1428: is read-only
1429: and the DBM files are writable,
1430: a slightly sophisticated user
1431: can arrange to steal mail anyway.
1432: .pp
1433: If your DBM files are not writable by the world
1434: or you do not have auto-rebuild enabled
1435: (with the
1436: .q D
1437: option),
1438: then you must be careful to reconstruct the alias database
1439: each time you change the text version:
1440: .(b
1441: newaliases
1442: .)b
1443: If this step is ignored or forgotten
1444: any intended changes will also be ignored or forgotten.
1445: .sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE"
1446: .pp
1447: This section describes the configuration file
1448: in detail,
1449: including hints on how to write one of your own
1450: if you have to.
1451: .pp
1452: There is one point that should be made clear immediately:
1453: the syntax of the configuration file
1454: is designed to be reasonably easy to parse,
1455: since this is done every time
1456: .i sendmail
1457: starts up,
1458: rather than easy for a human to read or write.
1459: On the
1460: .q "future project"
1461: list is a
1462: configuration-file compiler.
1463: .pp
1464: An overview of the configuration file
1465: is given first,
1466: followed by details of the semantics.
1467: .sh 2 "The Syntax"
1468: .pp
1469: The configuration file is organized as a series of lines,
1470: each of which begins with a single character
1471: defining the semantics for the rest of the line.
1472: Lines beginning with a space or a tab
1473: are continuation lines
1474: (although the semantics are not well defined in many places).
1475: Blank lines and lines beginning with a sharp symbol
1476: (`#')
1477: are comments.
1478: .sh 3 "R and S \*- rewriting rules"
1479: .pp
1480: The core of address parsing
1481: are the rewriting rules.
1482: These are an ordered production system.
1483: .i Sendmail
1484: scans through the set of rewriting rules
1485: looking for a match on the left hand side
1486: (LHS)
1487: of the rule.
1488: When a rule matches,
1489: the address is replaced by the right hand side
1490: (RHS)
1491: of the rule.
1492: .pp
1493: There are several sets of rewriting rules.
1494: Some of the rewriting sets are used internally
1495: and must have specific semantics.
1496: Other rewriting sets
1497: do not have specifically assigned semantics,
1498: and may be referenced by the mailer definitions
1499: or by other rewriting sets.
1500: .pp
1501: The syntax of these two commands are:
1502: .(b F
1503: .b S \c
1504: .i n
1505: .)b
1506: Sets the current ruleset being collected to
1507: .i n .
1508: If you begin a ruleset more than once
1509: it deletes the old definition.
1510: .(b F
1511: .b R \c
1512: .i lhs
1513: .i rhs
1514: .i comments
1515: .)b
1516: The
1517: fields must be separated
1518: by at least one tab character;
1519: there may be embedded spaces
1520: in the fields.
1521: The
1522: .i lhs
1523: is a pattern that is applied to the input.
1524: If it matches,
1525: the input is rewritten to the
1526: .i rhs .
1527: The
1528: .i comments
1529: are ignored.
1530: .sh 3 "D \*- define macro"
1531: .pp
1532: Macros are named with a single character.
1533: These may be selected from the entire ASCII set,
1534: but user-defined macros
1535: should be selected from the set of upper case letters only.
1536: Lower case letters
1537: and special symbols
1538: are used internally.
1539: .pp
1540: The syntax for macro definitions is:
1541: .(b F
1542: .b D \c
1543: .i x\|val
1544: .)b
1545: where
1546: .i x
1547: is the name of the macro
1548: and
1549: .i val
1550: is the value it should have.
1551: Macros can be interpolated in most places using the escape sequence
1552: .b $ \c
1553: .i x .
1554: .sh 3 "C and F \*- define classes"
1555: .pp
1556: Classes of words may be defined
1557: to match on the left hand side of rewriting rules,
1558: where a
1559: .q word
1560: is a sequence of characters that do not contain characters
1561: in the $o macro.
1562: For example
1563: a class of all local names for this site
1564: might be created
1565: so that attempts to send to oneself
1566: can be eliminated.
1567: These can either be defined directly in the configuration file
1568: or read in from another file.
1569: Classes may be given names
1570: from the set of upper case letters.
1571: Lower case letters and special characters
1572: are reserved for system use.
1573: .pp
1574: The syntax is:
1575: .(b F
1576: .b C \c
1577: .i c\|word1
1578: .i word2...
1579: .br
1580: .b F \c
1581: .i c\|file
1582: .)b
1583: The first form defines the class
1584: .i c
1585: to match any of the named words.
1586: It is permissible to split them among multiple lines;
1587: for example, the two forms:
1588: .(b
1589: CHmonet ucbmonet
1590: .)b
1591: and
1592: .(b
1593: CHmonet
1594: CHucbmonet
1595: .)b
1596: are equivalent.
1597: The second form
1598: reads the elements of the class
1599: .i c
1600: from the named
1601: .i file .
1602: .sh 3 "M \*- define mailer"
1603: .pp
1604: Programs and interfaces to mailers
1605: are defined in this line.
1606: The format is:
1607: .(b F
1608: .b M \c
1609: .i name ,
1610: {\c
1611: .i field =\c
1612: .i value \|}*
1613: .)b
1614: where
1615: .i name
1616: is the name of the mailer
1617: (used internally only)
1618: and the
1619: .q field=name
1620: pairs define attributes of the mailer.
1621: Fields are:
1622: .(b
1623: .ta 1i
1624: Path The pathname of the mailer
1625: Flags Special flags for this mailer
1626: Sender A rewriting set for sender addresses
1627: Recipient A rewriting set for recipient addresses
1628: Argv An argument vector to pass to this mailer
1629: Eol The end-of-line string for this mailer
1630: Maxsize The maximum message length to this mailer
1631: .)b
1632: Only the first character of the field name is checked.
1633: .sh 3 "H \*- define header"
1634: .pp
1635: The format of the header lines that sendmail inserts into the message
1636: are defined by the
1637: .b H
1638: line.
1639: The syntax of this line is:
1640: .(b F
1641: .b H [\c
1642: .b ? \c
1643: .i mflags \c
1644: .b ? ]\c
1645: .i hname \c
1646: .b :
1647: .i htemplate
1648: .)b
1649: Continuation lines in this spec
1650: are reflected directly into the outgoing message.
1651: The
1652: .i htemplate
1653: is macro expanded before insertion into the message.
1654: If the
1655: .i mflags
1656: (surrounded by question marks)
1657: are specified,
1658: at least one of the specified flags
1659: must be stated in the mailer definition
1660: for this header to be automatically output.
1661: If one of these headers is in the input
1662: it is reflected to the output
1663: regardless of these flags.
1664: .pp
1665: Some headers have special semantics
1666: that will be described below.
1667: .sh 3 "O \*- set option"
1668: .pp
1669: There are a number of
1670: .q random
1671: options that
1672: can be set from a configuration file.
1673: Options are represented by single characters.
1674: The syntax of this line is:
1675: .(b F
1676: .b O \c
1677: .i o\|value
1678: .)b
1679: This sets option
1680: .i o
1681: to be
1682: .i value .
1683: Depending on the option,
1684: .i value
1685: may be a string, an integer,
1686: a boolean
1687: (with legal values
1688: .q t ,
1689: .q T ,
1690: .q f ,
1691: or
1692: .q F ;
1693: the default is TRUE),
1694: or
1695: a time interval.
1696: .sh 3 "T \*- define trusted users"
1697: .pp
1698: Trusted users
1699: are those users who are permitted
1700: to override the sender address
1701: using the
1702: .b \-f
1703: flag.
1704: These typically are
1705: .q root,
1706: .q uucp,
1707: and
1708: .q network,
1709: but on some users it may be convenient
1710: to extend this list to include other users,
1711: perhaps to support
1712: a separate
1713: UUCP
1714: login for each host.
1715: The syntax of this line is:
1716: .(b F
1717: .b T \c
1718: .i user1
1719: .i user2 ...
1720: .)b
1721: There may be more than one of these lines.
1722: .sh 3 "P \*- precedence definitions"
1723: .pp
1724: Values for the
1725: .q "Precedence:"
1726: field may be defined using the
1727: .b P
1728: control line.
1729: The syntax of this field is:
1730: .(b
1731: \fBP\fP\fIname\fP\fB=\fP\fInum\fP
1732: .)b
1733: When the
1734: .i name
1735: is found in a
1736: .q Precedence:
1737: field,
1738: the message class is set to
1739: .i num .
1740: Higher numbers mean higher precedence.
1741: Numbers less than zero
1742: have the special property
1743: that error messages will not be returned.
1744: The default precedence is zero.
1745: For example,
1746: our list of precedences is:
1747: .(b
1748: Pfirst-class=0
1749: Pspecial-delivery=100
1750: Pjunk=\-100
1751: .)b
1752: .sh 2 "The Semantics"
1753: .pp
1754: This section describes the semantics of the configuration file.
1755: .sh 3 "Special macros, conditionals"
1756: .pp
1757: Macros are interpolated
1758: using the construct
1759: .b $ \c
1760: .i x ,
1761: where
1762: .i x
1763: is the name of the macro to be interpolated.
1764: In particular,
1765: lower case letters are reserved to have
1766: special semantics,
1767: used to pass information in or out of sendmail,
1768: and some special characters are reserved to
1769: provide conditionals, etc.
1770: .pp
1771: Conditionals can be specified using the syntax:
1772: .(b
1773: $?x text1 $| text2 $.
1774: .)b
1775: This interpolates
1776: .i text1
1777: if the macro
1778: .b $x
1779: is set,
1780: and
1781: .i text2
1782: otherwise.
1783: The
1784: .q else
1785: (\c
1786: .b $| )
1787: clause may be omitted.
1788: .pp
1789: The following macros
1790: .i must
1791: be defined to transmit information into
1792: .i sendmail:
1793: .(b
1794: .ta 4n
1795: e The SMTP entry message
1796: j The \*(lqofficial\*(rq domain name for this site
1797: l The format of the UNIX from line
1798: n The name of the daemon (for error messages)
1799: o The set of "operators" in addresses
1800: q default format of sender address
1801: .)b
1802: The
1803: .b $e
1804: macro is printed out when SMTP starts up.
1805: The first word must be the
1806: .b $j
1807: macro.
1808: The
1809: .b $j
1810: macro
1811: should be in RFC821 format.
1812: The
1813: .b $l
1814: and
1815: .b $n
1816: macros can be considered constants
1817: except under terribly unusual circumstances.
1818: The
1819: .b $o
1820: macro consists of a list of characters
1821: which will be considered tokens
1822: and which will separate tokens
1823: when doing parsing.
1824: For example, if
1825: .q @
1826: were in the
1827: .b $o
1828: macro, then the input
1829: .q a@b
1830: would be scanned as three tokens:
1831: .q a,
1832: .q @,
1833: and
1834: .q b.
1835: Finally, the
1836: .b $q
1837: macro specifies how an address should appear in a message
1838: when it is defaulted.
1839: For example, on our system these definitions are:
1840: .(b
1841: De$j Sendmail $v ready at $b
1842: DnMAILER-DAEMON
1843: DlFrom $g $d
1844: Do.:%@!^=/
1845: Dq$g$?x ($x)$.
1846: Dj$H.$D
1847: .)b
1848: An acceptable alternative for the
1849: .b $q
1850: macro is
1851: .q "$?x$x $.<$g>" .
1852: These correspond to the following two formats:
1853: .(b
1854: eric@Berkeley (Eric Allman)
1855: Eric Allman <eric@Berkeley>
1856: .)b
1857: .pp
1858: Some macros are defined by
1859: .i sendmail
1860: for interpolation into argv's for mailers
1861: or for other contexts.
1862: These macros are:
1863: .(b
1864: a The origination date in RFC 822 format
1865: b The current date in RFC 822 format
1866: c The hop count
1867: d The date in UNIX (ctime) format
1868: f The sender (from) address
1869: g The sender address relative to the recipient
1870: h The recipient host
1871: i The queue id
1872: p Sendmail's pid
1873: r Protocol used
1874: s Sender's host name
1875: t A numeric representation of the current time
1876: u The recipient user
1877: v The version number of sendmail
1878: w The hostname of this site
1879: x The full name of the sender
1880: z The home directory of the recipient
1881: .)b
1882: .pp
1883: There are three types of dates that can be used.
1884: The
1885: .b $a
1886: and
1887: .b $b
1888: macros are in RFC 822 format;
1889: .b $a
1890: is the time as extracted from the
1891: .q Date:
1892: line of the message
1893: (if there was one),
1894: and
1895: .b $b
1896: is the current date and time
1897: (used for postmarks).
1898: If no
1899: .q Date:
1900: line is found in the incoming message,
1901: .b $a
1902: is set to the current time also.
1903: The
1904: .b $d
1905: macro is equivalent to the
1906: .b $a
1907: macro in UNIX
1908: (ctime)
1909: format.
1910: .pp
1911: The
1912: .b $f
1913: macro is the id of the sender
1914: as originally determined;
1915: when mailing to a specific host
1916: the
1917: .b $g
1918: macro is set to the address of the sender
1919: .ul
1920: relative to the recipient.
1921: For example,
1922: if I send to
1923: .q bollard@matisse
1924: from the machine
1925: .q ucbarpa
1926: the
1927: .b $f
1928: macro will be
1929: .q eric
1930: and the
1931: .b $g
1932: macro will be
1933: .q eric@ucbarpa.
1934: .pp
1935: The
1936: .b $x
1937: macro is set to the full name of the sender.
1938: This can be determined in several ways.
1939: It can be passed as flag to
1940: .i sendmail.
1941: The second choice is the value of the
1942: .q Full-name:
1943: line in the header if it exists,
1944: and the third choice is the comment field
1945: of a
1946: .q From:
1947: line.
1948: If all of these fail,
1949: and if the message is being originated locally,
1950: the full name is looked up in the
1951: .i /etc/passwd
1952: file.
1953: .pp
1954: When sending,
1955: the
1956: .b $h ,
1957: .b $u ,
1958: and
1959: .b $z
1960: macros get set to the host, user, and home directory
1961: (if local)
1962: of the recipient.
1963: The first two are set from the
1964: .b $@
1965: and
1966: .b $:
1967: part of the rewriting rules, respectively.
1968: .pp
1969: The
1970: .b $p
1971: and
1972: .b $t
1973: macros are used to create unique strings
1974: (e.g., for the
1975: .q Message-Id:
1976: field).
1977: The
1978: .b $i
1979: macro is set to the queue id on this host;
1980: if put into the timestamp line
1981: it can be extremely useful for tracking messages.
1982: The
1983: .b $v
1984: macro is set to be the version number of
1985: .i sendmail ;
1986: this is normally put in timestamps
1987: and has been proven extremely useful for debugging.
1988: The
1989: .b $w
1990: macro is set to the name of this host
1991: if it can be determined.
1992: The
1993: .b $c
1994: field is set to the
1995: .q "hop count,"
1996: i.e., the number of times this message has been processed.
1997: This can be determined
1998: by the
1999: .b \-h
2000: flag on the command line
2001: or by counting the timestamps in the message.
2002: .pp
2003: The
2004: .b $r
2005: and
2006: .b $s
2007: fields are set to the protocol used to communicate with sendmail
2008: and the sending hostname;
2009: these are not supported in the current version.
2010: .sh 3 "Special classes"
2011: .pp
2012: The class
2013: .b $=w
2014: is set to be the set of all names
2015: this host is known by.
2016: This can be used to match local hostnames.
2017: .sh 3 "The left hand side"
2018: .pp
2019: The left hand side of rewriting rules contains a pattern.
2020: Normal words are simply matched directly.
2021: Metasyntax is introduced using a dollar sign.
2022: The metasymbols are:
2023: .(b
2024: .ta \w'\fB$=\fP\fIx\fP 'u
2025: \fB$*\fP Match zero or more tokens
2026: \fB$+\fP Match one or more tokens
2027: \fB$\-\fP Match exactly one token
2028: \fB$=\fP\fIx\fP Match any token in class \fIx\fP
2029: \fB$~\fP\fIx\fP Match any token not in class \fIx\fP
2030: .)b
2031: If any of these match,
2032: they are assigned to the symbol
2033: .b $ \c
2034: .i n
2035: for replacement on the right hand side,
2036: where
2037: .i n
2038: is the index in the LHS.
2039: For example,
2040: if the LHS:
2041: .(b
2042: $\-:$+
2043: .)b
2044: is applied to the input:
2045: .(b
2046: UCBARPA:eric
2047: .)b
2048: the rule will match, and the values passed to the RHS will be:
2049: .(b
2050: .ta 4n
2051: $1 UCBARPA
2052: $2 eric
2053: .)b
2054: .sh 3 "The right hand side"
2055: .pp
2056: When the left hand side of a rewriting rule matches,
2057: the input is deleted and replaced by the right hand side.
2058: Tokens are copied directly from the RHS
2059: unless they begin with a dollar sign.
2060: Metasymbols are:
2061: .(b
2062: .ta \w'$#mailer 'u
2063: \fB$\fP\fIn\fP Substitute indefinite token \fIn\fP from LHS
2064: \fB$[\fP\fIname\fP\fB$]\fP Canonicalize \fIname\fP
2065: \fB$>\fP\fIn\fP \*(lqCall\*(rq ruleset \fIn\fP
2066: \fB$#\fP\fImailer\fP Resolve to \fImailer\fP
2067: \fB$@\fP\fIhost\fP Specify \fIhost\fP
2068: \fB$:\fP\fIuser\fP Specify \fIuser\fP
2069: .)b
2070: .pp
2071: The
2072: .b $ \c
2073: .i n
2074: syntax substitutes the corresponding value from a
2075: .b $+ ,
2076: .b $\- ,
2077: .b $* ,
2078: .b $= ,
2079: or
2080: .b $~
2081: match on the LHS.
2082: It may be used anywhere.
2083: .pp
2084: A host name enclosed between
2085: .b $[
2086: and
2087: .b $]
2088: is looked up using the
2089: .i gethostent \|(3)
2090: routines and replaced by the canonical name.
2091: For example,
2092: .q $[csam$]
2093: might become
2094: .q lbl-csam.arpa
2095: and
2096: .q $[[128.32.130.2]$]
2097: would become
2098: .q vangogh.berkeley.edu.
2099: .pp
2100: The
2101: .b $> \c
2102: .i n
2103: syntax
2104: causes the remainder of the line to be substituted as usual
2105: and then passed as the argument to ruleset
2106: .i n .
2107: The final value of ruleset
2108: .i n
2109: then becomes
2110: the substitution for this rule.
2111: .pp
2112: The
2113: .b $#
2114: syntax should
2115: .i only
2116: be used in ruleset zero.
2117: It causes evaluation of the ruleset to terminate immediately,
2118: and signals to sendmail that the address has completely resolved.
2119: The complete syntax is:
2120: .(b
2121: \fB$#\fP\fImailer\fP\fB$@\fP\fIhost\fP\fB$:\fP\fIuser\fP
2122: .)b
2123: This specifies the
2124: {mailer, host, user}
2125: 3-tuple necessary to direct the mailer.
2126: If the mailer is local
2127: the host part may be omitted.
2128: The
2129: .i mailer
2130: and
2131: .i host
2132: must be a single word,
2133: but the
2134: .i user
2135: may be multi-part.
2136: .pp
2137: A RHS may also be preceded by a
2138: .b $@
2139: or a
2140: .b $:
2141: to control evaluation.
2142: A
2143: .b $@
2144: prefix causes the ruleset to return with the remainder of the RHS
2145: as the value.
2146: A
2147: .b $:
2148: prefix causes the rule to terminate immediately,
2149: but the ruleset to continue;
2150: this can be used to avoid continued application of a rule.
2151: The prefix is stripped before continuing.
2152: .pp
2153: The
2154: .b $@
2155: and
2156: .b $:
2157: prefixes may precede a
2158: .b $>
2159: spec;
2160: for example:
2161: .(b
2162: .ta 8n
2163: R$+ $:$>7$1
2164: .)b
2165: matches anything,
2166: passes that to ruleset seven,
2167: and continues;
2168: the
2169: .b $:
2170: is necessary to avoid an infinite loop.
2171: .pp
2172: Substitution occurs in the order described,
2173: that is,
2174: parameters from the LHS are substituted,
2175: hostnames are canonicalized,
2176: .q subroutines
2177: are called,
2178: and finally
2179: .b $# ,
2180: .b $@ ,
2181: and
2182: .b $:
2183: are processed.
2184: .sh 3 "Semantics of rewriting rule sets"
2185: .pp
2186: There are five rewriting sets
2187: that have specific semantics.
2188: These are related as depicted by figure 2.
2189: .(z
2190: .hl
2191: .ie n \{\
2192: .(c
2193: +---+
2194: -->| 0 |-->resolved address
2195: / +---+
2196: / +---+ +---+
2197: / ---->| 1 |-->| S |--
2198: +---+ / +---+ / +---+ +---+ \e +---+
2199: addr-->| 3 |-->| D |-- --->| 4 |-->msg
2200: +---+ +---+ \e +---+ +---+ / +---+
2201: --->| 2 |-->| R |--
2202: +---+ +---+
2203: .)c
2204:
2205: .\}
2206: .el .ie !"\*(.T"" \
2207: \{\
2208: .PS
2209: boxwid = 0.3i
2210: boxht = 0.3i
2211: movewid = 0.3i
2212: moveht = 0.3i
2213: linewid = 0.3i
2214: lineht = 0.3i
2215:
2216: box invis "addr"; arrow
2217: Box3: box "3"
2218: A1: arrow
2219: BoxD: box "D"; line; L1: Here
2220: C: [
2221: C1: arrow; box "1"; arrow; box "S"; line; E1: Here
2222: move to C1 down 0.5; right
2223: C2: arrow; box "2"; arrow; box "R"; line; E2: Here
2224: ] with .w at L1 + (0.5, 0)
2225: move to C.e right 0.5
2226: L4: arrow; box "4"; arrow; box invis "msg"
2227: line from L1 to C.C1
2228: line from L1 to C.C2
2229: line from C.E1 to L4
2230: line from C.E2 to L4
2231: move to BoxD.n up 0.6; right
2232: Box0: arrow; box "0"
2233: arrow; box invis "resolved address" width 1.3
2234: line from 1/3 of the way between A1 and BoxD.w to Box0
2235: .PE
2236: .\}
2237: .el .sp 2i
2238: .ce
2239: Figure 2 \*- Rewriting set semantics
2240: .(c
2241: D \*- sender domain addition
2242: S \*- mailer-specific sender rewriting
2243: R \*- mailer-specific recipient rewriting
2244: .)c
2245: .hl
2246: .)z
2247: .pp
2248: Ruleset three
2249: should turn the address into
2250: .q "canonical form."
2251: This form should have the basic syntax:
2252: .(b
2253: local-part@host-domain-spec
2254: .)b
2255: If no
2256: .q @
2257: sign is specified,
2258: then the
2259: host-domain-spec
2260: .i may
2261: be appended from the
2262: sender address
2263: (if the
2264: .b C
2265: flag is set in the mailer definition
2266: corresponding to the
2267: .i sending
2268: mailer).
2269: Ruleset three
2270: is applied by sendmail
2271: before doing anything with any address.
2272: .pp
2273: Ruleset zero
2274: is applied after ruleset three
2275: to addresses that are going to actually specify recipients.
2276: It must resolve to a
2277: .i "{mailer, host, user}"
2278: triple.
2279: The
2280: .i mailer
2281: must be defined in the mailer definitions
2282: from the configuration file.
2283: The
2284: .i host
2285: is defined into the
2286: .b $h
2287: macro
2288: for use in the argv expansion of the specified mailer.
2289: .pp
2290: Rulesets one and two
2291: are applied to all sender and recipient addresses respectively.
2292: They are applied before any specification
2293: in the mailer definition.
2294: They must never resolve.
2295: .pp
2296: Ruleset four is applied to all addresses
2297: in the message.
2298: It is typically used
2299: to translate internal to external form.
2300: .sh 3 "Mailer flags etc."
2301: .pp
2302: There are a number of flags that may be associated with each mailer,
2303: each identified by a letter of the alphabet.
2304: Many of them are assigned semantics internally.
2305: These are detailed in Appendix C.
2306: Any other flags may be used freely
2307: to conditionally assign headers to messages
2308: destined for particular mailers.
2309: .sh 3 "The \*(lqerror\*(rq mailer"
2310: .pp
2311: The mailer with the special name
2312: .q error
2313: can be used to generate a user error.
2314: The (optional) host field is a numeric exit status to be returned,
2315: and the user field is a message to be printed.
2316: For example, the entry:
2317: .(b
2318: $#error$:Host unknown in this domain
2319: .)b
2320: on the RHS of a rule
2321: will cause the specified error to be generated
2322: if the LHS matches.
2323: This mailer is only functional in ruleset zero.
2324: .sh 2 "Building a Configuration File From Scratch"
2325: .pp
2326: Building a configuration table from scratch is an extremely difficult job.
2327: Fortunately,
2328: it is almost never necessary to do so;
2329: nearly every situation that may come up
2330: may be resolved by changing an existing table.
2331: In any case,
2332: it is critical that you understand what it is that you are trying to do
2333: and come up with a philosophy for the configuration table.
2334: This section is intended to explain what the real purpose
2335: of a configuration table is
2336: and to give you some ideas
2337: for what your philosophy might be.
2338: .sh 3 "What you are trying to do"
2339: .pp
2340: The configuration table has three major purposes.
2341: The first and simplest
2342: is to set up the environment for
2343: .i sendmail .
2344: This involves setting the options,
2345: defining a few critical macros,
2346: etc.
2347: Since these are described in other places,
2348: we will not go into more detail here.
2349: .pp
2350: The second purpose is to rewrite addresses in the message.
2351: This should typically be done in two phases.
2352: The first phase maps addresses in any format
2353: into a canonical form.
2354: This should be done in ruleset three.
2355: The second phase maps this canonical form
2356: into the syntax appropriate for the receiving mailer.
2357: .i Sendmail
2358: does this in three subphases.
2359: Rulesets one and two
2360: are applied to all sender and recipient addresses respectively.
2361: After this,
2362: you may specify per-mailer rulesets
2363: for both sender and recipient addresses;
2364: this allows mailer-specific customization.
2365: Finally,
2366: ruleset four is applied to do any default conversion
2367: to external form.
2368: .pp
2369: The third purpose
2370: is to map addresses into the actual set of instructions
2371: necessary to get the message delivered.
2372: Ruleset zero must resolve to the internal form,
2373: which is in turn used as a pointer to a mailer descriptor.
2374: The mailer descriptor describes the interface requirements
2375: of the mailer.
2376: .sh 3 "Philosophy"
2377: .pp
2378: The particular philosophy you choose will depend heavily
2379: on the size and structure of your organization.
2380: I will present a few possible philosophies here.
2381: .pp
2382: One general point applies to all of these philosophies:
2383: it is almost always a mistake
2384: to try to do full name resolution.
2385: For example,
2386: if you are trying to get names of the form
2387: .q user@host
2388: to the Arpanet,
2389: it does not pay to route them to
2390: .q xyzvax!decvax!ucbvax!c70:user@host
2391: since you then depend on several links not under your control.
2392: The best approach to this problem
2393: is to simply forward to
2394: .q xyzvax!user@host
2395: and let xyzvax
2396: worry about it from there.
2397: In summary,
2398: just get the message closer to the destination,
2399: rather than determining the full path.
2400: .sh 4 "Large site, many hosts \*- minimum information"
2401: .pp
2402: Berkeley is an example of a large site,
2403: i.e., more than two or three hosts
2404: and multiple mail connections.
2405: We have decided that the only reasonable philosophy
2406: in our environment
2407: is to designate one host as the guru for our site.
2408: It must be able to resolve any piece of mail it receives.
2409: The other sites should have the minimum amount of information
2410: they can get away with.
2411: In addition,
2412: any information they do have
2413: should be hints rather than solid information.
2414: .pp
2415: For example,
2416: a typical site on our local ether network is
2417: .q monet.
2418: When monet receives mail for delivery,
2419: it checks whether it knows
2420: that the destination host is directly reachable;
2421: if so, mail is sent to that host.
2422: If it receives mail for any unknown host,
2423: it just passes it directly to
2424: .q ucbvax,
2425: our master host.
2426: Ucbvax may determine that the host name is illegal
2427: and reject the message,
2428: or may be able to do delivery.
2429: However, it is important to note that when a new mail connection is added,
2430: the only host that
2431: .i must
2432: have its tables updated
2433: is ucbvax;
2434: the others
2435: .i may
2436: be updated if convenient,
2437: but this is not critical.
2438: .pp
2439: This picture is slightly muddied
2440: due to network connections that are not actually located
2441: on ucbvax.
2442: For example,
2443: some UUCP connections are currently on
2444: .q ucbarpa.
2445: However,
2446: monet
2447: .i "does not"
2448: know about this;
2449: the information is hidden totally between ucbvax and ucbarpa.
2450: Mail going from monet to a UUCP host
2451: is transferred via the ethernet
2452: from monet to ucbvax,
2453: then via the ethernet from ucbvax to ucbarpa,
2454: and then is submitted to UUCP.
2455: Although this involves some extra hops,
2456: we feel this is an acceptable tradeoff.
2457: .pp
2458: An interesting point is that it would be possible
2459: to update monet
2460: to send appropriate UUCP mail directly to ucbarpa
2461: if the load got too high;
2462: if monet failed to note a host as connected to ucbarpa
2463: it would go via ucbvax as before,
2464: and if monet incorrectly sent a message to ucbarpa
2465: it would still be sent by ucbarpa
2466: to ucbvax as before.
2467: The only problem that can occur is loops,
2468: for example,
2469: if ucbarpa thought that ucbvax had the UUCP connection
2470: and vice versa.
2471: For this reason,
2472: updates should
2473: .i always
2474: happen to the master host first.
2475: .pp
2476: This philosophy results as much from the need
2477: to have a single source for the configuration files
2478: (typically built using
2479: .i m4 \|(1)
2480: or some similar tool)
2481: as any logical need.
2482: Maintaining more than three separate tables by hand
2483: is essentially an impossible job.
2484: .sh 4 "Small site \*- complete information"
2485: .pp
2486: A small site
2487: (two or three hosts and few external connections)
2488: may find it more reasonable to have complete information
2489: at each host.
2490: This would require that each host
2491: know exactly where each network connection is,
2492: possibly including the names of each host on that network.
2493: As long as the site remains small
2494: and the the configuration remains relatively static,
2495: the update problem will probably not be too great.
2496: .sh 4 "Single host"
2497: .pp
2498: This is in some sense the trivial case.
2499: The only major issue is trying to insure that you don't
2500: have to know too much about your environment.
2501: For example,
2502: if you have a UUCP connection
2503: you might find it useful to know about the names of hosts
2504: connected directly to you,
2505: but this is really not necessary
2506: since this may be determined from the syntax.
2507: .sh 3 "Relevant issues"
2508: .pp
2509: The canonical form you use
2510: should almost certainly be as specified in
2511: the Arpanet protocols
2512: RFC819 and RFC822.
2513: Copies of these RFC's are included on the
2514: .i sendmail
2515: tape
2516: as
2517: .i doc/rfc819.lpr
2518: and
2519: .i doc/rfc822.lpr .
2520: .pp
2521: RFC822
2522: describes the format of the mail message itself.
2523: .i Sendmail
2524: follows this RFC closely,
2525: to the extent that many of the standards described in this document
2526: can not be changed without changing the code.
2527: In particular,
2528: the following characters have special interpretations:
2529: .(b
2530: < > ( ) " \e
2531: .)b
2532: Any attempt to use these characters for other than their RFC822
2533: purpose in addresses is probably doomed to disaster.
2534: .pp
2535: RFC819
2536: describes the specifics of the domain-based addressing.
2537: This is touched on in RFC822 as well.
2538: Essentially each host is given a name
2539: which is a right-to-left dot qualified pseudo-path
2540: from a distinguished root.
2541: The elements of the path need not be physical hosts;
2542: the domain is logical rather than physical.
2543: For example,
2544: at Berkeley
2545: one legal host might be
2546: .q a.CC.Berkeley.EDU ;
2547: reading from right to left,
2548: .q EDU
2549: is a top level domain
2550: comprising educational institutions,
2551: .q Berkeley
2552: is a logical domain name,
2553: .q CC
2554: represents the Computer Center,
2555: (in this case a strictly logical entity),
2556: and
2557: .q a
2558: is a host in the Computer Center.
2559: .pp
2560: Beware when reading RFC819
2561: that there are a number of errors in it.
2562: .sh 3 "How to proceed"
2563: .pp
2564: Once you have decided on a philosophy,
2565: it is worth examining the available configuration tables
2566: to decide if any of them are close enough
2567: to steal major parts of.
2568: Even under the worst of conditions,
2569: there is a fair amount of boiler plate that can be collected safely.
2570: .pp
2571: The next step is to build ruleset three.
2572: This will be the hardest part of the job.
2573: Beware of doing too much to the address in this ruleset,
2574: since anything you do will reflect through
2575: to the message.
2576: In particular,
2577: stripping of local domains is best deferred,
2578: since this can leave you with addresses with no domain spec at all.
2579: Since
2580: .i sendmail
2581: likes to append the sending domain to addresses with no domain,
2582: this can change the semantics of addresses.
2583: Also try to avoid
2584: fully qualifying domains in this ruleset.
2585: Although technically legal,
2586: this can lead to unpleasantly and unnecessarily long addresses
2587: reflected into messages.
2588: The Berkeley configuration files
2589: define ruleset nine
2590: to qualify domain names and strip local domains.
2591: This is called from ruleset zero
2592: to get all addresses into a cleaner form.
2593: .pp
2594: Once you have ruleset three finished,
2595: the other rulesets should be relatively trivial.
2596: If you need hints,
2597: examine the supplied configuration tables.
2598: .sh 3 "Testing the rewriting rules \*- the \-bt flag"
2599: .pp
2600: When you build a configuration table,
2601: you can do a certain amount of testing
2602: using the
2603: .q "test mode"
2604: of
2605: .i sendmail .
2606: For example,
2607: you could invoke
2608: .i sendmail
2609: as:
2610: .(b
2611: sendmail \-bt \-Ctest.cf
2612: .)b
2613: which would read the configuration file
2614: .q test.cf
2615: and enter test mode.
2616: In this mode,
2617: you enter lines of the form:
2618: .(b
2619: rwset address
2620: .)b
2621: where
2622: .i rwset
2623: is the rewriting set you want to use
2624: and
2625: .i address
2626: is an address to apply the set to.
2627: Test mode shows you the steps it takes
2628: as it proceeds,
2629: finally showing you the address it ends up with.
2630: You may use a comma separated list of rwsets
2631: for sequential application of rules to an input;
2632: ruleset three is always applied first.
2633: For example:
2634: .(b
2635: 1,21,4 monet:bollard
2636: .)b
2637: first applies ruleset three to the input
2638: .q monet:bollard.
2639: Ruleset one is then applied to the output of ruleset three,
2640: followed similarly by rulesets twenty-one and four.
2641: .pp
2642: If you need more detail,
2643: you can also use the
2644: .q \-d21
2645: flag to turn on more debugging.
2646: For example,
2647: .(b
2648: sendmail \-bt \-d21.99
2649: .)b
2650: turns on an incredible amount of information;
2651: a single word address
2652: is probably going to print out several pages worth of information.
2653: .sh 3 "Building mailer descriptions"
2654: .pp
2655: To add an outgoing mailer to your mail system,
2656: you will have to define the characteristics of the mailer.
2657: .pp
2658: Each mailer must have an internal name.
2659: This can be arbitrary,
2660: except that the names
2661: .q local
2662: and
2663: .q prog
2664: must be defined.
2665: .pp
2666: The pathname of the mailer must be given in the P field.
2667: If this mailer should be accessed via an IPC connection,
2668: use the string
2669: .q [IPC]
2670: instead.
2671: .pp
2672: The F field defines the mailer flags.
2673: You should specify an
2674: .q f
2675: or
2676: .q r
2677: flag to pass the name of the sender as a
2678: .b \-f
2679: or
2680: .b \-r
2681: flag respectively.
2682: These flags are only passed if they were passed to
2683: .i sendmail,
2684: so that mailers that give errors under some circumstances
2685: can be placated.
2686: If the mailer is not picky
2687: you can just specify
2688: .q "\-f $g"
2689: in the argv template.
2690: If the mailer must be called as
2691: .b root
2692: the
2693: .q S
2694: flag should be given;
2695: this will not reset the userid
2696: before calling the mailer\**.
2697: .(f
2698: \**\c
2699: .i Sendmail
2700: must be running setuid to root
2701: for this to work.
2702: .)f
2703: If this mailer is local
2704: (i.e., will perform final delivery
2705: rather than another network hop)
2706: the
2707: .q l
2708: flag should be given.
2709: Quote characters
2710: (backslashes and " marks)
2711: can be stripped from addresses if the
2712: .q s
2713: flag is specified;
2714: if this is not given
2715: they are passed through.
2716: If the mailer is capable of sending to more than one user
2717: on the same host
2718: in a single transaction
2719: the
2720: .q m
2721: flag should be stated.
2722: If this flag is on,
2723: then the argv template containing
2724: .b $u
2725: will be repeated for each unique user
2726: on a given host.
2727: The
2728: .q e
2729: flag will mark the mailer as being
2730: .q expensive,
2731: which will cause
2732: .i sendmail
2733: to defer connection
2734: until a queue run\**.
2735: .(f
2736: \**The
2737: .q c
2738: configuration option must be given
2739: for this to be effective.
2740: .)f
2741: .pp
2742: An unusual case is the
2743: .q C
2744: flag.
2745: This flag applies to the mailer that the message is received from,
2746: rather than the mailer being sent to;
2747: if set,
2748: the domain spec of the sender
2749: (i.e., the
2750: .q @host.domain
2751: part)
2752: is saved
2753: and is appended to any addresses in the message
2754: that do not already contain a domain spec.
2755: For example,
2756: a message of the form:
2757: .(b
2758: From: eric@ucbarpa
2759: To: wnj@monet, mckusick
2760: .)b
2761: will be modified to:
2762: .(b
2763: From: eric@ucbarpa
2764: To: wnj@monet, mckusick@ucbarpa
2765: .)b
2766: .i "if and only if"
2767: the
2768: .q C
2769: flag is defined in the mailer corresponding to
2770: .q eric@ucbarpa.
2771: .pp
2772: Other flags are described
2773: in Appendix C.
2774: .pp
2775: The S and R fields in the mailer description
2776: are per-mailer rewriting sets
2777: to be applied to sender and recipient addresses
2778: respectively.
2779: These are applied after the sending domain is appended
2780: and the general rewriting sets
2781: (numbers one and two)
2782: are applied,
2783: but before the output rewrite
2784: (ruleset four)
2785: is applied.
2786: A typical use is to append the current domain
2787: to addresses that do not already have a domain.
2788: For example,
2789: a header of the form:
2790: .(b
2791: From: eric
2792: .)b
2793: might be changed to be:
2794: .(b
2795: From: eric@ucbarpa
2796: .)b
2797: or
2798: .(b
2799: From: ucbvax!eric
2800: .)b
2801: depending on the domain it is being shipped into.
2802: These sets can also be used
2803: to do special purpose output rewriting
2804: in cooperation with ruleset four.
2805: .pp
2806: The E field defines the string to use
2807: as an end-of-line indication.
2808: A string containing only newline is the default.
2809: The usual backslash escapes
2810: (\er, \en, \ef, \eb)
2811: may be used.
2812: .pp
2813: Finally,
2814: an argv template is given as the E field.
2815: It may have embedded spaces.
2816: If there is no argv with a
2817: .b $u
2818: macro in it,
2819: .i sendmail
2820: will speak SMTP
2821: to the mailer.
2822: If the pathname for this mailer is
2823: .q [IPC],
2824: the argv should be
2825: .(b
2826: IPC $h [ \fIport\fP ]
2827: .)b
2828: where
2829: .i port
2830: is the optional port number
2831: to connect to.
2832: .pp
2833: For example,
2834: the specifications:
2835: .(b
2836: .ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'u
2837: Mlocal, P=/bin/mail, F=rlsm S=10, R=20, A=mail \-d $u
2838: Mether, P=[IPC], F=meC, S=11, R=21, A=IPC $h, M=100000
2839: .)b
2840: specifies a mailer to do local delivery
2841: and a mailer for ethernet delivery.
2842: The first is called
2843: .q local,
2844: is located in the file
2845: .q /bin/mail,
2846: takes a picky
2847: .b \-r
2848: flag,
2849: does local delivery,
2850: quotes should be stripped from addresses,
2851: and multiple users can be delivered at once;
2852: ruleset ten
2853: should be applied to sender addresses in the message
2854: and ruleset twenty
2855: should be applied to recipient addresses;
2856: the argv to send to a message will be the word
2857: .q mail,
2858: the word
2859: .q \-d,
2860: and words containing the name of the receiving user.
2861: If a
2862: .b \-r
2863: flag is inserted
2864: it will be between the words
2865: .q mail
2866: and
2867: .q \-d.
2868: The second mailer is called
2869: .q ether,
2870: it should be connected to via an IPC connection,
2871: it can handle multiple users at once,
2872: connections should be deferred,
2873: and any domain from the sender address
2874: should be appended to any receiver name
2875: without a domain;
2876: sender addresses should be processed by ruleset eleven
2877: and recipient addresses by ruleset twenty-one.
2878: There is a 100,000 byte limit on messages passed through this mailer.
2879: .++ A
2880: .+c "COMMAND LINE FLAGS"
2881: .ba 0
2882: .nr ii 1i
2883: .pp
2884: Arguments must be presented with flags before addresses.
2885: The flags are:
2886: .ip "\-f\ \fIaddr\fP"
2887: The sender's machine address is
2888: .i addr .
2889: This flag is ignored unless the real user
2890: is listed as a
2891: .q "trusted user"
2892: or if
2893: .i addr
2894: contains an exclamation point
2895: (because of certain restrictions in UUCP).
2896: .ip "\-r\ \fIaddr\fP"
2897: An obsolete form of
2898: .b \-f .
2899: .ip "\-h\ \fIcnt\fP"
2900: Sets the
2901: .q "hop count"
2902: to
2903: .i cnt .
2904: This represents the number of times this message has been processed
2905: by
2906: .i sendmail
2907: (to the extent that it is supported by the underlying networks).
2908: .i Cnt
2909: is incremented during processing,
2910: and if it reaches
2911: MAXHOP
2912: (currently 30)
2913: .i sendmail
2914: throws away the message with an error.
2915: .ip \-F\fIname\fP
2916: Sets the full name of this user to
2917: .i name .
2918: .ip \-n
2919: Don't do aliasing or forwarding.
2920: .ip \-t
2921: Read the header for
2922: .q To: ,
2923: .q Cc: ,
2924: and
2925: .q Bcc:
2926: lines, and send to everyone listed in those lists.
2927: The
2928: .q Bcc:
2929: line will be deleted before sending.
2930: Any addresses in the argument vector will be deleted
2931: from the send list.
2932: .ip \-b\fIx\fP
2933: Set operation mode to
2934: .i x .
2935: Operation modes are:
2936: .(b
2937: .ta 4n
2938: m Deliver mail (default)
2939: a Run in arpanet mode (see below)
2940: s Speak SMTP on input side
2941: d Run as a daemon
2942: t Run in test mode
2943: v Just verify addresses, don't collect or deliver
2944: i Initialize the alias database
2945: p Print the mail queue
2946: z Freeze the configuration file
2947: .)b
2948: The special processing for the
2949: ARPANET
2950: includes reading the
2951: .q "From:"
2952: line from the header to find the sender,
2953: printing
2954: ARPANET
2955: style messages
2956: (preceded by three digit reply codes for compatibility with
2957: the FTP protocol
2958: [Neigus73, Postel74, Postel77]),
2959: and ending lines of error messages with <CRLF>.
2960: .ip \-q\fItime\fP
2961: Try to process the queued up mail.
2962: If the time is given,
2963: a sendmail will run through the queue at the specified interval
2964: to deliver queued mail;
2965: otherwise, it only runs once.
2966: .ip \-C\fIfile\fP
2967: Use a different configuration file.
2968: .i Sendmail
2969: runs as the invoking user (rather than root)
2970: when this flag is specified.
2971: .ip \-d\fIlevel\fP
2972: Set debugging level.
2973: .ip \-o\fIx\|value\fP
2974: Set option
2975: .i x
2976: to the specified
2977: .i value .
2978: These options are described in Appendix B.
2979: .pp
2980: There are a number of options that may be specified as
2981: primitive flags
2982: (provided for compatibility with
2983: .i delivermail ).
2984: These are the e, i, m, and v options.
2985: Also,
2986: the f option
2987: may be specified as the
2988: .b \-s
2989: flag.
2990: .+c "CONFIGURATION OPTIONS"
2991: .pp
2992: The following options may be set using the
2993: .b \-o
2994: flag on the command line
2995: or the
2996: .b O
2997: line in the configuration file.
2998: Many of them cannot be specified unless the invoking user is trusted.
2999: .nr ii 1i
3000: .ip A\fIfile\fP
3001: Use the named
3002: .i file
3003: as the alias file.
3004: If no file is specified,
3005: use
3006: .i aliases
3007: in the current directory.
3008: .ip a\fIN\fP
3009: If set,
3010: wait up to
3011: .i N
3012: minutes for an
3013: .q @:@
3014: entry to exist in the alias database
3015: before starting up.
3016: If it does not appear in
3017: .i N
3018: minutes,
3019: rebuild the database
3020: (if the
3021: .b D
3022: option is also set)
3023: or issue a warning.
3024: .ip B\fIc\fP
3025: Set the blank substitution character to
3026: .i c .
3027: Unquoted spaces in addresses are replaced by this character.
3028: .ip c
3029: If an outgoing mailer is marked as being expensive,
3030: don't connect immediately.
3031: This requires that queueing be compiled in,
3032: since it will depend on a queue run process to
3033: actually send the mail.
3034: .ip d\fIx\fP
3035: Deliver in mode
3036: .i x .
3037: Legal modes are:
3038: .(b
3039: .ta 4n
3040: i Deliver interactively (synchronously)
3041: b Deliver in background (asynchronously)
3042: q Just queue the message (deliver during queue run)
3043: .)b
3044: .ip D
3045: If set,
3046: rebuild the alias database if necessary and possible.
3047: If this option is not set,
3048: .i sendmail
3049: will never rebuild the alias database
3050: unless explicitly requested
3051: using
3052: .b \-bi .
3053: .ip e\fIx\fP
3054: Dispose of errors using mode
3055: .i x .
3056: The values for
3057: .i x
3058: are:
3059: .(b
3060: p Print error messages (default)
3061: q No messages, just give exit status
3062: m Mail back errors
3063: w Write back errors (mail if user not logged in)
3064: e Mail back errors and give zero exit stat always
3065: .)b
3066: .ip f
3067: Save
3068: Unix-style
3069: .q From
3070: lines at the front of headers.
3071: Normally they are assumed redundant
3072: and discarded.
3073: .ip g\fIn\fP
3074: Set the default group id
3075: for mailers to run in
3076: to
3077: .i n .
3078: .ip H\fIfile\fP
3079: Specify the help file
3080: for SMTP.
3081: .ip I
3082: Insist that the BIND name server be running
3083: to resolve host names.
3084: If this is not set and the name server is not running,
3085: the
3086: .i /etc/hosts
3087: file will be considered complete.
3088: In general, you do want to set this option
3089: if your
3090: .i /etc/hosts
3091: file does not include all hosts known to you
3092: or if you are using the MX (mail forwarding) feature of the BIND name server.
3093: The name server will still be consulted
3094: even if this option is not set, but
3095: .i sendmail
3096: will feel free to resort to reading
3097: .i /etc/hosts
3098: if the name server is not available.
3099: Thus, you should
3100: .i never
3101: set this option if you do not run the name server.
3102: .ip i
3103: Ignore dots in incoming messages.
3104: .ip L\fIn\fP
3105: Set the default log level to
3106: .i n .
3107: .ip M\fIx\|value\fP
3108: Set the macro
3109: .i x
3110: to
3111: .i value .
3112: This is intended only for use from the command line.
3113: .ip m
3114: Send to me too,
3115: even if I am in an alias expansion.
3116: .ip N\fInetname\fP
3117: The name of the home network;
3118: .q ARPA
3119: by default.
3120: The the argument of an SMTP
3121: .q HELO
3122: command is checked against
3123: .q hostname.netname
3124: where
3125: .i hostname
3126: is requested from the kernel for the current connection.
3127: If they do not match,
3128: .q Received:
3129: lines are augmented by the name that is determined in this manner
3130: so that messages can be traced accurately.
3131: .ip o
3132: Assume that the headers may be in old format,
3133: i.e.,
3134: spaces delimit names.
3135: This actually turns on
3136: an adaptive algorithm:
3137: if any recipient address contains a comma, parenthesis,
3138: or angle bracket,
3139: it will be assumed that commas already exist.
3140: If this flag is not on,
3141: only commas delimit names.
3142: Headers are always output with commas between the names.
3143: .ip Q\fIdir\fP
3144: Use the named
3145: .i dir
3146: as the queue directory.
3147: .ip q\fIfactor\fP
3148: Use
3149: .i factor
3150: as the multiplier in the map function
3151: to decide when to just queue up jobs rather than run them.
3152: This value is divided by the difference between the current load average
3153: and the load average limit
3154: (\c
3155: .b x
3156: flag)
3157: to determine the maximum message priority
3158: that will be sent.
3159: Defaults to 10000.
3160: .ip r\fItime\fP
3161: Timeout reads after
3162: .i time
3163: interval.
3164: .ip S\fIfile\fP
3165: Log statistics in the named
3166: .i file .
3167: .ip s
3168: Be super-safe when running things,
3169: i.e.,
3170: always instantiate the queue file,
3171: even if you are going to attempt immediate delivery.
3172: .i Sendmail
3173: always instantiates the queue file
3174: before returning control the the client
3175: under any circumstances.
3176: .ip T\fItime\fP
3177: Set the queue timeout to
3178: .i time .
3179: After this interval,
3180: messages that have not been successfully sent
3181: will be returned to the sender.
3182: .ip t\fIS,D\fP
3183: Set the local time zone name to
3184: .i S
3185: for standard time and
3186: .i D
3187: for daylight time;
3188: this is only used under version six.
3189: .ip u\fIn\fP
3190: Set the default userid for mailers to
3191: .i n .
3192: Mailers without the
3193: .i S
3194: flag in the mailer definition
3195: will run as this user.
3196: .ip v
3197: Run in verbose mode.
3198: .ip x\fILA\fP
3199: When the system load average exceeds
3200: .i LA ,
3201: just queue messages
3202: (i.e., don't try to send them).
3203: .ip X\fILA\fP
3204: When the system load average exceeds
3205: .i LA ,
3206: refuse incoming SMTP connections.
3207: .ip y\fIfact\fP
3208: The indicated
3209: .i fact or
3210: is added to the priority (thus
3211: .i lowering
3212: the priority of the job)
3213: for each recipient,
3214: i.e., this value penalizes jobs with large numbers of recipients.
3215: .ip Y
3216: If set,
3217: deliver each job that is run from the queue in a separate process.
3218: Use this option if you are short of memory,
3219: since the default tends to consume considerable amounts of memory
3220: while the queue is being processed.
3221: .ip z\fIfact\fP
3222: The indicated
3223: .i fact or
3224: is multiplied by the message class
3225: (determined by the Precedence: field in the user header
3226: and the
3227: .b P
3228: lines in the configuration file)
3229: and subtracted from the priority.
3230: Thus, messages with a higher Priority: will be favored.
3231: .ip Z\fIfact\fP
3232: The
3233: .i fact or
3234: is added to the priority
3235: every time a job is processed.
3236: Thus,
3237: each time a job is processed,
3238: its priority will be decreased by the indicated value.
3239: In most environments this should be positive,
3240: since hosts that are down are all too often down for a long time.
3241: .+c "MAILER FLAGS"
3242: The following flags may be set in the mailer description.
3243: .nr ii 4n
3244: .ip f
3245: The mailer wants a
3246: .b \-f
3247: .i from
3248: flag,
3249: but only if this is a network forward operation
3250: (i.e.,
3251: the mailer will give an error
3252: if the executing user
3253: does not have special permissions).
3254: .ip r
3255: Same as
3256: .b f ,
3257: but sends a
3258: .b \-r
3259: flag.
3260: .ip S
3261: Don't reset the userid
3262: before calling the mailer.
3263: This would be used in a secure environment
3264: where
3265: .i sendmail
3266: ran as root.
3267: This could be used to avoid forged addresses.
3268: This flag is suppressed if given from an
3269: .q unsafe
3270: environment
3271: (e.g, a user's mail.cf file).
3272: .ip n
3273: Do not insert a UNIX-style
3274: .q From
3275: line on the front of the message.
3276: .ip l
3277: This mailer is local
3278: (i.e.,
3279: final delivery will be performed).
3280: .ip s
3281: Strip quote characters off of the address
3282: before calling the mailer.
3283: .ip m
3284: This mailer can send to multiple users
3285: on the same host
3286: in one transaction.
3287: When a
3288: .b $u
3289: macro occurs in the
3290: .i argv
3291: part of the mailer definition,
3292: that field will be repeated as necessary
3293: for all qualifying users.
3294: .ip F
3295: This mailer wants a
3296: .q From:
3297: header line.
3298: .ip D
3299: This mailer wants a
3300: .q Date:
3301: header line.
3302: .ip M
3303: This mailer wants a
3304: .q Message-Id:
3305: header line.
3306: .ip x
3307: This mailer wants a
3308: .q Full-Name:
3309: header line.
3310: .ip P
3311: This mailer wants a
3312: .q Return-Path:
3313: line.
3314: .ip u
3315: Upper case should be preserved in user names
3316: for this mailer.
3317: .ip h
3318: Upper case should be preserved in host names
3319: for this mailer.
3320: .ip A
3321: This is an Arpanet-compatible mailer,
3322: and all appropriate modes should be set.
3323: .ip U
3324: This mailer wants Unix-style
3325: .q From
3326: lines with the ugly UUCP-style
3327: .q "remote from <host>"
3328: on the end.
3329: .ip e
3330: This mailer is expensive to connect to,
3331: so try to avoid connecting normally;
3332: any necessary connection will occur during a queue run.
3333: .ip X
3334: This mailer want to use the hidden dot algorithm
3335: as specified in RFC821;
3336: basically,
3337: any line beginning with a dot
3338: will have an extra dot prepended
3339: (to be stripped at the other end).
3340: This insures that lines in the message containing a dot
3341: will not terminate the message prematurely.
3342: .ip L
3343: Limit the line lengths as specified in RFC821.
3344: .ip P
3345: Use the return-path in the SMTP
3346: .q "MAIL FROM:"
3347: command
3348: rather than just the return address;
3349: although this is required in RFC821,
3350: many hosts do not process return paths properly.
3351: .ip I
3352: This mailer will be speaking SMTP
3353: to another
3354: .i sendmail
3355: \*-
3356: as such it can use special protocol features.
3357: This option is not required
3358: (i.e.,
3359: if this option is omitted the transmission will still operate successfully,
3360: although perhaps not as efficiently as possible).
3361: .ip C
3362: If mail is
3363: .i received
3364: from a mailer with this flag set,
3365: any addresses in the header that do not have an at sign
3366: (\c
3367: .q @ )
3368: after being rewritten by ruleset three
3369: will have the
3370: .q @domain
3371: clause from the sender
3372: tacked on.
3373: This allows mail with headers of the form:
3374: .(b
3375: From: usera@hosta
3376: To: userb@hostb, userc
3377: .)b
3378: to be rewritten as:
3379: .(b
3380: From: usera@hosta
3381: To: userb@hostb, userc@hosta
3382: .)b
3383: automatically.
3384: .ip E
3385: Escape lines beginning with
3386: .q From
3387: in the message with a `>' sign.
3388: .+c "OTHER CONFIGURATION"
3389: .rm $0
3390: .nr ii 1i
3391: .pp
3392: There are some configuration changes that can be made by
3393: recompiling
3394: .i sendmail .
3395: These are located in two places:
3396: .ip src/conf.h
3397: Configuration parameters that may be tweaked by the installer
3398: are included in conf.h.
3399: .ip src/conf.c
3400: Some special routines and a few variables
3401: may be defined in conf.c.
3402: For the most part these are selected from the settings
3403: in conf.h.
3404: .uh "Parameters in src/conf.h"
3405: .pp
3406: Parameters and compilation options
3407: are defined in conf.h.
3408: Most of these need not normally be tweaked;
3409: common parameters are all in sendmail.cf.
3410: However, the sizes of certain primitive vectors, etc.,
3411: are included in this file.
3412: The numbers following the parameters
3413: are their default value.
3414: .nr ii 1.2i
3415: .ip "MAXLINE [1024]"
3416: The maximum line length of any input line.
3417: If message lines exceed this length
3418: they will still be processed correctly;
3419: however, header lines,
3420: configuration file lines,
3421: alias lines,
3422: etc.,
3423: must fit within this limit.
3424: .ip "MAXNAME [256]"
3425: The maximum length of any name,
3426: such as a host or a user name.
3427: .ip "MAXFIELD [2500]"
3428: The maximum total length of any header field,
3429: including continuation lines.
3430: .ip "MAXPV [40]"
3431: The maximum number of parameters to any mailer.
3432: This limits the number of recipients that may be passed in one transaction.
3433: .ip "MAXHOP [17]"
3434: When a message has been processed more than this number of times,
3435: sendmail rejects the message
3436: on the assumption that there has been an aliasing loop.
3437: This can be determined from the
3438: .b \-h
3439: flag
3440: or by counting the number of trace fields
3441: (i.e,
3442: .q Received:
3443: lines)
3444: in the message header.
3445: .ip "MAXATOM [100]"
3446: The maximum number of atoms
3447: (tokens)
3448: in a single address.
3449: For example,
3450: the address
3451: .q "eric@Berkeley"
3452: is three atoms.
3453: .ip "MAXMAILERS [25]"
3454: The maximum number of mailers that may be defined
3455: in the configuration file.
3456: .ip "MAXRWSETS [30]"
3457: The maximum number of rewriting sets
3458: that may be defined.
3459: .ip "MAXPRIORITIES [25]"
3460: The maximum number of values for the
3461: .q Precedence:
3462: field that may be defined
3463: (using the
3464: .b P
3465: line in sendmail.cf).
3466: .ip "MAXTRUST [30]"
3467: The maximum number of trusted users that may be defined
3468: (using the
3469: .b T
3470: line in sendmail.cf).
3471: .ip "MAXUSERENVIRON [40]"
3472: The maximum number of items in the user environment
3473: that will be passed to subordinate mailers.
3474: .ip "QUEUESIZE [600]"
3475: The maximum number of entries that will be processed
3476: in a single queue run.
3477: .lp
3478: A number of other compilation options exist.
3479: These specify whether or not specific code should be compiled in.
3480: .nr ii 1i
3481: .ip DBM
3482: If set,
3483: the
3484: .q DBM
3485: package in UNIX is used
3486: (see
3487: .i dbm(3X)
3488: in [UNIX80]).
3489: If not set,
3490: a much less efficient algorithm for processing aliases is used.
3491: .ip NDBM
3492: If set,
3493: the new version of the DBM library
3494: that allows multiple databases will be used.
3495: .q DBM
3496: must also be set.
3497: .ip DEBUG
3498: If set, debugging information is compiled in.
3499: To actually get the debugging output,
3500: the
3501: .b \-d
3502: flag must be used.
3503: .ip LOG
3504: If set,
3505: the
3506: .i syslog
3507: routine in use at some sites is used.
3508: This makes an informational log record
3509: for each message processed,
3510: and makes a higher priority log record
3511: for internal system errors.
3512: .ip QUEUE
3513: This flag should be set to compile in the queueing code.
3514: If this is not set,
3515: mailers must accept the mail immediately
3516: or it will be returned to the sender.
3517: .ip SMTP
3518: If set,
3519: the code to handle user and server SMTP will be compiled in.
3520: This is only necessary if your machine has some mailer
3521: that speaks SMTP.
3522: .ip DAEMON
3523: If set,
3524: code to run a daemon is compiled in.
3525: This code is for 4.2 or 4.3BSD.
3526: .ip UGLYUUCP
3527: If you have a UUCP host adjacent to you which is not running
3528: a reasonable version of
3529: .i rmail ,
3530: you will have to set this flag to include the
3531: .q "remote from sysname"
3532: info on the from line.
3533: Otherwise, UUCP gets confused about where the mail came from.
3534: .ip NOTUNIX
3535: If you are using a non-UNIX mail format,
3536: you can set this flag to turn off special processing
3537: of UNIX-style
3538: .q "From "
3539: lines.
3540: .ip NAMED_BIND
3541: Compile in code to use the Berkeley Internet Name Domain (BIND) server
3542: to resolve TCP/IP host names.
3543: .ip SETPROCTITLE
3544: If defined,
3545: .i sendmail
3546: will change its
3547: .i argv
3548: array to indicate its current status.
3549: This can be used in conjunction with the
3550: .i ps
3551: command to find out just what it's up to.
3552: .ip NO_WILDCARD_MX
3553: Should be set if there are no wildcard MX nameserver records
3554: in the local domain.
3555: If set, this will enable the use of ANY query types, resulting
3556: in better performance.
3557: Unfortunately, wildcard MX records in the local domain will mess
3558: this up, hence the need for this compilation option.
3559: .uh "Configuration in src/conf.c"
3560: .pp
3561: Not all header semantics are defined in the configuration file.
3562: Header lines that should only be included by certain mailers
3563: (as well as other more obscure semantics)
3564: must be specified in the
3565: .i HdrInfo
3566: table in
3567: .i conf.c .
3568: This table contains the header name
3569: (which should be in all lower case)
3570: and a set of header control flags (described below),
3571: The flags are:
3572: .ip H_ACHECK
3573: Normally when the check is made to see if a header line is compatible
3574: with a mailer,
3575: .i sendmail
3576: will not delete an existing line.
3577: If this flag is set,
3578: .i sendmail
3579: will delete
3580: even existing header lines.
3581: That is,
3582: if this bit is set and the mailer does not have flag bits set
3583: that intersect with the required mailer flags
3584: in the header definition in
3585: sendmail.cf,
3586: the header line is
3587: .i always
3588: deleted.
3589: .ip H_EOH
3590: If this header field is set,
3591: treat it like a blank line,
3592: i.e.,
3593: it will signal the end of the header
3594: and the beginning of the message text.
3595: .ip H_FORCE
3596: Add this header entry
3597: even if one existed in the message before.
3598: If a header entry does not have this bit set,
3599: .i sendmail
3600: will not add another header line if a header line
3601: of this name already existed.
3602: This would normally be used to stamp the message
3603: by everyone who handled it.
3604: .ip H_TRACE
3605: If set,
3606: this is a timestamp
3607: (trace)
3608: field.
3609: If the number of trace fields in a message
3610: exceeds a preset amount
3611: the message is returned
3612: on the assumption that it has an aliasing loop.
3613: .ip H_RCPT
3614: If set,
3615: this field contains recipient addresses.
3616: This is used by the
3617: .b \-t
3618: flag to determine who to send to
3619: when it is collecting recipients from the message.
3620: .ip H_FROM
3621: This flag indicates that this field
3622: specifies a sender.
3623: The order of these fields in the
3624: .i HdrInfo
3625: table specifies
3626: .i sendmail's
3627: preference
3628: for which field to return error messages to.
3629: .nr ii 5n
3630: .lp
3631: Let's look at a sample
3632: .i HdrInfo
3633: specification:
3634: .(b
3635: .ta 4n +\w'"return-receipt-to", 'u
3636: struct hdrinfo HdrInfo[] =
3637: \&{
3638: /* originator fields, most to least significant */
3639: "resent-sender", H_FROM,
3640: "resent-from", H_FROM,
3641: "sender", H_FROM,
3642: "from", H_FROM,
3643: "full-name", H_ACHECK,
3644: /* destination fields */
3645: "to", H_RCPT,
3646: "resent-to", H_RCPT,
3647: "cc", H_RCPT,
3648: /* message identification and control */
3649: "message", H_EOH,
3650: "text", H_EOH,
3651: /* trace fields */
3652: "received", H_TRACE|H_FORCE,
3653:
3654: NULL, 0,
3655: };
3656: .)b
3657: This structure indicates that the
3658: .q To: ,
3659: .q Resent-To: ,
3660: and
3661: .q Cc:
3662: fields
3663: all specify recipient addresses.
3664: Any
3665: .q Full-Name:
3666: field will be deleted unless the required mailer flag
3667: (indicated in the configuration file)
3668: is specified.
3669: The
3670: .q Message:
3671: and
3672: .q Text:
3673: fields will terminate the header;
3674: these are specified in new protocols
3675: [NBS80]
3676: or used by random dissenters around the network world.
3677: The
3678: .q Received:
3679: field will always be added,
3680: and can be used to trace messages.
3681: .pp
3682: There are a number of important points here.
3683: First,
3684: header fields are not added automatically just because they are in the
3685: .i HdrInfo
3686: structure;
3687: they must be specified in the configuration file
3688: in order to be added to the message.
3689: Any header fields mentioned in the configuration file but not
3690: mentioned in the
3691: .i HdrInfo
3692: structure have default processing performed;
3693: that is,
3694: they are added unless they were in the message already.
3695: Second,
3696: the
3697: .i HdrInfo
3698: structure only specifies cliched processing;
3699: certain headers are processed specially by ad hoc code
3700: regardless of the status specified in
3701: .i HdrInfo .
3702: For example,
3703: the
3704: .q Sender:
3705: and
3706: .q From:
3707: fields are always scanned on ARPANET mail
3708: to determine the sender;
3709: this is used to perform the
3710: .q "return to sender"
3711: function.
3712: The
3713: .q "From:"
3714: and
3715: .q "Full-Name:"
3716: fields are used to determine the full name of the sender
3717: if possible;
3718: this is stored in the macro
3719: .b $x
3720: and used in a number of ways.
3721: .pp
3722: The file
3723: .i conf.c
3724: also contains the specification of ARPANET reply codes.
3725: There are four classifications these fall into:
3726: .(b
3727: .sz -1
3728: .ta \w'char 'u +\w'Arpa_TUsrerr[] = 'u +\w'"888"; 'u
3729: char Arpa_Info[] = "050"; /* arbitrary info */
3730: char Arpa_TSyserr[] = "455"; /* some (transient) system error */
3731: char Arpa_PSyserr[] = "554"; /* some (permanent) system error */
3732: char Arpa_Usrerr[] = "554"; /* some (fatal) user error */
3733: .sz
3734: .)b
3735: The class
3736: .i Arpa_Info
3737: is for any information that is not required by the protocol,
3738: such as forwarding information.
3739: .i Arpa_TSyserr
3740: and
3741: .i Arpa_PSyserr
3742: is printed by the
3743: .i syserr
3744: routine.
3745: TSyserr
3746: is printed out for transient errors,
3747: that is,
3748: errors that are likely to go away without explicit action
3749: on the part of a systems administrator.
3750: PSyserr
3751: is printed for permanent errors.
3752: The distinction is made based on the value of
3753: .i errno .
3754: Finally,
3755: .i Arpa_Usrerr
3756: is the result of a user error
3757: and is generated by the
3758: .i usrerr
3759: routine;
3760: these are generated when the user has specified something wrong,
3761: and hence the error is permanent,
3762: i.e.,
3763: it will not work simply by resubmitting the request.
3764: .pp
3765: If it is necessary to restrict mail through a relay,
3766: the
3767: .i checkcompat
3768: routine can be modified.
3769: This routine is called for every recipient address.
3770: It can return
3771: .b TRUE
3772: to indicate that the address is acceptable
3773: and mail processing will continue,
3774: or it can return
3775: .b FALSE
3776: to reject the recipient.
3777: If it returns false,
3778: it is up to
3779: .i checkcompat
3780: to print an error message
3781: (using
3782: .i usrerr )
3783: saying why the message is rejected.
3784: For example,
3785: .i checkcompat
3786: could read:
3787: .(b
3788: .re
3789: .sz -1
3790: .ta 4n +4n +4n +4n +4n +4n +4n
3791: bool
3792: checkcompat(to)
3793: register ADDRESS *to;
3794: \&{
3795: if (MsgSize > 50000 && to->q_mailer != LocalMailer)
3796: {
3797: usrerr("Message too large for non-local delivery");
3798: NoReturn = TRUE;
3799: return (FALSE);
3800: }
3801: return (TRUE);
3802: }
3803: .sz
3804: .)b
3805: This would reject messages greater than 50000 bytes
3806: unless they were local.
3807: The
3808: .i NoReturn
3809: flag can be sent to suppress the return of the actual body
3810: of the message in the error return.
3811: The actual use of this routine is highly dependent on the
3812: implementation,
3813: and use should be limited.
3814: .uh "Configuration in src/daemon.c"
3815: .pp
3816: The file
3817: .i src/daemon.c
3818: contains a number of routines that are dependent
3819: on the local networking environment.
3820: The version supplied is specific to 4.3 BSD.
3821: .pp
3822: The routine
3823: .i maphostname
3824: is called to convert strings within
3825: .b $[
3826: \&...\&
3827: .b $]
3828: symbols.
3829: It can be modified if you wish to provide a more sophisticated service,
3830: e.g.,
3831: mapping UUCP host names to full paths.
3832: .+c "SUMMARY OF SUPPORT FILES"
3833: .pp
3834: This is a summary of the support files
3835: that
3836: .i sendmail
3837: creates or generates.
3838: .nr ii 1i
3839: .ip "/usr/lib/sendmail"
3840: The binary of
3841: .i sendmail .
3842: .ip /usr/bin/newaliases
3843: A link to /usr/lib/sendmail;
3844: causes the alias database to be rebuilt.
3845: Running this program is completely equivalent to giving
3846: .i sendmail
3847: the
3848: .b \-bi
3849: flag.
3850: .ip /usr/bin/mailq
3851: Prints a listing of the mail queue.
3852: This program is equivalent to using the
3853: .b \-bp
3854: flag to
3855: .i sendmail .
3856: .ip /usr/lib/sendmail.cf
3857: The configuration file,
3858: in textual form.
3859: .ip /usr/lib/sendmail.fc
3860: The configuration file
3861: represented as a memory image.
3862: .ip /usr/lib/sendmail.hf
3863: The SMTP help file.
3864: .ip /usr/lib/sendmail.st
3865: A statistics file; need not be present.
3866: .ip /usr/lib/aliases
3867: The textual version of the alias file.
3868: .ip /usr/lib/aliases.{pag,dir}
3869: The alias file in
3870: .i dbm \|(3)
3871: format.
3872: .ip /usr/spool/mqueue
3873: The directory in which the mail queue
3874: and temporary files reside.
3875: .ip /usr/spool/mqueue/qf*
3876: Control (queue) files for messages.
3877: .ip /usr/spool/mqueue/df*
3878: Data files.
3879: .ip /usr/spool/mqueue/lf*
3880: Lock files
3881: .ip /usr/spool/mqueue/tf*
3882: Temporary versions of the qf files,
3883: used during queue file rebuild.
3884: .ip /usr/spool/mqueue/nf*
3885: A file used when creating a unique id.
3886: .ip /usr/spool/mqueue/xf*
3887: A transcript of the current session.
3888: .\".ro
3889: .\".ls 1
3890: .\".tp
3891: .\".sp 2i
3892: .\".in 0
3893: .\".ce 100
3894: .\".sz 24
3895: .\".b SENDMAIL
3896: .\".sz 14
3897: .\".sp
3898: .\"INSTALLATION AND OPERATION GUIDE
3899: .\".sp
3900: .\".sz 10
3901: .\"Eric Allman
3902: .\"Britton-Lee, Inc.
3903: .\".sp
3904: .\"Version 5.12
3905: .\".ce 0
3906: .pn 2
3907: .bp
3908: .ce
3909: .sz 12
3910: TABLE OF CONTENTS
3911: .sz 10
3912: .sp
3913: .\" remove some things to avoid "out of temp file space" problem
3914: .rm sh
3915: .rm (x
3916: .rm )x
3917: .rm ip
3918: .rm pp
3919: .rm lp
3920: .rm he
3921: .rm fo
3922: .rm eh
3923: .rm oh
3924: .rm ef
3925: .rm of
3926: .xp
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.