Merge from vendor branch LIBSTDC++:
[dragonfly.git] / contrib / sendmail / src / sendmail.8
1 .\" Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
2 .\"      All rights reserved.
3 .\" Copyright (c) 1983, 1997 Eric P. Allman.  All rights reserved.
4 .\" Copyright (c) 1988, 1991, 1993
5 .\"     The Regents of the University of California.  All rights reserved.
6 .\"
7 .\" By using this file, you agree to the terms and conditions set
8 .\" forth in the LICENSE file which can be found at the top level of
9 .\" the sendmail distribution.
10 .\"
11 .\"
12 .\"     $Id: sendmail.8,v 8.51.2.1 2003/05/20 16:38:15 gshapiro Exp $
13 .\"
14 .TH SENDMAIL 8 "$Date: 2003/05/20 16:38:15 $"
15 .SH NAME
16 sendmail
17 \- an electronic mail transport agent
18 .SH SYNOPSIS
19 .B sendmail
20 .RI [ flags "] [" "address ..." ]
21 .br
22 .B newaliases
23 .br
24 .B mailq
25 .RB [ \-v ]
26 .br
27 .B hoststat
28 .br
29 .B purgestat
30 .br
31 .B smtpd
32 .SH DESCRIPTION
33 .B Sendmail
34 sends a message to one or more
35 .I recipients,
36 routing the message over whatever networks 
37 are necessary.
38 .B Sendmail
39 does internetwork forwarding as necessary 
40 to deliver the message to the correct place.
41 .PP
42 .B Sendmail
43 is not intended as a user interface routine; 
44 other programs provide user-friendly 
45 front ends;
46 .B sendmail
47 is used only to deliver pre-formatted messages.
48 .PP
49 With no flags,
50 .B sendmail
51 reads its standard input 
52 up to an end-of-file 
53 or a line consisting only of a single dot 
54 and sends a copy of the message found there
55 to all of the addresses listed.  
56 It determines the network(s) to use 
57 based on the syntax and contents of the addresses.
58 .PP
59 Local addresses are looked up in a file 
60 and aliased appropriately.
61 Aliasing can be prevented by preceding the address 
62 with a backslash.
63 Beginning with 8.10, the sender is included in any alias 
64 expansions, e.g., 
65 if `john' sends to `group', 
66 and `group' includes `john' in the expansion, 
67 then the letter will also be delivered to `john'.
68 .SS Parameters
69 .TP
70 .B \-Ac
71 Use submit.cf even if the operation mode does not indicate
72 an initial mail submission.
73 .TP
74 .B \-Am
75 Use sendmail.cf even if the operation mode indicates
76 an initial mail submission.
77 .TP
78 .BI \-B type
79 Set the body type to
80 .IR type .
81 Current legal values are 
82 7BIT 
83 or  
84 8BITMIME.
85 .TP
86 .B \-ba
87 Go into 
88 ARPANET 
89 mode.  All input lines must end with a CR-LF, 
90 and all messages will be generated with a CR-LF at the end.  
91 Also, 
92 the ``From:'' and ``Sender:'' 
93 fields are examined for the name of the sender.
94 .TP
95 .B \-bd
96 Run as a daemon.
97 .B Sendmail
98 will fork and run in background 
99 listening on socket 25 for incoming
100 SMTP 
101 connections.  
102 This is normally run from 
103 /etc/rc.
104 .TP
105 .B \-bD
106 Same as
107 .B \-bd
108 except runs in foreground.
109 .TP
110 .B \-bh
111 Print the persistent host status database.
112 .TP
113 .B \-bH
114 Purge expired entries from the persistent host status database.
115 .TP
116 .B \-bi
117 Initialize the alias database.
118 .TP
119 .B \-bm
120 Deliver mail in the usual way (default).
121 .TP
122 .B \-bp
123 Print a listing of the queue(s).
124 .TP
125 .B \-bP
126 Print number of entries in the queue(s);
127 only available with shared memory support.
128 .TP
129 .B \-bs
130 Use the 
131 SMTP 
132 protocol as described in 
133 RFC821 
134 on standard input and output.  
135 This flag implies all the operations of the
136 .B \-ba
137 flag that are compatible with 
138 SMTP.
139 .TP
140 .B \-bt
141 Run in address test mode.  
142 This mode reads addresses and shows the steps in parsing; 
143 it is used for debugging configuration tables.
144 .TP
145 .B \-bv
146 Verify names only \- do not try to collect or deliver a message.
147 Verify mode is normally used for validating 
148 users or mailing lists.
149 .TP
150 .BI \-C file
151 Use alternate configuration file.
152 .B Sendmail
153 refuses to run as root if an alternate configuration file is specified.
154 .TP
155 .BI \-d X
156 Set debugging value to
157 .IR X .
158 .ne 1i
159 .TP
160 .BI \-F fullname
161 Set the full name of the sender.
162 .TP
163 .BI \-f name
164 Sets the name of the ``from'' person 
165 (i.e., the envelope sender of the mail).
166 This address may also be used in the From: header
167 if that header is missing during initial submission.
168 The envelope sender address is used as the recipient
169 for delivery status notifications
170 and may also appear in a Return-Path: header.
171 .B \-f
172 should only be used 
173 by ``trusted'' users 
174 (normally
175 .IR root ", " daemon ,
176 and
177 .IR network )
178 or if the person you are trying to become 
179 is the same as the person you are.
180 Otherwise,
181 an X-Authentication-Warning header
182 will be added to the message.
183 .TP
184 .BI \-G
185 Relay (gateway) submission of a message,
186 e.g., when
187 .BR rmail
188 calls
189 .B sendmail .
190 .TP
191 .BI \-h N
192 Set the hop count to
193 .IR N .
194 The hop count is incremented every time the mail is 
195 processed.
196 When it reaches a limit, 
197 the mail is returned with an error message,
198 the victim of an aliasing loop.  
199 If not specified, 
200 ``Received:'' lines in the message are counted.
201 .TP
202 .B \-i
203 Ignore dots alone on lines by themselves in incoming messages.
204 This should be set if you are reading data from a file.
205 .TP
206 .BI "\-L " tag
207 Set the identifier used in syslog messages to the supplied
208 .IR tag .
209 .TP
210 .BI "\-N " dsn
211 Set delivery status notification conditions to
212 .IR dsn ,
213 which can be 
214 `never' 
215 for no notifications 
216 or a comma separated list of the values 
217 `failure' 
218 to be notified if delivery failed, 
219 `delay'
220 to be notified if delivery is delayed, and 
221 `success' 
222 to be notified when the message is successfully delivered.
223 .TP
224 .B \-n
225 Don't do aliasing.
226 .TP
227 \fB\-O\fP \fIoption\fR=\fIvalue\fR 
228 Set option
229 .I option
230 to the specified
231 .IR value .
232 This form uses long names.  See below for more details.
233 .TP
234 .BI \-o "x value"
235 Set option
236 .I x
237 to the specified
238 .IR value .
239 This form uses single character names only.  
240 The short names are not described in this manual page; 
241 see the
242 .I "Sendmail Installation and Operation Guide"
243 for details.
244 .TP
245 .BI \-p protocol
246 Set the name of the protocol used to receive the message.  
247 This can be a simple protocol name such as ``UUCP'' 
248 or a protocol and hostname, such as ``UUCP:ucbvax''.
249 .TP
250 \fB\-q\fR[\fItime\fR] 
251 Process saved messages in the queue at given intervals.  
252 If
253 .I time
254 is omitted, process the queue once.
255 .I Time
256 is given as a tagged number, 
257 with 
258 `s' 
259 being seconds, 
260 `m' 
261 being minutes (default), 
262 `h' 
263 being hours, 
264 `d' 
265 being days, 
266 and 
267 `w' 
268 being weeks.
269 For example, 
270 `\-q1h30m' 
271 or 
272 `\-q90m' 
273 would both set the timeout to one hour thirty minutes.
274 By default,
275 .B sendmail
276 will run in the background.
277 This option can be used safely with
278 .BR \-bd .
279 .TP
280 \fB\-qp\fR[\fItime\fR] 
281 Similar to \fB\-q\fItime\fR,
282 except that instead of periodically forking a child to process the queue,
283 sendmail forks a single persistent child for each queue
284 that alternates between processing the queue and sleeping.
285 The sleep time is given as the argument; it defaults to 1 second.
286 The process will always sleep at least 5 seconds if the queue was
287 empty in the previous queue run.
288 .TP
289 \fB\-q\fRf
290 Process saved messages in the queue once and do not fork(),
291 but run in the foreground.
292 .TP
293 \fB\-q\fRG name
294 Process jobs in queue group called
295 .I name
296 only.
297 .TP
298 \fB\-q\fR[\fI!\fR]I\fIsubstr\fR
299 Limit processed jobs to those containing
300 .I substr
301 as a substring of the queue id or not when
302 .I !
303 is specified.
304 .TP
305 \fB\-q\fR[\fI!\fR]R\fIsubstr\fR
306 Limit processed jobs to those containing
307 .I substr
308 as a substring of one of the recipients or not when
309 .I !
310 is specified.
311 .TP
312 \fB\-q\fR[\fI!\fR]S\fIsubstr\fR
313 Limit processed jobs to those containing
314 .I substr
315 as a substring of the sender or not when
316 .I !
317 is specified.
318 .TP
319 .BI "\-R " return
320 Set the amount of the message to be returned 
321 if the message bounces.
322 The
323 .I return
324 parameter can be 
325 `full' 
326 to return the entire message or 
327 `hdrs' 
328 to return only the headers.  
329 In the latter case also local bounces return only the headers.
330 .TP
331 .BI \-r name
332 An alternate and obsolete form of the
333 .B \-f
334 flag.
335 .TP
336 .B \-t
337 Read message for recipients.  
338 To:, Cc:, and Bcc: lines will be scanned for recipient addresses.  
339 The Bcc: line will be deleted before transmission.
340 .TP
341 .BI "\-V " envid
342 Set the original envelope id.  
343 This is propagated across SMTP to servers that support DSNs 
344 and is returned in DSN-compliant error messages.
345 .TP
346 .B \-v
347 Go into verbose mode.  
348 Alias expansions will be announced, etc.
349 .TP
350 .BI "\-X " logfile
351 Log all traffic in and out of mailers in the indicated log file.
352 This should only be used as a last resort 
353 for debugging mailer bugs.  
354 It will log a lot of data very quickly.
355 .TP
356 .B \-\-
357 Stop processing command flags and use the rest of the arguments as
358 addresses.
359 .SS Options
360 There are also a number of processing options that may be set.
361 Normally these will only be used by a system administrator.  
362 Options may be set either on the command line 
363 using the
364 .B \-o
365 flag (for short names), the
366 .B \-O
367 flag (for long names), 
368 or in the configuration file.  
369 This is a partial list limited to those options that are likely to be useful
370 on the command line 
371 and only shows the long names; 
372 for a complete list (and details), consult the
373 .IR "Sendmail Installation and Operation Guide" .
374 The options are:
375 .TP
376 .RI AliasFile= file
377 Use alternate alias file.
378 .TP
379 HoldExpensive 
380 On mailers that are considered ``expensive'' to connect to, 
381 don't initiate immediate connection.  
382 This requires queueing.
383 .TP
384 .RI CheckpointInterval= N
385 Checkpoint the queue file after every
386 .I N
387 successful deliveries (default 10).  
388 This avoids excessive duplicate deliveries 
389 when sending to long mailing lists 
390 interrupted by system crashes.
391 .ne 1i
392 .TP
393 .RI DeliveryMode= x
394 Set the delivery mode to
395 .IR x .
396 Delivery modes are 
397 `i' 
398 for interactive (synchronous) delivery, 
399 `b'
400 for background (asynchronous) delivery, 
401 `q' 
402 for queue only \- i.e.,
403 actual delivery is done the next time the queue is run, and 
404 `d'
405 for deferred \- the same as 
406 `q' 
407 except that database lookups for maps which have set the \-D option
408 (default for the host map) are avoided.
409 .TP
410 .RI ErrorMode= x
411 Set error processing to mode
412 .IR x .
413 Valid modes are 
414 `m' 
415 to mail back the error message, 
416 `w' 
417 to ``write''
418 back the error message 
419 (or mail it back if the sender is not logged in), 
420 `p' 
421 to print the errors on the terminal 
422 (default), 
423 `q' 
424 to throw away error messages 
425 (only exit status is returned), 
426 and 
427 `e'
428 to do special processing for the BerkNet.  
429 If the text of the message is not mailed back 
430 by 
431 modes
432 `m'
433 or
434 `w'
435 and if the sender is local to this machine, 
436 a copy of the message is appended to the file
437 .I dead.letter
438 in the sender's home directory.
439 .TP
440 SaveFromLine
441 Save
442 UNIX-style
443 From lines at the front of messages.
444 .TP
445 .RI MaxHopCount= N
446 The maximum number of times a message is allowed to ``hop'' 
447 before we decide it is in a loop.
448 .TP
449 IgnoreDots
450 Do not take dots on a line by themselves 
451 as a message terminator.
452 .TP
453 SendMimeErrors
454 Send error messages in MIME format.  
455 If not set, the DSN (Delivery Status Notification) SMTP extension 
456 is disabled.
457 .TP
458 .RI ConnectionCacheTimeout= timeout
459 Set connection cache timeout.
460 .TP
461 .RI ConnectionCacheSize= N
462 Set connection cache size.
463 .TP
464 .RI LogLevel= n
465 The log level.
466 .TP
467 .RI MeToo= False
468 Don't send to ``me'' (the sender) if I am in an alias expansion.
469 .TP
470 CheckAliases
471 Validate the right hand side of aliases during a
472 newaliases(1)
473 command.
474 .TP
475 OldStyleHeaders
476 If set, this message may have 
477 old style headers.  
478 If not set, 
479 this message is guaranteed to have new style headers 
480 (i.e., commas instead of spaces between addresses).  
481 If set, an adaptive algorithm is used that will correctly 
482 determine the header format in most cases.
483 .TP
484 .RI QueueDirectory= queuedir
485 Select the directory in which to queue messages.
486 .TP
487 .RI StatusFile= file
488 Save statistics in the named file.
489 .TP
490 .RI Timeout.queuereturn= time
491 Set the timeout on undelivered messages in the queue to the specified time.  
492 After delivery has failed 
493 (e.g., because of a host being down) 
494 for this amount of time, 
495 failed messages will be returned to the sender.  
496 The default is five days.
497 .TP
498 .RI UserDatabaseSpec= userdatabase
499 If set, a user database is consulted to get forwarding information.
500 You can consider this an adjunct to the aliasing mechanism, 
501 except that the database is intended to be distributed; 
502 aliases are local to a particular host.  
503 This may not be available if your sendmail does not have the
504 USERDB
505 option compiled in.
506 .TP
507 ForkEachJob
508 Fork each job during queue runs.  
509 May be convenient on memory-poor machines.
510 .TP
511 SevenBitInput
512 Strip incoming messages to seven bits.
513 .TP
514 .RI EightBitMode= mode
515 Set the handling of eight bit input to seven bit destinations to
516 .IR mode :
517 m
518 (mimefy) will convert to seven-bit MIME format,
519 p
520 (pass) will pass it as eight bits (but violates protocols), 
521 and
522 s
523 (strict) will bounce the message.
524 .TP
525 .RI MinQueueAge= timeout
526 Sets how long a job must ferment in the queue between attempts to send it.
527 .TP
528 .RI DefaultCharSet= charset
529 Sets the default character set used to label 8-bit data 
530 that is not otherwise labelled.
531 .TP
532 .RI DialDelay= sleeptime
533 If opening a connection fails, 
534 sleep for
535 .I sleeptime
536 seconds and try again.  
537 Useful on dial-on-demand sites.
538 .TP
539 .RI NoRecipientAction= action
540 Set the behaviour when there are no recipient headers (To:, Cc: or
541 Bcc:) in the message to
542 .IR action :
543 none
544 leaves the message unchanged,
545 add-to
546 adds a To: header with the envelope recipients,
547 add-apparently-to
548 adds an Apparently-To: header with the envelope recipients,
549 add-bcc
550 adds an empty Bcc: header, and
551 add-to-undisclosed
552 adds a header reading
553 `To: undisclosed-recipients:;'.
554 .TP
555 .RI MaxDaemonChildren= N
556 Sets the maximum number of children that an incoming SMTP daemon
557 will allow to spawn at any time to
558 .IR N .
559 .TP
560 .RI ConnectionRateThrottle= N
561 Sets the maximum number of connections per second to the SMTP port to
562 .IR N .
563 .PP
564 In aliases, 
565 the first character of a name may be 
566 a vertical bar to cause interpretation of 
567 the rest of the name as a command 
568 to pipe the mail to.  
569 It may be necessary to quote the name 
570 to keep
571 .B sendmail
572 from suppressing the blanks from between arguments. 
573 For example, a common alias is:
574 .IP
575 msgs: "|/usr/bin/msgs -s"
576 .PP
577 Aliases may also have the syntax
578 .RI ``:include: filename ''
579 to ask
580 .B sendmail
581 to read the named file for a list of recipients.  
582 For example, an alias such as:
583 .IP
584 poets: ":include:/usr/local/lib/poets.list"
585 .PP
586 would read
587 .I /usr/local/lib/poets.list
588 for the list of addresses making up the group.
589 .PP
590 .B Sendmail
591 returns an exit status 
592 describing what it did.  
593 The codes are defined in
594 .RI < sysexits.h >:
595 .TP
596 EX_OK
597 Successful completion on all addresses.
598 .TP
599 EX_NOUSER
600 User name not recognized.
601 .TP
602 EX_UNAVAILABLE
603 Catchall meaning necessary resources 
604 were not available.
605 .TP
606 EX_SYNTAX
607 Syntax error in address.
608 .TP
609 EX_SOFTWARE
610 Internal software error, 
611 including bad arguments.
612 .TP
613 EX_OSERR
614 Temporary operating system error, 
615 such as
616 ``cannot fork''.
617 .TP
618 EX_NOHOST
619 Host name not recognized.
620 .TP
621 EX_TEMPFAIL
622 Message could not be sent immediately, 
623 but was queued.
624 .PP
625 If invoked as
626 .BR newaliases ,
627 .B sendmail
628 will rebuild the alias database.  If invoked as
629 .BR mailq ,
630 .B sendmail
631 will print the contents of the mail queue.
632 If invoked as
633 .BR hoststat ,
634 .B sendmail
635 will print the persistent host status database.
636 If invoked as
637 .BR purgestat ,
638 .B sendmail
639 will purge expired entries from the persistent host status database.
640 If invoked as
641 .BR smtpd ,
642 .B sendmail
643 will act as a daemon, as if the
644 .B \-bd
645 option were specified.
646 .SH NOTES
647 .B sendmail
648 often gets blamed for many problems
649 that are actually the result of other problems,
650 such as overly permissive modes on directories.
651 For this reason,
652 .B sendmail
653 checks the modes on system directories and files
654 to determine if they can be trusted.
655 Although these checks can be turned off
656 and your system security reduced by setting the
657 .BR DontBlameSendmail
658 option,
659 the permission problems should be fixed.
660 For more information, see:
661
662 .I http://www.sendmail.org/tips/DontBlameSendmail.html
663 .SH FILES
664 Except for the file
665 .I /etc/mail/sendmail.cf
666 itself the following pathnames are all specified in
667 .IR /etc/mail/sendmail.cf .
668 Thus, 
669 these values are only approximations.
670 .PP
671 .TP
672  /etc/mail/aliases
673 raw data for alias names
674 .TP
675  /etc/mail/aliases.db
676 data base of alias names
677 .TP
678  /etc/mail/sendmail.cf
679 configuration file
680 .TP
681  /etc/mail/helpfile
682 help file
683 .TP
684  /etc/mail/statistics
685 collected statistics
686 .TP
687  /var/spool/mqueue/*
688 temp files
689 .SH SEE ALSO
690 mail(1),
691 syslog(3),
692 aliases(5),
693 mailaddr(7),
694 mail.local(8),
695 rc(8),
696 rmail(8)
697 .PP
698 DARPA 
699 Internet Request For Comments
700 .IR RFC819 ,
701 .IR RFC821 ,
702 .IR RFC822 .
703 .IR "Sendmail Installation and Operation Guide" ,
704 No. 8, SMM.
705 .PP
706 http://www.sendmail.org/
707 .SH HISTORY
708 The
709 .B sendmail
710 command appeared in
711 4.2BSD.
712 .\" $FreeBSD: src/contrib/sendmail/src/sendmail.8,v 1.3.6.7 2003/10/30 22:31:45 gshapiro Exp $