source: trunk/third/sendmail/sendmail/sendmail.8 @ 19204

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