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