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