Commit | Line | Data |
---|---|---|
b42074ab | 1 | .\" Copyright (c) 1988, 1991 The Regents of the University of California. |
08e47b66 | 2 | .\" All rights reserved. |
5412ac7d | 3 | .\" |
a280d268 | 4 | .\" %sccs.include.redist.man% |
08e47b66 | 5 | .\" |
b42074ab | 6 | .\" @(#)sendmail.8 6.5 (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'. | |
b42074ab | 57 | .Pp |
8de6f6c6 | 58 | Flags are: |
b42074ab CL |
59 | .Bl -tag -width Fl |
60 | .It Fl ba | |
61 | Go into | |
62 | .Tn ARPANET | |
63 | mode. | |
8de6f6c6 KM |
64 | All input lines must end with a CR-LF, |
65 | and all messages will be generated with a CR-LF at the end. | |
66 | Also, | |
67 | the ``From:'' and ``Sender:'' | |
68 | fields are examined for the name of the sender. | |
b42074ab CL |
69 | .It Fl bd |
70 | Run as a daemon. This requires Berkeley | |
71 | .Tn IPC . | |
72 | .Nm Sendmail | |
8e8bec7f | 73 | will fork and run in background |
b42074ab CL |
74 | listening on socket 25 for incoming |
75 | .Tn SMTP | |
76 | connections. | |
8e8bec7f | 77 | This is normally run from |
b42074ab CL |
78 | .Pa /etc/rc . |
79 | .It Fl bi | |
8de6f6c6 | 80 | Initialize the alias database. |
b42074ab | 81 | .It Fl bm |
8de6f6c6 | 82 | Deliver mail in the usual way (default). |
b42074ab | 83 | .It Fl bp |
8de6f6c6 | 84 | Print a listing of the queue. |
b42074ab CL |
85 | .It Fl bs |
86 | Use the | |
87 | .Tn SMTP | |
88 | protocol as described in | |
89 | .Tn RFC821 | |
8e8bec7f | 90 | on standard input and output. |
8de6f6c6 | 91 | This flag implies all the operations of the |
b42074ab CL |
92 | .Fl ba |
93 | flag that are compatible with | |
94 | .Tn SMTP . | |
95 | .It Fl bt | |
8de6f6c6 KM |
96 | Run in address test mode. |
97 | This mode reads addresses and shows the steps in parsing; | |
98 | it is used for debugging configuration tables. | |
b42074ab | 99 | .It Fl bv |
8de6f6c6 KM |
100 | Verify names only \- do not try to collect or deliver a message. |
101 | Verify mode is normally used for validating | |
102 | users or mailing lists. | |
b42074ab | 103 | .It Fl bz |
8de6f6c6 | 104 | Create the configuration freeze file. |
b42074ab | 105 | .It Fl C Ns Ar file |
8de6f6c6 | 106 | Use alternate configuration file. |
b42074ab | 107 | .Nm Sendmail |
8e8bec7f EA |
108 | refuses to run as root if an alternate configuration file is specified. |
109 | The frozen configuration file is bypassed. | |
b42074ab | 110 | .It Fl d Ns Ar X |
8de6f6c6 | 111 | Set debugging value to |
b42074ab CL |
112 | .Ar X . |
113 | .It Fl F Ns Ar fullname | |
8de6f6c6 | 114 | Set the full name of the sender. |
b42074ab | 115 | .It Fl f Ns Ar name |
8de6f6c6 KM |
116 | Sets the name of the ``from'' person |
117 | (i.e., the sender of the mail). | |
b42074ab | 118 | .Fl f |
8de6f6c6 | 119 | can only be used |
8e8bec7f EA |
120 | by ``trusted'' users |
121 | (normally | |
b42074ab CL |
122 | .Em root , |
123 | .Em daemon , | |
5412ac7d | 124 | and |
b42074ab | 125 | .Em network ) |
5412ac7d KM |
126 | or if the person you are trying to become |
127 | is the same as the person you are. | |
b42074ab | 128 | .It Fl h Ns Ar N |
8de6f6c6 | 129 | Set the hop count to |
b42074ab | 130 | .Ar N . |
8de6f6c6 KM |
131 | The hop count is incremented every time the mail is |
132 | processed. | |
133 | When it reaches a limit, | |
134 | the mail is returned with an error message, | |
135 | the victim of an aliasing loop. | |
8e8bec7f EA |
136 | If not specified, |
137 | ``Received:'' lines in the message are counted. | |
b42074ab | 138 | .It Fl n |
8de6f6c6 | 139 | Don't do aliasing. |
b42074ab | 140 | .It Fl o Ns Ar x Em value |
8de6f6c6 | 141 | Set option |
b42074ab | 142 | .Ar x |
8de6f6c6 | 143 | to the specified |
b42074ab | 144 | .Em value . |
8de6f6c6 | 145 | Options are described below. |
b42074ab | 146 | .It Fl q Ns Bq Ar time |
8de6f6c6 KM |
147 | Processed saved messages in the queue at given intervals. |
148 | If | |
b42074ab | 149 | .Ar time |
8de6f6c6 KM |
150 | is omitted, |
151 | process the queue once. | |
b42074ab | 152 | .Xr Time |
8de6f6c6 | 153 | is given as a tagged number, |
b42074ab CL |
154 | with |
155 | .Ql s | |
156 | being seconds, | |
157 | .Ql m | |
158 | being minutes, | |
159 | .Ql h | |
160 | being hours, | |
161 | .Ql d | |
162 | being days, | |
8de6f6c6 | 163 | and |
b42074ab CL |
164 | .Ql w |
165 | being weeks. | |
8de6f6c6 | 166 | For example, |
b42074ab CL |
167 | .Ql \-q1h30m |
168 | or | |
169 | .Ql \-q90m | |
8de6f6c6 | 170 | would both set the timeout to one hour thirty minutes. |
8e8bec7f | 171 | If |
b42074ab | 172 | .Ar time |
8e8bec7f | 173 | is specified, |
b42074ab | 174 | .Nm sendmail |
8e8bec7f EA |
175 | will run in background. |
176 | This option can be used safely with | |
b42074ab CL |
177 | .Fl bd . |
178 | .It Fl r Ns Ar name | |
8de6f6c6 | 179 | An alternate and obsolete form of the |
b42074ab | 180 | .Fl f |
8de6f6c6 | 181 | flag. |
b42074ab | 182 | .It Fl t |
8de6f6c6 | 183 | Read message for recipients. |
8e8bec7f | 184 | To:, Cc:, and Bcc: lines will be scanned for recipient addresses. |
8de6f6c6 | 185 | The Bcc: line will be deleted before transmission. |
8e8bec7f EA |
186 | Any addresses in the argument list will be suppressed, |
187 | that is, | |
188 | they will | |
b42074ab | 189 | .Em not |
8e8bec7f | 190 | receive copies even if listed in the message header. |
b42074ab | 191 | .It Fl v |
8de6f6c6 KM |
192 | Go into verbose mode. |
193 | Alias expansions will be announced, etc. | |
b42074ab CL |
194 | .El |
195 | .Pp | |
8de6f6c6 KM |
196 | There are also a number of processing options that may be set. |
197 | Normally these will only be used by a system administrator. | |
198 | Options may be set either on the command line | |
199 | using the | |
b42074ab | 200 | .Fl o |
8de6f6c6 KM |
201 | flag |
202 | or in the configuration file. | |
203 | These are described in detail in the | |
b42074ab | 204 | .%T Sendmail Installation and Operation Guide. |
8de6f6c6 | 205 | The options are: |
b42074ab CL |
206 | .Bl -tag -width Fl |
207 | .It Li A Ns Ar file | |
8de6f6c6 | 208 | Use alternate alias file. |
b42074ab | 209 | .It Li c |
8de6f6c6 KM |
210 | On mailers that are considered ``expensive'' to connect to, |
211 | don't initiate immediate connection. | |
212 | This requires queueing. | |
b42074ab | 213 | .It Li d Ns Ar x |
8de6f6c6 | 214 | Set the delivery mode to |
b42074ab | 215 | .Ar x . |
8de6f6c6 | 216 | Delivery modes are |
b42074ab CL |
217 | .Ql i |
218 | for interactive (synchronous) delivery, | |
219 | .Ql b | |
220 | for background (asynchronous) delivery, | |
8de6f6c6 | 221 | and |
b42074ab CL |
222 | .Ql q |
223 | for queue only \- i.e., | |
8de6f6c6 | 224 | actual delivery is done the next time the queue is run. |
b42074ab | 225 | .It Li D |
8de6f6c6 KM |
226 | Try to automatically rebuild the alias database |
227 | if necessary. | |
b42074ab | 228 | .It Li e Ns Ar x |
8de6f6c6 | 229 | Set error processing to mode |
b42074ab | 230 | .Ar x . |
8de6f6c6 | 231 | Valid modes are |
b42074ab CL |
232 | .Ql m |
233 | to mail back the error message, | |
234 | .Ql w | |
235 | to ``write'' back the error message | |
8de6f6c6 | 236 | (or mail it back if the sender is not logged in), |
b42074ab CL |
237 | .Ql p |
238 | to print the errors on the terminal | |
8de6f6c6 | 239 | (default), |
b42074ab CL |
240 | .Ql q |
241 | to throw away error messages | |
8de6f6c6 | 242 | (only exit status is returned), |
b42074ab CL |
243 | and |
244 | .Ql e | |
8de6f6c6 KM |
245 | to do special processing for the BerkNet. |
246 | If the text of the message is not mailed back | |
247 | by | |
b42074ab CL |
248 | modes |
249 | .Ql m | |
250 | or | |
251 | .Ql w | |
8de6f6c6 KM |
252 | and if the sender is local to this machine, |
253 | a copy of the message is appended to the file | |
b42074ab | 254 | .Pa dead.letter |
5412ac7d | 255 | in the sender's home directory. |
b42074ab | 256 | .It Li F Ns Ar mode |
8de6f6c6 | 257 | The mode to use when creating temporary files. |
b42074ab CL |
258 | .It Li f |
259 | Save | |
260 | .Tn UNIX Ns \-style | |
261 | From lines at the front of messages. | |
262 | .It Li g Ar N | |
8de6f6c6 | 263 | The default group id to use when calling mailers. |
b42074ab CL |
264 | .It Li H Ns Ar file |
265 | The | |
266 | .Tn SMTP | |
267 | help file. | |
268 | .It Li i | |
8de6f6c6 KM |
269 | Do not take dots on a line by themselves |
270 | as a message terminator. | |
b42074ab | 271 | .It Li L Ns Ar n |
8de6f6c6 | 272 | The log level. |
b42074ab | 273 | .It Li m |
8de6f6c6 | 274 | Send to ``me'' (the sender) also if I am in an alias expansion. |
b42074ab | 275 | .It Li o |
8de6f6c6 KM |
276 | If set, this message may have |
277 | old style headers. | |
278 | If not set, | |
279 | this message is guaranteed to have new style headers | |
280 | (i.e., commas instead of spaces between addresses). | |
281 | If set, an adaptive algorithm is used that will correctly | |
282 | determine the header format in most cases. | |
b42074ab | 283 | .It Li Q Ns Ar queuedir |
8de6f6c6 | 284 | Select the directory in which to queue messages. |
b42074ab | 285 | .It Li r Ns Ar timeout |
8de6f6c6 KM |
286 | The timeout on reads; |
287 | if none is set, | |
b42074ab | 288 | .Nm sendmail |
8de6f6c6 | 289 | will wait forever for a mailer. |
b42074ab CL |
290 | This option violates the word (if not the intent) of the |
291 | .Tn SMTP | |
292 | specification, | |
8e8bec7f | 293 | show the timeout should probably be fairly large. |
b42074ab | 294 | .It Li S Ns Ar file |
8de6f6c6 | 295 | Save statistics in the named file. |
b42074ab | 296 | .It Li s |
8de6f6c6 KM |
297 | Always instantiate the queue file, |
298 | even under circumstances where it is not strictly necessary. | |
8e8bec7f | 299 | This provides safety against system crashes during delivery. |
b42074ab | 300 | .It Li T Ns Ar time |
8e8bec7f EA |
301 | Set the timeout on undelivered messages in the queue to the specified time. |
302 | After delivery has failed | |
303 | (e.g., because of a host being down) | |
304 | for this amount of time, | |
305 | failed messages will be returned to the sender. | |
8de6f6c6 | 306 | The default is three days. |
b42074ab | 307 | .It Li t Ns Ar stz , Ar dtz |
8de6f6c6 | 308 | Set the name of the time zone. |
b42074ab | 309 | .It Li u Ns Ar N |
8de6f6c6 | 310 | Set the default user id for mailers. |
b42074ab CL |
311 | .El |
312 | .Pp | |
8e8bec7f EA |
313 | In aliases, |
314 | the first character of a name may be | |
315 | a vertical bar to cause interpretation of | |
316 | the rest of the name as a command | |
5412ac7d | 317 | to pipe the mail to. |
8e8bec7f | 318 | It may be necessary to quote the name |
5412ac7d | 319 | to keep |
b42074ab | 320 | .Nm sendmail |
5412ac7d | 321 | from suppressing the blanks from between arguments. |
8e8bec7f | 322 | For example, a common alias is: |
b42074ab CL |
323 | .Pp |
324 | .Bd -literal -offset indent -compact | |
325 | msgs: "|/usr/bin/msgs -s" | |
326 | .Ed | |
327 | .Pp | |
328 | Aliases may also have the syntax | |
329 | .Dq :include: Ns Ar filename | |
8e8bec7f | 330 | to ask |
b42074ab | 331 | .Xr sendmail |
8e8bec7f EA |
332 | to read the named file for a list of recipients. |
333 | For example, an alias such as: | |
b42074ab CL |
334 | .Pp |
335 | .Bd -literal -offset indent -compact | |
336 | poets: ":include:/usr/local/lib/poets.list" | |
337 | .Ed | |
338 | .Pp | |
8e8bec7f | 339 | would read |
b42074ab | 340 | .Pa /usr/local/lib/poets.list |
8e8bec7f | 341 | for the list of addresses making up the group. |
b42074ab CL |
342 | .Pp |
343 | .Nm Sendmail | |
5412ac7d KM |
344 | returns an exit status |
345 | describing what it did. | |
8de6f6c6 | 346 | The codes are defined in |
b42074ab CL |
347 | .Aq Pa sysexits.h : |
348 | .Bl -tag -width EX_UNAVAILABLE -compact -offset indent | |
349 | .It Dv EX_OK | |
350 | Successful completion on all addresses. | |
351 | .It Dv EX_NOUSER | |
352 | User name not recognized. | |
353 | .It Dv EX_UNAVAILABLE | |
354 | Catchall meaning necessary resources | |
5412ac7d | 355 | were not available. |
b42074ab CL |
356 | .It Dv EX_SYNTAX |
357 | Syntax error in address. | |
358 | .It Dv EX_SOFTWARE | |
359 | Internal software error, | |
5412ac7d | 360 | including bad arguments. |
b42074ab CL |
361 | .It Dv EX_OSERR |
362 | Temporary operating system error, | |
363 | such as | |
364 | .Dq cannot fork . | |
365 | .It Dv EX_NOHOST | |
366 | Host name not recognized. | |
367 | .It Dv EX_TEMPFAIL | |
368 | Message could not be sent immediately, | |
8de6f6c6 | 369 | but was queued. |
b42074ab CL |
370 | .El |
371 | .Pp | |
8de6f6c6 | 372 | If invoked as |
b42074ab CL |
373 | .Nm newaliases , |
374 | .Nm sendmail | |
8de6f6c6 KM |
375 | will rebuild the alias database. |
376 | If invoked as | |
b42074ab CL |
377 | .Nm mailq , |
378 | .Nm sendmail | |
8de6f6c6 | 379 | will print the contents of the mail queue. |
b42074ab CL |
380 | .Sh FILES |
381 | Except for the file | |
382 | .Pa /etc/sendmail.cf | |
383 | itself, | |
384 | the following pathnames are all specified in | |
385 | .Pa /etc/sendmail.cf. | |
8de6f6c6 KM |
386 | Thus, |
387 | these values are only approximations. | |
b42074ab CL |
388 | .Pp |
389 | .Bl -tag -width /usr/lib/sendmail.fc -compact | |
390 | .It Pa /etc/aliases | |
391 | raw data for alias names | |
392 | .It Pa /etc/aliases.pag | |
393 | .It Pa /etc/aliases.dir | |
394 | data base of alias names | |
395 | .It Pa /etc/sendmail.cf | |
396 | configuration file | |
397 | .It Pa /etc/sendmail.fc | |
398 | frozen configuration | |
399 | .It Pa /etc/sendmail.hf | |
400 | help file | |
401 | .It Pa /var/log/sendmail.st | |
402 | collected statistics | |
403 | .It Pa /var/spool/mqueue/* | |
404 | temp files | |
405 | .El | |
406 | .Sh SEE ALSO | |
407 | .Xr binmail 1 , | |
408 | .Xr mail 1 , | |
409 | .Xr rmail 1 , | |
410 | .Xr syslog 3 , | |
411 | .Xr aliases 5 , | |
412 | .Xr mailaddr 7 , | |
413 | .Xr rc 8 ; | |
414 | .Pp | |
415 | DARPA | |
416 | Internet Request For Comments | |
417 | .%T RFC819 , | |
418 | .%T RFC821 , | |
419 | .%T RFC822 . | |
420 | .Rs | |
421 | .%T Sendmail \- An Internetwork Mail Router | |
422 | .%V SMM | |
423 | .%N \&No. 9 | |
424 | .Re | |
425 | .Rs | |
426 | .%T Sendmail Installation and Operation Guide | |
427 | .%V SMM | |
428 | .%N \&No. 8 | |
429 | .Re | |
430 | .Sh HISTORY | |
431 | The | |
432 | .Nm | |
433 | command appeared in | |
434 | .Bx 4.2 . |