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