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