Commit | Line | Data |
---|---|---|
86609a16 KB |
1 | .\" Copyright (c) 1988, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
5412ac7d | 3 | .\" |
a280d268 | 4 | .\" %sccs.include.redist.man% |
08e47b66 | 5 | .\" |
653ba8b6 | 6 | .\" @(#)sendmail.8 8.4 (Berkeley) %G% |
5412ac7d | 7 | .\" |
b42074ab CL |
8 | .Dd |
9 | .Dt SENDMAIL 8 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm sendmail | |
13 | .Nd send mail over the internet | |
14 | .Sh SYNOPSIS | |
15 | .Nm sendmail | |
16 | .Op Ar flags | |
17 | .Op Ar address ... | |
18 | .Nm newaliases | |
19 | .Nm mailq | |
20 | .Op Fl v | |
21 | .Sh DESCRIPTION | |
22 | .Nm Sendmail | |
8e8bec7f | 23 | sends a message to one or more |
b42074ab | 24 | .Em recipients , |
8de6f6c6 | 25 | routing the message over whatever networks |
5412ac7d | 26 | are necessary. |
b42074ab | 27 | .Nm Sendmail |
8de6f6c6 KM |
28 | does internetwork forwarding as necessary |
29 | to deliver the message to the correct place. | |
b42074ab CL |
30 | .Pp |
31 | .Nm Sendmail | |
5412ac7d | 32 | is not intended as a user interface routine; |
8de6f6c6 KM |
33 | other programs provide user-friendly |
34 | front ends; | |
b42074ab | 35 | .Nm sendmail |
8de6f6c6 | 36 | is used only to deliver pre-formatted messages. |
b42074ab | 37 | .Pp |
8de6f6c6 | 38 | With no flags, |
b42074ab | 39 | .Nm sendmail |
5412ac7d | 40 | reads its standard input |
8e8bec7f EA |
41 | up to an end-of-file |
42 | or a line consisting only of a single dot | |
43 | and sends a copy of the message found there | |
5412ac7d | 44 | to all of the addresses listed. |
8e8bec7f | 45 | It determines the network(s) to use |
8de6f6c6 | 46 | based on the syntax and contents of the addresses. |
b42074ab | 47 | .Pp |
5412ac7d | 48 | Local addresses are looked up in a file |
5412ac7d KM |
49 | and aliased appropriately. |
50 | Aliasing can be prevented by preceding the address | |
8de6f6c6 | 51 | with a backslash. |
5412ac7d KM |
52 | Normally the sender is not included in any alias |
53 | expansions, e.g., | |
54 | if `john' sends to `group', | |
55 | and `group' includes `john' in the expansion, | |
56 | then the letter will not be delivered to `john'. | |
7ecdfce3 | 57 | .Ss Parameters |
b42074ab | 58 | .Bl -tag -width Fl |
2802a569 EA |
59 | .It Fl B Ns Ar type |
60 | Set the body type to | |
61 | .Ar type . | |
62 | Current legal values | |
63 | .Li 7BIT | |
64 | or | |
65 | .Li 8BITMIME . | |
b42074ab CL |
66 | .It Fl ba |
67 | Go into | |
68 | .Tn ARPANET | |
69 | mode. | |
8de6f6c6 KM |
70 | All input lines must end with a CR-LF, |
71 | and all messages will be generated with a CR-LF at the end. | |
72 | Also, | |
73 | the ``From:'' and ``Sender:'' | |
74 | fields are examined for the name of the sender. | |
b42074ab CL |
75 | .It Fl bd |
76 | Run as a daemon. This requires Berkeley | |
77 | .Tn IPC . | |
78 | .Nm Sendmail | |
8e8bec7f | 79 | will fork and run in background |
b42074ab CL |
80 | listening on socket 25 for incoming |
81 | .Tn SMTP | |
82 | connections. | |
8e8bec7f | 83 | This is normally run from |
b42074ab CL |
84 | .Pa /etc/rc . |
85 | .It Fl bi | |
8de6f6c6 | 86 | Initialize the alias database. |
b42074ab | 87 | .It Fl bm |
8de6f6c6 | 88 | Deliver mail in the usual way (default). |
b42074ab | 89 | .It Fl bp |
8de6f6c6 | 90 | Print a listing of the queue. |
b42074ab CL |
91 | .It Fl bs |
92 | Use the | |
93 | .Tn SMTP | |
94 | protocol as described in | |
95 | .Tn RFC821 | |
8e8bec7f | 96 | on standard input and output. |
8de6f6c6 | 97 | This flag implies all the operations of the |
b42074ab CL |
98 | .Fl ba |
99 | flag that are compatible with | |
100 | .Tn SMTP . | |
101 | .It Fl bt | |
8de6f6c6 KM |
102 | Run in address test mode. |
103 | This mode reads addresses and shows the steps in parsing; | |
104 | it is used for debugging configuration tables. | |
b42074ab | 105 | .It Fl bv |
8de6f6c6 KM |
106 | Verify names only \- do not try to collect or deliver a message. |
107 | Verify mode is normally used for validating | |
108 | users or mailing lists. | |
b42074ab | 109 | .It Fl C Ns Ar file |
8de6f6c6 | 110 | Use alternate configuration file. |
b42074ab | 111 | .Nm Sendmail |
8e8bec7f | 112 | refuses to run as root if an alternate configuration file is specified. |
b42074ab | 113 | .It Fl d Ns Ar X |
8de6f6c6 | 114 | Set debugging value to |
b42074ab | 115 | .Ar X . |
653ba8b6 | 116 | .ne 1i |
b42074ab | 117 | .It Fl F Ns Ar fullname |
8de6f6c6 | 118 | Set the full name of the sender. |
b42074ab | 119 | .It Fl f Ns Ar name |
8de6f6c6 KM |
120 | Sets the name of the ``from'' person |
121 | (i.e., the sender of the mail). | |
b42074ab | 122 | .Fl f |
8de6f6c6 | 123 | can only be used |
8e8bec7f EA |
124 | by ``trusted'' users |
125 | (normally | |
b42074ab CL |
126 | .Em root , |
127 | .Em daemon , | |
5412ac7d | 128 | and |
b42074ab | 129 | .Em network ) |
5412ac7d KM |
130 | or if the person you are trying to become |
131 | is the same as the person you are. | |
b42074ab | 132 | .It Fl h Ns Ar N |
8de6f6c6 | 133 | Set the hop count to |
b42074ab | 134 | .Ar N . |
8de6f6c6 KM |
135 | The hop count is incremented every time the mail is |
136 | processed. | |
137 | When it reaches a limit, | |
138 | the mail is returned with an error message, | |
139 | the victim of an aliasing loop. | |
8e8bec7f EA |
140 | If not specified, |
141 | ``Received:'' lines in the message are counted. | |
b42074ab | 142 | .It Fl n |
8de6f6c6 | 143 | Don't do aliasing. |
b42074ab | 144 | .It Fl o Ns Ar x Em value |
8de6f6c6 | 145 | Set option |
b42074ab | 146 | .Ar x |
8de6f6c6 | 147 | to the specified |
b42074ab | 148 | .Em value . |
8de6f6c6 | 149 | Options are described below. |
440394c6 EA |
150 | .It Fl p Ns Ar protocol |
151 | Set the name of the protocol used to receive the message. | |
152 | This can be a simple protocol name such as ``UUCP'' | |
153 | or a protocol and hostname, such as ``UUCP:ucbvax''. | |
b42074ab | 154 | .It Fl q Ns Bq Ar time |
8de6f6c6 KM |
155 | Processed saved messages in the queue at given intervals. |
156 | If | |
b42074ab | 157 | .Ar time |
8de6f6c6 KM |
158 | is omitted, |
159 | process the queue once. | |
b42074ab | 160 | .Xr Time |
8de6f6c6 | 161 | is given as a tagged number, |
b42074ab CL |
162 | with |
163 | .Ql s | |
164 | being seconds, | |
165 | .Ql m | |
166 | being minutes, | |
167 | .Ql h | |
168 | being hours, | |
169 | .Ql d | |
170 | being days, | |
8de6f6c6 | 171 | and |
b42074ab CL |
172 | .Ql w |
173 | being weeks. | |
8de6f6c6 | 174 | For example, |
b42074ab CL |
175 | .Ql \-q1h30m |
176 | or | |
177 | .Ql \-q90m | |
8de6f6c6 | 178 | would both set the timeout to one hour thirty minutes. |
8e8bec7f | 179 | If |
b42074ab | 180 | .Ar time |
8e8bec7f | 181 | is specified, |
b42074ab | 182 | .Nm sendmail |
8e8bec7f EA |
183 | will run in background. |
184 | This option can be used safely with | |
b42074ab CL |
185 | .Fl bd . |
186 | .It Fl r Ns Ar name | |
8de6f6c6 | 187 | An alternate and obsolete form of the |
b42074ab | 188 | .Fl f |
8de6f6c6 | 189 | flag. |
b42074ab | 190 | .It Fl t |
8de6f6c6 | 191 | Read message for recipients. |
8e8bec7f | 192 | To:, Cc:, and Bcc: lines will be scanned for recipient addresses. |
8de6f6c6 | 193 | The Bcc: line will be deleted before transmission. |
8e8bec7f EA |
194 | Any addresses in the argument list will be suppressed, |
195 | that is, | |
196 | they will | |
b42074ab | 197 | .Em not |
8e8bec7f | 198 | receive copies even if listed in the message header. |
b42074ab | 199 | .It Fl v |
8de6f6c6 KM |
200 | Go into verbose mode. |
201 | Alias expansions will be announced, etc. | |
1da0f965 EA |
202 | .It Fl X Ar logfile |
203 | Log all traffic in and out of mailers in the indicated log file. | |
204 | This should only be used as a last resort | |
205 | for debugging mailer bugs. | |
206 | It will log a lot of data very quickly. | |
b42074ab | 207 | .El |
7ecdfce3 | 208 | .Ss Options |
8de6f6c6 KM |
209 | There are also a number of processing options that may be set. |
210 | Normally these will only be used by a system administrator. | |
211 | Options may be set either on the command line | |
212 | using the | |
b42074ab | 213 | .Fl o |
8de6f6c6 KM |
214 | flag |
215 | or in the configuration file. | |
ebf4a41a KB |
216 | This is a partial list; |
217 | for a complete list (and details), consult the | |
e3f16e5f | 218 | .%T "Sendmail Installation and Operation Guide" . |
8de6f6c6 | 219 | The options are: |
b42074ab CL |
220 | .Bl -tag -width Fl |
221 | .It Li A Ns Ar file | |
8de6f6c6 | 222 | Use alternate alias file. |
ebf4a41a KB |
223 | .It Li b Ns Ar nblocks |
224 | The minimum number of free blocks needed on the spool filesystem. | |
b42074ab | 225 | .It Li c |
8de6f6c6 KM |
226 | On mailers that are considered ``expensive'' to connect to, |
227 | don't initiate immediate connection. | |
228 | This requires queueing. | |
0f59c44f EA |
229 | .It Li C Ar N |
230 | Checkpoint the queue file after every | |
231 | .Ar N | |
232 | successful deliveries (default 10). | |
233 | This avoids excessive duplicate deliveries | |
234 | when sending to long mailing lists | |
235 | interrupted by system crashes. | |
b42074ab | 236 | .It Li d Ns Ar x |
8de6f6c6 | 237 | Set the delivery mode to |
b42074ab | 238 | .Ar x . |
8de6f6c6 | 239 | Delivery modes are |
b42074ab CL |
240 | .Ql i |
241 | for interactive (synchronous) delivery, | |
242 | .Ql b | |
243 | for background (asynchronous) delivery, | |
8de6f6c6 | 244 | and |
b42074ab CL |
245 | .Ql q |
246 | for queue only \- i.e., | |
8de6f6c6 | 247 | actual delivery is done the next time the queue is run. |
b42074ab | 248 | .It Li D |
8de6f6c6 KM |
249 | Try to automatically rebuild the alias database |
250 | if necessary. | |
b42074ab | 251 | .It Li e Ns Ar x |
8de6f6c6 | 252 | Set error processing to mode |
b42074ab | 253 | .Ar x . |
8de6f6c6 | 254 | Valid modes are |
b42074ab CL |
255 | .Ql m |
256 | to mail back the error message, | |
257 | .Ql w | |
258 | to ``write'' back the error message | |
8de6f6c6 | 259 | (or mail it back if the sender is not logged in), |
b42074ab CL |
260 | .Ql p |
261 | to print the errors on the terminal | |
8de6f6c6 | 262 | (default), |
b42074ab CL |
263 | .Ql q |
264 | to throw away error messages | |
8de6f6c6 | 265 | (only exit status is returned), |
b42074ab CL |
266 | and |
267 | .Ql e | |
8de6f6c6 KM |
268 | to do special processing for the BerkNet. |
269 | If the text of the message is not mailed back | |
270 | by | |
b42074ab CL |
271 | modes |
272 | .Ql m | |
273 | or | |
274 | .Ql w | |
8de6f6c6 KM |
275 | and if the sender is local to this machine, |
276 | a copy of the message is appended to the file | |
b42074ab | 277 | .Pa dead.letter |
5412ac7d | 278 | in the sender's home directory. |
b42074ab CL |
279 | .It Li f |
280 | Save | |
281 | .Tn UNIX Ns \-style | |
282 | From lines at the front of messages. | |
ebf4a41a KB |
283 | .It Li G |
284 | Match local mail names against the GECOS portion of the password file. | |
b42074ab | 285 | .It Li g Ar N |
8de6f6c6 | 286 | The default group id to use when calling mailers. |
b42074ab CL |
287 | .It Li H Ns Ar file |
288 | The | |
289 | .Tn SMTP | |
290 | help file. | |
0f59c44f EA |
291 | .It Li h Ar N |
292 | The maximum number of times a message is allowed to ``hop'' | |
293 | before we decide it is in a loop. | |
b42074ab | 294 | .It Li i |
8de6f6c6 KM |
295 | Do not take dots on a line by themselves |
296 | as a message terminator. | |
ebf4a41a KB |
297 | .It Li j |
298 | Send error messages in MIME format. | |
299 | .It Li K Ns Ar timeout | |
300 | Set connection cache timeout. | |
301 | .It Li k Ns Ar N | |
302 | Set connection cache size. | |
b42074ab | 303 | .It Li L Ns Ar n |
8de6f6c6 | 304 | The log level. |
ebf4a41a KB |
305 | .It Li l |
306 | Pay attention to the Errors-To: header. | |
b42074ab | 307 | .It Li m |
8de6f6c6 | 308 | Send to ``me'' (the sender) also if I am in an alias expansion. |
ebf4a41a KB |
309 | .It Li n |
310 | Validate the right hand side of aliases during a | |
311 | .Xr newaliases 1 | |
312 | command. | |
b42074ab | 313 | .It Li o |
8de6f6c6 KM |
314 | If set, this message may have |
315 | old style headers. | |
316 | If not set, | |
317 | this message is guaranteed to have new style headers | |
318 | (i.e., commas instead of spaces between addresses). | |
319 | If set, an adaptive algorithm is used that will correctly | |
320 | determine the header format in most cases. | |
b42074ab | 321 | .It Li Q Ns Ar queuedir |
8de6f6c6 | 322 | Select the directory in which to queue messages. |
b42074ab | 323 | .It Li S Ns Ar file |
8de6f6c6 | 324 | Save statistics in the named file. |
b42074ab | 325 | .It Li s |
8de6f6c6 KM |
326 | Always instantiate the queue file, |
327 | even under circumstances where it is not strictly necessary. | |
8e8bec7f | 328 | This provides safety against system crashes during delivery. |
b42074ab | 329 | .It Li T Ns Ar time |
8e8bec7f EA |
330 | Set the timeout on undelivered messages in the queue to the specified time. |
331 | After delivery has failed | |
332 | (e.g., because of a host being down) | |
333 | for this amount of time, | |
334 | failed messages will be returned to the sender. | |
8de6f6c6 | 335 | The default is three days. |
b42074ab | 336 | .It Li t Ns Ar stz , Ar dtz |
8de6f6c6 | 337 | Set the name of the time zone. |
8a12fae4 EA |
338 | .It Li U Ns Ar userdatabase |
339 | If set, a user database is consulted to get forwarding information. | |
340 | You can consider this an adjunct to the aliasing mechanism, | |
341 | except that the database is intended to be distributed; | |
342 | aliases are local to a particular host. | |
343 | This may not be available if your sendmail does not have the | |
a717bd8e CL |
344 | .Dv USERDB |
345 | option compiled in. | |
b42074ab | 346 | .It Li u Ns Ar N |
8de6f6c6 | 347 | Set the default user id for mailers. |
ebf4a41a KB |
348 | .It Li Y |
349 | Fork each job during queue runs. | |
350 | May be convenient on memory-poor machines. | |
351 | .It Li 7 | |
352 | Strip incoming messages to seven bits. | |
b42074ab CL |
353 | .El |
354 | .Pp | |
8e8bec7f EA |
355 | In aliases, |
356 | the first character of a name may be | |
357 | a vertical bar to cause interpretation of | |
358 | the rest of the name as a command | |
5412ac7d | 359 | to pipe the mail to. |
8e8bec7f | 360 | It may be necessary to quote the name |
5412ac7d | 361 | to keep |
b42074ab | 362 | .Nm sendmail |
5412ac7d | 363 | from suppressing the blanks from between arguments. |
8e8bec7f | 364 | For example, a common alias is: |
b42074ab CL |
365 | .Pp |
366 | .Bd -literal -offset indent -compact | |
367 | msgs: "|/usr/bin/msgs -s" | |
368 | .Ed | |
369 | .Pp | |
370 | Aliases may also have the syntax | |
371 | .Dq :include: Ns Ar filename | |
8e8bec7f | 372 | to ask |
b42074ab | 373 | .Xr sendmail |
8e8bec7f EA |
374 | to read the named file for a list of recipients. |
375 | For example, an alias such as: | |
b42074ab CL |
376 | .Pp |
377 | .Bd -literal -offset indent -compact | |
378 | poets: ":include:/usr/local/lib/poets.list" | |
379 | .Ed | |
380 | .Pp | |
8e8bec7f | 381 | would read |
b42074ab | 382 | .Pa /usr/local/lib/poets.list |
8e8bec7f | 383 | for the list of addresses making up the group. |
b42074ab CL |
384 | .Pp |
385 | .Nm Sendmail | |
5412ac7d KM |
386 | returns an exit status |
387 | describing what it did. | |
8de6f6c6 | 388 | The codes are defined in |
b42074ab CL |
389 | .Aq Pa sysexits.h : |
390 | .Bl -tag -width EX_UNAVAILABLE -compact -offset indent | |
391 | .It Dv EX_OK | |
392 | Successful completion on all addresses. | |
393 | .It Dv EX_NOUSER | |
394 | User name not recognized. | |
395 | .It Dv EX_UNAVAILABLE | |
396 | Catchall meaning necessary resources | |
5412ac7d | 397 | were not available. |
b42074ab CL |
398 | .It Dv EX_SYNTAX |
399 | Syntax error in address. | |
400 | .It Dv EX_SOFTWARE | |
401 | Internal software error, | |
5412ac7d | 402 | including bad arguments. |
b42074ab CL |
403 | .It Dv EX_OSERR |
404 | Temporary operating system error, | |
405 | such as | |
406 | .Dq cannot fork . | |
407 | .It Dv EX_NOHOST | |
408 | Host name not recognized. | |
409 | .It Dv EX_TEMPFAIL | |
410 | Message could not be sent immediately, | |
8de6f6c6 | 411 | but was queued. |
b42074ab CL |
412 | .El |
413 | .Pp | |
8de6f6c6 | 414 | If invoked as |
b42074ab CL |
415 | .Nm newaliases , |
416 | .Nm sendmail | |
8de6f6c6 KM |
417 | will rebuild the alias database. |
418 | If invoked as | |
b42074ab CL |
419 | .Nm mailq , |
420 | .Nm sendmail | |
8de6f6c6 | 421 | will print the contents of the mail queue. |
b42074ab CL |
422 | .Sh FILES |
423 | Except for the file | |
424 | .Pa /etc/sendmail.cf | |
425 | itself, | |
426 | the following pathnames are all specified in | |
427 | .Pa /etc/sendmail.cf. | |
8de6f6c6 KM |
428 | Thus, |
429 | these values are only approximations. | |
b42074ab CL |
430 | .Pp |
431 | .Bl -tag -width /usr/lib/sendmail.fc -compact | |
432 | .It Pa /etc/aliases | |
433 | raw data for alias names | |
ebf4a41a | 434 | .It Pa /etc/aliases.db |
b42074ab CL |
435 | data base of alias names |
436 | .It Pa /etc/sendmail.cf | |
437 | configuration file | |
b42074ab CL |
438 | .It Pa /etc/sendmail.hf |
439 | help file | |
440 | .It Pa /var/log/sendmail.st | |
441 | collected statistics | |
442 | .It Pa /var/spool/mqueue/* | |
443 | temp files | |
ebf4a41a KB |
444 | .It Pa /var/run/sendmail.pid |
445 | The process id of the daemon | |
b42074ab CL |
446 | .El |
447 | .Sh SEE ALSO | |
448 | .Xr binmail 1 , | |
449 | .Xr mail 1 , | |
450 | .Xr rmail 1 , | |
451 | .Xr syslog 3 , | |
452 | .Xr aliases 5 , | |
453 | .Xr mailaddr 7 , | |
454 | .Xr rc 8 ; | |
455 | .Pp | |
456 | DARPA | |
457 | Internet Request For Comments | |
458 | .%T RFC819 , | |
459 | .%T RFC821 , | |
460 | .%T RFC822 . | |
461 | .Rs | |
e3f16e5f | 462 | .%T "Sendmail \- An Internetwork Mail Router" |
b42074ab CL |
463 | .%V SMM |
464 | .%N \&No. 9 | |
465 | .Re | |
466 | .Rs | |
e3f16e5f | 467 | .%T "Sendmail Installation and Operation Guide" |
b42074ab CL |
468 | .%V SMM |
469 | .%N \&No. 8 | |
470 | .Re | |
471 | .Sh HISTORY | |
472 | The | |
473 | .Nm | |
474 | command appeared in | |
475 | .Bx 4.2 . |