Commit | Line | Data |
---|---|---|
28719ec2 | 1 | .\" Copyright (c) 1983 Eric P. Allman |
3edcb7c8 | 2 | .\" Copyright (c) 1983 The Regents of the University of California. |
d312e734 | 3 | .\" All rights reserved. |
28719ec2 | 4 | .\" |
3edcb7c8 | 5 | .\" %sccs.include.redist.roff% |
28719ec2 | 6 | .\" |
399e2f78 | 7 | .\" @(#)op.me 6.51 (Berkeley) %G% |
28719ec2 | 8 | .\" |
55c435aa | 9 | .\" eqn op.me | pic | troff -me |
28719ec2 JB |
10 | .eh 'SMM:07-%''Sendmail Installation and Operation Guide' |
11 | .oh 'Sendmail Installation and Operation Guide''SMM:07-%' | |
55c435aa EA |
12 | .\" SD is lib if sendmail is installed in /usr/lib, sbin if in /usr/sbin |
13 | .ds SD sbin | |
4da134f8 EA |
14 | .nr si 3n |
15 | .de $0 | |
16 | .(x | |
2fb78b49 EA |
17 | .in \\$3u*3n |
18 | .ti -3n | |
4da134f8 EA |
19 | \\$2. \\$1 |
20 | .)x | |
21 | .. | |
69a914e1 EA |
22 | .de $C |
23 | .(x | |
24 | .in 0 | |
25 | \\$1 \\$2. \\$3 | |
26 | .)x | |
27 | .. | |
4da134f8 EA |
28 | .+c |
29 | .(l C | |
74b6e641 EA |
30 | .sz 16 |
31 | .b SENDMAIL | |
4da134f8 | 32 | .sz 12 |
74b6e641 EA |
33 | .sp |
34 | .b "INSTALLATION AND OPERATION GUIDE" | |
35 | .sz 10 | |
36 | .sp | |
4da134f8 | 37 | .r |
4da134f8 | 38 | Eric Allman |
d754edf0 EA |
39 | University of California, Berkeley |
40 | Mammoth Project | |
55c435aa | 41 | eric@CS.Berkeley.EDU |
69a914e1 | 42 | .sp |
399e2f78 | 43 | Version 6.51 |
18843c53 | 44 | .sp |
399e2f78 | 45 | For Sendmail Version 6.64 |
74b6e641 EA |
46 | .)l |
47 | .sp 2 | |
4da134f8 EA |
48 | .pp |
49 | .i Sendmail | |
69a914e1 EA |
50 | implements a general purpose internetwork mail routing facility |
51 | under the UNIX* | |
52 | .(f | |
53 | *UNIX is a trademark of Bell Laboratories. | |
54 | .)f | |
55 | operating system. | |
4da134f8 EA |
56 | It is not tied to any one transport protocol \*- |
57 | its function may be likened to a crossbar switch, | |
58 | relaying messages from one domain into another. | |
59 | In the process, | |
60 | it can do a limited amount of message header editing | |
61 | to put the message into a format that is appropriate | |
62 | for the receiving domain. | |
63 | All of this is done under the control of a configuration file. | |
64 | .pp | |
65 | Due to the requirements of flexibility | |
66 | for | |
67 | .i sendmail , | |
68 | the configuration file can seem somewhat unapproachable. | |
69 | However, there are only a few basic configurations | |
70 | for most sites, | |
71 | for which standard configuration files have been supplied. | |
72 | Most other configurations | |
73 | can be built by adjusting an existing configuration files | |
74 | incrementally. | |
75 | .pp | |
55c435aa | 76 | .i Sendmail |
f13b6b36 EA |
77 | is based on |
78 | RFC822 (Internet Mail Format Protocol), | |
79 | RFC821 (Simple Mail Transport Protocol), | |
475d7a3d | 80 | RFC1123 (Internet Host Requirements), |
f13b6b36 | 81 | and |
475d7a3d | 82 | RFC1425 (SMTP Service Extensions). |
f13b6b36 EA |
83 | However, since |
84 | .i sendmail | |
85 | is designed to work in a wider world, | |
86 | in many cases it can be configured to exceed these protocols. | |
87 | These cases are described herein. | |
55c435aa | 88 | .pp |
4da134f8 EA |
89 | Although |
90 | .i sendmail | |
91 | is intended to run | |
92 | without the need for monitoring, | |
93 | it has a number of features | |
94 | that may be used to monitor or adjust the operation | |
95 | under unusual circumstances. | |
96 | These features are described. | |
97 | .pp | |
98 | Section one describes how to do a basic | |
99 | .i sendmail | |
100 | installation. | |
101 | Section two | |
69a914e1 | 102 | explains the day-to-day information you should know |
4da134f8 EA |
103 | to maintain your mail system. |
104 | If you have a relatively normal site, | |
105 | these two sections should contain sufficient information | |
106 | for you to install | |
107 | .i sendmail | |
108 | and keep it happy. | |
109 | Section three | |
2fb78b49 EA |
110 | describes some parameters that may be safely tweaked. |
111 | Section four | |
112 | has information regarding the command line arguments. | |
113 | Section five | |
4da134f8 EA |
114 | contains the nitty-gritty information about the configuration |
115 | file. | |
116 | This section is for masochists | |
117 | and people who must write their own configuration file. | |
55c435aa EA |
118 | Section six |
119 | gives a brief description of differences | |
120 | in this version of | |
121 | .i sendmail . | |
4da134f8 EA |
122 | The appendixes give a brief |
123 | but detailed explanation of a number of features | |
124 | not described in the rest of the paper. | |
3dfefb78 | 125 | .bp 5 |
4da134f8 EA |
126 | .sh 1 "BASIC INSTALLATION" |
127 | .pp | |
55c435aa EA |
128 | .i |
129 | This section is a very rough rewrite; | |
130 | please don't assume that it is already completely correct. | |
131 | However, | |
132 | please send me suggestions so that later versions of this document | |
133 | can be more accurate. | |
134 | .pp | |
4da134f8 EA |
135 | There are two basic steps to installing sendmail. |
136 | The hard part is to build the configuration table. | |
137 | This is a file that sendmail reads when it starts up | |
138 | that describes the mailers it knows about, | |
139 | how to parse addresses, | |
140 | how to rewrite the message header, | |
141 | and the settings of various options. | |
142 | Although the configuration table is quite complex, | |
143 | a configuration can usually be built | |
144 | by adjusting an existing off-the-shelf configuration. | |
145 | The second part is actually doing the installation, | |
146 | i.e., creating the necessary files, etc. | |
147 | .pp | |
148 | The remainder of this section will describe the installation of sendmail | |
149 | assuming you can use one of the existing configurations | |
150 | and that the standard installation parameters are acceptable. | |
2fb78b49 EA |
151 | All pathnames and examples |
152 | are given from the root of the | |
153 | .i sendmail | |
318b7556 EA |
154 | subtree, |
155 | normally | |
55c435aa | 156 | .i /usr/src/usr.\*(SD/sendmail |
318b7556 | 157 | on 4.3BSD. |
4da134f8 | 158 | .pp |
55c435aa EA |
159 | If you are loading this off the tape, |
160 | continue with the next session. | |
161 | If you have a running binary already on your system, | |
162 | you should probably skip to section 1.2. | |
163 | .sh 2 "Compiling Sendmail" | |
f0b465a8 | 164 | .pp |
55c435aa EA |
165 | All sendmail source is in the |
166 | .i src | |
167 | subdirectory. | |
168 | If you are running on a 4.4BSD system, | |
169 | compile by typing | |
170 | .q make . | |
171 | On other systems, you may have to make some other adjustments. | |
172 | .sh 3 "Old versions of make" | |
173 | .pp | |
174 | If you are not running the new version of | |
175 | .b make | |
176 | you will probably have to use | |
69a914e1 | 177 | .(b |
d656ea51 | 178 | make \-f Makefile.dist |
69a914e1 | 179 | .)b |
55c435aa EA |
180 | This file does not assume several new syntaxes, |
181 | including the | |
182 | .q += | |
183 | syntax in macro definition | |
184 | and the | |
185 | .q ".include" | |
186 | syntax. | |
187 | .sh 3 "Compilation flags" | |
188 | .pp | |
189 | .i Sendmail | |
859d056a | 190 | supports two different formats |
55c435aa EA |
191 | for the |
192 | .i aliases | |
193 | database. | |
194 | These formats are: | |
d656ea51 | 195 | .nr ii 1i |
55c435aa | 196 | .ip NDBM |
859d056a EA |
197 | The ``new DBM'' format, |
198 | available on nearly all systems around today. | |
55c435aa EA |
199 | This was the preferred format prior to 4.4BSD. |
200 | It allows such complex things as multiple databases | |
201 | and closing a currently open database. | |
202 | .ip NEWDB | |
203 | The new database package from Berkeley. | |
204 | If you have this, use it. | |
205 | It allows | |
206 | long records, | |
207 | multiple open databases, | |
208 | real in-memory caching, | |
209 | and so forth. | |
210 | You can define this in conjunction with one of the other two; | |
211 | if you do, | |
212 | old databases are read, | |
213 | but when a new database is created it will be in NEWDB format. | |
214 | As a nasty hack, | |
d6f77a91 | 215 | if you have NEWDB, NDBM, and YPCOMPAT defined, |
55c435aa EA |
216 | and if the file |
217 | .i /var/yp/Makefile | |
218 | exists and is readable, | |
f0b465a8 | 219 | .i sendmail |
55c435aa EA |
220 | will create both new and old versions of the alias file |
221 | during a | |
222 | .i newalias | |
223 | command. | |
224 | This is required because the Sun NIS/YP system | |
225 | reads the DBM version of the alias file. | |
226 | It's ugly as sin, | |
227 | but it works. | |
228 | .lp | |
859d056a | 229 | If neither of these are defined, |
f0b465a8 | 230 | .i sendmail |
55c435aa EA |
231 | reads the alias file into memory on every invocation. |
232 | This can be slow and should be avoided. | |
233 | .pp | |
234 | System V based systems can define | |
235 | SYSTEM5 | |
236 | to make several small adjustments. | |
237 | This changes the handling of timezones | |
238 | and uses the much less efficient | |
239 | .i lockf | |
240 | call in preference to | |
241 | .i flock . | |
242 | These can be specified separately using the compilation flags | |
243 | SYS5TZ | |
244 | and | |
245 | LOCKF | |
246 | respectively. | |
de7324ac EA |
247 | .pp |
248 | If you don't have the | |
249 | .i unsetenv | |
250 | routine in your system library, define the UNSETENV compilation flag. | |
251 | .pp | |
252 | You may also have to define the compilation variable LA_TYPE | |
253 | to describe how your load average is computed. | |
859d056a | 254 | This and other flags are detailed in section 6.1. |
55c435aa EA |
255 | .sh 3 "Compilation and installation" |
256 | .pp | |
257 | After making the local system configuration described above, | |
258 | You should be able to compile and install the system. | |
259 | Compilation can be performed using | |
260 | .q make\** | |
261 | .(f | |
262 | \**where you may have to replace | |
263 | .q make | |
264 | with | |
265 | .q "make \-f Makefile.dist" | |
266 | as appropriate. | |
267 | .)f | |
268 | in the | |
269 | .b sendmail/src | |
270 | directory. | |
271 | You may be able to install using | |
69a914e1 | 272 | .(b |
18843c53 | 273 | make install |
69a914e1 | 274 | .)b |
55c435aa EA |
275 | This should install the binary in |
276 | /usr/\*(SD | |
277 | and create links from | |
278 | /usr/bin/newaliases | |
279 | and | |
280 | /usr/bin/mailq | |
281 | to | |
282 | /usr/\*(SD/sendmail. | |
283 | On BSD4.4 systems it will also format and install man pages. | |
284 | .sh 2 "Configuration Files" | |
285 | .pp | |
286 | .i Sendmail | |
287 | cannot operate without a configuration file. | |
288 | The configuration defines the mail systems understood at this site, | |
289 | how to access them, | |
290 | how to forward email to remote mail systems, | |
291 | and a number of tuning parameters. | |
292 | This configuration file is detailed | |
293 | in the later portion of this document. | |
294 | .pp | |
295 | The | |
296 | .i sendmail | |
297 | configuration can be daunting at first. | |
298 | The world is complex, | |
299 | and the mail configuration reflects that. | |
300 | The distribution includes an m4-based configuration package | |
301 | that hides a lot of the complexity. | |
302 | .pp | |
303 | These configuration files are simpler than old versions | |
304 | largely because the world has become simpler; | |
305 | in particular, | |
306 | text-based host files are officially eliminated, | |
307 | obviating the need to | |
308 | .q hide | |
309 | hosts behind a registered internet gateway. | |
310 | .pp | |
311 | These files also assume that most of your neighbors | |
312 | use domain-based UUCP addressing; | |
313 | that is, | |
314 | instead of naming hosts as | |
315 | .q host!user | |
316 | they will use | |
317 | .q host.domain!user . | |
318 | The configuration files can be customized to work around this, | |
319 | but it is more complex. | |
320 | .pp | |
321 | I haven't tested these yet on an isolated LAN environment | |
322 | with a single UUCP connection to the outside world. | |
323 | If you are in such an environment, | |
324 | please send comments to | |
325 | sendmail@okeeffe.CS.Berkeley.EDU. | |
326 | .pp | |
327 | Our configuration files are processed by | |
328 | .i m4 | |
329 | to facilitate local customization; | |
330 | the directory | |
331 | .i cf | |
332 | of the | |
333 | sendmail | |
334 | distribution directory | |
335 | contains the source files. | |
336 | This directory contains several subdirectories: | |
337 | .nr ii 1i | |
338 | .ip cf | |
339 | Both site-dependent and site-independent descriptions of hosts. | |
340 | These can be literal host names | |
341 | (e.g., | |
342 | .q ucbvax.mc ) | |
343 | when the hosts are gateways | |
344 | or more general descriptions | |
345 | (such as | |
346 | .q "tcpproto.mc" | |
347 | as a general description of an SMTP-connected host | |
348 | or | |
349 | .q "uucpproto.mc" | |
350 | as a general description of a UUCP-connected host). | |
351 | Files ending | |
352 | .b \&.mc | |
353 | (``Master Configuration'') | |
354 | are the input descriptions; | |
355 | the output is in the corresponding | |
356 | .b \&.cf | |
357 | file. | |
358 | The general structure of these files is described below. | |
359 | .ip domain | |
360 | Site-dependent subdomain descriptions. | |
361 | These are tied to the way your organization wants to do addressing. | |
362 | For example, | |
363 | .b domain/cs.exposed.m4 | |
364 | is our description for hosts in the CS.Berkeley.EDU subdomain | |
365 | that want their individual hostname to be externally visible; | |
366 | .b domain/cs.hidden.m4 | |
367 | is the same except that the hostname is hidden | |
368 | (everything looks like it comes from CS.Berkeley.EDU). | |
369 | These are referenced using the | |
370 | .sm DOMAIN | |
371 | .b m4 | |
372 | macro in the | |
373 | .b \&.mc | |
374 | file. | |
375 | .ip feature | |
376 | Definitions of specific features that some particular host in your site | |
377 | might want. | |
378 | These are referenced using the | |
379 | .sm FEATURE | |
380 | .b m4 | |
381 | macro. | |
093461e4 | 382 | An example feature is |
d656ea51 EA |
383 | use_cw_file |
384 | (which tells sendmail to read an /etc/sendmail.cw file on startup | |
385 | to find the set of local names). | |
55c435aa EA |
386 | .ip hack |
387 | Local hacks, referenced using the | |
388 | .sm HACK | |
389 | .b m4 | |
390 | macro. | |
391 | Try to avoid these. | |
392 | The point of having them here is to make it clear that they smell. | |
393 | .ip m4 | |
394 | Site-independent | |
395 | .i m4 (1) | |
396 | include files that have information common to all configuration files. | |
397 | This can be thought of as a | |
398 | .q #include | |
399 | directory. | |
400 | .ip mailer | |
401 | Definitions of mailers, | |
402 | referenced using the | |
403 | .sm MAILER | |
404 | .b m4 | |
405 | macro. | |
d656ea51 | 406 | Defined mailer types in this distribution are |
475d7a3d | 407 | fax, |
d656ea51 EA |
408 | local, |
409 | smtp, | |
475d7a3d EA |
410 | uucp, |
411 | and usenet. | |
55c435aa EA |
412 | .ip ostype |
413 | Definitions describing various operating system environments | |
414 | (such as the location of support files). | |
415 | These are referenced using the | |
416 | .sm OSTYPE | |
417 | .b m4 | |
418 | macro. | |
419 | .ip sh | |
420 | Shell files used by the | |
421 | .b m4 | |
422 | build process. | |
423 | You shouldn't have to mess with these. | |
424 | .ip siteconfig | |
425 | Local site configuration information, | |
426 | such as UUCP connectivity. | |
d656ea51 EA |
427 | They normally contain lists of site information, for example: |
428 | .(b | |
429 | SITE(contessa) | |
430 | SITE(hoptoad) | |
431 | SITE(nkainc) | |
432 | SITE(well) | |
433 | .)b | |
434 | They are referenced using the SITECONFIG macro: | |
435 | .(b | |
436 | SITECONFIG(site.config.file, name_of_site, X) | |
437 | .)b | |
438 | where | |
439 | .i X | |
440 | is the macro/class name to use. | |
441 | It can be U | |
442 | (indicating locally connected hosts) | |
443 | or one of W, X, or Y | |
444 | for up to three remote UUCP hubs. | |
55c435aa EA |
445 | .pp |
446 | If you are in a new domain | |
447 | (e.g., a company), | |
448 | you will probably want to create a | |
449 | cf/domain | |
450 | file for your domain. | |
451 | This consists primarily of relay definitions: | |
452 | for example, Berkeley's domain definition | |
453 | defines relays for | |
454 | BitNET, | |
455 | CSNET, | |
456 | and UUCP. | |
457 | Of these, | |
458 | only the UUCP relay is particularly specific | |
459 | to Berkeley. | |
460 | All of these are internet-style domain names. | |
461 | Please check to make certain they are reasonable for your domain. | |
462 | .pp | |
463 | Subdomains at Berkeley are also represented in the | |
464 | cf/domain | |
465 | directory. | |
466 | For example, | |
467 | the domain | |
468 | cs-exposed | |
469 | is the Computer Science subdomain with the local hostname shown | |
470 | to other users; | |
471 | cs-hidden | |
472 | makes users appear to be from the CS.Berkeley.EDU subdomain | |
473 | (with no local host information included). | |
474 | You will probably have to update this directory | |
475 | to be appropriate for your domain. | |
d656ea51 EA |
476 | .pp |
477 | You will have to use or create | |
478 | .b \&.mc | |
479 | files in the | |
480 | .i cf/cf | |
481 | subdirectory for your hosts. | |
482 | This is detailed in the | |
483 | cf/README | |
484 | file. | |
55c435aa EA |
485 | .sh 2 "Details of Installation Files" |
486 | .pp | |
487 | This subsection describes the files that | |
488 | comprise the | |
489 | sendmail | |
490 | installation. | |
491 | .sh 3 "/usr/\*(SD/sendmail" | |
492 | .pp | |
493 | The binary for sendmail is located in /usr/\*(SD\**. | |
494 | .(f | |
495 | \**This is usually | |
496 | /usr/sbin | |
497 | on 4.4BSD and newer systems; | |
498 | many systems install it in | |
499 | /usr/lib. | |
500 | I understand it is in /usr/ucblib | |
501 | on System V Release 4. | |
502 | .)f | |
d656ea51 EA |
503 | It should be setuid root. |
504 | For security reasons, | |
505 | /, /usr, and /usr/\*(SD | |
506 | should be owned by root, mode 755\**. | |
507 | .(f | |
508 | \**Some vendors ship them owned by bin; | |
509 | this creates a security hole that is not actually related to | |
510 | .i sendmail . | |
511 | Other important directories that should have restrictive ownerships | |
512 | and permissions are | |
513 | /bin, /usr/bin, /etc, /usr/etc, /lib, and /usr/lib. | |
514 | .)f | |
daae36f7 | 515 | .sh 3 "/etc/sendmail.cf" |
f0b465a8 | 516 | .pp |
55c435aa EA |
517 | This is the configuration file for sendmail. |
518 | This and the frozen configuration file | |
519 | are the only two non-library file names compiled into sendmail\**. | |
520 | .(f | |
521 | \**The system libraries can reference other files; | |
522 | in particular, system library subroutines that | |
523 | sendmail | |
524 | calls probably reference | |
525 | .i /etc/passwd | |
526 | and | |
527 | .i /etc/resolv.conf . | |
528 | .)f | |
529 | Some older systems install it in | |
530 | .b /usr/lib/sendmail.cf . | |
531 | .pp | |
532 | If you want to move this file, | |
533 | change | |
534 | .i src/pathnames.h . | |
535 | .pp | |
536 | The configuration file is normally created | |
537 | using the distribution files described above. | |
538 | If you have a particularly unusual system configuration | |
539 | you may need to create a special version. | |
540 | The format of this file is detailed in later sections | |
541 | of this document. | |
2fb78b49 EA |
542 | .sh 3 "/usr/ucb/newaliases" |
543 | .pp | |
544 | If you are running delivermail, | |
545 | it is critical that the | |
546 | .i newaliases | |
547 | command be replaced. | |
548 | This can just be a link to | |
549 | .i sendmail : | |
550 | .(b | |
74b6e641 | 551 | rm \-f /usr/ucb/newaliases |
55c435aa | 552 | ln /usr/\*(SD/sendmail /usr/ucb/newaliases |
2fb78b49 | 553 | .)b |
55c435aa EA |
554 | This can be installed in whatever search path you prefer |
555 | for your system. | |
daae36f7 | 556 | .sh 3 "/var/spool/mqueue" |
4da134f8 EA |
557 | .pp |
558 | The directory | |
daae36f7 | 559 | .i /var/spool/mqueue |
4da134f8 | 560 | should be created to hold the mail queue. |
d656ea51 | 561 | This directory should be mode 700 |
18843c53 | 562 | and owned by root. |
55c435aa EA |
563 | .pp |
564 | The actual path of this directory | |
565 | is defined in the | |
566 | .b Q | |
567 | option of the | |
568 | .i sendmail.cf | |
569 | file. | |
daae36f7 | 570 | .sh 3 "/etc/aliases*" |
69a914e1 | 571 | .pp |
55c435aa EA |
572 | The system aliases are held in |
573 | .q /etc/aliases . | |
69a914e1 EA |
574 | A sample is given in |
575 | .q lib/aliases | |
576 | which includes some aliases which | |
577 | .i must | |
578 | be defined: | |
579 | .(b | |
daae36f7 | 580 | cp lib/aliases /etc/aliases |
55c435aa | 581 | .i "edit /etc/aliases" |
69a914e1 EA |
582 | .)b |
583 | You should extend this file with any aliases that are apropos to your system. | |
584 | .pp | |
585 | Normally | |
586 | .i sendmail | |
587 | looks at a version of these files maintained by the | |
74b6e641 | 588 | .i dbm \|(3) |
f13b6b36 EA |
589 | or |
590 | .i db \|(3) | |
69a914e1 | 591 | routines. |
f13b6b36 | 592 | These are stored either in |
daae36f7 | 593 | .q /etc/aliases.dir |
69a914e1 | 594 | and |
55c435aa | 595 | .q /etc/aliases.pag |
f13b6b36 EA |
596 | or |
597 | .q /etc/aliases.db | |
598 | depending on which database package you are using. | |
69a914e1 EA |
599 | These can initially be created as empty files, |
600 | but they will have to be initialized promptly. | |
18843c53 | 601 | These should be mode 644: |
69a914e1 | 602 | .(b |
daae36f7 EA |
603 | cp /dev/null /etc/aliases.dir |
604 | cp /dev/null /etc/aliases.pag | |
605 | chmod 644 /etc/aliases.* | |
74b6e641 | 606 | newaliases |
69a914e1 | 607 | .)b |
f13b6b36 EA |
608 | The |
609 | .i db | |
610 | routines preset the mode reasonably, | |
611 | so this step can be skipped. | |
55c435aa EA |
612 | The actual path of this file |
613 | is defined in the | |
614 | .b A | |
615 | option of the | |
616 | .i sendmail.cf | |
617 | file. | |
daae36f7 | 618 | .sh 3 "/etc/sendmail.fc" |
69a914e1 EA |
619 | .pp |
620 | If you intend to install the frozen version of the configuration file | |
621 | (for quick startup) | |
daae36f7 | 622 | you should create the file /etc/sendmail.fc |
69a914e1 EA |
623 | and initialize it. |
624 | This step may be safely skipped. | |
625 | .(b | |
daae36f7 | 626 | cp /dev/null /etc/sendmail.fc |
d656ea51 EA |
627 | chmod 644 /etc/sendmail.fc |
628 | /usr/\*(SD/sendmail \-bz | |
69a914e1 | 629 | .)b |
f13b6b36 EA |
630 | In general, freeze files are not worth doing |
631 | unless your disks are much faster than your CPU; | |
632 | this is seldom true any more. | |
09ac6be2 EA |
633 | .pp |
634 | If your | |
635 | .i sendmail | |
636 | was not compiled with | |
637 | .sm FROZENCONFIG | |
638 | defined, the | |
639 | .b \-bz | |
640 | flag will be ignored. | |
4da134f8 EA |
641 | .sh 3 "/etc/rc" |
642 | .pp | |
643 | It will be necessary to start up the sendmail daemon when your system reboots. | |
644 | This daemon performs two functions: | |
645 | it listens on the SMTP socket for connections | |
646 | (to receive mail from a remote system) | |
647 | and it processes the queue periodically | |
648 | to insure that mail gets delivered when hosts come up. | |
649 | .pp | |
650 | Add the following lines to | |
69a914e1 | 651 | .q /etc/rc |
4da134f8 | 652 | (or |
69a914e1 | 653 | .q /etc/rc.local |
4da134f8 EA |
654 | as appropriate) |
655 | in the area where it is starting up the daemons: | |
656 | .(b | |
d656ea51 | 657 | if [ \-f /usr/\*(SD/sendmail \-a \-f /etc/sendmail.cf ]; then |
daae36f7 | 658 | (cd /var/spool/mqueue; rm \-f [lnx]f*) |
55c435aa | 659 | /usr/\*(SD/sendmail \-bd \-q30m & |
4da134f8 EA |
660 | echo \-n ' sendmail' >/dev/console |
661 | fi | |
662 | .)b | |
663 | The | |
664 | .q cd | |
665 | and | |
666 | .q rm | |
667 | commands insure that all lock files have been removed; | |
668 | extraneous lock files may be left around | |
669 | if the system goes down in the middle of processing a message. | |
670 | The line that actually invokes | |
671 | .i sendmail | |
672 | has two flags: | |
673 | .q \-bd | |
674 | causes it to listen on the SMTP port, | |
675 | and | |
bff69eb1 EA |
676 | .q \-q30m |
677 | causes it to run the queue every half hour. | |
69a914e1 | 678 | .pp |
09ac6be2 EA |
679 | Some people use a more complex startup script, |
680 | removing zero length qf files and df files for which there is no qf file. | |
681 | For example: | |
682 | .(b | |
683 | # remove zero length qf files | |
684 | for qffile in qf* | |
685 | do | |
686 | if [ \-r $qffile ] | |
687 | then | |
688 | if [ ! \-s $qffile ] | |
689 | then | |
690 | echo \-n " <zero: $qffile>" > /dev/console | |
691 | rm \-f $qffile | |
692 | fi | |
693 | fi | |
694 | done | |
695 | # rename tf files to be qf if the qf does not exist | |
696 | for tffile in tf* | |
697 | do | |
698 | qffile=`echo $tffile | sed 's/t/q/'` | |
699 | if [ \-r $tffile \-a ! \-f $qffile ] | |
700 | then | |
701 | echo \-n " <recovering: $tffile>" > /dev/console | |
702 | mv $tffile $qffile | |
703 | else | |
704 | echo \-n " <extra: $tffile>" > /dev/console | |
705 | rm \-f $tffile | |
706 | fi | |
707 | done | |
708 | # remove bogus qf files | |
709 | for dffile in df* | |
710 | do | |
711 | qffile=`echo $dffile | sed 's/d/q/'` | |
712 | if [ \-r $dffile \-a ! \-f $qffile ] | |
713 | then | |
714 | echo \-n " <incomplete: $dffile>" > /dev/console | |
715 | rm \-f $dffile | |
716 | fi | |
717 | done | |
718 | fi | |
719 | .)b | |
720 | .pp | |
69a914e1 EA |
721 | If you are not running a version of UNIX |
722 | that supports Berkeley TCP/IP, | |
723 | do not include the | |
724 | .b \-bd | |
725 | flag. | |
726 | .sh 3 "/usr/lib/sendmail.hf" | |
727 | .pp | |
728 | This is the help file used by the SMTP | |
729 | .b HELP | |
730 | command. | |
731 | It should be copied from | |
732 | .q lib/sendmail.hf : | |
733 | .(b | |
734 | cp lib/sendmail.hf /usr/lib | |
735 | .)b | |
55c435aa EA |
736 | The actual path of this file |
737 | is defined in the | |
738 | .b H | |
739 | option of the | |
740 | .i sendmail.cf | |
741 | file. | |
daae36f7 | 742 | .sh 3 "/etc/sendmail.st" |
69a914e1 EA |
743 | .pp |
744 | If you wish to collect statistics | |
745 | about your mail traffic, | |
746 | you should create the file | |
daae36f7 | 747 | .q /etc/sendmail.st : |
2fb78b49 | 748 | .(b |
daae36f7 EA |
749 | cp /dev/null /etc/sendmail.st |
750 | chmod 666 /etc/sendmail.st | |
2fb78b49 | 751 | .)b |
69a914e1 EA |
752 | This file does not grow. |
753 | It is printed with the program | |
55c435aa EA |
754 | .q mailstats/mailstats.c. |
755 | The actual path of this file | |
756 | is defined in the | |
757 | .b S | |
758 | option of the | |
759 | .i sendmail.cf | |
760 | file. | |
3f83c754 EA |
761 | .sh 3 "/usr/ucb/newaliases" |
762 | .pp | |
763 | If | |
764 | .i sendmail | |
765 | is invoked as | |
766 | .q newaliases, | |
767 | it will simulate the | |
768 | .b \-bi | |
769 | flag | |
770 | (i.e., will rebuild the alias database; | |
771 | see below). | |
55c435aa | 772 | This should be a link to /usr/\*(SD/sendmail. |
3f83c754 EA |
773 | .sh 3 "/usr/ucb/mailq" |
774 | .pp | |
775 | If | |
776 | .i sendmail | |
777 | is invoked as | |
778 | .q mailq, | |
779 | it will simulate the | |
780 | .b \-bp | |
781 | flag | |
782 | (i.e., | |
783 | .i sendmail | |
784 | will print the contents of the mail queue; | |
785 | see below). | |
55c435aa | 786 | This should be a link to /usr/\*(SD/sendmail. |
4da134f8 | 787 | .sh 1 "NORMAL OPERATIONS" |
6d5ff626 | 788 | .sh 2 "``Quick'' Configuration Startup" |
817683ae | 789 | .pp |
56ba89fb EA |
790 | if the |
791 | .sm FROZENCONFIG | |
792 | option is included during compilation, | |
793 | a precompiled (``frozen'') version of the configuration file | |
6d5ff626 | 794 | can be created using the |
b16e27c4 | 795 | .b \-bz |
6d5ff626 EA |
796 | flag. |
797 | This is really only worthwhile doing | |
798 | if you are on a slow processor with a relatively fast I/O system | |
799 | (a VAX 11/750 is a good example). | |
800 | Since it creates other problems, | |
801 | I recommend against using the frozen configuration | |
802 | on most current architectures. | |
803 | .pp | |
804 | To create the freeze file, use | |
817683ae | 805 | .(b |
55c435aa | 806 | /usr/\*(SD/sendmail \-bz |
817683ae | 807 | .)b |
6d5ff626 EA |
808 | This creates the frozen configuration file |
809 | .i /etc/sendmail.fc . | |
817683ae EA |
810 | This file is an image of |
811 | .i sendmail 's | |
812 | data space after reading in the configuration file. | |
813 | If this file exists, | |
814 | it is used instead of | |
daae36f7 | 815 | .i /etc/sendmail.cf |
69a914e1 EA |
816 | .i sendmail.fc |
817 | must be rebuilt manually every time | |
817683ae EA |
818 | .i sendmail.cf |
819 | is changed. | |
820 | .pp | |
69a914e1 | 821 | The frozen configuration file will be ignored |
817683ae EA |
822 | if a |
823 | .b \-C | |
824 | flag is specified | |
825 | or if sendmail detects that it is out of date. | |
826 | However, the heuristics are not strong | |
827 | so this should not be trusted. | |
4da134f8 EA |
828 | .sh 2 "The System Log" |
829 | .pp | |
830 | The system log is supported by the | |
367a5dcd | 831 | .i syslogd \|(8) |
4da134f8 EA |
832 | program. |
833 | .sh 3 "Format" | |
834 | .pp | |
835 | Each line in the system log | |
836 | consists of a timestamp, | |
837 | the name of the machine that generated it | |
838 | (for logging from several machines | |
18843c53 | 839 | over the local area network), |
4da134f8 EA |
840 | the word |
841 | .q sendmail: , | |
842 | and a message. | |
843 | .sh 3 "Levels" | |
844 | .pp | |
69a914e1 | 845 | If you have |
367a5dcd | 846 | .i syslogd \|(8) |
69a914e1 EA |
847 | or an equivalent installed, |
848 | you will be able to do logging. | |
849 | There is a large amount of information that can be logged. | |
850 | The log is arranged as a succession of levels. | |
851 | At the lowest level | |
852 | only extremely strange situations are logged. | |
853 | At the highest level, | |
854 | even the most mundane and uninteresting events | |
855 | are recorded for posterity. | |
856 | As a convention, | |
857 | log levels under ten | |
6ebbc09a | 858 | are considered generally |
69a914e1 | 859 | .q useful; |
6ebbc09a EA |
860 | log levels above 64 |
861 | are reserved for debugging purposes. | |
862 | Levels from 11\-64 are reserved for verbose information | |
863 | that some sites might want. | |
69a914e1 EA |
864 | .pp |
865 | A complete description of the log levels | |
367a5dcd | 866 | is given in section 4.6. |
4da134f8 EA |
867 | .sh 2 "The Mail Queue" |
868 | .pp | |
869 | The mail queue should be processed transparently. | |
870 | However, you may find that manual intervention is sometimes necessary. | |
871 | For example, | |
872 | if a major host is down for a period of time | |
873 | the queue may become clogged. | |
874 | Although sendmail ought to recover gracefully when the host comes up, | |
875 | you may find performance unacceptably bad in the meantime. | |
3f83c754 EA |
876 | .sh 3 "Printing the queue" |
877 | .pp | |
878 | The contents of the queue can be printed | |
879 | using the | |
74b6e641 EA |
880 | .i mailq |
881 | command | |
882 | (or by specifying the | |
3f83c754 | 883 | .b \-bp |
74b6e641 | 884 | flag to sendmail): |
3f83c754 | 885 | .(b |
74b6e641 | 886 | mailq |
3f83c754 EA |
887 | .)b |
888 | This will produce a listing of the queue id's, | |
889 | the size of the message, | |
890 | the date the message entered the queue, | |
891 | and the sender and recipients. | |
4da134f8 EA |
892 | .sh 3 "Forcing the queue" |
893 | .pp | |
894 | .i Sendmail | |
895 | should run the queue automatically | |
896 | at intervals. | |
897 | The algorithm is to read and sort the queue, | |
898 | and then to attempt to process all jobs in order. | |
899 | When it attempts to run the job, | |
900 | .i sendmail | |
901 | first checks to see if the job is locked. | |
902 | If so, it ignores the job. | |
903 | .pp | |
904 | There is no attempt to insure that only one queue processor | |
905 | exists at any time, | |
906 | since there is no guarantee that a job cannot take forever | |
f13b6b36 EA |
907 | to process |
908 | (however, | |
909 | .i sendmail | |
910 | does include heuristics to try to abort jobs | |
911 | that are taking absurd amounts of time; | |
912 | technically, this violates RFC 821, but is blessed by RFC 1123). | |
4da134f8 | 913 | Due to the locking algorithm, |
f13b6b36 | 914 | it is impossible for one job to freeze the entire queue. |
4da134f8 EA |
915 | However, |
916 | an uncooperative recipient host | |
917 | or a program recipient | |
918 | that never returns | |
919 | can accumulate many processes in your system. | |
920 | Unfortunately, | |
f13b6b36 | 921 | there is no completely general way to solve this. |
4da134f8 EA |
922 | .pp |
923 | In some cases, | |
924 | you may find that a major host going down | |
925 | for a couple of days | |
926 | may create a prohibitively large queue. | |
927 | This will result in | |
928 | .i sendmail | |
929 | spending an inordinate amount of time | |
930 | sorting the queue. | |
931 | This situation can be fixed by moving the queue to a temporary place | |
932 | and creating a new queue. | |
933 | The old queue can be run later when the offending host returns to service. | |
934 | .pp | |
935 | To do this, | |
936 | it is acceptable to move the entire queue directory: | |
937 | .(b | |
daae36f7 | 938 | cd /var/spool |
d656ea51 | 939 | mv mqueue omqueue; mkdir mqueue; chmod 700 mqueue |
4da134f8 EA |
940 | .)b |
941 | You should then kill the existing daemon | |
942 | (since it will still be processing in the old queue directory) | |
943 | and create a new daemon. | |
944 | .pp | |
945 | To run the old mail queue, | |
946 | run the following command: | |
947 | .(b | |
55c435aa | 948 | /usr/\*(SD/sendmail \-oQ/var/spool/omqueue \-q |
4da134f8 EA |
949 | .)b |
950 | The | |
2fb78b49 | 951 | .b \-oQ |
4da134f8 EA |
952 | flag specifies an alternate queue directory |
953 | and the | |
954 | .b \-q | |
955 | flag says to just run every job in the queue. | |
956 | If you have a tendency toward voyeurism, | |
957 | you can use the | |
958 | .b \-v | |
959 | flag to watch what is going on. | |
960 | .pp | |
961 | When the queue is finally emptied, | |
962 | you can remove the directory: | |
963 | .(b | |
daae36f7 | 964 | rmdir /var/spool/omqueue |
4da134f8 EA |
965 | .)b |
966 | .sh 2 "The Alias Database" | |
967 | .pp | |
968 | The alias database exists in two forms. | |
969 | One is a text form, | |
970 | maintained in the file | |
daae36f7 | 971 | .i /etc/aliases. |
4da134f8 EA |
972 | The aliases are of the form |
973 | .(b | |
974 | name: name1, name2, ... | |
975 | .)b | |
976 | Only local names may be aliased; | |
977 | e.g., | |
978 | .(b | |
daae36f7 | 979 | eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU |
4da134f8 EA |
980 | .)b |
981 | will not have the desired effect. | |
982 | Aliases may be continued by starting any continuation lines | |
983 | with a space or a tab. | |
984 | Blank lines and lines beginning with a sharp sign | |
985 | (\c | |
986 | .q # ) | |
987 | are comments. | |
988 | .pp | |
989 | The second form is processed by the | |
74b6e641 | 990 | .i dbm \|(3) |
f13b6b36 EA |
991 | (or |
992 | .i db \|(3)) | |
4da134f8 EA |
993 | library. |
994 | This form is in the files | |
daae36f7 | 995 | .i /etc/aliases.dir |
4da134f8 | 996 | and |
daae36f7 | 997 | .i /etc/aliases.pag. |
4da134f8 EA |
998 | This is the form that |
999 | .i sendmail | |
1000 | actually uses to resolve aliases. | |
1001 | This technique is used to improve performance. | |
d6f77a91 EA |
1002 | .pp |
1003 | You can also use | |
1004 | .sm NIS -based | |
1005 | alias files. | |
1006 | For example, the specification: | |
1007 | .(b | |
1008 | OA/etc/aliases | |
1009 | OAnis:mail.aliases@my.nis.domain | |
1010 | .)b | |
1011 | will first search the /etc/aliases file | |
1012 | and then the map named | |
1013 | .q mail.aliases | |
1014 | in | |
1015 | .q my.nis.domain . | |
4da134f8 EA |
1016 | .sh 3 "Rebuilding the alias database" |
1017 | .pp | |
d6f77a91 | 1018 | The DB or DBM version of the database |
4da134f8 EA |
1019 | may be rebuilt explicitly by executing the command |
1020 | .(b | |
74b6e641 EA |
1021 | newaliases |
1022 | .)b | |
1023 | This is equivalent to giving | |
1024 | .i sendmail | |
1025 | the | |
1026 | .b \-bi | |
1027 | flag: | |
1028 | .(b | |
55c435aa | 1029 | /usr/\*(SD/sendmail \-bi |
4da134f8 EA |
1030 | .)b |
1031 | .pp | |
69a914e1 EA |
1032 | If the |
1033 | .q D | |
1034 | option is specified in the configuration, | |
4da134f8 | 1035 | .i sendmail |
69a914e1 EA |
1036 | will rebuild the alias database automatically |
1037 | if possible | |
1038 | when it is out of date. | |
69a914e1 EA |
1039 | Auto-rebuild can be dangerous |
1040 | on heavily loaded machines | |
b16e27c4 EA |
1041 | with large alias files; |
1042 | if it might take more than five minutes | |
1043 | to rebuild the database, | |
1044 | there is a chance that several processes will start the rebuild process | |
1045 | simultaneously. | |
d6f77a91 EA |
1046 | .pp |
1047 | If you have multiple aliases databases specified, | |
1048 | the | |
1049 | .b \-bi | |
1050 | flag rebuilds all the database types it understands | |
1051 | (for example, it can rebuild dbm databases but not nis databases). | |
69a914e1 | 1052 | .sh 3 "Potential problems" |
4da134f8 EA |
1053 | .pp |
1054 | There are a number of problems that can occur | |
1055 | with the alias database. | |
1056 | They all result from a | |
1057 | .i sendmail | |
1058 | process accessing the DBM version | |
1059 | while it is only partially built. | |
1060 | This can happen under two circumstances: | |
1061 | One process accesses the database | |
1062 | while another process is rebuilding it, | |
1063 | or the process rebuilding the database dies | |
1064 | (due to being killed or a system crash) | |
1065 | before completing the rebuild. | |
1066 | .pp | |
1067 | Sendmail has two techniques to try to relieve these problems. | |
1068 | First, it ignores interrupts while rebuilding the database; | |
1069 | this avoids the problem of someone aborting the process | |
1070 | leaving a partially rebuilt database. | |
1071 | Second, | |
1072 | at the end of the rebuild | |
1073 | it adds an alias of the form | |
1074 | .(b | |
1075 | @: @ | |
1076 | .)b | |
1077 | (which is not normally legal). | |
1078 | Before sendmail will access the database, | |
69a914e1 EA |
1079 | it checks to insure that this entry exists\**. |
1080 | .(f | |
1081 | \**The | |
1082 | .q a | |
1083 | option is required in the configuration | |
1084 | for this action to occur. | |
1085 | This should normally be specified | |
1086 | unless you are running | |
1087 | .i delivermail | |
1088 | in parallel with | |
1089 | .i sendmail. | |
1090 | .)f | |
631e7688 EA |
1091 | .sh 3 "List owners" |
1092 | .pp | |
1093 | If an error occurs on sending to a certain address, | |
1094 | say | |
1095 | .q \fIx\fP , | |
1096 | .i sendmail | |
1097 | will look for an alias | |
1098 | of the form | |
1099 | .q owner-\fIx\fP | |
1100 | to receive the errors. | |
1101 | This is typically useful | |
1102 | for a mailing list | |
1103 | where the submitter of the list | |
28719ec2 | 1104 | has no control over the maintenance of the list itself; |
631e7688 EA |
1105 | in this case the list maintainer would be the owner of the list. |
1106 | For example: | |
1107 | .(b | |
69a914e1 EA |
1108 | unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser, |
1109 | sam@matisse | |
631e7688 EA |
1110 | owner-unix-wizards: eric@ucbarpa |
1111 | .)b | |
1112 | would cause | |
1113 | .q eric@ucbarpa | |
1114 | to get the error that will occur | |
1115 | when someone sends to | |
1116 | unix-wizards | |
1117 | due to the inclusion of | |
1118 | .q nosuchuser | |
1119 | on the list. | |
f90dac5e EA |
1120 | .pp |
1121 | List owners also cause the envelope sender address to be modified. | |
1122 | The contents of the owner alias are used if they point to a single user, | |
1123 | otherwise the name of the alias itself is used. | |
1124 | For this reason, and to obey Internet conventions, | |
1125 | a typical scheme would be: | |
1126 | .(b | |
1127 | list: some, set, of, addresses | |
1128 | list-request: list, administrators | |
1129 | owner-list: list-request | |
1130 | .)b | |
daae36f7 EA |
1131 | .sh 2 "User Information Database" |
1132 | .pp | |
1133 | If you have a version of | |
1134 | .i sendmail | |
1135 | with the user information database | |
1136 | compiled in, | |
1137 | and you have specified one or more databases using the | |
1138 | .b U | |
1139 | option, | |
1140 | the databases will be searched for a | |
1141 | .i user :maildrop | |
1142 | entry. | |
1143 | If found, the mail will be sent to the specified address. | |
1144 | .pp | |
1145 | If the first token passed to user part of the | |
1146 | .q local | |
1147 | mailer is an at sign, | |
1148 | the at sign will be stripped off | |
1149 | and this step will be skipped. | |
2fb78b49 | 1150 | .sh 2 "Per-User Forwarding (.forward Files)" |
4da134f8 | 1151 | .pp |
2fb78b49 EA |
1152 | As an alternative to the alias database, |
1153 | any user may put a file with the name | |
1154 | .q .forward | |
1155 | in his or her home directory. | |
1156 | If this file exists, | |
1157 | .i sendmail | |
1158 | redirects mail for that user | |
1159 | to the list of addresses listed in the .forward file. | |
1160 | For example, if the home directory for user | |
1161 | .q mckusick | |
1162 | has a .forward file with contents: | |
1163 | .(b | |
1164 | mckusick@ernie | |
1165 | kirk@calder | |
1166 | .)b | |
1167 | then any mail arriving for | |
1168 | .q mckusick | |
1169 | will be redirected to the specified accounts. | |
f13b6b36 EA |
1170 | .pp |
1171 | Actually, the configuration file defines a sequence of filenames to check. | |
1172 | By default, this is the user's .forward file, | |
1173 | but can be defined to be more generally using the | |
1174 | .b J | |
1175 | option. | |
1176 | If you change this, | |
1177 | you will have to inform your user base of the change; | |
1178 | \&.forward is pretty well incorporated into the collective subconscious. | |
2fb78b49 | 1179 | .sh 2 "Special Header Lines" |
4da134f8 | 1180 | .pp |
2fb78b49 EA |
1181 | Several header lines have special interpretations |
1182 | defined by the configuration file. | |
1183 | Others have interpretations built into | |
4da134f8 | 1184 | .i sendmail |
2fb78b49 EA |
1185 | that cannot be changed without changing the code. |
1186 | These builtins are described here. | |
bff69eb1 | 1187 | .sh 3 "Return-Receipt-To:" |
4da134f8 | 1188 | .pp |
2fb78b49 EA |
1189 | If this header is sent, |
1190 | a message will be sent to any specified addresses | |
318b7556 EA |
1191 | when the final delivery is complete, |
1192 | that is, | |
1193 | when successfully delivered to a mailer with the | |
2fb78b49 | 1194 | .b l |
bff69eb1 EA |
1195 | flag (local delivery) set in the mailer descriptor. |
1196 | .sh 3 "Errors-To:" | |
4da134f8 | 1197 | .pp |
2fb78b49 EA |
1198 | If errors occur anywhere during processing, |
1199 | this header will cause error messages to go to | |
50d4a65c | 1200 | the listed addresses. |
2fb78b49 | 1201 | This is intended for mailing lists. |
859d056a EA |
1202 | .pp |
1203 | The Errors-To: header was created in the bad old days | |
1204 | when UUCP didn't understand the distinction between an envelope and a header; | |
1205 | this was a hack to provide what should now be passed | |
1206 | as the envelope sender address. | |
1207 | It should go away. | |
399e2f78 EA |
1208 | It is only used if the |
1209 | .b l | |
1210 | option is set. | |
bff69eb1 | 1211 | .sh 3 "Apparently-To:" |
4da134f8 | 1212 | .pp |
2fb78b49 EA |
1213 | If a message comes in with no recipients listed in the message |
1214 | (in a To:, Cc:, or Bcc: line) | |
1215 | then | |
1216 | .i sendmail | |
1217 | will add an | |
1218 | .q "Apparently-To:" | |
1219 | header line for any recipients it is aware of. | |
1220 | This is not put in as a standard recipient line | |
1221 | to warn any recipients that the list is not complete. | |
4da134f8 | 1222 | .pp |
2fb78b49 | 1223 | At least one recipient line is required under RFC 822. |
25e4e430 EA |
1224 | .sh 2 "IDENT Protocol Support" |
1225 | .pp | |
1226 | .i Sendmail | |
1227 | supports the IDENT protocol as defined in RFC 1413. | |
6564d66c EA |
1228 | Although this enhances identification |
1229 | of the author of an email message | |
1230 | by doing a ``call back'' to the originating system to include | |
1231 | the owner of a particular TCP connection | |
1232 | in the audit trail | |
25e4e430 EA |
1233 | it is in no sense perfect; |
1234 | a determined forger can easily spoof the IDENT protocol. | |
1235 | The following description is excerpted from RFC 1413: | |
1236 | .ba +5 | |
1237 | 6. Security Considerations | |
1238 | .lp | |
1239 | The information returned by this protocol is at most as trustworthy | |
1240 | as the host providing it OR the organization operating the host. For | |
1241 | example, a PC in an open lab has few if any controls on it to prevent | |
1242 | a user from having this protocol return any identifier the user | |
1243 | wants. Likewise, if the host has been compromised the information | |
1244 | returned may be completely erroneous and misleading. | |
1245 | .lp | |
1246 | The Identification Protocol is not intended as an authorization or | |
1247 | access control protocol. At best, it provides some additional | |
1248 | auditing information with respect to TCP connections. At worst, it | |
1249 | can provide misleading, incorrect, or maliciously incorrect | |
1250 | information. | |
1251 | .lp | |
1252 | The use of the information returned by this protocol for other than | |
1253 | auditing is strongly discouraged. Specifically, using Identification | |
1254 | Protocol information to make access control decisions - either as the | |
1255 | primary method (i.e., no other checks) or as an adjunct to other | |
1256 | methods may result in a weakening of normal host security. | |
1257 | .lp | |
1258 | An Identification server may reveal information about users, | |
1259 | entities, objects or processes which might normally be considered | |
1260 | private. An Identification server provides service which is a rough | |
1261 | analog of the CallerID services provided by some phone companies and | |
1262 | many of the same privacy considerations and arguments that apply to | |
1263 | the CallerID service apply to Identification. If you wouldn't run a | |
1264 | "finger" server due to privacy considerations you may not want to run | |
1265 | this protocol. | |
1266 | .ba | |
2fb78b49 | 1267 | .sh 1 "ARGUMENTS" |
4da134f8 | 1268 | .pp |
2fb78b49 EA |
1269 | The complete list of arguments to |
1270 | .i sendmail | |
1271 | is described in detail in Appendix A. | |
1272 | Some important arguments are described here. | |
1273 | .sh 2 "Queue Interval" | |
4da134f8 | 1274 | .pp |
2fb78b49 EA |
1275 | The amount of time between forking a process |
1276 | to run through the queue | |
1277 | is defined by the | |
1278 | .b \-q | |
1279 | flag. | |
1280 | If you run in mode | |
1281 | .b f | |
1282 | or | |
1283 | .b a | |
1284 | this can be relatively large, | |
1285 | since it will only be relevant | |
1286 | when a host that was down comes back up. | |
1287 | If you run in | |
1288 | .b q | |
1289 | mode | |
1290 | it should be relatively short, | |
1291 | since it defines the maximum amount of time that a message | |
1292 | may sit in the queue. | |
e920f7ff | 1293 | .pp |
859d056a EA |
1294 | RFC 1123 section 5.3.1.1 says that this value should be at least 30 minutes |
1295 | (although that probably doesn't make sense if you use ``queue-only'' mode). | |
2fb78b49 | 1296 | .sh 2 "Daemon Mode" |
4da134f8 | 1297 | .pp |
2fb78b49 EA |
1298 | If you allow incoming mail over an IPC connection, |
1299 | you should have a daemon running. | |
1300 | This should be set by your | |
1301 | .i /etc/rc | |
1302 | file using the | |
1303 | .b \-bd | |
1304 | flag. | |
1305 | The | |
1306 | .b \-bd | |
1307 | flag and the | |
1308 | .b \-q | |
1309 | flag may be combined in one call: | |
1310 | .(b | |
55c435aa | 1311 | /usr/\*(SD/sendmail \-bd \-q30m |
4da134f8 | 1312 | .)b |
2fb78b49 | 1313 | .sh 2 "Forcing the Queue" |
4da134f8 | 1314 | .pp |
2fb78b49 EA |
1315 | In some cases you may find that the queue has gotten clogged for some reason. |
1316 | You can force a queue run | |
1317 | using the | |
1318 | .b \-q | |
1319 | flag (with no value). | |
bff69eb1 | 1320 | It is entertaining to use the |
2fb78b49 EA |
1321 | .b \-v |
1322 | flag (verbose) | |
1323 | when this is done to watch what happens: | |
1324 | .(b | |
55c435aa | 1325 | /usr/\*(SD/sendmail \-q \-v |
4da134f8 | 1326 | .)b |
0780838b EA |
1327 | .pp |
1328 | You can also limit the jobs to those with a particular queue identifier, | |
1329 | sender, or recipient | |
1330 | using one of the queue modifiers. | |
1331 | For example, | |
1332 | .q \-qRberkeley | |
1333 | restricts the queue run to jobs that have the string | |
1334 | .q berkeley | |
1335 | somewhere in one of the recipient addresses. | |
1336 | Similarly, | |
1337 | .q \-qSstring | |
1338 | limits the run to particular senders and | |
1339 | .q \-qIstring | |
1340 | limits it to particular identifiers. | |
2fb78b49 EA |
1341 | .sh 2 "Debugging" |
1342 | .pp | |
1343 | There are a fairly large number of debug flags | |
1344 | built into | |
1345 | .i sendmail . | |
1346 | Each debug flag has a number and a level, | |
1347 | where higher levels means to print out more information. | |
1348 | The convention is that levels greater than nine are | |
1349 | .q absurd, | |
1350 | i.e., | |
1351 | they print out so much information that you wouldn't normally | |
1352 | want to see them except for debugging that particular piece of code. | |
1353 | Debug flags are set using the | |
1354 | .b \-d | |
1355 | option; | |
1356 | the syntax is: | |
4da134f8 | 1357 | .(b |
2fb78b49 EA |
1358 | .ta \w'debug-option 'u |
1359 | debug-flag: \fB\-d\fP debug-list | |
1360 | debug-list: debug-option [ , debug-option ] | |
1361 | debug-option: debug-range [ . debug-level ] | |
1362 | debug-range: integer | integer \- integer | |
1363 | debug-level: integer | |
4da134f8 | 1364 | .)b |
2fb78b49 EA |
1365 | where spaces are for reading ease only. |
1366 | For example, | |
4da134f8 | 1367 | .(b |
2fb78b49 EA |
1368 | \-d12 Set flag 12 to level 1 |
1369 | \-d12.3 Set flag 12 to level 3 | |
1370 | \-d3-17 Set flags 3 through 17 to level 1 | |
1371 | \-d3-17.4 Set flags 3 through 17 to level 4 | |
4da134f8 | 1372 | .)b |
2fb78b49 EA |
1373 | For a complete list of the available debug flags |
1374 | you will have to look at the code | |
1375 | (they are too dynamic to keep this documentation up to date). | |
1376 | .sh 2 "Trying a Different Configuration File" | |
4da134f8 | 1377 | .pp |
2fb78b49 EA |
1378 | An alternative configuration file |
1379 | can be specified using the | |
1380 | .b \-C | |
1381 | flag; for example, | |
1382 | .(b | |
55c435aa | 1383 | /usr/\*(SD/sendmail \-Ctest.cf |
4da134f8 | 1384 | .)b |
2fb78b49 EA |
1385 | uses the configuration file |
1386 | .i test.cf | |
1387 | instead of the default | |
daae36f7 | 1388 | .i /etc/sendmail.cf. |
4da134f8 | 1389 | If the |
2fb78b49 EA |
1390 | .b \-C |
1391 | flag has no value | |
1392 | it defaults to | |
1393 | .i sendmail.cf | |
1394 | in the current directory. | |
1395 | .sh 2 "Changing the Values of Options" | |
4da134f8 | 1396 | .pp |
2fb78b49 EA |
1397 | Options can be overridden using the |
1398 | .b \-o | |
4da134f8 | 1399 | flag. |
2fb78b49 | 1400 | For example, |
4da134f8 | 1401 | .(b |
55c435aa | 1402 | /usr/\*(SD/sendmail \-oT2m |
4da134f8 | 1403 | .)b |
2fb78b49 EA |
1404 | sets the |
1405 | .b T | |
1406 | (timeout) option to two minutes | |
1407 | for this run only. | |
55c435aa EA |
1408 | .pp |
1409 | Some options have security implications. | |
1410 | Sendmail allows you to set these, | |
3dfefb78 | 1411 | but refuses to run as root thereafter. |
2fb78b49 EA |
1412 | .sh 1 "TUNING" |
1413 | .pp | |
1414 | There are a number of configuration parameters | |
1415 | you may want to change, | |
1416 | depending on the requirements of your site. | |
1417 | Most of these are set | |
1418 | using an option in the configuration file. | |
4da134f8 | 1419 | For example, |
2fb78b49 | 1420 | the line |
e920f7ff | 1421 | .q OT5d |
2fb78b49 EA |
1422 | sets option |
1423 | .q T | |
1424 | to the value | |
e920f7ff | 1425 | .q 5d |
859d056a | 1426 | (five days). |
1ef34914 | 1427 | .pp |
d656ea51 | 1428 | Most of these options have appropriate defaults for most sites. |
1ef34914 EA |
1429 | However, |
1430 | sites having very high mail loads may find they need to tune them | |
1431 | as appropriate for their mail load. | |
1432 | In particular, | |
1433 | sites experiencing a large number of small messages, | |
1434 | many of which are delivered to many recipients, | |
1435 | may find that they need to adjust the parameters | |
1436 | dealing with queue priorities. | |
2fb78b49 EA |
1437 | .sh 2 "Timeouts" |
1438 | .pp | |
1439 | All time intervals are set | |
1440 | using a scaled syntax. | |
1441 | For example, | |
1442 | .q 10m | |
1443 | represents ten minutes, whereas | |
1444 | .q 2h30m | |
1445 | represents two and a half hours. | |
1446 | The full set of scales is: | |
4da134f8 | 1447 | .(b |
2fb78b49 EA |
1448 | .ta 4n |
1449 | s seconds | |
1450 | m minutes | |
1451 | h hours | |
1452 | d days | |
1453 | w weeks | |
4da134f8 | 1454 | .)b |
2fb78b49 | 1455 | .sh 3 "Queue interval" |
4da134f8 | 1456 | .pp |
2fb78b49 EA |
1457 | The argument to the |
1458 | .b \-q | |
1459 | flag | |
55c435aa | 1460 | specifies how often a sub-daemon will run the queue. |
1ef34914 EA |
1461 | This is typically set to between fifteen minutes |
1462 | and one hour. | |
e920f7ff | 1463 | RFC 1123 section 5.3.1.1 recommends that this be at least 30 minutes. |
2fb78b49 | 1464 | .sh 3 "Read timeouts" |
4da134f8 | 1465 | .pp |
2fb78b49 EA |
1466 | It is possible to time out when reading the standard input |
1467 | or when reading from a remote SMTP server. | |
e920f7ff | 1468 | These timeouts are set using the |
2fb78b49 EA |
1469 | .b r |
1470 | option in the configuration file. | |
e920f7ff EA |
1471 | The argument is a list of |
1472 | .i keyword=value | |
1473 | pairs. | |
1474 | The recognized keywords, their default values, and the minimum values | |
1475 | allowed by RFC 1123 section 5.3.2 are: | |
1476 | .nr ii 1i | |
1477 | .ip initial | |
1478 | The wait for the initial 220 greeting message | |
1479 | [5m, 5m]. | |
1480 | .ip helo | |
475d7a3d | 1481 | The wait for a reply from a HELO or EHLO command |
e920f7ff EA |
1482 | [5m, unspecified]. |
1483 | This may require a host name lookup, so | |
1484 | five minutes is probably a reasonable minimum. | |
1485 | .ip mail\(dg | |
1486 | The wait for a reply from a MAIL command | |
1487 | [10m, 5m]. | |
1488 | .ip rcpt\(dg | |
1489 | The wait for a reply from a RCPT command | |
1490 | [1h, 5m]. | |
1491 | This should be long | |
1492 | because it could be pointing at a list | |
1493 | that takes a long time to expand. | |
1494 | .ip datainit\(dg | |
1495 | The wait for a reply from a DATA command | |
1496 | [5m, 2m]. | |
1497 | .ip datablock\(dg | |
1498 | The wait for reading a data block | |
1499 | (that is, the body of the message). | |
1500 | [1h, 3m]. | |
1501 | This should be long because it also applies to programs | |
1502 | piping input to | |
1503 | .i sendmail | |
1504 | which have no guarantee of promptness. | |
1505 | .ip datafinal\(dg | |
1506 | The wait for a reply from the dot terminating a message. | |
1507 | [1h, 10m]. | |
890cda2d EA |
1508 | If this is shorter than the time actually needed |
1509 | for the receiver to deliver the message, | |
1510 | duplicates will be generated. | |
1511 | This is discussed in RFC 1047. | |
e920f7ff EA |
1512 | .ip rset |
1513 | The wait for a reply from a RSET command | |
1514 | [5m, unspecified]. | |
1515 | .ip quit | |
1516 | The wait for a reply from a QUIT command | |
1517 | [2m, unspecified]. | |
1518 | .ip misc | |
1519 | The wait for a reply from miscellaneous (but short) commands | |
1520 | such as NOOP (no-operation) and VERB (go into verbose mode). | |
1521 | [2m, unspecified]. | |
1522 | .ip command\(dg | |
1523 | In server SMTP, | |
1524 | the time to wait for another command. | |
1525 | [1h, 5m]. | |
1526 | .lp | |
1527 | For compatibility with old configuration files, | |
1528 | if no ``keyword='' is specified, | |
1529 | all the timeouts marked with \(dg are set to the indicated value. | |
55c435aa | 1530 | .pp |
e920f7ff EA |
1531 | Many of the RFC 1123 minimum values |
1532 | may well be too short. | |
55c435aa | 1533 | .i Sendmail |
e920f7ff | 1534 | was designed to the RFC 822 protocols, |
55c435aa EA |
1535 | which did not specify read timeouts; |
1536 | hence, | |
1537 | .i sendmail | |
1538 | does not guarantee to reply to messages promptly. | |
1539 | In particular, a | |
1540 | .q RCPT | |
1541 | command specifying a mailing list | |
1542 | will expand and verify the entire list; | |
1543 | a large list on a slow system | |
1544 | may take more than five minutes\**. | |
1545 | .(f | |
1546 | \**This verification includes looking up every address | |
1547 | with the name server; | |
1548 | this involves network delays, | |
1549 | and can in some cases can be considerable. | |
1550 | .)f | |
e920f7ff | 1551 | I recommend a one hour timeout \*- |
55c435aa EA |
1552 | since this failure is rare, |
1553 | a long timeout is not onerous | |
1554 | and may ultimately help reduce network load. | |
1555 | .pp | |
e920f7ff EA |
1556 | For example, the line: |
1557 | .(b | |
1558 | Orcommand=25m,datablock=3h | |
1559 | .)b | |
1560 | sets the server SMTP command timeout to 25 minutes | |
1561 | and the input data block timeout to three hours. | |
2fb78b49 | 1562 | .sh 3 "Message timeouts" |
4da134f8 | 1563 | .pp |
2fb78b49 EA |
1564 | After sitting in the queue for a few days, |
1565 | a message will time out. | |
1566 | This is to insure that at least the sender is aware | |
1567 | of the inability to send a message. | |
1568 | The timeout is typically set to three days. | |
1569 | This timeout is set using the | |
1570 | .b T | |
1571 | option in the configuration file. | |
1572 | .pp | |
1573 | The time of submission is set in the queue, | |
1574 | rather than the amount of time left until timeout. | |
1575 | As a result, you can flush messages that have been hanging | |
1576 | for a short period | |
1577 | by running the queue | |
1578 | with a short message timeout. | |
1579 | For example, | |
4da134f8 | 1580 | .(b |
55c435aa | 1581 | /usr/\*(SD/sendmail \-oT1d \-q |
4da134f8 | 1582 | .)b |
2fb78b49 EA |
1583 | will run the queue |
1584 | and flush anything that is one day old. | |
55c435aa EA |
1585 | .pp |
1586 | Since this option is global, | |
1587 | and since you can not | |
1588 | .i "a priori" | |
1589 | know how long another host outside your domain will be down, | |
e920f7ff | 1590 | a five day timeout is recommended. |
55c435aa | 1591 | This allows a recipient to fix the problem even if it occurs |
e920f7ff EA |
1592 | at the beginning of a long weekend. |
1593 | RFC 1123 section 5.3.1.1 says that this parameter | |
1594 | should be ``at least 4\-5 days''. | |
31e506e2 EA |
1595 | .pp |
1596 | The | |
1597 | .b T | |
1598 | option can also take a second timeout indicating a time after which | |
1599 | a warning message should be sent; | |
1600 | the two timeouts are separated by a slash. | |
1601 | For example, the value | |
1602 | .(b | |
1603 | 5d/4h | |
1604 | .)b | |
1605 | causes email to fail after five days, | |
1606 | but a warning message will be sent after four hours. | |
1607 | This should be large enough that the message will have been tried | |
1608 | several times. | |
1ef34914 EA |
1609 | .sh 2 "Forking During Queue Runs" |
1610 | .pp | |
1611 | By setting the | |
1612 | .b Y | |
1613 | option, | |
1614 | .i sendmail | |
1615 | will fork before each individual message | |
1616 | while running the queue. | |
1617 | This will prevent | |
1618 | .i sendmail | |
1619 | from consuming large amounts of memory, | |
1620 | so it may be useful in memory-poor environments. | |
1621 | However, if the | |
1622 | .b Y | |
1623 | option is not set, | |
1624 | .i sendmail | |
1625 | will keep track of hosts that are down during a queue run, | |
1626 | which can improve performance dramatically. | |
55c435aa EA |
1627 | .pp |
1628 | If the | |
1629 | .b Y | |
1630 | option is set, | |
1631 | .i sendmail | |
1632 | can not use connection caching. | |
1ef34914 EA |
1633 | .sh 2 "Queue Priorities" |
1634 | .pp | |
1635 | Every message is assigned a priority when it is first instantiated, | |
1636 | consisting of the message size (in bytes) | |
1637 | offset by the message class times the | |
1638 | .q "work class factor" | |
1639 | and the number of recipients times the | |
1640 | .q "work recipient factor." | |
55aab950 | 1641 | The priority is used to order the queue. |
1ef34914 EA |
1642 | Higher numbers for the priority mean that the message will be processed later |
1643 | when running the queue. | |
1644 | .pp | |
1645 | The message size is included so that large messages are penalized | |
1646 | relative to small messages. | |
1647 | The message class allows users to send | |
1648 | .q "high priority" | |
1649 | messages by including a | |
1650 | .q Precedence: | |
1651 | field in their message; | |
1652 | the value of this field is looked up in the | |
1653 | .b P | |
1654 | lines of the configuration file. | |
1655 | Since the number of recipients affects the amount of load a message presents | |
1656 | to the system, | |
1657 | this is also included into the priority. | |
1658 | .pp | |
1659 | The recipient and class factors | |
1660 | can be set in the configuration file using the | |
1661 | .b y | |
1662 | and | |
1663 | .b z | |
1664 | options respectively. | |
55aab950 | 1665 | They default to 30000 (for the recipient factor) |
1ef34914 EA |
1666 | and 1800 |
1667 | (for the class factor). | |
367a5dcd | 1668 | The initial priority is: |
d656ea51 | 1669 | .EQ |
55aab950 | 1670 | pri = size - (class times bold z) + (nrcpt times bold y) |
d656ea51 | 1671 | .EN |
367a5dcd EA |
1672 | (Remember, higher values for this parameter actually mean |
1673 | that the job will be treated with lower priority.) | |
1ef34914 EA |
1674 | .pp |
1675 | The priority of a job can also be adjusted each time it is processed | |
1676 | (that is, each time an attempt is made to deliver it) | |
1677 | using the | |
1678 | .q "work time factor," | |
1679 | set by the | |
1680 | .b Z | |
1681 | option. | |
1682 | This is added to the priority, | |
1683 | so it normally decreases the precedence of the job, | |
1684 | on the grounds that jobs that have failed many times | |
1685 | will tend to fail again in the future. | |
55aab950 EA |
1686 | The |
1687 | .b Z | |
1688 | option defaults to 90000. | |
1ef34914 EA |
1689 | .sh 2 "Load Limiting" |
1690 | .pp | |
1691 | .i Sendmail | |
1692 | can be asked to queue (but not deliver) | |
1693 | mail if the system load average gets too high | |
1694 | using the | |
1695 | .b x | |
1696 | option. | |
1697 | When the load average exceeds the value of the | |
1698 | .b x | |
1699 | option, | |
1700 | the delivery mode is set to | |
1701 | .b q | |
1702 | (queue only) | |
1703 | if the | |
1704 | .i "Queue Factor" | |
1705 | (\c | |
1706 | .b q | |
1707 | option) | |
1708 | divided by the difference in the current load average and the | |
1709 | .b x | |
1710 | option | |
1711 | plus one | |
1712 | exceeds the priority of the message \(em | |
1713 | that is, the message is queued iff: | |
1714 | .EQ | |
890cda2d | 1715 | pri > { bold q } over { LA - { bold x } + 1 } |
1ef34914 EA |
1716 | .EN |
1717 | The | |
1718 | .b q | |
55aab950 EA |
1719 | option defaults to 200000, |
1720 | so each point of load average is worth 200000 | |
1ef34914 | 1721 | priority points |
55aab950 | 1722 | (as described above). |
1ef34914 EA |
1723 | .pp |
1724 | For drastic cases, | |
1725 | the | |
1726 | .b X | |
1727 | option defines a load average at which sendmail will refuse | |
1728 | to accept network connections. | |
1729 | Locally generated mail | |
1730 | (including incoming UUCP mail) | |
1731 | is still accepted. | |
2fb78b49 | 1732 | .sh 2 "Delivery Mode" |
4da134f8 | 1733 | .pp |
2fb78b49 | 1734 | There are a number of delivery modes that |
4da134f8 | 1735 | .i sendmail |
2fb78b49 EA |
1736 | can operate in, |
1737 | set by the | |
1738 | .q d | |
1739 | configuration option. | |
1740 | These modes | |
1741 | specify how quickly mail will be delivered. | |
1742 | Legal modes are: | |
4da134f8 | 1743 | .(b |
2fb78b49 EA |
1744 | .ta 4n |
1745 | i deliver interactively (synchronously) | |
1746 | b deliver in background (asynchronously) | |
1747 | q queue only (don't deliver) | |
4da134f8 | 1748 | .)b |
2fb78b49 EA |
1749 | There are tradeoffs. |
1750 | Mode | |
1751 | .q i | |
1752 | passes the maximum amount of information to the sender, | |
1753 | but is hardly ever necessary. | |
1754 | Mode | |
1755 | .q q | |
1756 | puts the minimum load on your machine, | |
1757 | but means that delivery may be delayed for up to the queue interval. | |
1758 | Mode | |
1759 | .q b | |
1760 | is probably a good compromise. | |
74b6e641 EA |
1761 | However, this mode can cause large numbers of processes |
1762 | if you have a mailer that takes a long time to deliver a message. | |
859d056a EA |
1763 | .pp |
1764 | If you run in mode | |
1765 | .q q | |
1766 | (queue only) | |
1767 | .i sendmail | |
1768 | will not expand aliases and follow .forward files | |
1769 | upon initial receipt of the mail. | |
1770 | This speeds up the response to RCPT commands. | |
2fb78b49 | 1771 | .sh 2 "Log Level" |
4da134f8 | 1772 | .pp |
2fb78b49 EA |
1773 | The level of logging can be set for sendmail. |
1774 | The default using a standard configuration table is level 9. | |
1775 | The levels are as follows: | |
d656ea51 | 1776 | .nr ii 0.5i |
2fb78b49 EA |
1777 | .ip 0 |
1778 | No logging. | |
1779 | .ip 1 | |
6ebbc09a | 1780 | Serious system failures and potential security problems. |
2fb78b49 | 1781 | .ip 2 |
6ebbc09a | 1782 | Lost communications (network problems) and protocol failures. |
2fb78b49 | 1783 | .ip 3 |
6ebbc09a | 1784 | Other serious failures. |
2fb78b49 | 1785 | .ip 4 |
6ebbc09a | 1786 | Minor failures. |
2fb78b49 | 1787 | .ip 5 |
6ebbc09a | 1788 | Message collection statistics. |
2fb78b49 | 1789 | .ip 6 |
6ebbc09a EA |
1790 | Creation of error messages, |
1791 | VRFY and EXPN commands. | |
1792 | .ip 7 | |
1793 | Delivery failures (host or user unknown, etc.). | |
1794 | .ip 8 | |
1795 | Successful deliveries. | |
ef1c322e | 1796 | .ip 9 |
6ebbc09a EA |
1797 | Messages being deferred |
1798 | (due to a host being down, etc.). | |
1799 | .ip 10 | |
1800 | Database expansion (alias, forward, and userdb lookups). | |
1801 | .ip 15 | |
1802 | Automatic alias database rebuilds. | |
1803 | .ip 20 | |
d656ea51 EA |
1804 | Logs attempts to run locked queue files. |
1805 | These are not errors, | |
1806 | but can be useful to note if your queue appears to be clogged. | |
6ebbc09a EA |
1807 | .ip 30 |
1808 | Lost locks (only if using lockf instead of flock). | |
1809 | .lp | |
1810 | Additionally, | |
1811 | values above 64 are reserved for extremely verbose debuggging output. | |
1812 | No normal site would ever set these. | |
2fb78b49 | 1813 | .sh 2 "File Modes" |
4da134f8 | 1814 | .pp |
2fb78b49 EA |
1815 | There are a number of files |
1816 | that may have a number of modes. | |
1817 | The modes depend on what functionality you want | |
1818 | and the level of security you require. | |
1819 | .sh 3 "To suid or not to suid?" | |
4da134f8 | 1820 | .pp |
2fb78b49 EA |
1821 | .i Sendmail |
1822 | can safely be made | |
1823 | setuid to root. | |
1824 | At the point where it is about to | |
74b6e641 | 1825 | .i exec \|(2) |
2fb78b49 EA |
1826 | a mailer, |
1827 | it checks to see if the userid is zero; | |
1828 | if so, | |
1829 | it resets the userid and groupid to a default | |
1830 | (set by the | |
1831 | .b u | |
4da134f8 | 1832 | and |
2fb78b49 EA |
1833 | .b g |
1834 | options). | |
1835 | (This can be overridden | |
1836 | by setting the | |
1837 | .b S | |
1838 | flag to the mailer | |
1839 | for mailers that are trusted | |
1840 | and must be called as root.) | |
1841 | However, | |
1842 | this will cause mail processing | |
1843 | to be accounted | |
1844 | (using | |
74b6e641 | 1845 | .i sa \|(8)) |
2fb78b49 EA |
1846 | to root |
1847 | rather than to the user sending the mail. | |
2fb78b49 | 1848 | .sh 3 "Should my alias database be writable?" |
4da134f8 | 1849 | .pp |
2fb78b49 EA |
1850 | At Berkeley |
1851 | we have the alias database | |
daae36f7 | 1852 | (/etc/aliases*) |
18843c53 PL |
1853 | mode 644. |
1854 | While this is not as flexible as if the database | |
1855 | were more 666, it avoids potential security problems | |
1856 | with a globally writable database. | |
4da134f8 | 1857 | .pp |
2fb78b49 EA |
1858 | The database that |
1859 | .i sendmail | |
1860 | actually used | |
1861 | is represented by the two files | |
1862 | .i aliases.dir | |
4da134f8 | 1863 | and |
2fb78b49 | 1864 | .i aliases.pag |
de7324ac EA |
1865 | (both in /etc) |
1866 | (or | |
1867 | .i aliases.db | |
1868 | if you are running with the new Berkeley database primitives). | |
2fb78b49 | 1869 | The mode on these files should match the mode |
daae36f7 | 1870 | on /etc/aliases. |
2fb78b49 EA |
1871 | If |
1872 | .i aliases | |
1873 | is writable | |
1874 | and the | |
1875 | DBM | |
1876 | files | |
4da134f8 | 1877 | (\c |
2fb78b49 EA |
1878 | .i aliases.dir |
1879 | and | |
1880 | .i aliases.pag ) | |
1881 | are not, | |
1882 | users will be unable to reflect their desired changes | |
1883 | through to the actual database. | |
1884 | However, | |
1885 | if | |
1886 | .i aliases | |
1887 | is read-only | |
1888 | and the DBM files are writable, | |
1889 | a slightly sophisticated user | |
1890 | can arrange to steal mail anyway. | |
4da134f8 | 1891 | .pp |
2fb78b49 EA |
1892 | If your DBM files are not writable by the world |
1893 | or you do not have auto-rebuild enabled | |
1894 | (with the | |
1895 | .q D | |
1896 | option), | |
1897 | then you must be careful to reconstruct the alias database | |
1898 | each time you change the text version: | |
4da134f8 | 1899 | .(b |
74b6e641 | 1900 | newaliases |
4da134f8 | 1901 | .)b |
2fb78b49 EA |
1902 | If this step is ignored or forgotten |
1903 | any intended changes will also be ignored or forgotten. | |
55c435aa EA |
1904 | .sh 2 "Connection Caching" |
1905 | .pp | |
1906 | When processing the queue, | |
1907 | .b sendmail | |
1908 | will try to keep the last few open connections open | |
1909 | to avoid startup and shutdown costs. | |
1910 | This only applies to IPC connections. | |
1911 | .pp | |
1912 | When trying to open a connection | |
1913 | the cache is first searched. | |
1914 | If an open connection is found, it is probed to see if it is still active | |
1915 | by sending a | |
1916 | .sm NOOP | |
1917 | command. | |
1918 | It is not an error if this fails; | |
1919 | instead, the connection is closed and reopened. | |
1920 | .pp | |
1921 | Two parameters control the connection cache. | |
1922 | The | |
1923 | .b k | |
1924 | option defines the number of simultaneous open connections | |
1925 | that will be permitted. | |
1926 | If it is set to zero, | |
1927 | connections will be closed as quickly as possible. | |
1928 | The default is one. | |
1929 | This should be set as appropriate for your system size; | |
1930 | it will limit the amount of system resources that | |
1931 | .b sendmail | |
1932 | will use during queue runs. | |
1933 | .pp | |
1934 | The | |
1935 | .b K | |
1936 | option specifies the maximum time that any cached connection | |
1937 | will be permitted to idle. | |
1938 | When the idle time exceeds this value | |
1939 | the connection is closed. | |
1940 | This number should be small | |
1941 | (under ten minutes) | |
1942 | to prevent you from grabbing too many resources | |
1943 | from other hosts. | |
1944 | The default is five minutes. | |
1945 | .sh 2 "Name Server Access" | |
1946 | .pp | |
1947 | If your system supports the name server, | |
1948 | then the probability is that | |
1949 | .i sendmail | |
1950 | will be using it regardless of how you configure sendmail. | |
d656ea51 EA |
1951 | However, if you have nameserver support |
1952 | which you are not using, | |
1953 | sendmail will get a | |
1954 | .q "connection refused" | |
1955 | message when it tries to connect to the name server | |
1956 | (either by calling | |
55c435aa | 1957 | .i gethostbyname |
d656ea51 EA |
1958 | or by trying to look up the MX records). |
1959 | If the | |
55c435aa | 1960 | .b I |
d656ea51 EA |
1961 | option is set, |
1962 | .i sendmail | |
1963 | will interpret this to mean a temporary failure; | |
1964 | otherwise, it ignores the name server data. | |
1965 | If your name server is running properly, | |
1966 | the setting of this option is not relevant; | |
1967 | however, it is important that it be set properly | |
1968 | to make error handling work properly. | |
55c435aa | 1969 | .pp |
599d791f EA |
1970 | This option also allows you to tweak name server options. |
1971 | The command line takes a series of flags as documented in | |
1972 | .i resolver (3) | |
1973 | (with the leading | |
1974 | .q RES_ | |
1975 | deleted). | |
1976 | Each can be preceded by an optional `+' or `\(mi'. | |
1977 | For example, the line | |
1978 | .(b | |
1979 | OITrue +AAONLY \(miDNSRCH | |
1980 | .)b | |
1981 | turns on the AAONLY (accept authoritative answers only) | |
1982 | and turns off the DNSRCH (search the domain path) options. | |
1983 | Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE | |
1984 | flags on and all others off. | |
1985 | Note the use of the initial ``True'' \*- | |
1986 | this is for compatibility with previous versions of sendmail, | |
1987 | but is not otherwise necessary. | |
1988 | .pp | |
859d056a | 1989 | Version level 1 configurations |
599d791f EA |
1990 | turn DNSRCH and DEFNAMES off when doing delivery lookups, |
1991 | but leave them on everywhere else. | |
acbfac81 | 1992 | Version 6 of |
599d791f EA |
1993 | .i sendmail |
1994 | ignores them when doing canonification lookups | |
1995 | (that is, when using $[ ... $]), | |
1996 | and always does the search. | |
1997 | If you don't want to do automatic name extension, | |
1998 | don't call $[ ... $]. | |
1999 | .pp | |
2000 | The search rules for $[ ... $] are somewhat different than usual. | |
2001 | If the name (that is, the ``...'') | |
2002 | has at least one dot, it always tries the unmodified name first. | |
2003 | If that fails, it tries the reduced search path, | |
2004 | and lastly tries the unmodified name | |
2005 | (but only for names without a dot, | |
2006 | since names with a dot have already been tried). | |
2007 | This allows names such as | |
2008 | ``utc.CS'' | |
2009 | to match the site in Czechoslovakia | |
2010 | rather than the site in your local Computer Science department. | |
6d5ff626 EA |
2011 | It also prefers A and CNAME records over MX records \*- |
2012 | that is, if it finds an MX record it makes note of it, | |
2013 | but keeps looking. | |
2014 | This way, if you have a wildcard MX record matching your domain, | |
2015 | it will not assume that all names match. | |
f13b6b36 EA |
2016 | .sh 2 "Moving the Per-User Forward Files" |
2017 | .pp | |
2018 | Some sites mount each user's home directory | |
2019 | from a local disk on their workstation, | |
2020 | so that local access is fast. | |
2021 | However, the result is that .forward file lookups are slow. | |
2022 | In some cases, | |
2023 | mail can even be delivered on machines inappropriately | |
2024 | because of a file server being down. | |
2025 | The performance can be especially bad if you run the automounter. | |
2026 | .pp | |
2027 | The | |
2028 | .b J | |
2029 | option allows you to set a path of forward files. | |
2030 | For example, the config file line | |
2031 | .(b | |
2032 | OJ/var/forward/$u:$z/.forward | |
2033 | .)b | |
2034 | would first look for a file with the same name as the user's login | |
2035 | in /var/forward; | |
2036 | if that is not found (or is inaccessible) | |
2037 | the file | |
2038 | .q \&.forward | |
2039 | in the user's home directory is searched. | |
2040 | A truly perverse site could also search by sender | |
2041 | by using $r, $s, or $f. | |
2042 | .pp | |
2043 | If you create a directory such as /var/forward, | |
2044 | it should be mode 1777 | |
2045 | (that is, the sticky bit should be set). | |
2046 | Users should create the files mode 644. | |
59baf33c EA |
2047 | .sh 2 "Free Space" |
2048 | .pp | |
859d056a | 2049 | On systems that have the |
59baf33c EA |
2050 | .i statfs (2) |
2051 | system call, | |
2052 | you can specify a minimum number of free blocks on the queue filesystem | |
2053 | using the | |
2054 | .b b | |
2055 | option. | |
2056 | If there are fewer than the indicated number of blocks free | |
2057 | on the filesystem on which the queue is mounted | |
2058 | the SMTP server will reject mail | |
2059 | with the | |
2060 | 452 error code. | |
2061 | This invites the SMTP client to try again later. | |
2062 | .pp | |
2063 | Beware of setting this option too high; | |
2064 | it can cause rejection of email | |
2065 | when that mail would be processed without difficulty. | |
50d4a65c EA |
2066 | .pp |
2067 | This option can also specify an advertised | |
2068 | .q "maximum message size" | |
2069 | for hosts that speak ESMTP. | |
59baf33c EA |
2070 | .sh 2 "Privacy Flags" |
2071 | .pp | |
2072 | The | |
2073 | .b p | |
2074 | option allows you to set certain | |
2075 | ``privacy'' | |
2076 | flags. | |
2077 | Actually, many of them don't give you any extra privacy, | |
2078 | rather just insisting that client SMTP servers | |
2079 | use the HELO command | |
2080 | before using certain commands. | |
2081 | .pp | |
2082 | The option takes a series of flag names; | |
2083 | the final privacy is the inclusive or of those flags. | |
2084 | For example: | |
2085 | .(b | |
6bf8e61c | 2086 | Op needmailhelo, noexpn |
59baf33c | 2087 | .)b |
475d7a3d | 2088 | insists that the HELO or EHLO command be used before a MAIL command is accepted |
59baf33c | 2089 | and disables the EXPN command. |
890cda2d EA |
2090 | .pp |
2091 | The | |
2092 | .q restrictmailq | |
2093 | option restricts printing the queue to the group that owns the queue directory. | |
2094 | It is absurd to set this if you don't also protect the logs. | |
d6f77a91 EA |
2095 | .sh 2 "Send to Me Too" |
2096 | .pp | |
2097 | Normally, | |
2098 | .i sendmail | |
2099 | deletes the (envelope) sender from any list expansions. | |
2100 | For example, if | |
2101 | .q matt | |
2102 | sends to a list that contains | |
2103 | .q matt | |
2104 | as one of the members he won't get a copy of the message. | |
2105 | If the | |
2106 | .b \-m | |
2107 | (me too) | |
2108 | command line flag, or if the | |
2109 | .b m | |
2110 | option is set in the configuration file, | |
2111 | this behaviour is supressed. | |
2112 | Some sites like to run the | |
2113 | .sm SMTP | |
2114 | daemon with | |
2115 | .b \-m . | |
2fb78b49 | 2116 | .sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE" |
4da134f8 | 2117 | .pp |
2fb78b49 EA |
2118 | This section describes the configuration file |
2119 | in detail, | |
2120 | including hints on how to write one of your own | |
2121 | if you have to. | |
4da134f8 | 2122 | .pp |
2fb78b49 EA |
2123 | There is one point that should be made clear immediately: |
2124 | the syntax of the configuration file | |
2125 | is designed to be reasonably easy to parse, | |
2126 | since this is done every time | |
2127 | .i sendmail | |
2128 | starts up, | |
2129 | rather than easy for a human to read or write. | |
2130 | On the | |
2131 | .q "future project" | |
2132 | list is a | |
2133 | configuration-file compiler. | |
4da134f8 | 2134 | .pp |
2fb78b49 EA |
2135 | An overview of the configuration file |
2136 | is given first, | |
2137 | followed by details of the semantics. | |
de7324ac | 2138 | .sh 2 "Configuration File Lines" |
2fb78b49 EA |
2139 | .pp |
2140 | The configuration file is organized as a series of lines, | |
2141 | each of which begins with a single character | |
2142 | defining the semantics for the rest of the line. | |
2143 | Lines beginning with a space or a tab | |
2144 | are continuation lines | |
2145 | (although the semantics are not well defined in many places). | |
2146 | Blank lines and lines beginning with a sharp symbol | |
2147 | (`#') | |
2148 | are comments. | |
2149 | .sh 3 "R and S \*- rewriting rules" | |
2150 | .pp | |
2151 | The core of address parsing | |
2152 | are the rewriting rules. | |
2153 | These are an ordered production system. | |
2154 | .i Sendmail | |
2155 | scans through the set of rewriting rules | |
2156 | looking for a match on the left hand side | |
2157 | (LHS) | |
2158 | of the rule. | |
2159 | When a rule matches, | |
2160 | the address is replaced by the right hand side | |
2161 | (RHS) | |
2162 | of the rule. | |
2163 | .pp | |
2164 | There are several sets of rewriting rules. | |
2165 | Some of the rewriting sets are used internally | |
2166 | and must have specific semantics. | |
2167 | Other rewriting sets | |
2168 | do not have specifically assigned semantics, | |
2169 | and may be referenced by the mailer definitions | |
2170 | or by other rewriting sets. | |
2171 | .pp | |
2172 | The syntax of these two commands are: | |
2173 | .(b F | |
2174 | .b S \c | |
4da134f8 | 2175 | .i n |
2fb78b49 EA |
2176 | .)b |
2177 | Sets the current ruleset being collected to | |
4da134f8 | 2178 | .i n . |
2fb78b49 EA |
2179 | If you begin a ruleset more than once |
2180 | it deletes the old definition. | |
2181 | .(b F | |
2182 | .b R \c | |
2183 | .i lhs | |
2184 | .i rhs | |
2185 | .i comments | |
4da134f8 | 2186 | .)b |
4da134f8 | 2187 | The |
2fb78b49 EA |
2188 | fields must be separated |
2189 | by at least one tab character; | |
2190 | there may be embedded spaces | |
2191 | in the fields. | |
4da134f8 | 2192 | The |
2fb78b49 EA |
2193 | .i lhs |
2194 | is a pattern that is applied to the input. | |
2195 | If it matches, | |
2196 | the input is rewritten to the | |
2197 | .i rhs . | |
2198 | The | |
2199 | .i comments | |
2200 | are ignored. | |
7c1a78dc EA |
2201 | .pp |
2202 | Macro expansions of the form | |
2203 | .b $ \c | |
2204 | .i x | |
2205 | are performed when the configuration file is read. | |
2206 | Expansions of the form | |
2207 | .b $& \c | |
2208 | .i x | |
2209 | are performed at run time using a somewhat less general algorithm. | |
2210 | This for is intended only for referencing internally defined macros | |
2211 | such as | |
2212 | .b $h | |
2213 | that are changed at runtime. | |
de7324ac EA |
2214 | .sh 4 "The left hand side" |
2215 | .pp | |
2216 | The left hand side of rewriting rules contains a pattern. | |
2217 | Normal words are simply matched directly. | |
2218 | Metasyntax is introduced using a dollar sign. | |
2219 | The metasymbols are: | |
2220 | .(b | |
2221 | .ta \w'\fB$=\fP\fIx\fP 'u | |
2222 | \fB$*\fP Match zero or more tokens | |
2223 | \fB$+\fP Match one or more tokens | |
2224 | \fB$\-\fP Match exactly one token | |
dd905b60 | 2225 | \fB$=\fP\fIx\fP Match any phrase in class \fIx\fP |
7901972a | 2226 | \fB$~\fP\fIx\fP Match any word not in class \fIx\fP |
de7324ac EA |
2227 | .)b |
2228 | If any of these match, | |
2229 | they are assigned to the symbol | |
2230 | .b $ \c | |
2231 | .i n | |
2232 | for replacement on the right hand side, | |
2233 | where | |
2234 | .i n | |
2235 | is the index in the LHS. | |
2236 | For example, | |
2237 | if the LHS: | |
2238 | .(b | |
2239 | $\-:$+ | |
2240 | .)b | |
2241 | is applied to the input: | |
2242 | .(b | |
2243 | UCBARPA:eric | |
2244 | .)b | |
2245 | the rule will match, and the values passed to the RHS will be: | |
2246 | .(b | |
2247 | .ta 4n | |
2248 | $1 UCBARPA | |
2249 | $2 eric | |
2250 | .)b | |
acbfac81 EA |
2251 | .pp |
2252 | Additionally, the LHS can include | |
2253 | .b $@ | |
2254 | to match zero tokens. | |
2255 | This is | |
2256 | .i not | |
2257 | bound to a | |
2258 | .b $ \c | |
2259 | .i N | |
2260 | on the RHS, and is normally only used when it stands alone | |
2261 | in order to match the null input. | |
de7324ac EA |
2262 | .sh 4 "The right hand side" |
2263 | .pp | |
2264 | When the left hand side of a rewriting rule matches, | |
2265 | the input is deleted and replaced by the right hand side. | |
2266 | Tokens are copied directly from the RHS | |
2267 | unless they begin with a dollar sign. | |
2268 | Metasymbols are: | |
2269 | .(b | |
2270 | .ta \w'$#mailer\0\0\0'u | |
2271 | \fB$\fP\fIn\fP Substitute indefinite token \fIn\fP from LHS | |
2272 | \fB$[\fP\fIname\fP\fB$]\fP Canonicalize \fIname\fP | |
2273 | \fB$(\fP\fImap key\fP \fB$@\fP\fIarguments\fP \fB$:\fP\fIdefault\fP \fB$)\fP | |
2274 | Generalized keyed mapping function | |
2275 | \fB$>\fP\fIn\fP \*(lqCall\*(rq ruleset \fIn\fP | |
2276 | \fB$#\fP\fImailer\fP Resolve to \fImailer\fP | |
2277 | \fB$@\fP\fIhost\fP Specify \fIhost\fP | |
2278 | \fB$:\fP\fIuser\fP Specify \fIuser\fP | |
2279 | .)b | |
2280 | .pp | |
2281 | The | |
2282 | .b $ \c | |
2283 | .i n | |
2284 | syntax substitutes the corresponding value from a | |
2285 | .b $+ , | |
2286 | .b $\- , | |
2287 | .b $* , | |
2288 | .b $= , | |
2289 | or | |
2290 | .b $~ | |
2291 | match on the LHS. | |
2292 | It may be used anywhere. | |
2293 | .pp | |
2294 | A host name enclosed between | |
2295 | .b $[ | |
2296 | and | |
2297 | .b $] | |
2298 | is looked up using the | |
2299 | .i gethostent \|(3) | |
59baf33c EA |
2300 | routines and replaced by the canonical name\**. |
2301 | .(f | |
2302 | \**This is actually | |
2303 | completely equivalent | |
2304 | to $(host \fIhostname\fP$). | |
2305 | In particular, a | |
2306 | .b $: | |
2307 | default can be used. | |
2308 | .)f | |
de7324ac EA |
2309 | For example, |
2310 | .q $[csam$] | |
2311 | might become | |
2312 | .q lbl-csam.arpa | |
2313 | and | |
2314 | .q $[[128.32.130.2]$] | |
2315 | would become | |
2316 | .q vangogh.CS.Berkeley.EDU. | |
859d056a EA |
2317 | .i Sendmail |
2318 | recognizes it's numeric IP address | |
2319 | without calling the name server | |
2320 | and replaces it with it's canonical name. | |
de7324ac EA |
2321 | .pp |
2322 | The | |
2323 | .b $( | |
2324 | \&... | |
2325 | .b $) | |
2326 | syntax is a more general form of lookup; | |
2327 | it uses a named map instead of an implicit map. | |
2328 | If no lookup is found, the indicted | |
2329 | .i default | |
2330 | is inserted; | |
2331 | if no default is specified and no lookup matches, | |
2332 | the value is left unchanged. | |
2333 | .pp | |
2334 | The | |
2335 | .b $> \c | |
2336 | .i n | |
2337 | syntax | |
2338 | causes the remainder of the line to be substituted as usual | |
2339 | and then passed as the argument to ruleset | |
2340 | .i n . | |
2341 | The final value of ruleset | |
2342 | .i n | |
2343 | then becomes | |
2344 | the substitution for this rule. | |
2345 | .pp | |
2346 | The | |
2347 | .b $# | |
2348 | syntax should | |
2349 | .i only | |
2350 | be used in ruleset zero. | |
2351 | It causes evaluation of the ruleset to terminate immediately, | |
2352 | and signals to sendmail that the address has completely resolved. | |
2353 | The complete syntax is: | |
2354 | .(b | |
859d056a | 2355 | \fB$#\fP\fImailer\fP \fB$@\fP\fIhost\fP \fB$:\fP\fIuser\fP |
de7324ac EA |
2356 | .)b |
2357 | This specifies the | |
2358 | {mailer, host, user} | |
2359 | 3-tuple necessary to direct the mailer. | |
2360 | If the mailer is local | |
f6d3c63d EA |
2361 | the host part may be omitted\**. |
2362 | .(f | |
2363 | \**You may want to use it for special | |
2364 | .q "per user" | |
2365 | extensions. | |
2366 | For example, at CMU you can send email to | |
2367 | .q jgm+foo ; | |
2368 | the part after the plus sign | |
2369 | is not part of the user name, | |
2370 | and is passed to the local mailer for local use. | |
2371 | .)f | |
de7324ac EA |
2372 | The |
2373 | .i mailer | |
de7324ac EA |
2374 | must be a single word, |
2375 | but the | |
337767a9 EA |
2376 | .i host |
2377 | and | |
de7324ac EA |
2378 | .i user |
2379 | may be multi-part. | |
337767a9 EA |
2380 | If the |
2381 | .i mailer | |
2382 | is the builtin IPC mailer, | |
2383 | the | |
2384 | .i host | |
2385 | may be a colon-separated list of hosts | |
2386 | that are searched in order for the first working address | |
2387 | (exactly like MX records). | |
de7324ac EA |
2388 | .pp |
2389 | A RHS may also be preceded by a | |
2390 | .b $@ | |
2391 | or a | |
2392 | .b $: | |
2393 | to control evaluation. | |
2394 | A | |
2395 | .b $@ | |
2396 | prefix causes the ruleset to return with the remainder of the RHS | |
2397 | as the value. | |
2398 | A | |
2399 | .b $: | |
2400 | prefix causes the rule to terminate immediately, | |
2401 | but the ruleset to continue; | |
2402 | this can be used to avoid continued application of a rule. | |
2403 | The prefix is stripped before continuing. | |
2404 | .pp | |
2405 | The | |
2406 | .b $@ | |
2407 | and | |
2408 | .b $: | |
2409 | prefixes may precede a | |
2410 | .b $> | |
2411 | spec; | |
2412 | for example: | |
2413 | .(b | |
2414 | .ta 8n | |
859d056a | 2415 | R$+ $: $>7 $1 |
de7324ac EA |
2416 | .)b |
2417 | matches anything, | |
2418 | passes that to ruleset seven, | |
2419 | and continues; | |
2420 | the | |
2421 | .b $: | |
2422 | is necessary to avoid an infinite loop. | |
2423 | .pp | |
2424 | Substitution occurs in the order described, | |
2425 | that is, | |
2426 | parameters from the LHS are substituted, | |
2427 | hostnames are canonicalized, | |
2428 | .q subroutines | |
2429 | are called, | |
2430 | and finally | |
2431 | .b $# , | |
2432 | .b $@ , | |
2433 | and | |
2434 | .b $: | |
2435 | are processed. | |
475d7a3d EA |
2436 | .sh 4 "Semantics of rewriting rule sets" |
2437 | .pp | |
2438 | There are five rewriting sets | |
2439 | that have specific semantics. | |
2440 | These are related as depicted by figure 2. | |
2441 | .(z | |
2442 | .hl | |
2443 | .ie n \{\ | |
2444 | .(c | |
2445 | +---+ | |
2446 | -->| 0 |-->resolved address | |
2447 | / +---+ | |
2448 | / +---+ +---+ | |
2449 | / ---->| 1 |-->| S |-- | |
2450 | +---+ / +---+ / +---+ +---+ \e +---+ | |
2451 | addr-->| 3 |-->| D |-- --->| 4 |-->msg | |
2452 | +---+ +---+ \e +---+ +---+ / +---+ | |
2453 | --->| 2 |-->| R |-- | |
2454 | +---+ +---+ | |
2455 | .)c | |
2456 | ||
2457 | .\} | |
2458 | .el .ie !"\*(.T"" \ | |
2459 | \{\ | |
2460 | .PS | |
2461 | boxwid = 0.3i | |
2462 | boxht = 0.3i | |
2463 | movewid = 0.3i | |
2464 | moveht = 0.3i | |
2465 | linewid = 0.3i | |
2466 | lineht = 0.3i | |
2467 | ||
2468 | box invis "addr"; arrow | |
2469 | Box3: box "3" | |
2470 | A1: arrow | |
2471 | BoxD: box "D"; line; L1: Here | |
2472 | C: [ | |
2473 | C1: arrow; box "1"; arrow; box "S"; line; E1: Here | |
2474 | move to C1 down 0.5; right | |
2475 | C2: arrow; box "2"; arrow; box "R"; line; E2: Here | |
2476 | ] with .w at L1 + (0.5, 0) | |
2477 | move to C.e right 0.5 | |
2478 | L4: arrow; box "4"; arrow; box invis "msg" | |
2479 | line from L1 to C.C1 | |
2480 | line from L1 to C.C2 | |
2481 | line from C.E1 to L4 | |
2482 | line from C.E2 to L4 | |
2483 | move to BoxD.n up 0.6; right | |
2484 | Box0: arrow; box "0" | |
2485 | arrow; box invis "resolved address" width 1.3 | |
2486 | line from 1/3 of the way between A1 and BoxD.w to Box0 | |
2487 | .PE | |
2488 | .\} | |
2489 | .el .sp 2i | |
2490 | .ce | |
2491 | Figure 2 \*- Rewriting set semantics | |
2492 | .(c | |
2493 | D \*- sender domain addition | |
2494 | S \*- mailer-specific sender rewriting | |
2495 | R \*- mailer-specific recipient rewriting | |
2496 | .)c | |
2497 | .hl | |
2498 | .)z | |
2499 | .pp | |
2500 | Ruleset three | |
2501 | should turn the address into | |
2502 | .q "canonical form." | |
2503 | This form should have the basic syntax: | |
2504 | .(b | |
2505 | local-part@host-domain-spec | |
2506 | .)b | |
2507 | If no | |
2508 | .q @ | |
2509 | sign is specified, | |
2510 | then the | |
2511 | host-domain-spec | |
2512 | .i may | |
2513 | be appended from the | |
2514 | sender address | |
2515 | (if the | |
2516 | .b C | |
2517 | flag is set in the mailer definition | |
2518 | corresponding to the | |
2519 | .i sending | |
2520 | mailer). | |
2521 | Ruleset three | |
2522 | is applied by sendmail | |
2523 | before doing anything with any address. | |
2524 | .pp | |
2525 | Ruleset zero | |
2526 | is applied after ruleset three | |
2527 | to addresses that are going to actually specify recipients. | |
2528 | It must resolve to a | |
2529 | .i "{mailer, host, user}" | |
2530 | triple. | |
2531 | The | |
2532 | .i mailer | |
2533 | must be defined in the mailer definitions | |
2534 | from the configuration file. | |
2535 | The | |
2536 | .i host | |
2537 | is defined into the | |
2538 | .b $h | |
2539 | macro | |
2540 | for use in the argv expansion of the specified mailer. | |
2541 | .pp | |
2542 | Rulesets one and two | |
2543 | are applied to all sender and recipient addresses respectively. | |
2544 | They are applied before any specification | |
2545 | in the mailer definition. | |
2546 | They must never resolve. | |
2547 | .pp | |
2548 | Ruleset four is applied to all addresses | |
2549 | in the message. | |
2550 | It is typically used | |
2551 | to translate internal to external form. | |
2552 | .sh 4 "IPC mailers" | |
2553 | .pp | |
2554 | Some special processing occurs | |
337767a9 EA |
2555 | if the ruleset zero resolves to an IPC mailer |
2556 | (that is, a mailer that has | |
2557 | .q [IPC] | |
2558 | listed as the Path in the | |
2559 | .b M | |
2560 | configuration line. | |
475d7a3d EA |
2561 | The host name passed after |
2562 | .q $@ | |
2563 | has MX expansion performed; | |
2564 | this looks the name up in DNS to find alternate delivery sites. | |
2565 | .pp | |
2566 | The host name can also be provided as a dotted quad in square brackets; | |
2567 | for example: | |
2568 | .(b | |
2569 | [128.32.149.78] | |
2570 | .)b | |
2571 | This causes direct conversion of the numeric value | |
2572 | to a TCP/IP host address. | |
2573 | .pp | |
337767a9 EA |
2574 | The host name passed in after the |
2575 | .q $@ | |
2576 | may also be a colon-separated list of hosts. | |
2577 | Each is separately MX expanded and the results are concatenated | |
2578 | to make (essentially) one long MX list. | |
2579 | The intent here is to create | |
2580 | .q fake | |
2581 | MX records that are not published in DNS | |
2582 | for private internal networks. | |
2583 | .pp | |
475d7a3d EA |
2584 | As a final special case, the host name can be passed in |
2585 | as a text string | |
2586 | in square brackets: | |
2587 | .(b | |
2588 | [ucbvax.berkeley.edu] | |
2589 | .)b | |
2590 | This form avoids the MX mapping. | |
2591 | .b N.B.: | |
2592 | This is intended only for situations where you have a network firewall, | |
2593 | so that your MX record points to a gateway machine; | |
2594 | this machine could then do direct delivery to machines | |
2595 | within your local domain. | |
2596 | Use of this feature directly violates RFC 1123 section 5.3.5: | |
2597 | it should not be used lightly. | |
2598 | .sh 3 "D \*- define macro" | |
2fb78b49 EA |
2599 | .pp |
2600 | Macros are named with a single character. | |
2601 | These may be selected from the entire ASCII set, | |
2602 | but user-defined macros | |
2603 | should be selected from the set of upper case letters only. | |
2604 | Lower case letters | |
2605 | and special symbols | |
2606 | are used internally. | |
2607 | .pp | |
2608 | The syntax for macro definitions is: | |
2609 | .(b F | |
2610 | .b D \c | |
2611 | .i x\|val | |
2612 | .)b | |
2613 | where | |
2614 | .i x | |
2615 | is the name of the macro | |
4da134f8 | 2616 | and |
2fb78b49 EA |
2617 | .i val |
2618 | is the value it should have. | |
2fb78b49 | 2619 | .pp |
de7324ac EA |
2620 | Macros are interpolated |
2621 | using the construct | |
2622 | .b $ \c | |
2623 | .i x , | |
2624 | where | |
2625 | .i x | |
2626 | is the name of the macro to be interpolated. | |
7c1a78dc EA |
2627 | This interpolation is done when the configuration file is read, |
2628 | except in | |
2629 | .b M | |
2630 | lines. | |
2631 | The special construct | |
2632 | .b $& \c | |
2633 | .i x | |
2634 | can be used in | |
2635 | .b R | |
2636 | lines to get deferred interpolation. | |
2fb78b49 | 2637 | .pp |
de7324ac | 2638 | Conditionals can be specified using the syntax: |
4da134f8 | 2639 | .(b |
de7324ac | 2640 | $?x text1 $| text2 $. |
4da134f8 | 2641 | .)b |
de7324ac EA |
2642 | This interpolates |
2643 | .i text1 | |
2644 | if the macro | |
2645 | .b $x | |
2646 | is set, | |
2fb78b49 | 2647 | and |
de7324ac EA |
2648 | .i text2 |
2649 | otherwise. | |
2650 | The | |
2651 | .q else | |
2652 | (\c | |
2653 | .b $| ) | |
2654 | clause may be omitted. | |
4da134f8 | 2655 | .pp |
7c1a78dc EA |
2656 | Lower case macro names are reserved to have |
2657 | special semantics, | |
2658 | used to pass information in or out of sendmail, | |
2659 | and special characters are reserved to | |
2660 | provide conditionals, etc. | |
2661 | Upper case names | |
2662 | (that is, | |
2663 | .b $A | |
2664 | through | |
2665 | .b $Z ) | |
2666 | are specifically reserved for configuration file authors. | |
2667 | .pp | |
de7324ac EA |
2668 | The following macros |
2669 | .i must | |
2670 | be defined to transmit information into | |
2671 | .i sendmail: | |
0a9ea158 | 2672 | .(b |
de7324ac EA |
2673 | .ta 4n |
2674 | e The SMTP entry message | |
2675 | j The \*(lqofficial\*(rq domain name for this site | |
2676 | l The format of the UNIX from line | |
2677 | n The name of the daemon (for error messages) | |
2678 | o The set of "operators" in addresses | |
2679 | q default format of sender address | |
2fb78b49 | 2680 | .)b |
4da134f8 | 2681 | The |
de7324ac EA |
2682 | .b $e |
2683 | macro is printed out when SMTP starts up. | |
2684 | The first word must be the | |
2685 | .b $j | |
2686 | macro. | |
2687 | The | |
2688 | .b $j | |
2689 | macro | |
2690 | should be in RFC821 format. | |
2691 | The | |
2692 | .b $l | |
2fb78b49 | 2693 | and |
de7324ac EA |
2694 | .b $n |
2695 | macros can be considered constants | |
2696 | except under terribly unusual circumstances. | |
2697 | The | |
2698 | .b $o | |
2699 | macro consists of a list of characters | |
2700 | which will be considered tokens | |
2701 | and which will separate tokens | |
2702 | when doing parsing. | |
2703 | For example, if | |
2704 | .q @ | |
2705 | were in the | |
2706 | .b $o | |
2707 | macro, then the input | |
2708 | .q a@b | |
2709 | would be scanned as three tokens: | |
2710 | .q a, | |
2711 | .q @, | |
2712 | and | |
2713 | .q b. | |
2714 | Finally, the | |
2715 | .b $q | |
2716 | macro specifies how an address should appear in a message | |
2717 | when it is defaulted. | |
2718 | For example, on our system these definitions are: | |
2fb78b49 | 2719 | .(b |
859d056a | 2720 | De$j Sendmail $v/$Z ready at $b |
de7324ac | 2721 | DnMAILER-DAEMON |
91679fc8 | 2722 | DlFrom $g $d |
859d056a EA |
2723 | Do.:%@!^/[] |
2724 | Dq$?x$x <$g>$|$g$. | |
2725 | Dj$w | |
2fb78b49 | 2726 | .)b |
de7324ac EA |
2727 | An acceptable alternative for the |
2728 | .b $q | |
2729 | macro is | |
859d056a | 2730 | .q "$g$?x ($x)$." . |
de7324ac | 2731 | These correspond to the following two formats: |
2fb78b49 | 2732 | .(b |
de7324ac | 2733 | Eric Allman <eric@CS.Berkeley.EDU> |
859d056a | 2734 | eric@CS.Berkeley.EDU (Eric Allman) |
2fb78b49 | 2735 | .)b |
859d056a EA |
2736 | .i Sendmail |
2737 | properly quotes names that have special characters | |
2738 | if the first form is used. | |
55c435aa | 2739 | .pp |
de7324ac EA |
2740 | Some macros are defined by |
2741 | .i sendmail | |
2742 | for interpolation into argv's for mailers | |
2743 | or for other contexts. | |
2744 | These macros are: | |
2745 | .(b | |
2746 | a The origination date in RFC 822 format | |
2747 | b The current date in RFC 822 format | |
2748 | c The hop count | |
2749 | d The date in UNIX (ctime) format | |
2750 | f The sender (from) address | |
2751 | g The sender address relative to the recipient | |
2752 | h The recipient host | |
2753 | i The queue id | |
a3d50769 | 2754 | k The UUCP node name (from the uname system call) |
de7324ac EA |
2755 | m The domain part of the \fIgethostname\fP return value |
2756 | p Sendmail's pid | |
2757 | r Protocol used to receive the message | |
2758 | s Sender's host name | |
2759 | t A numeric representation of the current time | |
2760 | u The recipient user | |
2761 | v The version number of sendmail | |
2762 | w The hostname of this site | |
2763 | x The full name of the sender | |
2764 | z The home directory of the recipient | |
403c2581 | 2765 | _ The validated sender address |
de7324ac | 2766 | .)b |
55c435aa | 2767 | .pp |
de7324ac | 2768 | There are three types of dates that can be used. |
55c435aa | 2769 | The |
de7324ac EA |
2770 | .b $a |
2771 | and | |
2772 | .b $b | |
2773 | macros are in RFC 822 format; | |
2774 | .b $a | |
2775 | is the time as extracted from the | |
2776 | .q Date: | |
2777 | line of the message | |
2778 | (if there was one), | |
2779 | and | |
2780 | .b $b | |
2781 | is the current date and time | |
2782 | (used for postmarks). | |
2783 | If no | |
2784 | .q Date: | |
2785 | line is found in the incoming message, | |
2786 | .b $a | |
2787 | is set to the current time also. | |
55c435aa | 2788 | The |
de7324ac EA |
2789 | .b $d |
2790 | macro is equivalent to the | |
859d056a | 2791 | .b $b |
de7324ac EA |
2792 | macro in UNIX |
2793 | (ctime) | |
2794 | format. | |
55c435aa | 2795 | .pp |
8b73c824 | 2796 | The |
de7324ac EA |
2797 | .b $f |
2798 | macro is the id of the sender | |
2799 | as originally determined; | |
2800 | when mailing to a specific host | |
2801 | the | |
2802 | .b $g | |
2803 | macro is set to the address of the sender | |
2804 | .ul | |
2805 | relative to the recipient. | |
2806 | For example, | |
2807 | if I send to | |
3dfefb78 | 2808 | .q bollard@matisse.CS.Berkeley.EDU |
de7324ac | 2809 | from the machine |
3dfefb78 | 2810 | .q vangogh.CS.Berkeley.EDU |
de7324ac EA |
2811 | the |
2812 | .b $f | |
2813 | macro will be | |
2814 | .q eric | |
2815 | and the | |
2816 | .b $g | |
2817 | macro will be | |
3dfefb78 | 2818 | .q eric@vangogh.CS.Berkeley.EDU. |
55c435aa | 2819 | .pp |
de7324ac | 2820 | The |
de7324ac EA |
2821 | .b $x |
2822 | macro is set to the full name of the sender. | |
2823 | This can be determined in several ways. | |
2824 | It can be passed as flag to | |
2825 | .i sendmail. | |
2826 | The second choice is the value of the | |
2827 | .q Full-name: | |
2828 | line in the header if it exists, | |
2829 | and the third choice is the comment field | |
2830 | of a | |
2831 | .q From: | |
2832 | line. | |
2833 | If all of these fail, | |
2834 | and if the message is being originated locally, | |
2835 | the full name is looked up in the | |
2836 | .i /etc/passwd | |
2837 | file. | |
55c435aa | 2838 | .pp |
de7324ac EA |
2839 | When sending, |
2840 | the | |
2841 | .b $h , | |
2842 | .b $u , | |
8b73c824 | 2843 | and |
de7324ac EA |
2844 | .b $z |
2845 | macros get set to the host, user, and home directory | |
2846 | (if local) | |
2847 | of the recipient. | |
2848 | The first two are set from the | |
2849 | .b $@ | |
2850 | and | |
2851 | .b $: | |
2852 | part of the rewriting rules, respectively. | |
8b73c824 EA |
2853 | .pp |
2854 | The | |
de7324ac | 2855 | .b $p |
2fb78b49 EA |
2856 | and |
2857 | .b $t | |
2858 | macros are used to create unique strings | |
2859 | (e.g., for the | |
2860 | .q Message-Id: | |
2861 | field). | |
2862 | The | |
2863 | .b $i | |
2864 | macro is set to the queue id on this host; | |
2865 | if put into the timestamp line | |
2866 | it can be extremely useful for tracking messages. | |
2867 | The | |
2fb78b49 EA |
2868 | .b $v |
2869 | macro is set to be the version number of | |
2870 | .i sendmail ; | |
2871 | this is normally put in timestamps | |
2872 | and has been proven extremely useful for debugging. | |
2873 | The | |
b01d261b EA |
2874 | .b $w |
2875 | macro is set to the name of this host | |
2876 | if it can be determined. | |
2877 | The | |
2fb78b49 EA |
2878 | .b $c |
2879 | field is set to the | |
2880 | .q "hop count," | |
2881 | i.e., the number of times this message has been processed. | |
2882 | This can be determined | |
2883 | by the | |
2884 | .b \-h | |
2885 | flag on the command line | |
2886 | or by counting the timestamps in the message. | |
4da134f8 | 2887 | .pp |
2fb78b49 EA |
2888 | The |
2889 | .b $r | |
2890 | and | |
2891 | .b $s | |
2892 | fields are set to the protocol used to communicate with sendmail | |
f13b6b36 | 2893 | and the sending hostname. |
403c2581 EA |
2894 | The |
2895 | .b $_ | |
2896 | is set to a validated sender host name. | |
2897 | If the sender is running an RFC 1413 compliant IDENT server, | |
2898 | it will include the user name on that host. | |
de7324ac | 2899 | .sh 3 "C and F \*- define classes" |
2fb78b49 | 2900 | .pp |
dd905b60 | 2901 | Classes of phrases may be defined |
de7324ac EA |
2902 | to match on the left hand side of rewriting rules, |
2903 | where a | |
dd905b60 EA |
2904 | .q phrase |
2905 | is a sequence of characters that do not contain space characters. | |
de7324ac EA |
2906 | For example |
2907 | a class of all local names for this site | |
2908 | might be created | |
2909 | so that attempts to send to oneself | |
2910 | can be eliminated. | |
2911 | These can either be defined directly in the configuration file | |
2912 | or read in from another file. | |
2913 | Classes may be given names | |
2914 | from the set of upper case letters. | |
2915 | Lower case letters and special characters | |
2916 | are reserved for system use. | |
b66b7f9a | 2917 | .pp |
de7324ac EA |
2918 | The syntax is: |
2919 | .(b F | |
2920 | .b C \c | |
dd905b60 EA |
2921 | .i c\|phrase1 |
2922 | .i phrase2... | |
de7324ac EA |
2923 | .br |
2924 | .b F \c | |
2925 | .i c\|file | |
2926 | .)b | |
2927 | The first form defines the class | |
2928 | .i c | |
2929 | to match any of the named words. | |
2930 | It is permissible to split them among multiple lines; | |
2931 | for example, the two forms: | |
b66b7f9a | 2932 | .(b |
de7324ac | 2933 | CHmonet ucbmonet |
b66b7f9a | 2934 | .)b |
de7324ac EA |
2935 | and |
2936 | .(b | |
2937 | CHmonet | |
2938 | CHucbmonet | |
2939 | .)b | |
2940 | are equivalent. | |
2941 | The second form | |
2942 | reads the elements of the class | |
2943 | .i c | |
2944 | from the named | |
2945 | .i file . | |
4da134f8 | 2946 | .pp |
7901972a EA |
2947 | The |
2948 | .b $~ | |
2949 | (match entries not in class) | |
2950 | only matches a single word; | |
2951 | multi-word entries in the class are ignored in this context. | |
2952 | .pp | |
de7324ac EA |
2953 | The class |
2954 | .b $=w | |
2955 | is set to be the set of all names | |
2956 | this host is known by. | |
2957 | This can be used to match local hostnames. | |
c3e97ee9 EA |
2958 | .pp |
2959 | The class | |
2960 | .b $=k | |
2961 | is set to be the same as | |
2962 | .b $k , | |
2963 | that is, the UUCP node name. | |
de7324ac EA |
2964 | .sh 3 "M \*- define mailer" |
2965 | .pp | |
2966 | Programs and interfaces to mailers | |
2967 | are defined in this line. | |
2968 | The format is: | |
2969 | .(b F | |
2970 | .b M \c | |
2971 | .i name , | |
2972 | {\c | |
2973 | .i field =\c | |
2974 | .i value \|}* | |
2975 | .)b | |
2976 | where | |
2977 | .i name | |
2978 | is the name of the mailer | |
2979 | (used internally only) | |
2980 | and the | |
2981 | .q field=name | |
2982 | pairs define attributes of the mailer. | |
2983 | Fields are: | |
4da134f8 | 2984 | .(b |
de7324ac EA |
2985 | .ta 1i |
2986 | Path The pathname of the mailer | |
2987 | Flags Special flags for this mailer | |
2988 | Sender A rewriting set for sender addresses | |
2989 | Recipient A rewriting set for recipient addresses | |
2990 | Argv An argument vector to pass to this mailer | |
2991 | Eol The end-of-line string for this mailer | |
2992 | Maxsize The maximum message length to this mailer | |
2993 | Linelimit The maximum line length in the message body | |
403c2581 | 2994 | Directory The working directory for the mailer |
4da134f8 | 2995 | .)b |
de7324ac EA |
2996 | Only the first character of the field name is checked. |
2997 | .pp | |
2998 | The following flags may be set in the mailer description. | |
2999 | Any other flags may be used freely | |
3000 | to conditionally assign headers to messages | |
3001 | destined for particular mailers. | |
3002 | .nr ii 4n | |
50d4a65c EA |
3003 | .ip a |
3004 | Run Extended SMTP (ESMTP) protocol (defined in RFCs 1425, 1426, and 1427). | |
8aace743 EA |
3005 | .ip b |
3006 | Force a blank line on the end of a message. | |
3007 | This is intended to work around some stupid versions of | |
3008 | /bin/mail | |
3009 | that require a blank line, but do not provide it themselves. | |
3010 | It would not normally be used on network mail. | |
6d5ff626 EA |
3011 | .ip c |
3012 | Do not include comments in addresses. | |
3013 | This should only be used if you have to work around | |
3014 | a remote mailer that gets confused by comments. | |
de7324ac EA |
3015 | .ip C |
3016 | If mail is | |
3017 | .i received | |
3018 | from a mailer with this flag set, | |
3019 | any addresses in the header that do not have an at sign | |
3020 | (\c | |
3021 | .q @ ) | |
3022 | after being rewritten by ruleset three | |
3023 | will have the | |
3024 | .q @domain | |
3025 | clause from the sender | |
3026 | tacked on. | |
3027 | This allows mail with headers of the form: | |
4da134f8 | 3028 | .(b |
de7324ac EA |
3029 | From: usera@hosta |
3030 | To: userb@hostb, userc | |
4da134f8 | 3031 | .)b |
de7324ac EA |
3032 | to be rewritten as: |
3033 | .(b | |
3034 | From: usera@hosta | |
3035 | To: userb@hostb, userc@hosta | |
3036 | .)b | |
3037 | automatically. | |
3038 | .ip D | |
3039 | This mailer wants a | |
3040 | .q Date: | |
3041 | header line. | |
3042 | .ip e | |
3043 | This mailer is expensive to connect to, | |
3044 | so try to avoid connecting normally; | |
3045 | any necessary connection will occur during a queue run. | |
3046 | .ip E | |
3047 | Escape lines beginning with | |
f13b6b36 | 3048 | .q From |
de7324ac EA |
3049 | in the message with a `>' sign. |
3050 | .ip f | |
3051 | The mailer wants a | |
3052 | .b \-f | |
3053 | .i from | |
3054 | flag, | |
3055 | but only if this is a network forward operation | |
3056 | (i.e., | |
3057 | the mailer will give an error | |
3058 | if the executing user | |
3059 | does not have special permissions). | |
3060 | .ip F | |
3061 | This mailer wants a | |
3062 | .q From: | |
3063 | header line. | |
8aace743 EA |
3064 | .ip g |
3065 | Normally, | |
3066 | .i sendmail | |
3067 | sends internally generated email (e.g., error messages) | |
3068 | using the null return address\** | |
3069 | .(f | |
3070 | \**Actually, this only applies to SMTP, | |
3071 | which uses the ``MAIL FROM:<>'' command. | |
3072 | .)f | |
3073 | as required by RFC 1123. | |
3074 | However, some mailers don't accept a null return address. | |
3075 | If necessary, | |
3076 | you can set the | |
3077 | .b g | |
3078 | flag to prevent | |
3079 | .i sendmail | |
3080 | from obeying the standards; | |
3081 | error messages will be sent as from the MAILER-DAEMON | |
3082 | (actually, the value of the | |
3083 | .b $n | |
3084 | macro). | |
de7324ac EA |
3085 | .ip h |
3086 | Upper case should be preserved in host names | |
3087 | for this mailer. | |
f13b6b36 | 3088 | .ip I |
de7324ac EA |
3089 | This mailer will be speaking SMTP |
3090 | to another | |
f13b6b36 | 3091 | .i sendmail |
de7324ac EA |
3092 | \*- |
3093 | as such it can use special protocol features. | |
3094 | This option is not required | |
3095 | (i.e., | |
3096 | if this option is omitted the transmission will still operate successfully, | |
3097 | although perhaps not as efficiently as possible). | |
3098 | .ip l | |
3099 | This mailer is local | |
3100 | (i.e., | |
3101 | final delivery will be performed). | |
3102 | .ip L | |
3103 | Limit the line lengths as specified in RFC821. | |
3104 | This deprecated option should be replaced by the | |
3105 | .b L= | |
3106 | mail declaration. | |
3107 | For historic reasons, the | |
3108 | .b L | |
3109 | flag also sets the | |
3110 | .b 7 | |
3111 | flag. | |
f13b6b36 EA |
3112 | .ip m |
3113 | This mailer can send to multiple users | |
3114 | on the same host | |
3115 | in one transaction. | |
3116 | When a | |
3117 | .b $u | |
3118 | macro occurs in the | |
3119 | .i argv | |
3120 | part of the mailer definition, | |
3121 | that field will be repeated as necessary | |
3122 | for all qualifying users. | |
3123 | .ip M | |
3124 | This mailer wants a | |
3125 | .q Message-Id: | |
3126 | header line. | |
3127 | .ip n | |
3128 | Do not insert a UNIX-style | |
3129 | .q From | |
3130 | line on the front of the message. | |
3131 | .ip p | |
e920f7ff | 3132 | Use the route-addr style reverse-path in the SMTP |
f13b6b36 EA |
3133 | .q "MAIL FROM:" |
3134 | command | |
3135 | rather than just the return address; | |
e920f7ff EA |
3136 | although this is required in RFC821 section 3.1, |
3137 | many hosts do not process reverse-paths properly. | |
3138 | Reverse-paths are officially discouraged by RFC 1123. | |
f13b6b36 EA |
3139 | .ip P |
3140 | This mailer wants a | |
3141 | .q Return-Path: | |
3142 | line. | |
3143 | .ip r | |
3144 | Same as | |
3145 | .b f , | |
3146 | but sends a | |
2fb78b49 | 3147 | .b \-r |
f13b6b36 EA |
3148 | flag. |
3149 | .ip s | |
3150 | Strip quote characters off of the address | |
3151 | before calling the mailer. | |
3152 | .ip S | |
3153 | Don't reset the userid | |
3154 | before calling the mailer. | |
3155 | This would be used in a secure environment | |
3156 | where | |
3157 | .i sendmail | |
3158 | ran as root. | |
3159 | This could be used to avoid forged addresses. | |
3160 | This flag is suppressed if given from an | |
3161 | .q unsafe | |
3162 | environment | |
3163 | (e.g, a user's mail.cf file). | |
3164 | .ip u | |
3165 | Upper case should be preserved in user names | |
3166 | for this mailer. | |
3167 | .ip U | |
3168 | This mailer wants Unix-style | |
3169 | .q From | |
3170 | lines with the ugly UUCP-style | |
3171 | .q "remote from <host>" | |
3172 | on the end. | |
3173 | .ip x | |
3174 | This mailer wants a | |
3175 | .q Full-Name: | |
3176 | header line. | |
3177 | .ip X | |
3178 | This mailer want to use the hidden dot algorithm | |
3179 | as specified in RFC821; | |
3180 | basically, | |
3181 | any line beginning with a dot | |
3182 | will have an extra dot prepended | |
3183 | (to be stripped at the other end). | |
3184 | This insures that lines in the message containing a dot | |
3185 | will not terminate the message prematurely. | |
3186 | .ip 7 | |
3187 | Strip all output to seven bits. | |
3188 | This is the default if the | |
3189 | .b L | |
3190 | flag is set. | |
3191 | Note that setting this is not | |
3192 | sufficient to get full eight bit data passed through | |
09ac6be2 EA |
3193 | .i sendmail . |
3194 | If the | |
3195 | .b 7 | |
3196 | option is set, this is essentially always set, | |
3197 | since the eighth bit was stripped on input. | |
de7324ac EA |
3198 | .pp |
3199 | The mailer with the special name | |
3200 | .q error | |
3201 | can be used to generate a user error. | |
3202 | The (optional) host field is an exit status to be returned, | |
3203 | and the user field is a message to be printed. | |
3204 | The exit status may be numeric or one of the values | |
3205 | USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG | |
3206 | to return the corresponding EX_ exit code. | |
3207 | For example, the entry: | |
3208 | .(b | |
3209 | $#error $@ NOHOST $: Host unknown in this domain | |
3210 | .)b | |
3211 | on the RHS of a rule | |
3212 | will cause the specified error to be generated | |
3213 | and the | |
3214 | .q "Host unknown" | |
3215 | exit status to be returned | |
3216 | if the LHS matches. | |
3217 | This mailer is only functional in ruleset zero. | |
fa2fc92a EA |
3218 | .pp |
3219 | The mailer named | |
3220 | .q local | |
3221 | .i must | |
3222 | be defined in every configuration file. | |
3223 | This is used to deliver local mail, | |
3224 | and is treated specially in several ways. | |
3225 | Additionally, three other mailers named | |
3226 | .q prog , | |
3227 | .q *file* , | |
3228 | and | |
3229 | .q *include* | |
3230 | may be defined to tune the delivery of messages to programs, | |
3231 | files, | |
3232 | and :include: lists respectively. | |
3233 | They default to: | |
3234 | .(b | |
3235 | Mprog, P=/bin/sh, F=lsD, A=sh \-c $u | |
6890b21b EA |
3236 | M*file*, P=/dev/null, F=lsDFMPEu, A=FILE |
3237 | M*include*, P=/dev/null, F=su, A=INCLUDE | |
fa2fc92a | 3238 | .)b |
6ebbc09a EA |
3239 | .pp |
3240 | The Sender and Recipient rewriting sets | |
3241 | may either be a simple integer | |
3242 | or may be two integers separated by a slash; | |
3243 | if so, the first rewriting set is applied to envelope | |
3244 | addresses | |
3245 | and the second is applied to headers. | |
403c2581 EA |
3246 | .pp |
3247 | The Directory | |
3248 | is actually a colon-separated path of directories to try. | |
3249 | For example, the definition | |
3250 | .q D=$z:/ | |
3251 | first tries to execute in the recipient's home directory; | |
3252 | if that is not available, | |
3253 | it tries to execute in the root of the filesystem. | |
3254 | This is intended to be used only on the | |
3255 | .q prog | |
3256 | mailer, | |
3257 | since some shells (such as | |
3258 | .i csh ) | |
3259 | refuse to execute if they cannot read the home directory. | |
3260 | Since the queue directory is not normally readable by normal users | |
3261 | .i csh | |
3262 | scripts as recipients can fail. | |
de7324ac EA |
3263 | .sh 3 "H \*- define header" |
3264 | .pp | |
3265 | The format of the header lines that sendmail inserts into the message | |
3266 | are defined by the | |
3267 | .b H | |
3268 | line. | |
3269 | The syntax of this line is: | |
3270 | .(b F | |
3271 | .b H [\c | |
3272 | .b ? \c | |
3273 | .i mflags \c | |
3274 | .b ? ]\c | |
3275 | .i hname \c | |
3276 | .b : | |
3277 | .i htemplate | |
3278 | .)b | |
3279 | Continuation lines in this spec | |
3280 | are reflected directly into the outgoing message. | |
3281 | The | |
3282 | .i htemplate | |
3283 | is macro expanded before insertion into the message. | |
3284 | If the | |
3285 | .i mflags | |
3286 | (surrounded by question marks) | |
3287 | are specified, | |
3288 | at least one of the specified flags | |
3289 | must be stated in the mailer definition | |
3290 | for this header to be automatically output. | |
3291 | If one of these headers is in the input | |
3292 | it is reflected to the output | |
3293 | regardless of these flags. | |
3294 | .pp | |
3295 | Some headers have special semantics | |
3296 | that will be described below. | |
3297 | .sh 3 "O \*- set option" | |
3298 | .pp | |
3299 | There are a number of | |
3300 | .q random | |
3301 | options that | |
3302 | can be set from a configuration file. | |
3303 | Options are represented by single characters. | |
3304 | The syntax of this line is: | |
3305 | .(b F | |
3306 | .b O \c | |
3307 | .i o\|value | |
3308 | .)b | |
3309 | This sets option | |
3310 | .i o | |
3311 | to be | |
3312 | .i value . | |
3313 | Depending on the option, | |
3314 | .i value | |
3315 | may be a string, an integer, | |
3316 | a boolean | |
3317 | (with legal values | |
3318 | .q t , | |
3319 | .q T , | |
3320 | .q f , | |
3321 | or | |
3322 | .q F ; | |
3323 | the default is TRUE), | |
3324 | or | |
3325 | a time interval. | |
3326 | .pp | |
3327 | The options supported are: | |
3328 | .nr ii 1i | |
3329 | .ip a\fIN\fP | |
3330 | If set, | |
3331 | wait up to | |
3332 | .i N | |
3333 | minutes for an | |
3334 | .q @:@ | |
3335 | entry to exist in the alias database | |
3336 | before starting up. | |
3337 | If it does not appear in | |
3338 | .i N | |
3339 | minutes, | |
3340 | rebuild the database | |
3341 | (if the | |
3342 | .b D | |
3343 | option is also set) | |
3344 | or issue a warning. | |
079e1752 | 3345 | .ip "A\fIspec, spec, ...\fP" |
d6f77a91 EA |
3346 | Specify possible alias file(s). |
3347 | Each | |
3348 | .i spec | |
3349 | should be in the format | |
3350 | ``\c | |
3351 | .i class \c | |
3352 | .b : | |
3353 | .i file '' | |
3354 | where | |
3355 | .i class \c | |
3356 | .b : | |
3357 | is optional and defaults to ``implicit''. | |
3358 | Depending on how | |
3359 | .b sendmail | |
3360 | is compiled, valid classes are | |
3361 | .q implicit | |
3362 | (search through a compiled-in list of alias file types, | |
3363 | for back compatibility), | |
3364 | .q hash | |
3365 | (if | |
3366 | .sm NEWDB | |
3367 | is specified), | |
3368 | .q dbm | |
3369 | (if | |
3370 | .sm NDBM | |
3371 | is specified), | |
3372 | .q stab | |
3373 | (internal symbol table \*- not normally used | |
3374 | unless you have no other database lookup), | |
3375 | or | |
3376 | .q nis | |
3377 | (if | |
3378 | .sm NIS | |
3379 | is specified). | |
3380 | If a list of | |
3381 | .i spec s | |
3382 | are provided, | |
3383 | .i sendmail | |
3384 | searches them in order. | |
50d4a65c | 3385 | .ip b\fIN\fP/\fIM\fP |
59baf33c EA |
3386 | Insist on at least |
3387 | .i N | |
3388 | blocks free on the filesystem that holds the queue files | |
3389 | before accepting email via SMTP. | |
3390 | If there is insufficient space | |
3391 | .i sendmail | |
3392 | gives a 452 response | |
3393 | to the MAIL command. | |
859d056a | 3394 | This invites the sender to try again later. |
50d4a65c EA |
3395 | The optional |
3396 | .i M | |
3397 | is a maximum message size advertised in the ESMTP EHLO response. | |
3398 | It is currently otherwise unused. | |
de7324ac EA |
3399 | .ip B\fIc\fP |
3400 | Set the blank substitution character to | |
3401 | .i c . | |
3402 | Unquoted spaces in addresses are replaced by this character. | |
55aab950 | 3403 | Defaults to space (i.e., no change is made). |
de7324ac EA |
3404 | .ip c |
3405 | If an outgoing mailer is marked as being expensive, | |
3406 | don't connect immediately. | |
3407 | This requires that queueing be compiled in, | |
3408 | since it will depend on a queue run process to | |
3409 | actually send the mail. | |
3410 | .ip C\fIN\fP | |
3411 | Checkpoints the queue every | |
3412 | .i N | |
3413 | (default 10) | |
3414 | addresses sent. | |
3415 | If your system crashes during delivery to a large list, | |
3416 | this prevents retransmission to any but the last | |
3417 | .I N | |
3418 | recipients. | |
3419 | .ip d\fIx\fP | |
3420 | Deliver in mode | |
3421 | .i x . | |
3422 | Legal modes are: | |
3423 | .(b | |
3424 | .ta 4n | |
3425 | i Deliver interactively (synchronously) | |
3426 | b Deliver in background (asynchronously) | |
3427 | q Just queue the message (deliver during queue run) | |
3428 | .)b | |
56ba89fb EA |
3429 | Defaults to ``b'' if no option is specified, |
3430 | ``i'' if it is specified but given no argument | |
3431 | (i.e., ``Od'' is equivalent to ``Odi''). | |
de7324ac EA |
3432 | .ip D |
3433 | If set, | |
3434 | rebuild the alias database if necessary and possible. | |
3435 | If this option is not set, | |
3436 | .i sendmail | |
3437 | will never rebuild the alias database | |
3438 | unless explicitly requested | |
3439 | using | |
3440 | .b \-bi . | |
3441 | .ip e\fIx\fP | |
3442 | Dispose of errors using mode | |
3443 | .i x . | |
3444 | The values for | |
3445 | .i x | |
3446 | are: | |
3447 | .(b | |
3448 | p Print error messages (default) | |
3449 | q No messages, just give exit status | |
3450 | m Mail back errors | |
3451 | w Write back errors (mail if user not logged in) | |
3452 | e Mail back errors and give zero exit stat always | |
3453 | .)b | |
3454 | .ip E\fIfile/message\fP | |
3455 | Prepend error messages with the indicated message. | |
3456 | If it begins with a slash, | |
3457 | it is assumed to be the pathname of a file | |
3458 | containing a message (this is the recommended setting). | |
3459 | Otherwise, it is a literal message. | |
3460 | The error file might contain the name, email address, and/or phone number | |
3461 | of a local postmaster who could provide assistance | |
3462 | in to end users. | |
3463 | If the option is missing or null, | |
3464 | or if it names a file which does not exist or which is not readable, | |
3465 | no message is printed. | |
3466 | .ip f | |
3467 | Save | |
3468 | Unix-style | |
3469 | .q From | |
3470 | lines at the front of headers. | |
3471 | Normally they are assumed redundant | |
3472 | and discarded. | |
3473 | .ip F\fImode\fP | |
3474 | The file mode for queue files. | |
3475 | .ip g\fIn\fP | |
3476 | Set the default group id | |
3477 | for mailers to run in | |
3478 | to | |
3479 | .i n . | |
55aab950 | 3480 | Defaults to 1. |
de7324ac EA |
3481 | .ip G |
3482 | Allow fuzzy matching on the GECOS field. | |
3483 | If this flag is set, | |
3484 | and the usual user name lookups fail | |
3485 | (that is, there is no alias with this name and a | |
3486 | .i getpwnam | |
3487 | fails), | |
3488 | sequentially search the password file | |
3489 | for a matching entry in the GECOS field. | |
3490 | This also requires that MATCHGECOS | |
3491 | be turned on during compilation. | |
3492 | This option is not recommended. | |
3493 | .ip h\fIN\fP | |
3494 | The maximum hop count. | |
3495 | Messages that have been processed more than | |
3496 | .i N | |
3497 | times are assumed to be in a loop and are rejected. | |
55aab950 | 3498 | Defaults to 25. |
de7324ac EA |
3499 | .ip H\fIfile\fP |
3500 | Specify the help file | |
3501 | for SMTP. | |
3502 | .ip i | |
3503 | Ignore dots in incoming messages. | |
859d056a EA |
3504 | This is always disabled (that is, dots are always accepted) |
3505 | when reading SMTP mail. | |
de7324ac EA |
3506 | .ip I |
3507 | Insist that the BIND name server be running | |
3508 | to resolve host names. | |
3509 | If this is not set and the name server is not running, | |
3510 | the | |
3511 | .i /etc/hosts | |
3512 | file will be considered complete. | |
3513 | In general, you do want to set this option | |
3514 | if your | |
3515 | .i /etc/hosts | |
3516 | file does not include all hosts known to you | |
3517 | or if you are using the MX (mail forwarding) feature of the BIND name server. | |
3518 | The name server will still be consulted | |
3519 | even if this option is not set, but | |
3520 | .i sendmail | |
3521 | will feel free to resort to reading | |
3522 | .i /etc/hosts | |
3523 | if the name server is not available. | |
3524 | Thus, you should | |
3525 | .i never | |
3526 | set this option if you do not run the name server. | |
d6f77a91 EA |
3527 | .ip j |
3528 | If set, send error messages in MIME format | |
3529 | (see RFC1341 and RFC1344 for details). | |
de7324ac EA |
3530 | .ip J\fIpath\fP |
3531 | Set the path for searching for users' .forward files. | |
3532 | The default is | |
3533 | .q $z/.forward . | |
3534 | Some sites that use the automounter may prefer to change this to | |
3535 | .q /var/forward/$u | |
3536 | to search a file with the same name as the user in a system directory. | |
3537 | It can also be set to a sequence of paths separated by colons; | |
3538 | .i sendmail | |
3539 | stops at the first file it can successfully and safely open. | |
3540 | For example, | |
3541 | .q /var/forward/$u:$z/.forward | |
3542 | will search first in /var/forward/\c | |
3543 | .i username | |
3544 | and then in | |
3545 | .i ~username /.forward | |
3546 | (but only if the first file does not exist). | |
3547 | .ip k\fIN\fP | |
3548 | The maximum number of open connections that will be cached at a time. | |
3549 | The default is one. | |
3550 | This delays closing the the current connection until | |
3551 | either this invocation of sendmail needs to connect to another host | |
3552 | or it terminates. | |
3553 | Setting it to zero defaults to the old behavior, | |
3554 | that is, connections are closed immediately. | |
3555 | .ip K\fItimeout\fP | |
3556 | The maximum amount of time a cached connection will be permitted to idle | |
3557 | without activity. | |
3558 | If this time is exceeded, | |
3559 | the connection is immediately closed. | |
3560 | This value should be small (on the order of ten minutes). | |
3561 | Before | |
3562 | .b sendmail | |
3563 | uses a cached connection, | |
3564 | it always sends a NOOP (no operation) command | |
3565 | to check the connection; | |
3566 | if this fails, it reopens the connection. | |
3567 | This keeps your end from failing if the other end times out. | |
3568 | The point of this option is to be a good network neighbor | |
3569 | and avoid using up excessive resources | |
3570 | on the other end. | |
3571 | The default is five minutes. | |
399e2f78 EA |
3572 | .ip l |
3573 | If there is an | |
3574 | .q Errors-To: | |
3575 | header, send error messages to the addresses listed there. | |
3576 | They normally go to the envelope sender. | |
3577 | Use of this option causes sendmail to violate RFC 1123. | |
de7324ac EA |
3578 | .ip L\fIn\fP |
3579 | Set the default log level to | |
3580 | .i n . | |
55aab950 | 3581 | Defaults to 9. |
de7324ac EA |
3582 | .ip m |
3583 | Send to me too, | |
3584 | even if I am in an alias expansion. | |
3585 | .ip M\fIx\|value\fP | |
3586 | Set the macro | |
3587 | .i x | |
3588 | to | |
3589 | .i value . | |
3590 | This is intended only for use from the command line. | |
56ba89fb EA |
3591 | .ip n |
3592 | Validate the RHS of aliases when rebuilding the alias database. | |
de7324ac EA |
3593 | .ip o |
3594 | Assume that the headers may be in old format, | |
3595 | i.e., | |
3596 | spaces delimit names. | |
3597 | This actually turns on | |
3598 | an adaptive algorithm: | |
3599 | if any recipient address contains a comma, parenthesis, | |
3600 | or angle bracket, | |
3601 | it will be assumed that commas already exist. | |
3602 | If this flag is not on, | |
3603 | only commas delimit names. | |
3604 | Headers are always output with commas between the names. | |
a99d3cb3 EA |
3605 | .ip O\fIoptions\fP |
3606 | Set server SMTP options. | |
3607 | The options are | |
3608 | .i key=value | |
3609 | pairs. | |
3610 | Known keys are: | |
3611 | .(b | |
3612 | .ta 1i | |
3613 | Port Name/number of listening port (defaults to "smtp") | |
3614 | Addr Address mask (defaults INADDR_ANY) | |
3615 | Family Address family (defaults to INET) | |
c9da16ae | 3616 | Listen Size of listen queue (defaults to 10) |
a99d3cb3 EA |
3617 | .)b |
3618 | The | |
3619 | .i Addr ess | |
3620 | mask may be a numeric address in dot notation | |
3621 | or a network name. | |
59baf33c EA |
3622 | .ip p\fI\|opt,opt,...\fP |
3623 | Set the privacy | |
3624 | .i opt ions. | |
3625 | ``Privacy'' is really a misnomer; | |
859d056a | 3626 | many of these are just a way of insisting on stricter adherence |
59baf33c EA |
3627 | to the SMTP protocol. |
3628 | The | |
3629 | .i opt ions | |
3630 | can be selected from: | |
3631 | .(b | |
859d056a | 3632 | .ta \w'needvrfyhelo'u+3n |
59baf33c | 3633 | public Allow open access |
475d7a3d EA |
3634 | needmailhelo Insist on HELO or EHLO command before MAIL |
3635 | needexpnhelo Insist on HELO or EHLO command before EXPN | |
59baf33c | 3636 | noexpn Disallow EXPN entirely |
475d7a3d | 3637 | needvrfyhelo Insist on HELO or EHLO command before VRFY |
59baf33c | 3638 | novrfy Disallow VRFY entirely |
890cda2d EA |
3639 | restrictmailq Restrict mailq command |
3640 | goaway Disallow essentially all SMTP status queries | |
59baf33c | 3641 | .)b |
890cda2d EA |
3642 | The |
3643 | .q goaway | |
3644 | pseudo-flag sets all flags except | |
3645 | .q restrictmailq . | |
3646 | If mailq is restricted, | |
3647 | only people in the same group as the queue directory | |
3648 | can print the queue. | |
de7324ac EA |
3649 | .ip P\fIpostmaster\fP |
3650 | If set, | |
3651 | copies of error messages will be sent to the named | |
3652 | .i postmaster . | |
475d7a3d | 3653 | Only the header of the failed message is sent. |
de7324ac EA |
3654 | Since most errors are user problems, |
3655 | this is probably not a good idea on large sites, | |
3656 | and arguably contains all sorts of privacy violations, | |
3657 | but it seems to be popular with certain operating systems vendors. | |
3658 | .ip q\fIfactor\fP | |
3659 | Use | |
3660 | .i factor | |
3661 | as the multiplier in the map function | |
3662 | to decide when to just queue up jobs rather than run them. | |
3663 | This value is divided by the difference between the current load average | |
3664 | and the load average limit | |
3665 | (\c | |
3666 | .b x | |
3667 | flag) | |
3668 | to determine the maximum message priority | |
3669 | that will be sent. | |
55aab950 | 3670 | Defaults to 600000. |
de7324ac EA |
3671 | .ip Q\fIdir\fP |
3672 | Use the named | |
3673 | .i dir | |
3674 | as the queue directory. | |
859d056a | 3675 | .ip r\|\fItimeouts\fP |
de7324ac EA |
3676 | Timeout reads after |
3677 | .i time | |
3678 | interval. | |
e920f7ff EA |
3679 | The |
3680 | .i timeouts | |
3681 | argument is a list of | |
3682 | .i keyword=value | |
3683 | pairs. | |
3684 | The recognized timeouts and their default values, and their | |
3685 | minimum values specified in RFC 1123 section 5.3.2 are: | |
3686 | .(b | |
859d056a | 3687 | .ta \w'datafinal'u+3n |
e920f7ff | 3688 | initial wait for initial greeting message [5m, 5m] |
475d7a3d | 3689 | helo reply to HELO or EHLO command [5m, none] |
e920f7ff EA |
3690 | mail reply to MAIL command [10m, 5m] |
3691 | rcpt reply to RCPT command [1h, 5m] | |
3692 | datainit reply to DATA command [5m, 2m] | |
3693 | datablock data block read [1h, 3m] | |
3694 | datafinal reply to final ``.'' in data [1h, 10m] | |
3695 | rset reply to RSET command [5m, none] | |
3696 | quit reply to QUIT command [2m, none] | |
859d056a | 3697 | misc reply to NOOP and VERB commands [2m, none] |
e920f7ff EA |
3698 | command command read [1h, 5m] |
3699 | .)b | |
3700 | All but | |
3701 | .q command | |
3702 | apply to client SMTP. | |
3703 | For back compatibility, | |
3704 | a timeout with no ``keyword='' part | |
3705 | will set all of the longer values. | |
de7324ac EA |
3706 | .ip s |
3707 | Be super-safe when running things, | |
3708 | i.e., | |
3709 | always instantiate the queue file, | |
3710 | even if you are going to attempt immediate delivery. | |
3711 | .i Sendmail | |
3712 | always instantiates the queue file | |
3713 | before returning control the the client | |
3714 | under any circumstances. | |
3715 | .ip S\fIfile\fP | |
3716 | Log statistics in the named | |
3717 | .i file . | |
3718 | .ip t\fIS,D\fP | |
3719 | Set the local time zone name to | |
3720 | .i S | |
3721 | for standard time and | |
3722 | .i D | |
3723 | for daylight time; | |
3724 | this is only used under version six. | |
31e506e2 | 3725 | .ip T\fIrtime/wtime\fP |
de7324ac | 3726 | Set the queue timeout to |
31e506e2 | 3727 | .i rtime . |
de7324ac EA |
3728 | After this interval, |
3729 | messages that have not been successfully sent | |
3730 | will be returned to the sender. | |
31e506e2 EA |
3731 | Defaults to five days. |
3732 | The optional | |
3733 | .i wtime | |
3734 | is the time after which a warning message is sent. | |
3735 | If it is missing or zero | |
3736 | then no warning messages are sent. | |
de7324ac EA |
3737 | .ip u\fIn\fP |
3738 | Set the default userid for mailers to | |
3739 | .i n . | |
3740 | Mailers without the | |
3741 | .i S | |
3742 | flag in the mailer definition | |
3743 | will run as this user. | |
55aab950 | 3744 | Defaults to 1. |
de7324ac EA |
3745 | .ip U\fIudbspec\fP |
3746 | The user database specification. | |
3747 | .ip v | |
3748 | Run in verbose mode. | |
56ba89fb EA |
3749 | If this is set, |
3750 | .i sendmail | |
3751 | adjusts options | |
3752 | .b c | |
3753 | (don't connect to expensive mailers) | |
3754 | and | |
3755 | .b d | |
3756 | (delivery mode) | |
3757 | so that all mail is delivered completely | |
3758 | in a single job | |
3759 | so that you can see the entire delivery process. | |
3760 | Option | |
3761 | .b v | |
3762 | should | |
3763 | .i never | |
3764 | be set in the configuration file; | |
3765 | it is intended for command line use only. | |
a99d3cb3 EA |
3766 | .ip V\fIfallbackhost\fP |
3767 | If specified, the | |
3768 | .i fallbackhost | |
3769 | acts like a very low priority MX | |
3770 | on every host. | |
3771 | This is intended to be used by sites with poor network connectivity. | |
de7324ac EA |
3772 | .ip x\fILA\fP |
3773 | When the system load average exceeds | |
3774 | .i LA , | |
3775 | just queue messages | |
3776 | (i.e., don't try to send them). | |
55aab950 | 3777 | Defaults to 8. |
de7324ac EA |
3778 | .ip X\fILA\fP |
3779 | When the system load average exceeds | |
3780 | .i LA , | |
3781 | refuse incoming SMTP connections. | |
55aab950 | 3782 | Defaults to 12. |
de7324ac EA |
3783 | .ip y\fIfact\fP |
3784 | The indicated | |
3785 | .i fact or | |
3786 | is added to the priority (thus | |
3787 | .i lowering | |
3788 | the priority of the job) | |
3789 | for each recipient, | |
3790 | i.e., this value penalizes jobs with large numbers of recipients. | |
55aab950 | 3791 | Defaults to 30000. |
de7324ac EA |
3792 | .ip Y |
3793 | If set, | |
3794 | deliver each job that is run from the queue in a separate process. | |
3795 | Use this option if you are short of memory, | |
3796 | since the default tends to consume considerable amounts of memory | |
3797 | while the queue is being processed. | |
3798 | .ip z\fIfact\fP | |
3799 | The indicated | |
3800 | .i fact or | |
3801 | is multiplied by the message class | |
3802 | (determined by the Precedence: field in the user header | |
3803 | and the | |
3804 | .b P | |
3805 | lines in the configuration file) | |
3806 | and subtracted from the priority. | |
3807 | Thus, messages with a higher Priority: will be favored. | |
55aab950 | 3808 | Defaults to 1800. |
de7324ac EA |
3809 | .ip Z\fIfact\fP |
3810 | The | |
3811 | .i fact or | |
3812 | is added to the priority | |
3813 | every time a job is processed. | |
3814 | Thus, | |
3815 | each time a job is processed, | |
3816 | its priority will be decreased by the indicated value. | |
3817 | In most environments this should be positive, | |
3818 | since hosts that are down are all too often down for a long time. | |
55aab950 | 3819 | Defaults to 90000. |
09ac6be2 EA |
3820 | .ip 7 |
3821 | Strip input to seven bits for compatibility with old systems. | |
3822 | This shouldn't be necessary. | |
de7324ac EA |
3823 | .lp |
3824 | All options can be specified on the command line using the | |
3825 | \-o flag, | |
3826 | but most will cause | |
3827 | .i sendmail | |
3828 | to relinquish its setuid permissions. | |
3829 | The options that will not cause this are | |
09ac6be2 | 3830 | b, d, e, E, i, L, m, o, p, r, s, v, C, and 7. |
de7324ac EA |
3831 | Also, M (define macro) when defining the r or s macros |
3832 | is also considered | |
3833 | .q safe . | |
de7324ac EA |
3834 | .sh 3 "P \*- precedence definitions" |
3835 | .pp | |
3836 | Values for the | |
3837 | .q "Precedence:" | |
3838 | field may be defined using the | |
3839 | .b P | |
3840 | control line. | |
3841 | The syntax of this field is: | |
3842 | .(b | |
3843 | \fBP\fP\fIname\fP\fB=\fP\fInum\fP | |
3844 | .)b | |
3845 | When the | |
3846 | .i name | |
3847 | is found in a | |
3848 | .q Precedence: | |
3849 | field, | |
3850 | the message class is set to | |
3851 | .i num . | |
3852 | Higher numbers mean higher precedence. | |
3853 | Numbers less than zero | |
3854 | have the special property | |
55aab950 EA |
3855 | that if an error occurs during processing |
3856 | the body of the message will not be returned; | |
3857 | this is expected to be used for | |
3858 | .q "bulk" | |
3859 | mail such as through mailing lists. | |
de7324ac EA |
3860 | The default precedence is zero. |
3861 | For example, | |
3862 | our list of precedences is: | |
3863 | .(b | |
3864 | Pfirst-class=0 | |
3865 | Pspecial-delivery=100 | |
859d056a | 3866 | Plist=\-30 |
55aab950 | 3867 | Pbulk=\-60 |
de7324ac EA |
3868 | Pjunk=\-100 |
3869 | .)b | |
859d056a EA |
3870 | People writing mailing list exploders |
3871 | are encouraged to use | |
3872 | .q "Precedence: list" . | |
3873 | Older versions of | |
3874 | .i sendmail | |
3875 | (which discarded all error returns for negative precedences) | |
3876 | didn't recognize this name, giving it a default precedence of zero. | |
3877 | This allows list maintainers to see error returns | |
3878 | on both old and new versions of | |
3879 | .i sendmail . | |
de7324ac EA |
3880 | .sh 3 "V \*- configuration version level" |
3881 | .pp | |
3882 | To provide compatibility with old configuration files, | |
3883 | the | |
3884 | .b V | |
3885 | line has been added to define some very basic semantics | |
3886 | of the configuration file. | |
3887 | These are not intended to be long term supports; | |
3888 | rather, they describe compatibility features | |
3889 | which will probably be removed in future releases. | |
3890 | .pp | |
3891 | .q Old | |
e920f7ff EA |
3892 | configuration files are defined as version level one. |
3893 | Version level two files make the following changes: | |
de7324ac EA |
3894 | .np |
3895 | Host name canonification ($[ ... $]) | |
3896 | appends a dot if the name is recognized; | |
3897 | this gives the config file a way of finding out if anything matched. | |
3898 | (Actually, this just initializes the | |
3899 | .q host | |
3900 | map with the | |
3901 | .q \-a. | |
3902 | flag \*- you can reset it to anything you prefer | |
3903 | by declaring the map explicitly.) | |
3904 | .np | |
3905 | Default host name extension is consistent throughout processing; | |
e920f7ff | 3906 | version level one configurations turned off domain extension |
de7324ac EA |
3907 | (that is, adding the local domain name) |
3908 | during certain points in processing. | |
e920f7ff | 3909 | Version level two configurations are expected to include a trailing dot |
de7324ac EA |
3910 | to indicate that the name is already canonical. |
3911 | .np | |
3912 | Local names that are not aliases | |
3913 | are passed through a new distinguished ruleset five; | |
3914 | this can be used to append a local relay. | |
3915 | This behaviour can be prevented by resolving the local name | |
3916 | with an initial `@'. | |
3917 | That is, something that resolves to a local mailer and a user name of | |
3918 | .q vikki | |
3919 | will be passed through ruleset five, | |
3920 | but a user name of | |
3921 | .q @vikki | |
3922 | will have the `@' stripped, | |
3923 | will not be passed through ruleset five, | |
3924 | but will otherwise be treated the same as the prior example. | |
3925 | The expectation is that this might be used to implement a policy | |
3926 | where mail sent to | |
3927 | .q vikki | |
3928 | was handled by a central hub, | |
3929 | but mail sent to | |
3930 | .q vikki@localhost | |
3931 | was delivered directly. | |
3932 | .pp | |
e920f7ff | 3933 | Version level three files |
de7324ac EA |
3934 | allow # initiated comments on all lines. |
3935 | Exceptions are backslash escaped # marks | |
3936 | and the $# syntax. | |
3937 | .sh 3 "K \*- key file declaration" | |
3938 | .pp | |
3939 | Special maps can be defined using the line: | |
3940 | .(b | |
3941 | Kmapname mapclass arguments | |
3942 | .)b | |
3943 | The | |
3944 | .i mapname | |
3945 | is the handle by which this map is referenced in the rewriting rules. | |
3946 | The | |
3947 | .i mapclass | |
3948 | is the name of a type of map; | |
3949 | these are compiled in to sendmail. | |
3950 | The | |
3951 | .i arguments | |
3952 | are interpreted depending on the class; | |
3953 | typically, | |
3954 | there would be a single argument naming the file containing the map. | |
3955 | .pp | |
3956 | Maps are referenced using the syntax: | |
3957 | .(b | |
3958 | $( \fImap\fP \fIkey\fP $@ \fIarguments\fP $: \fIdefault\fP $) | |
3959 | .)b | |
3960 | where either or both of the | |
3961 | .i arguments | |
3962 | or | |
3963 | .i default | |
3964 | portion may be omitted. | |
3965 | The | |
3966 | .i arguments | |
3967 | may appear more than once. | |
3968 | The indicated | |
3969 | .i key | |
3970 | and | |
3971 | .i arguments | |
3972 | are passed to the appropriate mapping function. | |
3973 | If it returns a value, it replaces the input. | |
3974 | If it does not return a value and the | |
3975 | .i default | |
3976 | is specified, the | |
3977 | .i default | |
3978 | replaces the input. | |
3979 | Otherwise, the input is unchanged. | |
3980 | .pp | |
3981 | During replacement of either a map value or default | |
3982 | the string | |
3983 | .q %\fIn\fP | |
3984 | (where | |
3985 | .i n | |
3986 | is a digit) | |
3987 | is replaced by the corresponding | |
3988 | .i argument . | |
3989 | Argument zero | |
3dfefb78 | 3990 | is always the database key. |
de7324ac EA |
3991 | For example, the rule |
3992 | .(b | |
3993 | .ta 1.5i | |
3994 | R$- ! $+ $: $(uucp $1 $@ $2 $: %1 @ %0 . UUCP $) | |
3995 | .)b | |
3996 | Looks up the UUCP name in a (user defined) UUCP map; | |
3997 | if not found it turns it into | |
3998 | .q \&.UUCP | |
3999 | form. | |
4000 | The database might contain records like: | |
4001 | .(b | |
4002 | decvax %1@%0.DEC.COM | |
4003 | research %1@%0.ATT.COM | |
4004 | .)b | |
4005 | .pp | |
4006 | The built in map with both name and class | |
4007 | .q host | |
4008 | is the host name canonicalization lookup. | |
4009 | Thus, | |
4010 | the syntax: | |
4011 | .(b | |
4012 | $(host \fIhostname\fP$) | |
4013 | .)b | |
4014 | is equivalent to: | |
4015 | .(b | |
4016 | $[\fIhostname\fP$] | |
4017 | .)b | |
4018 | .pp | |
4019 | There are four predefined database lookup classes: | |
4020 | .q dbm , | |
4021 | .q btree , | |
4022 | .q hash , | |
4023 | and | |
4024 | .q nis . | |
4025 | The first requires that sendmail be compiled with the | |
4026 | .b ndbm | |
4027 | library; | |
4028 | the second two require the | |
4029 | .b db | |
4030 | library, | |
4031 | and the third requires that sendmail be compiled with NIS support. | |
4032 | All four accept as arguments the some optional flags | |
4033 | and a filename (or a mapname for NIS). | |
4034 | Known flags are: | |
4035 | .ip "\-o" | |
4036 | Indicates that this map is optional \*- that is, | |
4037 | if it cannot be opened, | |
4038 | no error is produced, | |
4039 | and sendmail will behave as if the map existed but was empty. | |
4040 | .ip "\-N" | |
4041 | Normally sendmail does not include the trailing null byte | |
4042 | on a string as part of the key. | |
4043 | If this flag is indicated, | |
4044 | it will be included. | |
4045 | This is for compatibility with some methods of building the maps. | |
4046 | .ip "\-a\fIx\fP" | |
4047 | Append the character | |
4048 | .i x | |
4049 | on successful matches. | |
4050 | For example, the default | |
4051 | .i host | |
4052 | map appends a dot on successful matches. | |
de7324ac EA |
4053 | .ip "\-f" |
4054 | Fold upper to lower case before looking up the key. | |
4055 | .ip "\-m" | |
4056 | Match only (without replacing the value). | |
4057 | If you only care about the existence of a key and not the value | |
4058 | (as you might when searching the NIS map | |
4059 | .q hosts.byname | |
4060 | for example), | |
4061 | this flag prevents the map from substituting the value. | |
4062 | However, | |
4063 | The \-a argument is still appended on a match, | |
4064 | and the default is still taken if the match fails. | |
4065 | .pp | |
4066 | The | |
4067 | .i dbm | |
4068 | map appends the strings | |
4069 | .q \&.pag | |
4070 | and | |
4071 | .q \&.dir | |
4072 | to the given filename; | |
4073 | the two | |
4074 | .i db -based | |
d4097fda EA |
4075 | maps append |
4076 | .q \&.db . | |
de7324ac EA |
4077 | .pp |
4078 | The program | |
4079 | .i makemap (8) | |
4080 | can be used to build any of the three database-oriented maps. | |
4081 | It takes the following flags: | |
4082 | .ip \-f | |
f86ff76b | 4083 | Do not fold upper to lower case in the map. |
de7324ac EA |
4084 | .ip \-N |
4085 | Include null bytes in keys. | |
4086 | .ip \-o | |
4087 | Append to an existing (old) file. | |
4088 | .ip \-r | |
4089 | Allow replacement of existing keys; | |
4090 | normally, re-inserting an existing key is an error. | |
4091 | .ip \-v | |
4092 | Print what is happening. | |
4093 | .pp | |
6a197ea4 EA |
4094 | There are also two builtin maps that are, |
4095 | strictly speaking, | |
4096 | not database lookups. | |
4097 | .pp | |
4098 | The | |
4099 | .q host | |
4100 | map does host domain canonification; | |
4101 | given a host name it calls the name server | |
4102 | to find the canonical name for that host. | |
4103 | .pp | |
4104 | The | |
4105 | .q dequote | |
4106 | map strips double quotes (") from a name. | |
4107 | It does not strip backslashes. | |
4108 | It will not strip quotes if the resulting string | |
4109 | would contain unscannable syntax | |
4110 | (that is, basic errors like unbalanced angle brackets; | |
4111 | more sophisticated errors such as unknown hosts are not checked). | |
4112 | The intent is for use when trying to accept mail from systems such as | |
4113 | DECnet | |
4114 | that routinely quote odd syntax such as | |
4115 | .(b | |
4116 | "49ers::ubell" | |
4117 | .)b | |
4118 | A typical usage is probably something like: | |
4119 | .(b | |
4120 | Kdequote dequote | |
4121 | ||
4122 | \&... | |
4123 | ||
4124 | R$\- $: $(dequote $1 $) | |
4125 | R$\- $+ $: $>3 $1 $2 | |
4126 | .)b | |
4127 | Care must be taken to prevent unexpected results; | |
4128 | for example, | |
4129 | .(b | |
4130 | "|someprogram < input > output" | |
4131 | .)b | |
4132 | will have quotes stripped, | |
4133 | but the result is probably not what you had in mind. | |
4134 | Fortunately these cases are rare. | |
4135 | .pp | |
de7324ac EA |
4136 | New classes can be added in the routine |
4137 | .b setupmaps | |
4138 | in file | |
4139 | .b conf.c . | |
f13b6b36 | 4140 | .sh 2 "Building a Configuration File From Scratch" |
bbdc3cab | 4141 | .pp |
f13b6b36 EA |
4142 | Building a configuration table from scratch is an extremely difficult job. |
4143 | Fortunately, | |
4144 | it is almost never necessary to do so; | |
4145 | nearly every situation that may come up | |
4146 | may be resolved by changing an existing table. | |
4147 | In any case, | |
4148 | it is critical that you understand what it is that you are trying to do | |
4149 | and come up with a philosophy for the configuration table. | |
4150 | This section is intended to explain what the real purpose | |
4151 | of a configuration table is | |
4152 | and to give you some ideas | |
4153 | for what your philosophy might be. | |
859d056a EA |
4154 | .pp |
4155 | .b "Do not even consider" | |
4156 | writing your own configuration file | |
4157 | without carefully studying | |
4158 | RFC 821, 822, and 1123. | |
4159 | You should also read RFC 976 | |
4160 | if you are doing UUCP exchange. | |
f13b6b36 | 4161 | .sh 3 "What you are trying to do" |
55c435aa | 4162 | .pp |
f13b6b36 EA |
4163 | The configuration table has three major purposes. |
4164 | The first and simplest | |
4165 | is to set up the environment for | |
4166 | .i sendmail . | |
4167 | This involves setting the options, | |
4168 | defining a few critical macros, | |
4169 | etc. | |
4170 | Since these are described in other places, | |
4171 | we will not go into more detail here. | |
bbdc3cab | 4172 | .pp |
f13b6b36 EA |
4173 | The second purpose is to rewrite addresses in the message. |
4174 | This should typically be done in two phases. | |
4175 | The first phase maps addresses in any format | |
4176 | into a canonical form. | |
4177 | This should be done in ruleset three. | |
4178 | The second phase maps this canonical form | |
4179 | into the syntax appropriate for the receiving mailer. | |
4180 | .i Sendmail | |
4181 | does this in three subphases. | |
4182 | Rulesets one and two | |
4183 | are applied to all sender and recipient addresses respectively. | |
4184 | After this, | |
4185 | you may specify per-mailer rulesets | |
4186 | for both sender and recipient addresses; | |
4187 | this allows mailer-specific customization. | |
4188 | Finally, | |
4189 | ruleset four is applied to do any default conversion | |
4190 | to external form. | |
bbdc3cab | 4191 | .pp |
f13b6b36 EA |
4192 | The third purpose |
4193 | is to map addresses into the actual set of instructions | |
4194 | necessary to get the message delivered. | |
4195 | Ruleset zero must resolve to the internal form, | |
4196 | which is in turn used as a pointer to a mailer descriptor. | |
4197 | The mailer descriptor describes the interface requirements | |
4198 | of the mailer. | |
4199 | .sh 3 "Philosophy" | |
bbdc3cab | 4200 | .pp |
f13b6b36 EA |
4201 | The particular philosophy you choose will depend heavily |
4202 | on the size and structure of your organization. | |
4203 | I will present a few possible philosophies here. | |
093461e4 EA |
4204 | There are as many philosophies as there are config designers; |
4205 | feel free to develop your own. | |
bbdc3cab | 4206 | .pp |
f13b6b36 EA |
4207 | One general point applies to all of these philosophies: |
4208 | it is almost always a mistake | |
890cda2d | 4209 | to try to do full host route resolution. |
f13b6b36 | 4210 | For example, |
6d5ff626 EA |
4211 | if you are on a UUCP-only site |
4212 | and you are trying to get names of the form | |
f13b6b36 | 4213 | .q user@host |
6d5ff626 | 4214 | to the Internet, |
f13b6b36 | 4215 | it does not pay to route them to |
6d5ff626 | 4216 | .q xyzvax!decvax!ucbvax!c70!user@host |
f90dac5e EA |
4217 | since you then depend on several links not under your control, |
4218 | some of which are likely to misparse it anyway. | |
f13b6b36 | 4219 | The best approach to this problem |
6d5ff626 EA |
4220 | is to simply forward the message for |
4221 | .q user@host | |
4222 | to | |
4223 | .q xyzvax | |
f13b6b36 EA |
4224 | and let xyzvax |
4225 | worry about it from there. | |
4226 | In summary, | |
4227 | just get the message closer to the destination, | |
4228 | rather than determining the full path. | |
4229 | .sh 4 "Large site, many hosts \*- minimum information" | |
bbdc3cab | 4230 | .pp |
f13b6b36 EA |
4231 | Berkeley is an example of a large site, |
4232 | i.e., more than two or three hosts | |
4233 | and multiple mail connections. | |
4234 | We have decided that the only reasonable philosophy | |
4235 | in our environment | |
4236 | is to designate one host as the guru for our site. | |
4237 | It must be able to resolve any piece of mail it receives. | |
4238 | The other sites should have the minimum amount of information | |
4239 | they can get away with. | |
4240 | In addition, | |
4241 | any information they do have | |
4242 | should be hints rather than solid information. | |
55c435aa | 4243 | .pp |
f13b6b36 EA |
4244 | For example, |
4245 | a typical site on our local ether network is | |
3dfefb78 EA |
4246 | .q monet |
4247 | (actually | |
4248 | .q monet.CS.Berkeley.EDU ). | |
f13b6b36 EA |
4249 | When monet receives mail for delivery, |
4250 | it checks whether it knows | |
4251 | that the destination host is directly reachable; | |
4252 | if so, mail is sent to that host. | |
4253 | If it receives mail for any unknown host, | |
4254 | it just passes it directly to | |
3dfefb78 | 4255 | .q ucbvax.CS.Berkeley.EDU , |
f13b6b36 EA |
4256 | our master host. |
4257 | Ucbvax may determine that the host name is illegal | |
4258 | and reject the message, | |
4259 | or may be able to do delivery. | |
4260 | However, it is important to note that when a new mail connection is added, | |
4261 | the only host that | |
4262 | .i must | |
4263 | have its tables updated | |
4264 | is ucbvax; | |
4265 | the others | |
4266 | .i may | |
4267 | be updated if convenient, | |
4268 | but this is not critical. | |
55c435aa | 4269 | .pp |
f13b6b36 EA |
4270 | This picture is slightly muddied |
4271 | due to network connections that are not actually located | |
4272 | on ucbvax. | |
4273 | For example, | |
4274 | some UUCP connections are currently on | |
4275 | .q ucbarpa. | |
4276 | However, | |
4277 | monet | |
4278 | .i "does not" | |
4279 | know about this; | |
4280 | the information is hidden totally between ucbvax and ucbarpa. | |
4281 | Mail going from monet to a UUCP host | |
4282 | is transferred via the ethernet | |
4283 | from monet to ucbvax, | |
4284 | then via the ethernet from ucbvax to ucbarpa, | |
4285 | and then is submitted to UUCP. | |
4286 | Although this involves some extra hops, | |
4287 | we feel this is an acceptable tradeoff. | |
55c435aa | 4288 | .pp |
f13b6b36 EA |
4289 | An interesting point is that it would be possible |
4290 | to update monet | |
4291 | to send appropriate UUCP mail directly to ucbarpa | |
4292 | if the load got too high; | |
4293 | if monet failed to note a host as connected to ucbarpa | |
4294 | it would go via ucbvax as before, | |
4295 | and if monet incorrectly sent a message to ucbarpa | |
4296 | it would still be sent by ucbarpa | |
4297 | to ucbvax as before. | |
4298 | The only problem that can occur is loops, | |
4299 | for example, | |
4300 | if ucbarpa thought that ucbvax had the UUCP connection | |
4301 | and vice versa. | |
4302 | For this reason, | |
4303 | updates should | |
4304 | .i always | |
4305 | happen to the master host first. | |
55c435aa | 4306 | .pp |
f13b6b36 EA |
4307 | This philosophy results as much from the need |
4308 | to have a single source for the configuration files | |
4309 | (typically built using | |
4310 | .i m4 \|(1) | |
4311 | or some similar tool) | |
4312 | as any logical need. | |
4313 | Maintaining more than three separate tables by hand | |
4314 | is essentially an impossible job. | |
4315 | .sh 4 "Small site \*- complete information" | |
55c435aa | 4316 | .pp |
f13b6b36 EA |
4317 | A small site |
4318 | (two or three hosts and few external connections) | |
4319 | may find it more reasonable to have complete information | |
4320 | at each host. | |
4321 | This would require that each host | |
4322 | know exactly where each network connection is, | |
4323 | possibly including the names of each host on that network. | |
4324 | As long as the site remains small | |
4325 | and the the configuration remains relatively static, | |
4326 | the update problem will probably not be too great. | |
4327 | .sh 4 "Single host" | |
55c435aa | 4328 | .pp |
f13b6b36 EA |
4329 | This is in some sense the trivial case. |
4330 | The only major issue is trying to insure that you don't | |
4331 | have to know too much about your environment. | |
4332 | For example, | |
4333 | if you have a UUCP connection | |
4334 | you might find it useful to know about the names of hosts | |
4335 | connected directly to you, | |
4336 | but this is really not necessary | |
4337 | since this may be determined from the syntax. | |
093461e4 EA |
4338 | .sh 4 "A completely different philosophy" |
4339 | .pp | |
4340 | This is adapted from Bruce Lilly. | |
4341 | Any errors in interpretation are mine. | |
4342 | .pp | |
4343 | Do minimal changes in ruleset 3: | |
4344 | fix some common but unambiguous errors (e.g. trailing dot on domains) and | |
4345 | hide bang paths foo!bar into bar@foo.UUCP. | |
4346 | The resulting "canonical" form is any valid RFC822/RFC1123/RFC976 address. | |
4347 | .pp | |
4348 | Ruleset 0 does the bulk of the work. | |
4349 | It removes the trailing "@.UUCP" that hides bang paths, | |
4350 | strips anything not needed to resolve, | |
4351 | e.g. the phrase from phrase <route-addr> and from named groups, | |
4352 | rejects unparseable addresses using $#error, | |
4353 | and finally | |
4354 | resolves to a mailer/host/user triple. | |
4355 | Ruleset 0 is rather lengthy | |
4356 | as it has to handle 3 basic address forms: | |
4357 | RFC976 bang paths, | |
4358 | RFC1123 %-hacks | |
4359 | (including vanilla RFC822 local-part@domain), | |
4360 | and RFC822 source routes. | |
4361 | It's also complicated by having to handle named lists. | |
4362 | .pp | |
4363 | The header rewriting rulesets 1 and 2 | |
4364 | remove the trailing "@.UUCP" that hides bang paths. | |
4365 | Ruleset 2 also strips the $# mailer $@ host (for test mode). | |
4366 | .pp | |
4367 | Ruleset 4 does absolutely nothing. | |
4368 | .pp | |
4369 | The per-mailer rewriting rulesets conform the envelope and | |
4370 | header addresses to the requirements of the specific | |
4371 | mailer. | |
4372 | .pp | |
4373 | Lots of rulesets-as-subroutines are used. | |
4374 | .pp | |
4375 | As a result, header addresses are subject to minimal munging | |
4376 | (per RFC1123), and the general plan is per RFC822 sect. 3.4.10. | |
f13b6b36 | 4377 | .sh 3 "Relevant issues" |
55c435aa | 4378 | .pp |
f13b6b36 EA |
4379 | The canonical form you use |
4380 | should almost certainly be as specified in | |
6d5ff626 | 4381 | the Internet protocols |
f13b6b36 EA |
4382 | RFC819 and RFC822. |
4383 | Copies of these RFC's are included on the | |
4384 | .i sendmail | |
4385 | tape | |
4386 | as | |
4387 | .i doc/rfc819.lpr | |
4388 | and | |
4389 | .i doc/rfc822.lpr . | |
55c435aa | 4390 | .pp |
f13b6b36 EA |
4391 | RFC822 |
4392 | describes the format of the mail message itself. | |
4393 | .i Sendmail | |
4394 | follows this RFC closely, | |
4395 | to the extent that many of the standards described in this document | |
4396 | can not be changed without changing the code. | |
4397 | In particular, | |
4398 | the following characters have special interpretations: | |
4399 | .(b | |
4400 | < > ( ) " \e | |
4401 | .)b | |
4402 | Any attempt to use these characters for other than their RFC822 | |
4403 | purpose in addresses is probably doomed to disaster. | |
4da134f8 | 4404 | .pp |
f13b6b36 EA |
4405 | RFC819 |
4406 | describes the specifics of the domain-based addressing. | |
4407 | This is touched on in RFC822 as well. | |
4408 | Essentially each host is given a name | |
4409 | which is a right-to-left dot qualified pseudo-path | |
4410 | from a distinguished root. | |
4411 | The elements of the path need not be physical hosts; | |
4412 | the domain is logical rather than physical. | |
4413 | For example, | |
4414 | at Berkeley | |
4415 | one legal host might be | |
4416 | .q a.CC.Berkeley.EDU ; | |
4417 | reading from right to left, | |
4418 | .q EDU | |
4419 | is a top level domain | |
4420 | comprising educational institutions, | |
4421 | .q Berkeley | |
4422 | is a logical domain name, | |
4423 | .q CC | |
4424 | represents the Computer Center, | |
4425 | (in this case a strictly logical entity), | |
4426 | and | |
4427 | .q a | |
4428 | is a host in the Computer Center. | |
4429 | .pp | |
4430 | Beware when reading RFC819 | |
4431 | that there are a number of errors in it. | |
4432 | .sh 3 "How to proceed" | |
4433 | .pp | |
4434 | Once you have decided on a philosophy, | |
4435 | it is worth examining the available configuration tables | |
4436 | to decide if any of them are close enough | |
4437 | to steal major parts of. | |
4438 | Even under the worst of conditions, | |
4439 | there is a fair amount of boiler plate that can be collected safely. | |
4440 | .pp | |
4441 | The next step is to build ruleset three. | |
4442 | This will be the hardest part of the job. | |
4443 | Beware of doing too much to the address in this ruleset, | |
4444 | since anything you do will reflect through | |
4445 | to the message. | |
4446 | In particular, | |
4447 | stripping of local domains is best deferred, | |
4448 | since this can leave you with addresses with no domain spec at all. | |
4449 | Since | |
4da134f8 | 4450 | .i sendmail |
f13b6b36 EA |
4451 | likes to append the sending domain to addresses with no domain, |
4452 | this can change the semantics of addresses. | |
4453 | Also try to avoid | |
4454 | fully qualifying domains in this ruleset. | |
4455 | Although technically legal, | |
4456 | this can lead to unpleasantly and unnecessarily long addresses | |
4457 | reflected into messages. | |
4458 | The Berkeley configuration files | |
4459 | define ruleset nine | |
4460 | to qualify domain names and strip local domains. | |
4461 | This is called from ruleset zero | |
4462 | to get all addresses into a cleaner form. | |
4463 | .pp | |
4464 | Once you have ruleset three finished, | |
4465 | the other rulesets should be relatively trivial. | |
4466 | If you need hints, | |
4467 | examine the supplied configuration tables. | |
4468 | .sh 3 "Testing the rewriting rules \*- the \-bt flag" | |
4469 | .pp | |
4470 | When you build a configuration table, | |
4471 | you can do a certain amount of testing | |
4472 | using the | |
4473 | .q "test mode" | |
4474 | of | |
4475 | .i sendmail . | |
4476 | For example, | |
4477 | you could invoke | |
4da134f8 | 4478 | .i sendmail |
f13b6b36 EA |
4479 | as: |
4480 | .(b | |
4481 | sendmail \-bt \-Ctest.cf | |
4482 | .)b | |
4483 | which would read the configuration file | |
4484 | .q test.cf | |
4485 | and enter test mode. | |
4486 | In this mode, | |
4487 | you enter lines of the form: | |
4488 | .(b | |
4489 | rwset address | |
4490 | .)b | |
4491 | where | |
4492 | .i rwset | |
4493 | is the rewriting set you want to use | |
4da134f8 | 4494 | and |
f13b6b36 EA |
4495 | .i address |
4496 | is an address to apply the set to. | |
4497 | Test mode shows you the steps it takes | |
4498 | as it proceeds, | |
4499 | finally showing you the address it ends up with. | |
4500 | You may use a comma separated list of rwsets | |
093461e4 | 4501 | for sequential application of rules to an input. |
f13b6b36 | 4502 | For example: |
6362a767 | 4503 | .(b |
093461e4 | 4504 | 3,1,21,4 monet:bollard |
6362a767 | 4505 | .)b |
f13b6b36 EA |
4506 | first applies ruleset three to the input |
4507 | .q monet:bollard. | |
4508 | Ruleset one is then applied to the output of ruleset three, | |
4509 | followed similarly by rulesets twenty-one and four. | |
4da134f8 | 4510 | .pp |
f13b6b36 EA |
4511 | If you need more detail, |
4512 | you can also use the | |
4513 | .q \-d21 | |
4514 | flag to turn on more debugging. | |
4515 | For example, | |
6362a767 | 4516 | .(b |
f13b6b36 | 4517 | sendmail \-bt \-d21.99 |
6362a767 | 4518 | .)b |
f13b6b36 EA |
4519 | turns on an incredible amount of information; |
4520 | a single word address | |
4521 | is probably going to print out several pages worth of information. | |
093461e4 EA |
4522 | .pp |
4523 | You should be warned that internally, | |
4524 | .b sendmail | |
4525 | applies ruleset 3 to all addresses. | |
4526 | In this version of sendmail, you will have to do that manually. | |
4527 | For example, older versions allowed you to use | |
4528 | .(b | |
4529 | 0 bruce@broadcast.sony.com | |
4530 | .)b | |
4531 | This version requires that you use: | |
4532 | .(b | |
4533 | 3,0 bruce@broadcast.sony.com | |
4534 | .)b | |
f13b6b36 EA |
4535 | .sh 3 "Building mailer descriptions" |
4536 | .pp | |
4537 | To add an outgoing mailer to your mail system, | |
4538 | you will have to define the characteristics of the mailer. | |
4539 | .pp | |
4540 | Each mailer must have an internal name. | |
4541 | This can be arbitrary, | |
4542 | except that the names | |
4543 | .q local | |
4544 | and | |
4545 | .q prog | |
4546 | must be defined. | |
4547 | .pp | |
4548 | The pathname of the mailer must be given in the P field. | |
4549 | If this mailer should be accessed via an IPC connection, | |
4550 | use the string | |
4551 | .q [IPC] | |
4552 | instead. | |
4553 | .pp | |
4554 | The F field defines the mailer flags. | |
4555 | You should specify an | |
4556 | .q f | |
4557 | or | |
4558 | .q r | |
4559 | flag to pass the name of the sender as a | |
4560 | .b \-f | |
4561 | or | |
4562 | .b \-r | |
4563 | flag respectively. | |
4564 | These flags are only passed if they were passed to | |
4565 | .i sendmail, | |
4566 | so that mailers that give errors under some circumstances | |
4567 | can be placated. | |
4568 | If the mailer is not picky | |
4569 | you can just specify | |
4570 | .q "\-f $g" | |
4571 | in the argv template. | |
4572 | If the mailer must be called as | |
4573 | .b root | |
4574 | the | |
4575 | .q S | |
4576 | flag should be given; | |
4577 | this will not reset the userid | |
4578 | before calling the mailer\**. | |
4579 | .(f | |
4580 | \**\c | |
4581 | .i Sendmail | |
4582 | must be running setuid to root | |
4583 | for this to work. | |
4584 | .)f | |
4585 | If this mailer is local | |
4586 | (i.e., will perform final delivery | |
4587 | rather than another network hop) | |
4588 | the | |
4589 | .q l | |
4590 | flag should be given. | |
4591 | Quote characters | |
4592 | (backslashes and " marks) | |
4593 | can be stripped from addresses if the | |
4594 | .q s | |
4595 | flag is specified; | |
4596 | if this is not given | |
4597 | they are passed through. | |
4598 | If the mailer is capable of sending to more than one user | |
4599 | on the same host | |
4600 | in a single transaction | |
4601 | the | |
4602 | .q m | |
4603 | flag should be stated. | |
4604 | If this flag is on, | |
4605 | then the argv template containing | |
4606 | .b $u | |
4607 | will be repeated for each unique user | |
4608 | on a given host. | |
4609 | The | |
4610 | .q e | |
4611 | flag will mark the mailer as being | |
4612 | .q expensive, | |
4613 | which will cause | |
4614 | .i sendmail | |
4615 | to defer connection | |
4616 | until a queue run\**. | |
4617 | .(f | |
4618 | \**The | |
4619 | .q c | |
4620 | configuration option must be given | |
4621 | for this to be effective. | |
4622 | .)f | |
4623 | .pp | |
4624 | An unusual case is the | |
4625 | .q C | |
4626 | flag. | |
4627 | This flag applies to the mailer that the message is received from, | |
4628 | rather than the mailer being sent to; | |
4629 | if set, | |
4630 | the domain spec of the sender | |
4631 | (i.e., the | |
4632 | .q @host.domain | |
4633 | part) | |
4634 | is saved | |
4635 | and is appended to any addresses in the message | |
4636 | that do not already contain a domain spec. | |
4637 | For example, | |
4638 | a message of the form: | |
4da134f8 | 4639 | .(b |
3dfefb78 EA |
4640 | From: eric@vangogh.CS.Berkeley.EDU |
4641 | To: wnj@monet.CS.Berkeley.EDU, mckusick | |
4da134f8 | 4642 | .)b |
f13b6b36 EA |
4643 | will be modified to: |
4644 | .(b | |
3dfefb78 EA |
4645 | From: eric@vangogh.CS.Berkeley.EDU |
4646 | To: wnj@monet.CS.Berkeley.EDU, mckusick@vangogh.CS.Berkeley.EDU | |
f13b6b36 EA |
4647 | .)b |
4648 | .i "if and only if" | |
f3e184c1 | 4649 | the |
f13b6b36 EA |
4650 | .q C |
4651 | flag is defined in the mailer corresponding to | |
3dfefb78 | 4652 | .q eric@vangogh.CS.Berkeley.EDU. |
f13b6b36 EA |
4653 | .pp |
4654 | Other flags are described | |
4655 | in Appendix C. | |
4656 | .pp | |
4657 | The S and R fields in the mailer description | |
4658 | are per-mailer rewriting sets | |
4659 | to be applied to sender and recipient addresses | |
4660 | respectively. | |
4661 | These are applied after the sending domain is appended | |
4662 | and the general rewriting sets | |
4663 | (numbers one and two) | |
4664 | are applied, | |
4665 | but before the output rewrite | |
4666 | (ruleset four) | |
4667 | is applied. | |
4668 | A typical use is to append the current domain | |
4669 | to addresses that do not already have a domain. | |
4670 | For example, | |
4671 | a header of the form: | |
4672 | .(b | |
4673 | From: eric | |
4674 | .)b | |
4675 | might be changed to be: | |
4676 | .(b | |
3dfefb78 | 4677 | From: eric@vangogh.CS.Berkeley.EDU |
f13b6b36 EA |
4678 | .)b |
4679 | or | |
4680 | .(b | |
4681 | From: ucbvax!eric | |
4682 | .)b | |
4683 | depending on the domain it is being shipped into. | |
4684 | These sets can also be used | |
4685 | to do special purpose output rewriting | |
4686 | in cooperation with ruleset four. | |
4687 | .pp | |
4688 | The E field defines the string to use | |
4689 | as an end-of-line indication. | |
4690 | A string containing only newline is the default. | |
4691 | The usual backslash escapes | |
4692 | (\er, \en, \ef, \eb) | |
4693 | may be used. | |
4694 | .pp | |
4695 | Finally, | |
4696 | an argv template is given as the E field. | |
4697 | It may have embedded spaces. | |
4698 | If there is no argv with a | |
4699 | .b $u | |
4700 | macro in it, | |
f3e184c1 | 4701 | .i sendmail |
f13b6b36 EA |
4702 | will speak SMTP |
4703 | to the mailer. | |
4704 | If the pathname for this mailer is | |
4705 | .q [IPC], | |
4706 | the argv should be | |
4707 | .(b | |
4708 | IPC $h [ \fIport\fP ] | |
4709 | .)b | |
4710 | where | |
4711 | .i port | |
4712 | is the optional port number | |
4713 | to connect to. | |
4714 | .pp | |
4715 | For example, | |
4716 | the specifications: | |
4717 | .(b | |
4718 | .ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'u | |
4719 | Mlocal, P=/bin/mail, F=rlsm S=10, R=20, A=mail \-d $u | |
4720 | Mether, P=[IPC], F=meC, S=11, R=21, A=IPC $h, M=100000 | |
4721 | .)b | |
4722 | specifies a mailer to do local delivery | |
4723 | and a mailer for ethernet delivery. | |
4724 | The first is called | |
4725 | .q local, | |
4726 | is located in the file | |
4727 | .q /bin/mail, | |
4728 | takes a picky | |
4729 | .b \-r | |
4730 | flag, | |
4731 | does local delivery, | |
4732 | quotes should be stripped from addresses, | |
4733 | and multiple users can be delivered at once; | |
4734 | ruleset ten | |
4735 | should be applied to sender addresses in the message | |
4736 | and ruleset twenty | |
4737 | should be applied to recipient addresses; | |
4738 | the argv to send to a message will be the word | |
4739 | .q mail, | |
4740 | the word | |
4741 | .q \-d, | |
4742 | and words containing the name of the receiving user. | |
4743 | If a | |
4744 | .b \-r | |
4745 | flag is inserted | |
4746 | it will be between the words | |
4747 | .q mail | |
4748 | and | |
4749 | .q \-d. | |
4750 | The second mailer is called | |
4751 | .q ether, | |
4752 | it should be connected to via an IPC connection, | |
4753 | it can handle multiple users at once, | |
4754 | connections should be deferred, | |
4755 | and any domain from the sender address | |
4756 | should be appended to any receiver name | |
4757 | without a domain; | |
4758 | sender addresses should be processed by ruleset eleven | |
4759 | and recipient addresses by ruleset twenty-one. | |
4760 | There is a 100,000 byte limit on messages passed through this mailer. | |
4761 | .sh 2 "The User Database" | |
4762 | .pp | |
4763 | If you have a version of sendmail with the user database package | |
4764 | compiled in, | |
4765 | the handling of sender and recipient addresses | |
4766 | is modified. | |
4767 | .pp | |
4768 | The location of this database is controlled with the | |
4769 | .b U | |
4770 | option. | |
4771 | .sh 3 "Structure of the user database" | |
4772 | .pp | |
4773 | The database is a sorted (BTree-based) structure. | |
4774 | User records are stored with the key: | |
55c435aa | 4775 | .(b |
f13b6b36 | 4776 | \fIuser-name\fP\fB:\fP\fIfield-name\fP |
55c435aa | 4777 | .)b |
f13b6b36 EA |
4778 | The sorted database format ensures that user records are clustered together. |
4779 | Meta-information is always stored with a leading colon. | |
4780 | .pp | |
4781 | Field names define both the syntax and semantics of the value. | |
4782 | Defined fields include: | |
4783 | .nr ii 1i | |
4784 | .ip maildrop | |
4785 | The delivery address for this user. | |
4786 | There may be multiple values of this record. | |
4787 | In particular, | |
4788 | mailing lists will have one | |
4789 | .i maildrop | |
4790 | record for each user on the list. | |
4791 | .ip "mailname" | |
4792 | The outgoing mailname for this user. | |
4793 | For each outgoing name, | |
4794 | there should be an appropriate | |
4795 | .i maildrop | |
4796 | record for that name to allow return mail. | |
4797 | See also | |
4798 | .i :default:mailname . | |
d6f77a91 EA |
4799 | .ip mailsender |
4800 | Changes any mail sent to this address to have the indicated envelope sender. | |
4801 | This is intended for mailing lists, | |
4802 | and will normally be the name of an appropriate -request address. | |
4803 | It is very similar to the owner-\c | |
4804 | .i list | |
4805 | syntax in the alias file. | |
f13b6b36 EA |
4806 | .ip fullname |
4807 | The full name of the user. | |
4808 | .ip office-address | |
4809 | The office address for this user. | |
4810 | .ip office-phone | |
4811 | The office phone number for this user. | |
4812 | .ip office-fax | |
4813 | The office FAX number for this user. | |
4814 | .ip home-address | |
4815 | The home address for this user. | |
4816 | .ip home-phone | |
4817 | The home phone number for this user. | |
4818 | .ip home-fax | |
4819 | The home FAX number for this user. | |
4820 | .ip project | |
4821 | A (short) description of the project this person is affiliated with. | |
4822 | In the University this is often just the name of their graduate advisor. | |
4823 | .ip plan | |
4824 | A pointer to a file from which plan information can be gathered. | |
4825 | .pp | |
4826 | As of this writing, | |
4827 | only a few of these fields are actually being used by sendmail: | |
4828 | .i maildrop | |
4829 | and | |
4830 | .i mailname . | |
4831 | A | |
4832 | .i finger | |
4833 | program that uses the other fields is planned. | |
4834 | .sh 3 "User database semantics" | |
4835 | .pp | |
4836 | When the rewriting rules submit an address to the local mailer, | |
4837 | the user name is passed through the alias file. | |
4838 | If no alias is found (or if the alias points back to the same address), | |
4839 | the name (with | |
4840 | .q :maildrop | |
4841 | appended) | |
4842 | is then used as a key in the user database. | |
4843 | If no match occurs (or if the maildrop points at the same address), | |
4844 | forwarding is tried. | |
4845 | .pp | |
4846 | If the first token of the user name returned by ruleset 0 | |
4847 | is an | |
4848 | .q @ | |
4849 | sign, the user database lookup is skipped. | |
4850 | The intent is that the user database will act as a set of defaults | |
4851 | for a cluster (in our case, the Computer Science Division); | |
4852 | mail sent to a specific machine should ignore these defaults. | |
4853 | .pp | |
4854 | When mail is sent, | |
4855 | the name of the sending user is looked up in the database. | |
4856 | If that user has a | |
4857 | .q mailname | |
4858 | record, | |
4859 | the value of that record is used as their outgoing name. | |
4860 | For example, I might have a record: | |
55c435aa | 4861 | .(b |
f13b6b36 | 4862 | eric:mailname Eric.Allman@CS.Berkeley.EDU |
55c435aa | 4863 | .)b |
f13b6b36 EA |
4864 | This would cause my outgoing mail to be sent as Eric.Allman. |
4865 | .pp | |
4866 | If a | |
4867 | .q maildrop | |
4868 | is found for the user, | |
4869 | but no corresponding | |
4870 | .q maildrop | |
4871 | record exists, | |
4872 | the record | |
4873 | .q :default:mailname | |
4874 | is consulted. | |
4875 | If present, this is the name of a host to override the local host. | |
4876 | For example, in our case we would set it to | |
4877 | .q CS.Berkeley.EDU . | |
4878 | The effect is that anyone known in the database | |
4879 | gets their outgoing mail stamped as | |
4880 | .q user@CS.Berkeley.EDU , | |
4881 | but people not listed in the database use the local hostname. | |
4882 | .sh 1 "OTHER CONFIGURATION" | |
4da134f8 EA |
4883 | .pp |
4884 | There are some configuration changes that can be made by | |
4885 | recompiling | |
4886 | .i sendmail . | |
f13b6b36 EA |
4887 | This section describes what changes can be made |
4888 | and what has to be modified to make them. | |
4889 | .sh 2 "Parameters in src/Makefile" | |
55c435aa | 4890 | .pp |
102e8f9c EA |
4891 | These parameters are intended to describe the compilation environment, |
4892 | not site policy, | |
4893 | and should normally be defined in src/Makefile. | |
55c435aa EA |
4894 | .ip NDBM |
4895 | If set, | |
4896 | the new version of the DBM library | |
4897 | that allows multiple databases will be used. | |
102e8f9c EA |
4898 | If neither NDBM nor NEWDB are set, |
4899 | a much less efficient method of alias lookup is used. | |
55c435aa EA |
4900 | .ip NEWDB |
4901 | If set, use the new database package from Berkeley (from 4.4BSD). | |
4902 | This package is substantially faster than DBM or NDBM. | |
102e8f9c EA |
4903 | If NEWDB and NDBM are both set, |
4904 | sendmail will read DBM files, | |
55c435aa | 4905 | but will create and use NEWDB files. |
102e8f9c EA |
4906 | .ip YPCOMPAT |
4907 | If set together with | |
4908 | .i both | |
4909 | NEWDB and NDBM, | |
4910 | .i sendmail | |
4911 | will create both DBM and NEWDB files if and only if | |
4912 | the file /var/yp/Makefile | |
4913 | exists and is readable. | |
4914 | This is intended for compatibility with Sun Microsystems' | |
4915 | .i mkalias | |
4916 | program used on YP masters. | |
d4097fda EA |
4917 | .ip _AIX3 |
4918 | Compile for IBM AIX 3.x. | |
4919 | This has only been tested on 3.2.3. | |
dfd63518 EA |
4920 | .ip SYSTEM5 |
4921 | Set all of the compilation parameters appropriate for System V. | |
55c435aa EA |
4922 | .ip LOCKF |
4923 | Use System V | |
4924 | .b lockf | |
4925 | instead of Berkeley | |
4926 | .b flock . | |
32c5f422 EA |
4927 | Due to the highly unusual semantics of locks |
4928 | across forks in | |
55c435aa EA |
4929 | .b lockf , |
4930 | this should never be used unless absolutely necessary. | |
dfd63518 EA |
4931 | Set by default if |
4932 | SYSTEM5 is set. | |
55c435aa EA |
4933 | .ip SYS5TZ |
4934 | Use System V | |
4935 | time zone semantics. | |
dfd63518 EA |
4936 | .ip HASINITGROUPS |
4937 | Set this if your system has the | |
4938 | .i initgroups() | |
4939 | call | |
4940 | (if you have multiple group support). | |
4941 | This is the default if SYSTEM5 is | |
4942 | .i not | |
4943 | defined or if you are on HPUX. | |
4944 | .ip HASUNAME | |
4945 | Set this if you have the | |
59baf33c | 4946 | .i uname (2) |
dfd63518 EA |
4947 | system call (or corresponding library routine). |
4948 | Set by default if | |
4949 | SYSTEM5 | |
4950 | is set. | |
59baf33c EA |
4951 | .ip HASSTATFS |
4952 | Set this if you have the | |
4953 | .i statfs (2) | |
4954 | system call. | |
4955 | This will allow you to give a temporary failure | |
4956 | message to incoming SMTP email | |
4957 | when you are low on disk space. | |
4958 | It is set by default on 4.4 BSD and OSF/1 systems. | |
f90dac5e EA |
4959 | .ip HASUSTAT |
4960 | Set if you have the | |
4961 | .i ustat (2) | |
4962 | system call. | |
4963 | This is an alternative implementation of disk space control. | |
4964 | You should only set one of HASSTATFS or HASUSTAT; | |
4965 | the first is preferred. | |
4966 | .ip _PATH_SENDMAILCF | |
4967 | The pathname of the sendmail.cf file. | |
4968 | .ip _PATH_SENDMAILFC | |
4969 | The pathname of the sendmail.fc file. | |
4970 | .ip _PATH_SENDMAILPID | |
4971 | The pathname of the sendmail.pid file. | |
55c435aa EA |
4972 | .ip LA_TYPE |
4973 | The load average type. | |
4974 | Details are described below. | |
de7324ac EA |
4975 | .lp |
4976 | The are four built-in ways of computing the load average. | |
4977 | .i Sendmail | |
4978 | tries to auto-configure them based on imperfect guesses; | |
4979 | you can select one using the | |
4980 | .i cc | |
4981 | option | |
4982 | .b \-DLA_TYPE= \c | |
4983 | .i type , | |
4984 | where | |
4985 | .i type | |
4986 | is: | |
4987 | .ip LA_INT | |
4988 | The kernel stores the load average in the kernel as an array of long integers. | |
4989 | The actual values are scaled by a factor FSCALE | |
4990 | (default 256). | |
4991 | .ip LA_FLOAT | |
4992 | The kernel stores the load average in the kernel as an array of | |
4993 | double precision floats. | |
4994 | .ip LA_SUBR | |
4995 | Call the | |
4996 | .i getloadavg | |
4997 | routine to get the load average as an array of doubles. | |
4998 | .ip LA_ZERO | |
4999 | Always return zero as the load average. | |
5000 | This is the fallback case. | |
5001 | .lp | |
5002 | If type | |
5003 | .sm LA_INT | |
5004 | or | |
5005 | .sm LA_FLOAT | |
5006 | is specified, | |
5007 | you may also need to specify | |
5008 | .sm _PATH_UNIX | |
5009 | (the path to your system binary) | |
5010 | and | |
5011 | .sm LA_AVENRUN | |
5012 | (the name of the variable containing the load average in the kernel; | |
5013 | usually | |
5014 | .q _avenrun | |
5015 | or | |
5016 | .q avenrun ). | |
f13b6b36 | 5017 | .sh 2 "Parameters in src/conf.h" |
b16e27c4 EA |
5018 | .pp |
5019 | Parameters and compilation options | |
5020 | are defined in conf.h. | |
5021 | Most of these need not normally be tweaked; | |
5022 | common parameters are all in sendmail.cf. | |
5023 | However, the sizes of certain primitive vectors, etc., | |
5024 | are included in this file. | |
5025 | The numbers following the parameters | |
5026 | are their default value. | |
74b6e641 | 5027 | .nr ii 1.2i |
367a5dcd | 5028 | .ip "MAXLINE [1024]" |
b16e27c4 EA |
5029 | The maximum line length of any input line. |
5030 | If message lines exceed this length | |
5031 | they will still be processed correctly; | |
5032 | however, header lines, | |
5033 | configuration file lines, | |
5034 | alias lines, | |
5035 | etc., | |
5036 | must fit within this limit. | |
367a5dcd | 5037 | .ip "MAXNAME [256]" |
b16e27c4 EA |
5038 | The maximum length of any name, |
5039 | such as a host or a user name. | |
b16e27c4 EA |
5040 | .ip "MAXPV [40]" |
5041 | The maximum number of parameters to any mailer. | |
5042 | This limits the number of recipients that may be passed in one transaction. | |
f13b6b36 EA |
5043 | It can be set to any arbitrary number above about 10, |
5044 | since | |
5045 | .i sendmail | |
5046 | will break up a delivery into smaller batches as needed. | |
5047 | A higher number may reduce load on your system, however. | |
b16e27c4 EA |
5048 | .ip "MAXATOM [100]" |
5049 | The maximum number of atoms | |
5050 | (tokens) | |
5051 | in a single address. | |
5052 | For example, | |
5053 | the address | |
55c435aa EA |
5054 | .q "eric@CS.Berkeley.EDU" |
5055 | is seven atoms. | |
b16e27c4 EA |
5056 | .ip "MAXMAILERS [25]" |
5057 | The maximum number of mailers that may be defined | |
5058 | in the configuration file. | |
f13b6b36 | 5059 | .ip "MAXRWSETS [100]" |
b16e27c4 EA |
5060 | The maximum number of rewriting sets |
5061 | that may be defined. | |
5062 | .ip "MAXPRIORITIES [25]" | |
5063 | The maximum number of values for the | |
5064 | .q Precedence: | |
5065 | field that may be defined | |
5066 | (using the | |
5067 | .b P | |
5068 | line in sendmail.cf). | |
367a5dcd EA |
5069 | .ip "MAXUSERENVIRON [40]" |
5070 | The maximum number of items in the user environment | |
5071 | that will be passed to subordinate mailers. | |
f13b6b36 | 5072 | .ip "QUEUESIZE [1000]" |
4f24419a EA |
5073 | The maximum number of entries that will be processed |
5074 | in a single queue run. | |
f13b6b36 | 5075 | .ip "MAXMXHOSTS [20]" |
daae36f7 | 5076 | The maximum number of MX records we will accept for any single host. |
e920f7ff EA |
5077 | .ip "MAXIPADDR [16]" |
5078 | The maximum number of numeric IP addresses we will accept | |
5079 | for this host. | |
5080 | This does not limit the number the number of addresses for other hosts. | |
b16e27c4 EA |
5081 | .lp |
5082 | A number of other compilation options exist. | |
5083 | These specify whether or not specific code should be compiled in. | |
55c435aa | 5084 | .nr ii 1.2i |
4da134f8 EA |
5085 | .ip DEBUG |
5086 | If set, debugging information is compiled in. | |
5087 | To actually get the debugging output, | |
5088 | the | |
5089 | .b \-d | |
5090 | flag must be used. | |
f13b6b36 EA |
5091 | .b "WE STRONGLY RECOMMEND THAT THIS BE LEFT ON." |
5092 | Some people, believing that it was a security hole | |
5093 | (it was, once) | |
5094 | have turned it off and thus crippled debuggers. | |
959bbd2e | 5095 | .ip NETINET |
f13b6b36 | 5096 | If set, |
959bbd2e EA |
5097 | support for Internet protocol networking is compiled in. |
5098 | Previous versions of | |
5099 | .b sendmail | |
5100 | referred to this as | |
5101 | .sm DAEMON ; | |
5102 | this old usage is now incorrect. | |
5103 | .ip NETISO | |
5104 | If set, | |
337767a9 EA |
5105 | support for ISO protocol networking is compiled in |
5106 | (it may be appropriate to #define this in the Makefile instead of conf.h). | |
4da134f8 EA |
5107 | .ip LOG |
5108 | If set, | |
5109 | the | |
5110 | .i syslog | |
5111 | routine in use at some sites is used. | |
5112 | This makes an informational log record | |
5113 | for each message processed, | |
5114 | and makes a higher priority log record | |
5115 | for internal system errors. | |
f13b6b36 EA |
5116 | .ip MATCHGECOS |
5117 | Compile in the code to do ``fuzzy matching'' on the GECOS field | |
5118 | in /etc/passwd. | |
5119 | This also requires that option G be turned on. | |
5120 | .ip NAMED_BIND | |
5121 | Compile in code to use the | |
5122 | Berkeley Internet Name Domain (BIND) server | |
5123 | to resolve TCP/IP host names. | |
5124 | .ip NOTUNIX | |
5125 | If you are using a non-UNIX mail format, | |
5126 | you can set this flag to turn off special processing | |
5127 | of UNIX-style | |
5128 | .q "From " | |
5129 | lines. | |
4da134f8 EA |
5130 | .ip QUEUE |
5131 | This flag should be set to compile in the queueing code. | |
5132 | If this is not set, | |
5133 | mailers must accept the mail immediately | |
5134 | or it will be returned to the sender. | |
f13b6b36 EA |
5135 | .ip SETPROCTITLE |
5136 | If defined, | |
5137 | .i sendmail | |
5138 | will change its | |
5139 | .i argv | |
5140 | array to indicate its current status. | |
5141 | This can be used in conjunction with the | |
5142 | .i ps | |
5143 | command to find out just what it's up to. | |
4da134f8 EA |
5144 | .ip SMTP |
5145 | If set, | |
5146 | the code to handle user and server SMTP will be compiled in. | |
5147 | This is only necessary if your machine has some mailer | |
f13b6b36 EA |
5148 | that speaks SMTP |
5149 | (this means most machines everywhere). | |
4da134f8 EA |
5150 | .ip UGLYUUCP |
5151 | If you have a UUCP host adjacent to you which is not running | |
5152 | a reasonable version of | |
5153 | .i rmail , | |
5154 | you will have to set this flag to include the | |
5155 | .q "remote from sysname" | |
5156 | info on the from line. | |
5157 | Otherwise, UUCP gets confused about where the mail came from. | |
daae36f7 | 5158 | .ip USERDB |
55c435aa EA |
5159 | Include the |
5160 | .b experimental | |
5161 | Berkeley user information database package. | |
daae36f7 EA |
5162 | This adds a new level of local name expansion |
5163 | between aliasing and forwarding. | |
5164 | It also uses the NEWDB package. | |
55c435aa | 5165 | This may change in future releases. |
337767a9 EA |
5166 | .ip IDENTPROTO |
5167 | Compile in the IDENT protocol as defined in RFC 1413. | |
5168 | This defaults on for all systems except Ultrix, | |
5169 | which apparently has the interesting | |
5170 | .q feature | |
5171 | that when it receives a | |
5172 | .q "host unreachable" | |
5173 | message it closes all open connections to that host. | |
5174 | Since some firewall gateways send this error code | |
5175 | when you access an unauthorized port (such as 113, used by IDENT), | |
5176 | Ultrix cannot receive email from such hosts. | |
f13b6b36 | 5177 | .sh 2 "Configuration in src/conf.c" |
4da134f8 | 5178 | .pp |
de7324ac EA |
5179 | The following changes can be made in conf.c. |
5180 | .sh 3 "Built-in Header Semantics" | |
5181 | .pp | |
4da134f8 EA |
5182 | Not all header semantics are defined in the configuration file. |
5183 | Header lines that should only be included by certain mailers | |
5184 | (as well as other more obscure semantics) | |
5185 | must be specified in the | |
5186 | .i HdrInfo | |
5187 | table in | |
5188 | .i conf.c . | |
5189 | This table contains the header name | |
b16e27c4 EA |
5190 | (which should be in all lower case) |
5191 | and a set of header control flags (described below), | |
5192 | The flags are: | |
4da134f8 | 5193 | .ip H_ACHECK |
b16e27c4 EA |
5194 | Normally when the check is made to see if a header line is compatible |
5195 | with a mailer, | |
5196 | .i sendmail | |
5197 | will not delete an existing line. | |
5198 | If this flag is set, | |
5199 | .i sendmail | |
5200 | will delete | |
5201 | even existing header lines. | |
4da134f8 EA |
5202 | That is, |
5203 | if this bit is set and the mailer does not have flag bits set | |
b16e27c4 EA |
5204 | that intersect with the required mailer flags |
5205 | in the header definition in | |
5206 | sendmail.cf, | |
4da134f8 EA |
5207 | the header line is |
5208 | .i always | |
5209 | deleted. | |
5210 | .ip H_EOH | |
5211 | If this header field is set, | |
5212 | treat it like a blank line, | |
5213 | i.e., | |
5214 | it will signal the end of the header | |
5215 | and the beginning of the message text. | |
5216 | .ip H_FORCE | |
5217 | Add this header entry | |
5218 | even if one existed in the message before. | |
5219 | If a header entry does not have this bit set, | |
5220 | .i sendmail | |
5221 | will not add another header line if a header line | |
5222 | of this name already existed. | |
5223 | This would normally be used to stamp the message | |
5224 | by everyone who handled it. | |
5225 | .ip H_TRACE | |
5226 | If set, | |
5227 | this is a timestamp | |
5228 | (trace) | |
5229 | field. | |
5230 | If the number of trace fields in a message | |
5231 | exceeds a preset amount | |
5232 | the message is returned | |
5233 | on the assumption that it has an aliasing loop. | |
5234 | .ip H_RCPT | |
5235 | If set, | |
5236 | this field contains recipient addresses. | |
5237 | This is used by the | |
5238 | .b \-t | |
5239 | flag to determine who to send to | |
5240 | when it is collecting recipients from the message. | |
5241 | .ip H_FROM | |
5242 | This flag indicates that this field | |
5243 | specifies a sender. | |
5244 | The order of these fields in the | |
5245 | .i HdrInfo | |
5246 | table specifies | |
5247 | .i sendmail's | |
5248 | preference | |
5249 | for which field to return error messages to. | |
5250 | .nr ii 5n | |
5251 | .lp | |
5252 | Let's look at a sample | |
5253 | .i HdrInfo | |
5254 | specification: | |
5255 | .(b | |
be2fcca9 | 5256 | .ta 4n +\w'"return-receipt-to", 'u |
4da134f8 | 5257 | struct hdrinfo HdrInfo[] = |
367a5dcd | 5258 | \&{ |
69a914e1 | 5259 | /* originator fields, most to least significant */ |
be2fcca9 EA |
5260 | "resent-sender", H_FROM, |
5261 | "resent-from", H_FROM, | |
5262 | "sender", H_FROM, | |
5263 | "from", H_FROM, | |
5264 | "full-name", H_ACHECK, | |
69a914e1 | 5265 | /* destination fields */ |
be2fcca9 EA |
5266 | "to", H_RCPT, |
5267 | "resent-to", H_RCPT, | |
5268 | "cc", H_RCPT, | |
69a914e1 | 5269 | /* message identification and control */ |
be2fcca9 EA |
5270 | "message", H_EOH, |
5271 | "text", H_EOH, | |
69a914e1 | 5272 | /* trace fields */ |
be2fcca9 | 5273 | "received", H_TRACE|H_FORCE, |
4da134f8 | 5274 | |
be2fcca9 | 5275 | NULL, 0, |
4da134f8 | 5276 | }; |
4da134f8 | 5277 | .)b |
be2fcca9 | 5278 | This structure indicates that the |
4da134f8 EA |
5279 | .q To: , |
5280 | .q Resent-To: , | |
5281 | and | |
5282 | .q Cc: | |
be2fcca9 | 5283 | fields |
4da134f8 | 5284 | all specify recipient addresses. |
be2fcca9 EA |
5285 | Any |
5286 | .q Full-Name: | |
5287 | field will be deleted unless the required mailer flag | |
5288 | (indicated in the configuration file) | |
5289 | is specified. | |
4da134f8 EA |
5290 | The |
5291 | .q Message: | |
5292 | and | |
5293 | .q Text: | |
5294 | fields will terminate the header; | |
55c435aa | 5295 | these are used by random dissenters around the network world. |
4da134f8 EA |
5296 | The |
5297 | .q Received: | |
5298 | field will always be added, | |
5299 | and can be used to trace messages. | |
4da134f8 EA |
5300 | .pp |
5301 | There are a number of important points here. | |
5302 | First, | |
5303 | header fields are not added automatically just because they are in the | |
5304 | .i HdrInfo | |
5305 | structure; | |
5306 | they must be specified in the configuration file | |
5307 | in order to be added to the message. | |
5308 | Any header fields mentioned in the configuration file but not | |
5309 | mentioned in the | |
5310 | .i HdrInfo | |
5311 | structure have default processing performed; | |
5312 | that is, | |
5313 | they are added unless they were in the message already. | |
5314 | Second, | |
5315 | the | |
5316 | .i HdrInfo | |
5317 | structure only specifies cliched processing; | |
5318 | certain headers are processed specially by ad hoc code | |
5319 | regardless of the status specified in | |
5320 | .i HdrInfo . | |
5321 | For example, | |
5322 | the | |
5323 | .q Sender: | |
5324 | and | |
5325 | .q From: | |
5326 | fields are always scanned on ARPANET mail | |
6d5ff626 EA |
5327 | to determine the sender\**; |
5328 | .(f | |
5329 | \**Actually, this is no longer true in SMTP; | |
5330 | this information is contained in the envelope. | |
5331 | The older ARPANET protocols did not completely distinguish | |
5332 | envelope from header. | |
5333 | .)f | |
4da134f8 EA |
5334 | this is used to perform the |
5335 | .q "return to sender" | |
5336 | function. | |
5337 | The | |
5338 | .q "From:" | |
5339 | and | |
5340 | .q "Full-Name:" | |
5341 | fields are used to determine the full name of the sender | |
5342 | if possible; | |
5343 | this is stored in the macro | |
5344 | .b $x | |
5345 | and used in a number of ways. | |
de7324ac | 5346 | .sh 3 "Restricting Use of Email" |
4da134f8 | 5347 | .pp |
69a914e1 | 5348 | If it is necessary to restrict mail through a relay, |
4da134f8 EA |
5349 | the |
5350 | .i checkcompat | |
5351 | routine can be modified. | |
5352 | This routine is called for every recipient address. | |
d1e44f94 EA |
5353 | It returns an exit status |
5354 | indicating the status of the message. | |
5355 | The status | |
5356 | .sm EX_OK | |
5357 | accepts the address, | |
5358 | .sm EX_TEMPFAIL | |
5359 | queues the message for a later try, | |
5360 | and other values | |
5361 | (commonly | |
5362 | .sm EX_UNAVAILABLE ) | |
5363 | reject the message. | |
5364 | It is up to | |
4da134f8 EA |
5365 | .i checkcompat |
5366 | to print an error message | |
5367 | (using | |
5368 | .i usrerr ) | |
d1e44f94 | 5369 | if the message is rejected. |
4da134f8 EA |
5370 | For example, |
5371 | .i checkcompat | |
5372 | could read: | |
5373 | .(b | |
5374 | .re | |
74b6e641 | 5375 | .sz -1 |
69a914e1 | 5376 | .ta 4n +4n +4n +4n +4n +4n +4n |
d1e44f94 EA |
5377 | int |
5378 | checkcompat(to, e) | |
4da134f8 | 5379 | register ADDRESS *to; |
d1e44f94 | 5380 | register ENVELOPE *e; |
367a5dcd | 5381 | \&{ |
d1e44f94 EA |
5382 | register STAB *s; |
5383 | ||
5384 | s = stab("private", ST_MAILER, ST_FIND); | |
5385 | if (s != NULL && e\->e_from.q_mailer != LocalMailer && | |
5386 | to->q_mailer == s->s_mailer) | |
5387 | { | |
5388 | usrerr("No private net mail allowed through this machine"); | |
5389 | return (EX_UNAVAILABLE); | |
5390 | } | |
5391 | if (MsgSize > 50000 && to\->q_mailer != LocalMailer) | |
4da134f8 EA |
5392 | { |
5393 | usrerr("Message too large for non-local delivery"); | |
7a316267 | 5394 | NoReturn = TRUE; |
d1e44f94 | 5395 | return (EX_UNAVAILABLE); |
4da134f8 | 5396 | } |
d1e44f94 | 5397 | return (EX_OK); |
4da134f8 EA |
5398 | } |
5399 | .sz | |
5400 | .)b | |
5401 | This would reject messages greater than 50000 bytes | |
5402 | unless they were local. | |
7a316267 | 5403 | The |
f13b6b36 EA |
5404 | .i NoReturn |
5405 | flag can be sent to suppress the return of the actual body | |
5406 | of the message in the error return. | |
5407 | The actual use of this routine is highly dependent on the | |
5408 | implementation, | |
5409 | and use should be limited. | |
de7324ac | 5410 | .sh 3 "Load Average Computation" |
f13b6b36 EA |
5411 | .pp |
5412 | The routine | |
5413 | .i getla | |
5414 | should return an approximation of the current system load average | |
5415 | as an integer. | |
de7324ac EA |
5416 | There are four versions included on compilation flags |
5417 | as described above. | |
5418 | .sh 3 "New Database Map Classes" | |
f13b6b36 EA |
5419 | .pp |
5420 | New key maps can be added by creating a class initialization function | |
5421 | and a lookup function. | |
5422 | These are then added to the routine | |
5423 | .i setupmaps. | |
5424 | .pp | |
5425 | The initialization function is called as | |
5426 | .(b | |
5427 | \fIxxx\fP_map_init(MAP *map, char *mapname, char *args) | |
5428 | .)b | |
5429 | The | |
5430 | .i map | |
5431 | is an internal data structure. | |
5432 | The | |
5433 | .i mapname | |
5434 | is the name of the map (used for error messages). | |
5435 | The | |
5436 | .i args | |
5437 | is a pointer to the rest of the configuration file line; | |
5438 | flags and filenames can be extracted from this line. | |
5439 | The initialization function must return | |
5440 | .sm TRUE | |
5441 | if it successfully opened the map, | |
5442 | .sm FALSE | |
5443 | otherwise. | |
5444 | .pp | |
5445 | The lookup function is called as | |
5446 | .(b | |
e9305caa | 5447 | \fIxxx\fP_map_lookup(MAP *map, char buf[], int bufsize, char **av, int *statp) |
f13b6b36 EA |
5448 | .)b |
5449 | The | |
5450 | .i map | |
5451 | defines the map internally. | |
5452 | The parameters | |
5453 | .i buf | |
5454 | and | |
5455 | .i bufsize | |
5456 | have the input key. | |
5457 | This may be (and often is) used destructively. | |
5458 | The | |
5459 | .i av | |
5460 | is a list of arguments passed in from the rewrite line. | |
5461 | The lookup function should return a pointer to the new value. | |
e9305caa EA |
5462 | IF the map lookup fails, |
5463 | .i *statp | |
5464 | should be set to an exit status code; | |
5465 | in particular, it should be set to | |
5466 | .sm EX_TEMPFAIL | |
5467 | if recovery is to be attempted by the higher level code. | |
55aab950 EA |
5468 | .sh 3 "Queueing Function" |
5469 | .pp | |
5470 | The routine | |
5471 | .i shouldqueue | |
5472 | is called to decide if a message should be queued | |
5473 | or processed immediately. | |
5474 | Typically this compares the message priority to the current load average. | |
5475 | The default definition is: | |
5476 | .(b | |
5477 | bool | |
5478 | shouldqueue(pri, ctime) | |
5479 | long pri; | |
5480 | time_t ctime; | |
5481 | { | |
5482 | if (CurrentLA < QueueLA) | |
5483 | return (FALSE); | |
859d056a EA |
5484 | if (CurrentLA >= RefuseLA) |
5485 | return (TRUE); | |
55aab950 EA |
5486 | return (pri > (QueueFactor / (CurrentLA \- QueueLA + 1))); |
5487 | } | |
5488 | .)b | |
5489 | If the current load average | |
5490 | (global variable | |
5491 | .i CurrentLA , | |
5492 | which is set before this function is called) | |
859d056a | 5493 | is less than the low threshold load average |
55aab950 EA |
5494 | (option |
5495 | .b x , | |
5496 | variable | |
5497 | .i QueueLA ), | |
5498 | .i shouldqueue | |
5499 | returns | |
5500 | .sm FALSE | |
5501 | immediately | |
5502 | (that is, it should | |
5503 | .i not | |
5504 | queue). | |
859d056a EA |
5505 | If the current load average exceeds the high threshold load average |
5506 | (option | |
5507 | .b X , | |
5508 | variable | |
5509 | .i RefuseLA ), | |
5510 | .i shouldqueue | |
5511 | returns | |
5512 | .sm TRUE | |
5513 | immediately. | |
55aab950 EA |
5514 | Otherwise, it computes the function based on the message priority, |
5515 | the queue factor | |
5516 | (option | |
5517 | .b q , | |
5518 | global variable | |
5519 | .i QueueFactor ), | |
5520 | and the current and threshold load averages. | |
5521 | .pp | |
5522 | An implementation wishing to take the actual age of the message into account | |
5523 | can also use the | |
5524 | .i ctime | |
5525 | parameter, | |
5526 | which is the time that the message was first submitted to | |
5527 | .i sendmail . | |
5528 | Note that the | |
5529 | .i pri | |
5530 | parameter is already weighted | |
5531 | by the number of times the message has been tried | |
5532 | (although this tends to lower the priority of the message with time); | |
5533 | the expectation is that the | |
5534 | .i ctime | |
5535 | would be used as an | |
5536 | .q "escape clause" | |
5537 | to ensure that messages are eventually processed. | |
5538 | .sh 3 "Refusing Incoming SMTP Connections" | |
5539 | .pp | |
5540 | The function | |
5541 | .i refuseconnections | |
5542 | returns | |
5543 | .sm TRUE | |
5544 | if incoming SMTP connections should be refused. | |
5545 | The current implementation is based exclusively on the current load average | |
5546 | and the refuse load average option | |
5547 | (option | |
5548 | .b X , | |
5549 | global variable | |
5550 | .i RefuseLA ): | |
5551 | .(b | |
5552 | bool | |
5553 | refuseconnections() | |
5554 | { | |
859d056a | 5555 | return (CurrentLA >= RefuseLA); |
55aab950 EA |
5556 | } |
5557 | .)b | |
5558 | A more clever implementation | |
5559 | could look at more system resources. | |
5560 | .sh 3 "Load Average Computation" | |
5561 | .pp | |
5562 | The routine | |
5563 | .i getla | |
5564 | returns the current load average (as a rounded integer). | |
5565 | The distribution includes several possible implementations. | |
f13b6b36 EA |
5566 | .sh 2 "Configuration in src/daemon.c" |
5567 | .pp | |
5568 | The file | |
5569 | .i src/daemon.c | |
5570 | contains a number of routines that are dependent | |
5571 | on the local networking environment. | |
5572 | The version supplied is specific to 4.3 BSD. | |
5573 | .pp | |
5574 | In previous releases, | |
5575 | we recommended that you modify the routine | |
5576 | .i maphostname | |
5577 | if you wanted to generalize | |
5578 | .b $[ | |
5579 | \&...\& | |
5580 | .b $] | |
5581 | lookups. | |
5582 | We now recommend that you create a new keyed map instead. | |
f90dac5e | 5583 | .sh 1 "CHANGES IN VERSION 6" |
f13b6b36 EA |
5584 | .pp |
5585 | The following summarizes changes | |
5586 | since the last commonly available version of | |
5587 | .b sendmail | |
5588 | (5.67): | |
5589 | .sh 2 "Connection Caching" | |
5590 | .pp | |
5591 | Instead of closing SMTP connections immediately, | |
5592 | those connections are cached for possible future use. | |
5593 | The advent of MX records made this effective for mailing lists; | |
5594 | in addition, | |
5595 | substantial performance improvements can be expected for queue processing. | |
d1e44f94 EA |
5596 | .sh 2 "MX Piggybacking" |
5597 | .pp | |
5598 | If two hosts with different names in a single message | |
5599 | happen to have the same set of MX hosts, | |
5600 | they can be sent in the same transaction. | |
acbfac81 | 5601 | Version 6 notices this and tries to batch the messages. |
f13b6b36 EA |
5602 | .sh 2 "Eight-Bit Clean" |
5603 | .pp | |
5604 | Previous versions of | |
5605 | .b sendmail | |
5606 | used the 0200 bit for quoting. | |
5607 | This version avoids that use. | |
5608 | However, for compatibility with RFC 822, | |
09ac6be2 | 5609 | you can set option `7' to get seven bit stripping. |
f13b6b36 EA |
5610 | .pp |
5611 | Individual mailers can still produce seven bit out put using the | |
5612 | `7' mailer flag. | |
5613 | .sh 2 "User Database" | |
5614 | .pp | |
5615 | The user database is an as-yet experimental attempt | |
5616 | to provide unified large-site name support. | |
5617 | We are installing it at Berkeley; | |
5618 | future versions may show significant modifications. | |
5619 | .sh 2 "Improved BIND Support" | |
5620 | .pp | |
5621 | The BIND support, | |
5622 | particularly for MX records, | |
5623 | had a number of annoying | |
5624 | .q features | |
5625 | which have been removed in this release. | |
5626 | In particular, | |
5627 | these more tightly bind (pun intended) the name server to sendmail, | |
5628 | so that the name server resolution rules are incorporated directly into | |
5629 | .b sendmail . | |
5630 | .sh 2 "Keyed Files" | |
5631 | .pp | |
5632 | Generalized keyed files is an idea taken directly from | |
5633 | .sm IDA | |
5634 | .b sendmail | |
5635 | (albeit with a completely different implementation). | |
5636 | They can be useful on large sites. | |
de7324ac EA |
5637 | .pp |
5638 | R6 also understands YP. | |
9873c4c7 EA |
5639 | .sh 2 "Multi-Word Classes" |
5640 | .pp | |
5641 | Classes can now be multiple words. | |
5642 | For example, | |
5643 | .(b | |
5644 | CShofmann.CS.Berkeley.EDU | |
5645 | .)b | |
5646 | allows you to match the entire string | |
5647 | .q hofmann.CS.Berkeley.EDU | |
5648 | using the single construct | |
5649 | .q $=S . | |
25e4e430 EA |
5650 | .sh 2 "Deferred Macro Expansion" |
5651 | .pp | |
5652 | The | |
5653 | .b $& \c | |
5654 | .i x | |
5655 | construct has been adopted from | |
5656 | .sm IDA . | |
5657 | .sh 2 "IDENT Protocol Support" | |
5658 | .pp | |
5659 | The IDENT protocol as defined in RFC 1413 is supported. | |
f13b6b36 EA |
5660 | .sh 2 "Parsing Bug Fixes" |
5661 | .pp | |
5662 | A number of small bugs having to do with things like | |
5663 | backslash-escaped quotes inside of comments | |
5664 | have been fixed. | |
f90dac5e | 5665 | .sh 2 "Separate Envelope/Header Processing" |
f13b6b36 EA |
5666 | .pp |
5667 | Since the From: line is passed in separately from the envelope sender, | |
5668 | these have both been made visible; | |
5669 | the | |
91679fc8 EA |
5670 | .b $g |
5671 | macro is set to the envelope sender during processing | |
5672 | of mailer argument vectors | |
5673 | and the header sender during processing of headers. | |
6ebbc09a | 5674 | .pp |
f90dac5e EA |
5675 | It is also possible to specify separate per-mailer |
5676 | envelope and header processing. | |
6ebbc09a EA |
5677 | The |
5678 | .b S enderRWSet | |
5679 | and | |
5680 | .b R ecipientRWset | |
5681 | arguments for mailers | |
5682 | can be specified as | |
5683 | .i envelope/header | |
5684 | to give different rewritings for envelope versus header addresses. | |
f90dac5e EA |
5685 | .sh 2 "Owner-List Propagates to Envelope" |
5686 | .pp | |
5687 | When an alias has an associated owner\-list name, | |
5688 | that alias is used to change the envelope sender address. | |
5689 | This will cause downstream errors to be returned to that owner. | |
f13b6b36 EA |
5690 | .sh 2 "Dynamic Header Allocation" |
5691 | .pp | |
5692 | The fixed size limit on header lines has been eliminated. | |
5693 | .sh 2 "New Command Line Flag" | |
5694 | .pp | |
5695 | The \-p flag has been added | |
5696 | to pass in protocol information. | |
f90dac5e EA |
5697 | .sh 2 "New and Old Configuration Line Types" |
5698 | .pp | |
5699 | The | |
5700 | .b T | |
5701 | (Trusted users) configuration line has been deleted. | |
5702 | It will still be accepted but will be ignored. | |
5703 | .pp | |
5704 | The | |
5705 | .b K | |
5706 | line has been added to declare database maps. | |
5707 | .pp | |
5708 | The | |
5709 | .b V | |
5710 | line has been added to declare the configuration version level. | |
f13b6b36 EA |
5711 | .sh 2 "New Options" |
5712 | .pp | |
5713 | Several new options have been added, | |
5714 | many to support new features, | |
5715 | others to allow tuning that was previously available | |
5716 | only by recompiling. | |
de7324ac | 5717 | They are described in detail in Section 5.1.5. |
f13b6b36 | 5718 | Briefly, |
859d056a EA |
5719 | .ip b |
5720 | Insist on a minimum number of disk blocks. | |
f13b6b36 EA |
5721 | .ip C |
5722 | Set checkpoint interval. | |
5723 | .ip E | |
5724 | Default error message. | |
de7324ac EA |
5725 | .ip G |
5726 | Enable GECOS matching. | |
f13b6b36 EA |
5727 | .ip h |
5728 | Maximum hop count. | |
d6f77a91 EA |
5729 | .ip j |
5730 | Send errors in MIME-encapsulated format. | |
f13b6b36 EA |
5731 | .ip J |
5732 | Forward file path. | |
5733 | .ip k | |
5734 | Connection cache size | |
5735 | .ip K | |
5736 | Connection cache lifetime. | |
399e2f78 EA |
5737 | .ip l |
5738 | Enable Errors-To: header. | |
5739 | These headers violate RFC 1123; | |
5740 | this option is included to provide back compatibility | |
5741 | with old versions of sendmail. | |
859d056a EA |
5742 | .ip p |
5743 | Privacy options. | |
f13b6b36 EA |
5744 | .ip U |
5745 | User database spec. | |
d6f77a91 EA |
5746 | .ip 7 |
5747 | Do not run eight bit clean. | |
859d056a EA |
5748 | .sh 2 "Extended Options" |
5749 | .pp | |
5750 | The | |
5751 | .b r | |
31e506e2 | 5752 | (read timeout), |
859d056a | 5753 | .b I |
31e506e2 EA |
5754 | (use BIND), |
5755 | and | |
5756 | .b T | |
5757 | (queue timeout) | |
859d056a EA |
5758 | options have been extended to pass in more information. |
5759 | .sh 2 "New Mailer Flag" | |
5760 | .pp | |
5761 | The | |
5762 | .b c | |
5763 | mailer flag will strip all comments | |
5764 | from addresses; | |
5765 | this should only be used as a last resort | |
5766 | when dealing with cranky mailers. | |
acbfac81 EA |
5767 | .sh 2 "New LHS Token" |
5768 | .pp | |
5769 | Version 6 allows | |
5770 | .b $@ | |
5771 | on the Left Hand Side of an | |
5772 | .q R | |
5773 | line to match zero tokens. | |
5774 | This is intended to be used to match the null input. | |
f13b6b36 EA |
5775 | .sh 2 "Bigger Defaults" |
5776 | .pp | |
acbfac81 | 5777 | Version 6 allows up to 100 rulesets instead of 30. |
f13b6b36 EA |
5778 | It is recommended that rulesets 0\-9 be reserved for |
5779 | .i sendmail 's | |
5780 | dedicated use in future releases. | |
5781 | .pp | |
5782 | The total number of MX records that can be used has been raised to 20. | |
5783 | .pp | |
5784 | The number of queued messages that can be handled at one time | |
5785 | has been raised from 600 to 1000. | |
d1e44f94 EA |
5786 | .sh 2 "Different Default Tuning Parameters" |
5787 | .pp | |
acbfac81 | 5788 | Version 6 has changed the default parameters |
d1e44f94 EA |
5789 | for tuning queue costs |
5790 | to make the number of recipients more important | |
5791 | than the size of the message (for small messages). | |
5792 | This is reasonable if you are connected with reasonably fast links. | |
de7324ac EA |
5793 | .sh 2 "Auto-Quoting in Addresses" |
5794 | .pp | |
5795 | Previously, the | |
5796 | .q "Full Name <email address>" | |
5797 | syntax would generate incorrect protocol output | |
5798 | if | |
5799 | .q "Full Name" | |
5800 | had special characters such as dot. | |
5801 | This version puts quotes around such names. | |
5802 | .sh 2 "Symbolic Names On Error Mailer" | |
5803 | .pp | |
5804 | Several names have been built in to the $@ portion of the $#error | |
5805 | mailer. | |
59baf33c EA |
5806 | .sh 2 "SMTP VRFY Doesn't Expand" |
5807 | .pp | |
5808 | Previous versions of | |
5809 | .i sendmail | |
5810 | treated VRFY and EXPN the same. | |
5811 | In this version, | |
5812 | VRFY doesn't expand aliases or follow .forward files. | |
5813 | .pp | |
5814 | As an optimization, if you run with your default delivery mode being | |
5815 | queue-only, | |
5816 | the RCPT command will also not chase aliases and .forward files. | |
5817 | It will chase them when it processes the queue. | |
337767a9 EA |
5818 | .sh 2 "[IPC] Mailers Allow Multiple Hosts" |
5819 | .pp | |
5820 | When an address resolves to a mailer that has | |
5821 | .q [IPC] | |
5822 | as its | |
5823 | .q Path , | |
5824 | the $@ part (host name) | |
5825 | can be a colon-separated list of hosts instead of a single hostname. | |
5826 | This asks sendmail to search the list for the first entry that is available | |
5827 | exactly as though it were an MX record. | |
5828 | The intent is to route internal traffic through internal networks | |
5829 | without publishing an MX record to the net. | |
5830 | MX expansion is still done on the individual items. | |
09ac6be2 EA |
5831 | .sh 2 "Aliases Extended" |
5832 | .pp | |
5833 | The implementation has been merged with maps. | |
5834 | Among other things, | |
5835 | this supports NIS-based aliases. | |
de7324ac EA |
5836 | .sh 2 "Portability and Security Enhancements" |
5837 | .pp | |
5838 | A number of internal changes have been made to enhance portability. | |
5839 | .pp | |
5840 | Several fixes have been made to increase the paranoia factor. | |
6d5ff626 EA |
5841 | .sh 1 "ACKNOWLEDGEMENTS" |
5842 | .pp | |
5843 | I've worked on | |
5844 | .i sendmail | |
5845 | for many years, | |
5846 | and many employers have been remarkably patient | |
5847 | about letting me work on a large project | |
5848 | that was not part of my official job. | |
5849 | This includes time on the INGRES Project at Berkeley, | |
5850 | at Britton Lee, | |
5851 | and again on the Mammoth Project at Berkeley. | |
5852 | .pp | |
5853 | Much of the second wave of improvements | |
5854 | should be credited to Bryan Costales of ICSI. | |
5855 | As he passed me drafts of his book on | |
5856 | .i sendmail | |
5857 | I was inspired to start working on things again. | |
5858 | Bryan was also available to bounce ideas off of. | |
5859 | .pp | |
5860 | Many, many people contributed chunks of code and ideas to | |
5861 | .i sendmail . | |
5862 | It has proven to be a group network effort. | |
50d4a65c EA |
5863 | Version 6 in particular was a group project. |
5864 | The following people made notable contributions: | |
5865 | .(l | |
5866 | Keith Bostic, CSRG, University of California, Berkeley | |
5867 | Michael J. Corrigan, University of California, San Diego | |
5868 | Bryan Costales, International Computer Science Institute | |
5869 | P{r (Pell) Emanuelsson | |
5870 | Craig Everhart, Transarc Corporation | |
5871 | Tom Ivar Helbekkmo, Norwegian School of Economics | |
5872 | Allan E. Johannesen, WPI | |
5873 | Takahiro Kanbe, FujiXerox | |
5874 | Brian Kantor, University of California, San Diego | |
5875 | Bruce Lilly, Sony U.S. | |
5876 | Nakamura Motonori, Kyoto University | |
5877 | John Gardiner Myers, Carnegie Mellon University | |
5878 | Neil Rickert, Northern Illinois University | |
5879 | Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam | |
d4097fda | 5880 | Christophe Wolfhugel, Herve Schauer Consultants (Paris) |
50d4a65c EA |
5881 | .)l |
5882 | I apologize for anyone I have omitted, misspelled, misattributed, or | |
5883 | otherwise missed. | |
5884 | Many other people have contributed ideas, comments, and encouragement. | |
5885 | I appreciate their contribution as well. | |
f13b6b36 EA |
5886 | .++ A |
5887 | .+c "COMMAND LINE FLAGS" | |
5888 | .ba 0 | |
5889 | .nr ii 1i | |
5890 | .pp | |
5891 | Arguments must be presented with flags before addresses. | |
5892 | The flags are: | |
5893 | .ip \-b\fIx\fP | |
5894 | Set operation mode to | |
5895 | .i x . | |
5896 | Operation modes are: | |
5897 | .(b | |
5898 | .ta 4n | |
5899 | m Deliver mail (default) | |
5900 | s Speak SMTP on input side | |
5901 | d Run as a daemon | |
5902 | t Run in test mode | |
5903 | v Just verify addresses, don't collect or deliver | |
5904 | i Initialize the alias database | |
5905 | p Print the mail queue | |
5906 | z Freeze the configuration file | |
5907 | .)b | |
5908 | .ip \-C\fIfile\fP | |
5909 | Use a different configuration file. | |
5910 | .i Sendmail | |
5911 | runs as the invoking user (rather than root) | |
5912 | when this flag is specified. | |
5913 | .ip \-d\fIlevel\fP | |
5914 | Set debugging level. | |
5915 | .ip "\-f\ \fIaddr\fP" | |
5916 | The sender's machine address is | |
5917 | .i addr . | |
f13b6b36 EA |
5918 | .ip \-F\fIname\fP |
5919 | Sets the full name of this user to | |
5920 | .i name . | |
5921 | .ip "\-h\ \fIcnt\fP" | |
5922 | Sets the | |
5923 | .q "hop count" | |
5924 | to | |
5925 | .i cnt . | |
5926 | This represents the number of times this message has been processed | |
5927 | by | |
5928 | .i sendmail | |
5929 | (to the extent that it is supported by the underlying networks). | |
5930 | .i Cnt | |
5931 | is incremented during processing, | |
5932 | and if it reaches | |
5933 | MAXHOP | |
5934 | (currently 30) | |
5935 | .i sendmail | |
5936 | throws away the message with an error. | |
5937 | .ip \-n | |
5938 | Don't do aliasing or forwarding. | |
5939 | .ip "\-r\ \fIaddr\fP" | |
5940 | An obsolete form of | |
5941 | .b \-f . | |
5942 | .ip \-o\fIx\|value\fP | |
5943 | Set option | |
5944 | .i x | |
5945 | to the specified | |
5946 | .i value . | |
5947 | These options are described in Appendix B. | |
5948 | .ip \-p\fIprotocol\fP | |
5949 | Set the sending protocol. | |
5950 | Programs are encouraged to set this. | |
5951 | The protocol field can be in the form | |
5952 | .i protocol \c | |
5953 | .b : \c | |
5954 | .i host | |
5955 | to set both the sending protocol and sending host. | |
5956 | For example, | |
5957 | .q \-pUUCP:uunet | |
5958 | sets the sending protocol to UUCP | |
5959 | and the sending host to uunet. | |
5960 | (Some existing programs use \-oM to set the r and s macros; | |
5961 | this is equivalent to using \-p.) | |
5962 | .ip \-q\fItime\fP | |
5963 | Try to process the queued up mail. | |
5964 | If the time is given, | |
5965 | a sendmail will run through the queue at the specified interval | |
5966 | to deliver queued mail; | |
5967 | otherwise, it only runs once. | |
0780838b EA |
5968 | .ip \-q\fIXstring\fP |
5969 | Run the queue once, | |
5970 | limiting the jobs to those matching | |
5971 | .i Xstring . | |
5972 | The key letter | |
5973 | .i X | |
5974 | can be | |
5975 | .b I | |
5976 | to limit based on queue identifier, | |
5977 | .b R | |
5978 | to limit based on recipient, | |
5979 | or | |
5980 | .b S | |
5981 | to limit based on sender. | |
5982 | A particular queued job is accepted if one of the corresponding addresses | |
5983 | contains the indicated | |
5984 | .i string . | |
f13b6b36 EA |
5985 | .ip \-t |
5986 | Read the header for | |
5987 | .q To: , | |
5988 | .q Cc: , | |
5989 | and | |
5990 | .q Bcc: | |
5991 | lines, and send to everyone listed in those lists. | |
5992 | The | |
5993 | .q Bcc: | |
5994 | line will be deleted before sending. | |
5995 | Any addresses in the argument vector will be deleted | |
5996 | from the send list. | |
daae36f7 | 5997 | .pp |
f13b6b36 EA |
5998 | There are a number of options that may be specified as |
5999 | primitive flags | |
6000 | (provided for compatibility with | |
6001 | .i delivermail ). | |
6002 | These are the e, i, m, and v options. | |
6003 | Also, | |
6004 | the f option | |
6005 | may be specified as the | |
6006 | .b \-s | |
6007 | flag. | |
6008 | .+c "QUEUE FILE FORMATS" | |
6009 | .pp | |
6010 | This appendix describes the format of the queue files. | |
6011 | These files live in the directory defined by the | |
6012 | .b Q | |
6013 | option in the | |
6014 | .i sendmail.cf | |
6015 | file, usually | |
6016 | .i /var/spool/mqueue | |
daae36f7 | 6017 | or |
f13b6b36 EA |
6018 | .i /usr/spool/mqueue . |
6019 | .pp | |
6020 | All queue files have the name | |
b3c10f97 | 6021 | \fIx\fP\|\fBf\fP\fIAAA99999\fP |
f13b6b36 | 6022 | where |
b3c10f97 | 6023 | .i AAA99999 |
f13b6b36 EA |
6024 | is the |
6025 | .i id | |
6026 | for this message | |
6027 | and the | |
6028 | .i x | |
6029 | is a type. | |
b3c10f97 EA |
6030 | The first letter of the id encodes the hour of the day |
6031 | that the message was received by the system | |
6032 | (with A being the hour between midnight and 1:00AM). | |
f13b6b36 EA |
6033 | All files with the same id collectively define one message. |
6034 | .pp | |
6035 | The types are: | |
6036 | .nr ii 0.5i | |
6037 | .ip d | |
6038 | The data file. | |
6039 | The message body (excluding the header) is kept in this file. | |
6040 | .ip l | |
6041 | The lock file. | |
6042 | If this file exists, | |
6043 | the job is currently being processed, | |
6044 | and a queue run will not process the file. | |
6045 | For that reason, | |
6046 | an extraneous | |
6047 | .b lf | |
6048 | file can cause a job to apparently disappear | |
6049 | (it will not even time out!). | |
6050 | [Actually, this file is obsolete on most systems that support the | |
6051 | .b flock | |
daae36f7 | 6052 | or |
f13b6b36 EA |
6053 | .b lockf |
6054 | system calls.] | |
6055 | .ip n | |
6056 | This file is created when an id is being created. | |
6057 | It is a separate file to insure that no mail can ever be destroyed | |
6058 | due to a race condition. | |
6059 | It should exist for no more than a few milliseconds | |
6060 | at any given time. | |
6061 | [This is only used on old versions of | |
6062 | sendmail; | |
6063 | it is not used | |
6064 | on newer versions.] | |
6065 | .ip q | |
6066 | The queue control file. | |
6067 | This file contains the information necessary to process the job. | |
6068 | .ip t | |
6069 | A temporary file. | |
6070 | These are an image of the | |
6071 | .b qf | |
6072 | file when it is being rebuilt. | |
6073 | It should be renamed to a | |
6074 | .b qf | |
6075 | file very quickly. | |
6076 | .ip x | |
6077 | A transcript file, | |
6078 | existing during the life of a session | |
6079 | showing everything that happens | |
6080 | during that session. | |
367a5dcd | 6081 | .pp |
f13b6b36 EA |
6082 | The |
6083 | .b qf | |
6084 | file is structured as a series of lines | |
6085 | each beginning with a code letter. | |
6086 | The lines are as follows: | |
6087 | .ip D | |
6088 | The name of the data file. | |
6089 | There may only be one of these lines. | |
6090 | .ip H | |
6091 | A header definition. | |
6092 | There may be any number of these lines. | |
6093 | The order is important: | |
6094 | they represent the order in the final message. | |
6095 | These use the same syntax | |
6096 | as header definitions in the configuration file. | |
6097 | .ip C | |
6098 | The controlling address. | |
d6f77a91 EA |
6099 | The syntax is |
6100 | .q localuser:aliasname . | |
f13b6b36 | 6101 | Recipient addresses following this line |
d6f77a91 EA |
6102 | will be flagged so that deliveries will be run as the |
6103 | .i localuser | |
6104 | (a user name from the /etc/passwd file); | |
6105 | .i aliasname | |
6106 | is the name of the alias that expanded to this address | |
6107 | (used for printing messages). | |
f13b6b36 EA |
6108 | .ip R |
6109 | A recipient address. | |
6110 | This will normally be completely aliased, | |
6111 | but is actually realiased when the job is processed. | |
6112 | There will be one line | |
6113 | for each recipient. | |
6114 | .ip S | |
6115 | The sender address. | |
6116 | There may only be one of these lines. | |
6117 | .ip E | |
6118 | An error address. | |
6119 | If any such lines exist, | |
6120 | they represent the addresses that should receive error messages. | |
6121 | .ip T | |
6122 | The job creation time. | |
6123 | This is used to compute when to time out the job. | |
6124 | .ip P | |
6125 | The current message priority. | |
6126 | This is used to order the queue. | |
6127 | Higher numbers mean lower priorities. | |
6128 | The priority changes | |
6129 | as the message sits in the queue. | |
6130 | The initial priority depends on the message class | |
6131 | and the size of the message. | |
6132 | .ip M | |
6133 | A message. | |
6134 | This line is printed by the | |
6135 | .i mailq | |
6136 | command, | |
6137 | and is generally used to store status information. | |
6138 | It can contain any text. | |
d93f0185 EA |
6139 | .ip F |
6140 | Flag bits, represented as one letter per flag. | |
6141 | Defined flag bits are | |
6142 | .b r | |
6143 | indicating that this is a response message | |
6144 | and | |
6145 | .b w | |
6146 | indicating that a warning message has been sent | |
6147 | announcing that the mail has been delayed. | |
f13b6b36 EA |
6148 | .ip $ |
6149 | A macro definition. | |
6150 | The values of certain macros | |
6151 | (as of this writing, only | |
6152 | .b $r | |
6153 | and | |
6154 | .b $s ) | |
6155 | are passed through to the queue run phase. | |
40eb61ea EA |
6156 | .ip B |
6157 | The body type. | |
6158 | The remainder of the line is a text string defining the body type. | |
6159 | If this field is missing, | |
6160 | the body type is assumed to be | |
6161 | .q "undefined" | |
6162 | and no special processing is attempted. | |
6163 | Legal values are | |
6164 | .q 7BIT | |
6165 | and | |
6166 | .q 8BITMIME . | |
367a5dcd | 6167 | .pp |
f13b6b36 EA |
6168 | As an example, |
6169 | the following is a queue file sent to | |
6170 | .q eric@mammoth.Berkeley.EDU | |
6171 | and | |
6172 | .q bostic@okeeffe.CS.Berkeley.EDU \**: | |
6173 | .(f | |
6174 | \**This example is contrived and probably inaccurate for your environment. | |
6175 | Glance over it to get an idea; | |
6176 | nothing can replace looking at what your own system generates. | |
6177 | .)f | |
6178 | .(b | |
6179 | P835771 | |
6180 | T404261372 | |
b3c10f97 | 6181 | DdfAAA13557 |
f13b6b36 | 6182 | Seric |
f13b6b36 | 6183 | Eowner-sendmail@vangogh.CS.Berkeley.EDU |
d6f77a91 | 6184 | Ceric:sendmail@vangogh.CS.Berkeley.EDU |
f13b6b36 EA |
6185 | Reric@mammoth.Berkeley.EDU |
6186 | Rbostic@okeeffe.CS.Berkeley.EDU | |
6187 | H?P?return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU> | |
b3c10f97 | 6188 | Hreceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703; |
f13b6b36 EA |
6189 | Fri, 17 Jul 92 00:28:55 -0700 |
6190 | Hreceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7) | |
b3c10f97 | 6191 | id AAA06698; Fri, 17 Jul 92 00:28:54 -0700 |
f13b6b36 EA |
6192 | Hreceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5) |
6193 | id AA22777; Fri, 17 Jul 92 03:29:14 -0400 | |
6194 | Hreceived: by foo.bar.baz.de (5.57/Ultrix3.0-C) | |
6195 | id AA22757; Fri, 17 Jul 92 09:31:25 GMT | |
6196 | H?F?from: eric@foo.bar.baz.de (Eric Allman) | |
6197 | H?x?full-name: Eric Allman | |
6198 | Hmessage-id: <9207170931.AA22757@foo.bar.baz.de> | |
6199 | HTo: sendmail@vangogh.CS.Berkeley.EDU | |
6200 | Hsubject: this is an example message | |
6201 | .)b | |
6202 | This shows the name of the data file, | |
6203 | the person who sent the message, | |
6204 | the submission time | |
6205 | (in seconds since January 1, 1970), | |
6206 | the message priority, | |
6207 | the message class, | |
6208 | the recipients, | |
6209 | and the headers for the message. | |
69a914e1 EA |
6210 | .+c "SUMMARY OF SUPPORT FILES" |
6211 | .pp | |
6212 | This is a summary of the support files | |
6213 | that | |
6214 | .i sendmail | |
6215 | creates or generates. | |
f13b6b36 EA |
6216 | Many of these can be changed by editing the sendmail.cf file; |
6217 | check there to find the actual pathnames. | |
69a914e1 | 6218 | .nr ii 1i |
55c435aa | 6219 | .ip "/usr/\*(SD/sendmail" |
69a914e1 EA |
6220 | The binary of |
6221 | .i sendmail . | |
6222 | .ip /usr/bin/newaliases | |
55c435aa | 6223 | A link to /usr/\*(SD/sendmail; |
69a914e1 | 6224 | causes the alias database to be rebuilt. |
74b6e641 EA |
6225 | Running this program is completely equivalent to giving |
6226 | .i sendmail | |
6227 | the | |
6228 | .b \-bi | |
6229 | flag. | |
69a914e1 EA |
6230 | .ip /usr/bin/mailq |
6231 | Prints a listing of the mail queue. | |
74b6e641 EA |
6232 | This program is equivalent to using the |
6233 | .b \-bp | |
6234 | flag to | |
6235 | .i sendmail . | |
daae36f7 | 6236 | .ip /etc/sendmail.cf |
69a914e1 EA |
6237 | The configuration file, |
6238 | in textual form. | |
daae36f7 | 6239 | .ip /etc/sendmail.fc |
69a914e1 EA |
6240 | The configuration file |
6241 | represented as a memory image. | |
6242 | .ip /usr/lib/sendmail.hf | |
6243 | The SMTP help file. | |
daae36f7 | 6244 | .ip /etc/sendmail.st |
69a914e1 | 6245 | A statistics file; need not be present. |
859d056a EA |
6246 | .ip /etc/sendmail.pid |
6247 | Created in daemon mode; | |
6248 | it contains the process id of the current SMTP daemon. | |
6249 | If you use this in scripts; | |
6250 | use ``head \-1'' to get just the first line; | |
6251 | later versions of | |
6252 | .i sendmail | |
6253 | may add information to subsequent lines. | |
daae36f7 | 6254 | .ip /etc/aliases |
69a914e1 | 6255 | The textual version of the alias file. |
daae36f7 | 6256 | .ip /etc/aliases.{pag,dir} |
69a914e1 | 6257 | The alias file in |
74b6e641 | 6258 | .i dbm \|(3) |
69a914e1 | 6259 | format. |
daae36f7 | 6260 | .ip /var/spool/mqueue |
69a914e1 EA |
6261 | The directory in which the mail queue |
6262 | and temporary files reside. | |
daae36f7 | 6263 | .ip /var/spool/mqueue/qf* |
69a914e1 | 6264 | Control (queue) files for messages. |
daae36f7 | 6265 | .ip /var/spool/mqueue/df* |
69a914e1 | 6266 | Data files. |
daae36f7 | 6267 | .ip /var/spool/mqueue/tf* |
69a914e1 EA |
6268 | Temporary versions of the qf files, |
6269 | used during queue file rebuild. | |
daae36f7 | 6270 | .ip /var/spool/mqueue/xf* |
69a914e1 | 6271 | A transcript of the current session. |
28719ec2 JB |
6272 | .\".ro |
6273 | .\".ls 1 | |
6274 | .\".tp | |
6275 | .\".sp 2i | |
6276 | .\".in 0 | |
6277 | .\".ce 100 | |
6278 | .\".sz 24 | |
6279 | .\".b SENDMAIL | |
6280 | .\".sz 14 | |
6281 | .\".sp | |
6282 | .\"INSTALLATION AND OPERATION GUIDE | |
6283 | .\".sp | |
6284 | .\".sz 10 | |
6285 | .\"Eric Allman | |
6286 | .\"Britton-Lee, Inc. | |
6287 | .\".sp | |
399e2f78 | 6288 | .\"Version 6.51 |
28719ec2 JB |
6289 | .\".ce 0 |
6290 | .pn 2 | |
6291 | .bp | |
4da134f8 | 6292 | .ce |
74b6e641 | 6293 | .sz 12 |
4da134f8 | 6294 | TABLE OF CONTENTS |
74b6e641 | 6295 | .sz 10 |
28719ec2 | 6296 | .sp |
3702dbcc EA |
6297 | .\" remove some things to avoid "out of temp file space" problem |
6298 | .rm sh | |
6299 | .rm (x | |
6300 | .rm )x | |
6301 | .rm ip | |
6302 | .rm pp | |
6303 | .rm lp | |
6304 | .rm he | |
6305 | .rm fo | |
6306 | .rm eh | |
6307 | .rm oh | |
6308 | .rm ef | |
6309 | .rm of | |
4da134f8 | 6310 | .xp |