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