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