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