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