Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / sendmail-8.14 / sendmail / sendmail.8
1 .\" Copyright (c) 1998-2003 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.60 2011/03/07 23:44:48 ca Exp $
13 .\"
14 .TH SENDMAIL 8 "$Date: 2011/03/07 23:44:48 $"
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 gives up any enhanced (set-user-ID or set-group-ID) privileges
154 if an alternate configuration file is specified.
155 .TP
156 .BI "\-D " logfile
157 Send debugging output to the indicated log file instead of stdout.
158 .TP
159 .BI \-d category . level...
160 Set the debugging flag for
161 .I category
162 to
163 .IR level .
164 .I Category
165 is either an integer or a name specifying the topic, and
166 .I level
167 an integer specifying the level of debugging output desired.
168 Higher levels generally mean more output.
169 More than one flag can be specified by separating them with commas.
170 A list of numeric debugging categories can be found in the TRACEFLAGS file
171 in the sendmail source distribution.
172 .br
173 The option
174 .B \-d0.1
175 prints the version of
176 .B sendmail
177 and the options it was compiled with.
178 .br
179 Most other categories are only useful with, and documented in,
180 .BR sendmail 's
181 source code.
182 .ne 1i
183 .TP
184 .BI \-F fullname
185 Set the full name of the sender.
186 .TP
187 .BI \-f name
188 Sets the name of the ``from'' person 
189 (i.e., the envelope sender of the mail).
190 This address may also be used in the From: header
191 if that header is missing during initial submission.
192 The envelope sender address is used as the recipient
193 for delivery status notifications
194 and may also appear in a Return-Path: header.
195 .B \-f
196 should only be used 
197 by ``trusted'' users 
198 (normally
199 .IR root ", " daemon ,
200 and
201 .IR network )
202 or if the person you are trying to become 
203 is the same as the person you are.
204 Otherwise,
205 an X-Authentication-Warning header
206 will be added to the message.
207 .TP
208 .BI \-G
209 Relay (gateway) submission of a message,
210 e.g., when
211 .BR rmail
212 calls
213 .B sendmail .
214 .TP
215 .BI \-h N
216 Set the hop count to
217 .IR N .
218 The hop count is incremented every time the mail is 
219 processed.
220 When it reaches a limit, 
221 the mail is returned with an error message,
222 the victim of an aliasing loop.  
223 If not specified, 
224 ``Received:'' lines in the message are counted.
225 .TP
226 .B \-i
227 Do not strip a leading dot from lines in incoming messages,
228 and do not treat a dot on a line by itself
229 as the end of an incoming message.
230 This should be set if you are reading data from a file.
231 .TP
232 .BI "\-L " tag
233 Set the identifier used in syslog messages to the supplied
234 .IR tag .
235 .TP
236 .BI "\-N " dsn
237 Set delivery status notification conditions to
238 .IR dsn ,
239 which can be 
240 `never' 
241 for no notifications 
242 or a comma separated list of the values 
243 `failure' 
244 to be notified if delivery failed, 
245 `delay'
246 to be notified if delivery is delayed, and 
247 `success' 
248 to be notified when the message is successfully delivered.
249 .TP
250 .B \-n
251 Don't do aliasing.
252 .TP
253 \fB\-O\fP \fIoption\fR=\fIvalue\fR 
254 Set option
255 .I option
256 to the specified
257 .IR value .
258 This form uses long names.  See below for more details.
259 .TP
260 .BI \-o "x value"
261 Set option
262 .I x
263 to the specified
264 .IR value .
265 This form uses single character names only.  
266 The short names are not described in this manual page; 
267 see the
268 .I "Sendmail Installation and Operation Guide"
269 for details.
270 .TP
271 .BI \-p protocol
272 Set the name of the protocol used to receive the message.  
273 This can be a simple protocol name such as ``UUCP'' 
274 or a protocol and hostname, such as ``UUCP:ucbvax''.
275 .TP
276 \fB\-q\fR[\fItime\fR] 
277 Process saved messages in the queue at given intervals.  
278 If
279 .I time
280 is omitted, process the queue once.
281 .I Time
282 is given as a tagged number, 
283 with 
284 `s' 
285 being seconds, 
286 `m' 
287 being minutes (default), 
288 `h' 
289 being hours, 
290 `d' 
291 being days, 
292 and 
293 `w' 
294 being weeks.
295 For example, 
296 `\-q1h30m' 
297 or 
298 `\-q90m' 
299 would both set the timeout to one hour thirty minutes.
300 By default,
301 .B sendmail
302 will run in the background.
303 This option can be used safely with
304 .BR \-bd .
305 .TP
306 \fB\-qp\fR[\fItime\fR] 
307 Similar to \fB\-q\fItime\fR,
308 except that instead of periodically forking a child to process the queue,
309 sendmail forks a single persistent child for each queue
310 that alternates between processing the queue and sleeping.
311 The sleep time is given as the argument; it defaults to 1 second.
312 The process will always sleep at least 5 seconds if the queue was
313 empty in the previous queue run.
314 .TP
315 \fB\-q\fRf
316 Process saved messages in the queue once and do not fork(),
317 but run in the foreground.
318 .TP
319 \fB\-q\fRG\fIname\fR
320 Process jobs in queue group called
321 .I name
322 only.
323 .TP
324 \fB\-q\fR[\fI!\fR]I\fIsubstr\fR
325 Limit processed jobs to those containing
326 .I substr
327 as a substring of the queue id or not when
328 .I !
329 is specified.
330 .TP
331 \fB\-q\fR[\fI!\fR]Q\fIsubstr\fR
332 Limit processed jobs to quarantined jobs containing
333 .I substr
334 as a substring of the quarantine reason or not when
335 .I !
336 is specified.
337 .TP
338 \fB\-q\fR[\fI!\fR]R\fIsubstr\fR
339 Limit processed jobs to those containing
340 .I substr
341 as a substring of one of the recipients or not when
342 .I !
343 is specified.
344 .TP
345 \fB\-q\fR[\fI!\fR]S\fIsubstr\fR
346 Limit processed jobs to those containing
347 .I substr
348 as a substring of the sender or not when
349 .I !
350 is specified.
351 .TP
352 \fB\-Q\fR[reason]
353 Quarantine a normal queue items with the given reason or
354 unquarantine quarantined queue items if no reason is given.
355 This should only be used with some sort of item matching using
356 as described above.
357 .TP
358 .BI "\-R " return
359 Set the amount of the message to be returned 
360 if the message bounces.
361 The
362 .I return
363 parameter can be 
364 `full' 
365 to return the entire message or 
366 `hdrs' 
367 to return only the headers.  
368 In the latter case also local bounces return only the headers.
369 .TP
370 .BI \-r name
371 An alternate and obsolete form of the
372 .B \-f
373 flag.
374 .TP
375 .B \-t
376 Read message for recipients.  
377 To:, Cc:, and Bcc: lines will be scanned for recipient addresses.  
378 The Bcc: line will be deleted before transmission.
379 .TP
380 .BI "\-V " envid
381 Set the original envelope id.  
382 This is propagated across SMTP to servers that support DSNs 
383 and is returned in DSN-compliant error messages.
384 .TP
385 .B \-v
386 Go into verbose mode.  
387 Alias expansions will be announced, etc.
388 .TP
389 .BI "\-X " logfile
390 Log all traffic in and out of mailers in the indicated log file.
391 This should only be used as a last resort 
392 for debugging mailer bugs.  
393 It will log a lot of data very quickly.
394 .TP
395 .B \-\-
396 Stop processing command flags and use the rest of the arguments as
397 addresses.
398 .SS Options
399 There are also a number of processing options that may be set.
400 Normally these will only be used by a system administrator.  
401 Options may be set either on the command line 
402 using the
403 .B \-o
404 flag (for short names), the
405 .B \-O
406 flag (for long names), 
407 or in the configuration file.  
408 This is a partial list limited to those options that are likely to be useful
409 on the command line 
410 and only shows the long names; 
411 for a complete list (and details), consult the
412 .IR "Sendmail Installation and Operation Guide" .
413 The options are:
414 .TP
415 .RI AliasFile= file
416 Use alternate alias file.
417 .TP
418 HoldExpensive 
419 On mailers that are considered ``expensive'' to connect to, 
420 don't initiate immediate connection.  
421 This requires queueing.
422 .TP
423 .RI CheckpointInterval= N
424 Checkpoint the queue file after every
425 .I N
426 successful deliveries (default 10).  
427 This avoids excessive duplicate deliveries 
428 when sending to long mailing lists 
429 interrupted by system crashes.
430 .ne 1i
431 .TP
432 .RI DeliveryMode= x
433 Set the delivery mode to
434 .IR x .
435 Delivery modes are 
436 `i' 
437 for interactive (synchronous) delivery, 
438 `b'
439 for background (asynchronous) delivery, 
440 `q' 
441 for queue only \- i.e.,
442 actual delivery is done the next time the queue is run, and 
443 `d'
444 for deferred \- the same as 
445 `q' 
446 except that database lookups for maps which have set the \-D option
447 (default for the host map) are avoided.
448 .TP
449 .RI ErrorMode= x
450 Set error processing to mode
451 .IR x .
452 Valid modes are 
453 `m' 
454 to mail back the error message, 
455 `w' 
456 to ``write''
457 back the error message 
458 (or mail it back if the sender is not logged in), 
459 `p' 
460 to print the errors on the terminal 
461 (default), 
462 `q' 
463 to throw away error messages 
464 (only exit status is returned), 
465 and 
466 `e'
467 to do special processing for the BerkNet.  
468 If the text of the message is not mailed back 
469 by 
470 modes
471 `m'
472 or
473 `w'
474 and if the sender is local to this machine, 
475 a copy of the message is appended to the file
476 .I dead.letter
477 in the sender's home directory.
478 .TP
479 SaveFromLine
480 Save
481 UNIX-style
482 From lines at the front of messages.
483 .TP
484 .RI MaxHopCount= N
485 The maximum number of times a message is allowed to ``hop'' 
486 before we decide it is in a loop.
487 .TP
488 IgnoreDots
489 Do not take dots on a line by themselves 
490 as a message terminator.
491 .TP
492 SendMimeErrors
493 Send error messages in MIME format.  
494 If not set, the DSN (Delivery Status Notification) SMTP extension 
495 is disabled.
496 .TP
497 .RI ConnectionCacheTimeout= timeout
498 Set connection cache timeout.
499 .TP
500 .RI ConnectionCacheSize= N
501 Set connection cache size.
502 .TP
503 .RI LogLevel= n
504 The log level.
505 .TP
506 .RI MeToo= False
507 Don't send to ``me'' (the sender) if I am in an alias expansion.
508 .TP
509 CheckAliases
510 Validate the right hand side of aliases during a
511 newaliases(1)
512 command.
513 .TP
514 OldStyleHeaders
515 If set, this message may have 
516 old style headers.  
517 If not set, 
518 this message is guaranteed to have new style headers 
519 (i.e., commas instead of spaces between addresses).  
520 If set, an adaptive algorithm is used that will correctly 
521 determine the header format in most cases.
522 .TP
523 .RI QueueDirectory= queuedir
524 Select the directory in which to queue messages.
525 .TP
526 .RI StatusFile= file
527 Save statistics in the named file.
528 .TP
529 .RI Timeout.queuereturn= time
530 Set the timeout on undelivered messages in the queue to the specified time.  
531 After delivery has failed 
532 (e.g., because of a host being down) 
533 for this amount of time, 
534 failed messages will be returned to the sender.  
535 The default is five days.
536 .TP
537 .RI UserDatabaseSpec= userdatabase
538 If set, a user database is consulted to get forwarding information.
539 You can consider this an adjunct to the aliasing mechanism, 
540 except that the database is intended to be distributed; 
541 aliases are local to a particular host.  
542 This may not be available if your sendmail does not have the
543 USERDB
544 option compiled in.
545 .TP
546 ForkEachJob
547 Fork each job during queue runs.  
548 May be convenient on memory-poor machines.
549 .TP
550 SevenBitInput
551 Strip incoming messages to seven bits.
552 .TP
553 .RI EightBitMode= mode
554 Set the handling of eight bit input to seven bit destinations to
555 .IR mode :
556 m
557 (mimefy) will convert to seven-bit MIME format,
558 p
559 (pass) will pass it as eight bits (but violates protocols), 
560 and
561 s
562 (strict) will bounce the message.
563 .TP
564 .RI MinQueueAge= timeout
565 Sets how long a job must ferment in the queue between attempts to send it.
566 .TP
567 .RI DefaultCharSet= charset
568 Sets the default character set used to label 8-bit data 
569 that is not otherwise labelled.
570 .TP
571 .RI DialDelay= sleeptime
572 If opening a connection fails, 
573 sleep for
574 .I sleeptime
575 seconds and try again.  
576 Useful on dial-on-demand sites.
577 .TP
578 .RI NoRecipientAction= action
579 Set the behaviour when there are no recipient headers (To:, Cc: or
580 Bcc:) in the message to
581 .IR action :
582 none
583 leaves the message unchanged,
584 add-to
585 adds a To: header with the envelope recipients,
586 add-apparently-to
587 adds an Apparently-To: header with the envelope recipients,
588 add-bcc
589 adds an empty Bcc: header, and
590 add-to-undisclosed
591 adds a header reading
592 `To: undisclosed-recipients:;'.
593 .TP
594 .RI MaxDaemonChildren= N
595 Sets the maximum number of children that an incoming SMTP daemon
596 will allow to spawn at any time to
597 .IR N .
598 .TP
599 .RI ConnectionRateThrottle= N
600 Sets the maximum number of connections per second to the SMTP port to
601 .IR N .
602 .PP
603 In aliases, 
604 the first character of a name may be 
605 a vertical bar to cause interpretation of 
606 the rest of the name as a command 
607 to pipe the mail to.  
608 It may be necessary to quote the name 
609 to keep
610 .B sendmail
611 from suppressing the blanks from between arguments. 
612 For example, a common alias is:
613 .IP
614 msgs: "|/usr/bin/msgs -s"
615 .PP
616 Aliases may also have the syntax
617 .RI ``:include: filename ''
618 to ask
619 .B sendmail
620 to read the named file for a list of recipients.  
621 For example, an alias such as:
622 .IP
623 poets: ":include:/usr/local/lib/poets.list"
624 .PP
625 would read
626 .I /usr/local/lib/poets.list
627 for the list of addresses making up the group.
628 .PP
629 .B Sendmail
630 returns an exit status 
631 describing what it did.  
632 The codes are defined in
633 .RI < sysexits.h >:
634 .TP
635 EX_OK
636 Successful completion on all addresses.
637 .TP
638 EX_NOUSER
639 User name not recognized.
640 .TP
641 EX_UNAVAILABLE
642 Catchall meaning necessary resources 
643 were not available.
644 .TP
645 EX_SYNTAX
646 Syntax error in address.
647 .TP
648 EX_SOFTWARE
649 Internal software error, 
650 including bad arguments.
651 .TP
652 EX_OSERR
653 Temporary operating system error, 
654 such as
655 ``cannot fork''.
656 .TP
657 EX_NOHOST
658 Host name not recognized.
659 .TP
660 EX_TEMPFAIL
661 Message could not be sent immediately, 
662 but was queued.
663 .PP
664 If invoked as
665 .BR newaliases ,
666 .B sendmail
667 will rebuild the alias database.  If invoked as
668 .BR mailq ,
669 .B sendmail
670 will print the contents of the mail queue.
671 If invoked as
672 .BR hoststat ,
673 .B sendmail
674 will print the persistent host status database.
675 If invoked as
676 .BR purgestat ,
677 .B sendmail
678 will purge expired entries from the persistent host status database.
679 If invoked as
680 .BR smtpd ,
681 .B sendmail
682 will act as a daemon, as if the
683 .B \-bd
684 option were specified.
685 .SH NOTES
686 .B sendmail
687 often gets blamed for many problems
688 that are actually the result of other problems,
689 such as overly permissive modes on directories.
690 For this reason,
691 .B sendmail
692 checks the modes on system directories and files
693 to determine if they can be trusted.
694 Although these checks can be turned off
695 and your system security reduced by setting the
696 .BR DontBlameSendmail
697 option,
698 the permission problems should be fixed.
699 For more information, see:
700
701 .I http://www.sendmail.org/tips/DontBlameSendmail.html
702 .SH FILES
703 Except for the file
704 .I /etc/mail/sendmail.cf
705 itself the following pathnames are all specified in
706 .IR /etc/mail/sendmail.cf .
707 Thus, 
708 these values are only approximations.
709 .PP
710 .TP
711  /etc/mail/aliases
712 raw data for alias names
713 .TP
714  /etc/mail/aliases.db
715 data base of alias names
716 .TP
717  /etc/mail/sendmail.cf
718 configuration file
719 .TP
720  /etc/mail/helpfile
721 help file
722 .TP
723  /etc/mail/statistics
724 collected statistics
725 .TP
726  /var/spool/mqueue/*
727 temp files
728 .SH SEE ALSO
729 binmail(1),
730 mail(1),
731 rmail(1),
732 syslog(3),
733 aliases(5),
734 mailaddr(7),
735 rc(8)
736 .PP
737 DARPA 
738 Internet Request For Comments
739 .IR RFC819 ,
740 .IR RFC821 ,
741 .IR RFC822 .
742 .IR "Sendmail Installation and Operation Guide" ,
743 No. 8, SMM.
744 .PP
745 http://www.sendmail.org/
746 .PP
747 US Patent Numbers 6865671, 6986037.
748 .SH HISTORY
749 The
750 .B sendmail
751 command appeared in
752 4.2BSD.