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 | .\" | |
6f14531a | 32 | .\" @(#)sendmail.8 8.1 (Berkeley) 6/16/93 |
15637ed4 | 33 | .\" |
6f14531a | 34 | .Dd June 16, 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. | |
135 | .It Fl bz | |
136 | Create the configuration freeze file. | |
137 | .It Fl C Ns Ar file | |
138 | Use alternate configuration file. | |
139 | .Nm Sendmail | |
140 | refuses to run as root if an alternate configuration file is specified. | |
141 | The frozen configuration file is bypassed. | |
142 | .It Fl d Ns Ar X | |
143 | Set debugging value to | |
144 | .Ar X . | |
145 | .It Fl F Ns Ar fullname | |
146 | Set the full name of the sender. | |
147 | .It Fl f Ns Ar name | |
148 | Sets the name of the ``from'' person | |
149 | (i.e., the sender of the mail). | |
150 | .Fl f | |
151 | can only be used | |
152 | by ``trusted'' users | |
153 | (normally | |
154 | .Em root , | |
155 | .Em daemon , | |
156 | and | |
157 | .Em network ) | |
158 | or if the person you are trying to become | |
159 | is the same as the person you are. | |
160 | .It Fl h Ns Ar N | |
161 | Set the hop count to | |
162 | .Ar N . | |
163 | The hop count is incremented every time the mail is | |
164 | processed. | |
165 | When it reaches a limit, | |
166 | the mail is returned with an error message, | |
167 | the victim of an aliasing loop. | |
168 | If not specified, | |
169 | ``Received:'' lines in the message are counted. | |
170 | .It Fl n | |
171 | Don't do aliasing. | |
172 | .It Fl o Ns Ar x Em value | |
173 | Set option | |
174 | .Ar x | |
175 | to the specified | |
176 | .Em value . | |
177 | Options are described below. | |
6f14531a RG |
178 | .It Fl p Ns Ar protocol |
179 | Set the name of the protocol used to receive the message. | |
180 | This can be a simple protocol name such as ``UUCP'' | |
181 | or a protocol and hostname, such as ``UUCP:ucbvax''. | |
15637ed4 RG |
182 | .It Fl q Ns Bq Ar time |
183 | Processed saved messages in the queue at given intervals. | |
184 | If | |
185 | .Ar time | |
186 | is omitted, | |
187 | process the queue once. | |
188 | .Xr Time | |
189 | is given as a tagged number, | |
190 | with | |
191 | .Ql s | |
192 | being seconds, | |
193 | .Ql m | |
194 | being minutes, | |
195 | .Ql h | |
196 | being hours, | |
197 | .Ql d | |
198 | being days, | |
199 | and | |
200 | .Ql w | |
201 | being weeks. | |
202 | For example, | |
203 | .Ql \-q1h30m | |
204 | or | |
205 | .Ql \-q90m | |
206 | would both set the timeout to one hour thirty minutes. | |
207 | If | |
208 | .Ar time | |
209 | is specified, | |
210 | .Nm sendmail | |
211 | will run in background. | |
212 | This option can be used safely with | |
213 | .Fl bd . | |
214 | .It Fl r Ns Ar name | |
215 | An alternate and obsolete form of the | |
216 | .Fl f | |
217 | flag. | |
218 | .It Fl t | |
219 | Read message for recipients. | |
220 | To:, Cc:, and Bcc: lines will be scanned for recipient addresses. | |
221 | The Bcc: line will be deleted before transmission. | |
222 | Any addresses in the argument list will be suppressed, | |
223 | that is, | |
224 | they will | |
225 | .Em not | |
226 | receive copies even if listed in the message header. | |
227 | .It Fl v | |
228 | Go into verbose mode. | |
229 | Alias expansions will be announced, etc. | |
230 | .El | |
6f14531a | 231 | .Ss Options |
15637ed4 RG |
232 | There are also a number of processing options that may be set. |
233 | Normally these will only be used by a system administrator. | |
234 | Options may be set either on the command line | |
235 | using the | |
236 | .Fl o | |
237 | flag | |
238 | or in the configuration file. | |
6f14531a RG |
239 | This is a partial list; |
240 | for a complete list (and details), consult the | |
15637ed4 RG |
241 | .%T "Sendmail Installation and Operation Guide" . |
242 | The options are: | |
243 | .Bl -tag -width Fl | |
244 | .It Li A Ns Ar file | |
245 | Use alternate alias file. | |
6f14531a RG |
246 | .It Li b Ns Ar nblocks |
247 | The minimum number of free blocks needed on the spool filesystem. | |
15637ed4 RG |
248 | .It Li c |
249 | On mailers that are considered ``expensive'' to connect to, | |
250 | don't initiate immediate connection. | |
251 | This requires queueing. | |
6f14531a RG |
252 | .It Li C Ar N |
253 | Checkpoint the queue file after every | |
254 | .Ar N | |
255 | successful deliveries (default 10). | |
256 | This avoids excessive duplicate deliveries | |
257 | when sending to long mailing lists | |
258 | interrupted by system crashes. | |
15637ed4 RG |
259 | .It Li d Ns Ar x |
260 | Set the delivery mode to | |
261 | .Ar x . | |
262 | Delivery modes are | |
263 | .Ql i | |
264 | for interactive (synchronous) delivery, | |
265 | .Ql b | |
266 | for background (asynchronous) delivery, | |
267 | and | |
268 | .Ql q | |
269 | for queue only \- i.e., | |
270 | actual delivery is done the next time the queue is run. | |
271 | .It Li D | |
272 | Try to automatically rebuild the alias database | |
273 | if necessary. | |
274 | .It Li e Ns Ar x | |
275 | Set error processing to mode | |
276 | .Ar x . | |
277 | Valid modes are | |
278 | .Ql m | |
279 | to mail back the error message, | |
280 | .Ql w | |
281 | to ``write'' back the error message | |
282 | (or mail it back if the sender is not logged in), | |
283 | .Ql p | |
284 | to print the errors on the terminal | |
285 | (default), | |
286 | .Ql q | |
287 | to throw away error messages | |
288 | (only exit status is returned), | |
289 | and | |
290 | .Ql e | |
291 | to do special processing for the BerkNet. | |
292 | If the text of the message is not mailed back | |
293 | by | |
294 | modes | |
295 | .Ql m | |
296 | or | |
297 | .Ql w | |
298 | and if the sender is local to this machine, | |
299 | a copy of the message is appended to the file | |
300 | .Pa dead.letter | |
301 | in the sender's home directory. | |
15637ed4 RG |
302 | .It Li f |
303 | Save | |
304 | .Tn UNIX Ns \-style | |
305 | From lines at the front of messages. | |
6f14531a RG |
306 | .It Li G |
307 | Match local mail names against the GECOS portion of the password file. | |
15637ed4 RG |
308 | .It Li g Ar N |
309 | The default group id to use when calling mailers. | |
310 | .It Li H Ns Ar file | |
311 | The | |
312 | .Tn SMTP | |
313 | help file. | |
6f14531a RG |
314 | .It Li h Ar N |
315 | The maximum number of times a message is allowed to ``hop'' | |
316 | before we decide it is in a loop. | |
15637ed4 RG |
317 | .It Li i |
318 | Do not take dots on a line by themselves | |
319 | as a message terminator. | |
6f14531a RG |
320 | .It Li j |
321 | Send error messages in MIME format. | |
322 | .It Li K Ns Ar timeout | |
323 | Set connection cache timeout. | |
324 | .It Li k Ns Ar N | |
325 | Set connection cache size. | |
15637ed4 RG |
326 | .It Li L Ns Ar n |
327 | The log level. | |
6f14531a RG |
328 | .It Li l |
329 | Pay attention to the Errors-To: header. | |
15637ed4 RG |
330 | .It Li m |
331 | Send to ``me'' (the sender) also if I am in an alias expansion. | |
6f14531a RG |
332 | .It Li n |
333 | Validate the right hand side of aliases during a | |
334 | .Xr newaliases 1 | |
335 | command. | |
15637ed4 RG |
336 | .It Li o |
337 | If set, this message may have | |
338 | old style headers. | |
339 | If not set, | |
340 | this message is guaranteed to have new style headers | |
341 | (i.e., commas instead of spaces between addresses). | |
342 | If set, an adaptive algorithm is used that will correctly | |
343 | determine the header format in most cases. | |
344 | .It Li Q Ns Ar queuedir | |
345 | Select the directory in which to queue messages. | |
15637ed4 RG |
346 | .It Li S Ns Ar file |
347 | Save statistics in the named file. | |
348 | .It Li s | |
349 | Always instantiate the queue file, | |
350 | even under circumstances where it is not strictly necessary. | |
351 | This provides safety against system crashes during delivery. | |
352 | .It Li T Ns Ar time | |
353 | Set the timeout on undelivered messages in the queue to the specified time. | |
354 | After delivery has failed | |
355 | (e.g., because of a host being down) | |
356 | for this amount of time, | |
357 | failed messages will be returned to the sender. | |
358 | The default is three days. | |
359 | .It Li t Ns Ar stz , Ar dtz | |
360 | Set the name of the time zone. | |
361 | .It Li U Ns Ar userdatabase | |
362 | If set, a user database is consulted to get forwarding information. | |
363 | You can consider this an adjunct to the aliasing mechanism, | |
364 | except that the database is intended to be distributed; | |
365 | aliases are local to a particular host. | |
366 | This may not be available if your sendmail does not have the | |
367 | .Dv USERDB | |
368 | option compiled in. | |
369 | .It Li u Ns Ar N | |
370 | Set the default user id for mailers. | |
6f14531a RG |
371 | .It Li Y |
372 | Fork each job during queue runs. | |
373 | May be convenient on memory-poor machines. | |
374 | .It Li 7 | |
375 | Strip incoming messages to seven bits. | |
15637ed4 RG |
376 | .El |
377 | .Pp | |
378 | In aliases, | |
379 | the first character of a name may be | |
380 | a vertical bar to cause interpretation of | |
381 | the rest of the name as a command | |
382 | to pipe the mail to. | |
383 | It may be necessary to quote the name | |
384 | to keep | |
385 | .Nm sendmail | |
386 | from suppressing the blanks from between arguments. | |
387 | For example, a common alias is: | |
388 | .Pp | |
389 | .Bd -literal -offset indent -compact | |
390 | msgs: "|/usr/bin/msgs -s" | |
391 | .Ed | |
392 | .Pp | |
393 | Aliases may also have the syntax | |
394 | .Dq :include: Ns Ar filename | |
395 | to ask | |
396 | .Xr sendmail | |
397 | to read the named file for a list of recipients. | |
398 | For example, an alias such as: | |
399 | .Pp | |
400 | .Bd -literal -offset indent -compact | |
401 | poets: ":include:/usr/local/lib/poets.list" | |
402 | .Ed | |
403 | .Pp | |
404 | would read | |
405 | .Pa /usr/local/lib/poets.list | |
406 | for the list of addresses making up the group. | |
407 | .Pp | |
408 | .Nm Sendmail | |
409 | returns an exit status | |
410 | describing what it did. | |
411 | The codes are defined in | |
412 | .Aq Pa sysexits.h : | |
413 | .Bl -tag -width EX_UNAVAILABLE -compact -offset indent | |
414 | .It Dv EX_OK | |
415 | Successful completion on all addresses. | |
416 | .It Dv EX_NOUSER | |
417 | User name not recognized. | |
418 | .It Dv EX_UNAVAILABLE | |
419 | Catchall meaning necessary resources | |
420 | were not available. | |
421 | .It Dv EX_SYNTAX | |
422 | Syntax error in address. | |
423 | .It Dv EX_SOFTWARE | |
424 | Internal software error, | |
425 | including bad arguments. | |
426 | .It Dv EX_OSERR | |
427 | Temporary operating system error, | |
428 | such as | |
429 | .Dq cannot fork . | |
430 | .It Dv EX_NOHOST | |
431 | Host name not recognized. | |
432 | .It Dv EX_TEMPFAIL | |
433 | Message could not be sent immediately, | |
434 | but was queued. | |
435 | .El | |
436 | .Pp | |
437 | If invoked as | |
438 | .Nm newaliases , | |
439 | .Nm sendmail | |
440 | will rebuild the alias database. | |
441 | If invoked as | |
442 | .Nm mailq , | |
443 | .Nm sendmail | |
444 | will print the contents of the mail queue. | |
445 | .Sh FILES | |
446 | Except for the file | |
447 | .Pa /etc/sendmail.cf | |
448 | itself, | |
449 | the following pathnames are all specified in | |
450 | .Pa /etc/sendmail.cf. | |
451 | Thus, | |
452 | these values are only approximations. | |
453 | .Pp | |
454 | .Bl -tag -width /usr/lib/sendmail.fc -compact | |
455 | .It Pa /etc/aliases | |
456 | raw data for alias names | |
6f14531a | 457 | .It Pa /etc/aliases.db |
15637ed4 RG |
458 | data base of alias names |
459 | .It Pa /etc/sendmail.cf | |
460 | configuration file | |
461 | .It Pa /etc/sendmail.fc | |
462 | frozen configuration | |
463 | .It Pa /etc/sendmail.hf | |
464 | help file | |
465 | .It Pa /var/log/sendmail.st | |
466 | collected statistics | |
467 | .It Pa /var/spool/mqueue/* | |
468 | temp files | |
6f14531a RG |
469 | .It Pa /var/run/sendmail.pid |
470 | The process id of the daemon | |
15637ed4 RG |
471 | .El |
472 | .Sh SEE ALSO | |
473 | .Xr binmail 1 , | |
474 | .Xr mail 1 , | |
475 | .Xr rmail 1 , | |
476 | .Xr syslog 3 , | |
477 | .Xr aliases 5 , | |
478 | .Xr mailaddr 7 , | |
479 | .Xr rc 8 ; | |
480 | .Pp | |
481 | DARPA | |
482 | Internet Request For Comments | |
483 | .%T RFC819 , | |
484 | .%T RFC821 , | |
485 | .%T RFC822 . | |
486 | .Rs | |
487 | .%T "Sendmail \- An Internetwork Mail Router" | |
488 | .%V SMM | |
489 | .%N \&No. 16 | |
490 | .Re | |
491 | .Rs | |
492 | .%T "Sendmail Installation and Operation Guide" | |
493 | .%V SMM | |
494 | .%N \&No. 7 | |
495 | .Re | |
496 | .Sh HISTORY | |
497 | The | |
498 | .Nm | |
499 | command appeared in | |
500 | .Bx 4.2 . |