source: trunk/third/sendmail/src/sendmail.8 @ 12887

Revision 12887, 14.3 KB checked in by danw, 26 years ago (diff)
add in mdoc magic
Line 
1.\" Dummy comment to avoid confusing man
2.so /usr/athena/share/tmac/tmac.doc
3.\" Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
4.\" Copyright (c) 1983, 1997 Eric P. Allman.  All rights reserved.
5.\" Copyright (c) 1988, 1991, 1993
6.\"     The Regents of the University of California.  All rights reserved.
7.\"
8.\" By using this file, you agree to the terms and conditions set
9.\" forth in the LICENSE file which can be found at the top level of
10.\" the sendmail distribution.
11.\"
12.\"
13.\"     @(#)sendmail.8  8.20 (Berkeley) 8/2/1998
14.\"
15.Dd August 2, 1998
16.Dt SENDMAIL 8
17.Os BSD 4
18.Sh NAME
19.Nm sendmail
20.Nd an electronic mail transport agent
21.Sh SYNOPSIS
22.Nm sendmail
23.Op Ar flags
24.Op Ar address ...
25.Nm newaliases
26.Nm mailq
27.Op Fl v
28.Sh DESCRIPTION
29.Nm Sendmail
30sends a message to one or more
31.Em recipients ,
32routing the message over whatever networks
33are necessary.
34.Nm Sendmail
35does internetwork forwarding as necessary
36to deliver the message to the correct place.
37.Pp
38.Nm Sendmail
39is not intended as a user interface routine;
40other programs provide user-friendly
41front ends;
42.Nm sendmail
43is used only to deliver pre-formatted messages.
44.Pp
45With no flags,
46.Nm sendmail
47reads its standard input
48up to an end-of-file
49or a line consisting only of a single dot
50and sends a copy of the message found there
51to all of the addresses listed.
52It determines the network(s) to use
53based on the syntax and contents of the addresses.
54.Pp
55Local addresses are looked up in a file
56and aliased appropriately.
57Aliasing can be prevented by preceding the address
58with a backslash.
59Normally the sender is not included in any alias
60expansions, e.g.,
61if `john' sends to `group',
62and `group' includes `john' in the expansion,
63then the letter will not be delivered to `john'.
64.Ss Parameters
65.Bl -tag -width Fl
66.It Fl B Ns Ar type
67Set the body type to
68.Ar type .
69Current legal values
70.Li 7BIT
71or
72.Li 8BITMIME .
73.It Fl ba
74Go into
75.Tn ARPANET
76mode.
77All input lines must end with a CR-LF,
78and all messages will be generated with a CR-LF at the end.
79Also,
80the ``From:'' and ``Sender:''
81fields are examined for the name of the sender.
82.It Fl bd
83Run as a daemon.  This requires Berkeley
84.Tn IPC .
85.Nm Sendmail
86will fork and run in background
87listening on socket 25 for incoming
88.Tn SMTP
89connections.
90This is normally run from
91.Pa /etc/rc .
92.It Fl bD
93Same as
94.Fl bd
95except runs in foreground.
96.It Fl bh
97Print the persistent host status database.
98.It Fl bH
99Purge the persistent host status database.
100.It Fl bi
101Initialize the alias database.
102.It Fl bm
103Deliver mail in the usual way (default).
104.It Fl bp
105Print a listing of the queue.
106.It Fl bs
107Use the
108.Tn SMTP
109protocol as described in
110.Tn RFC821
111on standard input and output.
112This flag implies all the operations of the
113.Fl ba
114flag that are compatible with
115.Tn SMTP .
116.It Fl bt
117Run in address test mode.
118This mode reads addresses and shows the steps in parsing;
119it is used for debugging configuration tables.
120.It Fl bv
121Verify names only \- do not try to collect or deliver a message.
122Verify mode is normally used for validating
123users or mailing lists.
124.It Fl C Ns Ar file
125Use alternate configuration file.
126.Nm Sendmail
127refuses to run as root if an alternate configuration file is specified.
128.It Fl d Ns Ar X
129Set debugging value to
130.Ar X .
131.ne 1i
132.It Fl F Ns Ar fullname
133Set the full name of the sender.
134.It Fl f Ns Ar name
135Sets the name of the ``from'' person
136(i.e., the sender of the mail).
137.Fl f
138can only be used
139by ``trusted'' users
140(normally
141.Em root ,
142.Em daemon ,
143and
144.Em network )
145or if the person you are trying to become
146is the same as the person you are.
147.It Fl h Ns Ar N
148Set the hop count to
149.Ar N .
150The hop count is incremented every time the mail is
151processed.
152When it reaches a limit,
153the mail is returned with an error message,
154the victim of an aliasing loop.
155If not specified,
156``Received:'' lines in the message are counted.
157.It Fl i
158Ignore dots alone on lines by themselves in incoming messages.
159This should be set if you are reading data from a file.
160.It Fl N Ar dsn
161Set delivery status notification conditions to
162.Ar dsn,
163which can be
164.Ql never
165for no notifications
166or a comma separated list of the values
167.Ql failure
168to be notified if delivery failed,
169.Ql delay
170to be notified if delivery is delayed, and
171.Ql success
172to be notified when the message is successfully delivered.
173.It Fl n
174Don't do aliasing.
175.It Fl O Ar option Ns = Ns Em value
176Set option
177.Ar option
178to the specified
179.Em value .
180This form uses long names.
181See below for more details.
182.It Fl o Ns Ar x Em value
183Set option
184.Ar x
185to the specified
186.Em value .
187This form uses single character names only.
188The short names are not described in this manual page;
189see the
190.%T "Sendmail Installation and Operation Guide"
191for details.
192.It Fl p Ns Ar protocol
193Set the name of the protocol used to receive the message.
194This can be a simple protocol name such as ``UUCP''
195or a protocol and hostname, such as ``UUCP:ucbvax''.
196.It Fl q Ns Bq Ar time
197Processed saved messages in the queue at given intervals.
198If
199.Ar time
200is omitted,
201process the queue once.
202.Xr Time
203is given as a tagged number,
204with
205.Ql s
206being seconds,
207.Ql m
208being minutes,
209.Ql h
210being hours,
211.Ql d
212being days,
213and
214.Ql w
215being weeks.
216For example,
217.Ql \-q1h30m
218or
219.Ql \-q90m
220would both set the timeout to one hour thirty minutes.
221If
222.Ar time
223is specified,
224.Nm sendmail
225will run in background.
226This option can be used safely with
227.Fl bd .
228.It Fl qI Ns Ar substr
229Limit processed jobs to those containing
230.Ar substr
231as a substring of the queue id.
232.It Fl qR Ns Ar substr
233Limit processed jobs to those containing
234.Ar substr
235as a substring of one of the recipients.
236.It Fl qS Ns Ar substr
237Limit processed jobs to those containing
238.Ar substr
239as a substring of the sender.
240.It Fl R Ar return
241Set the amount of the message to be returned
242if the message bounces.
243The
244.Ar return
245parameter can be
246.Ql full
247to return the entire message or
248.Ql hdrs
249to return only the headers.
250.It Fl r Ns Ar name
251An alternate and obsolete form of the
252.Fl f
253flag.
254.It Fl t
255Read message for recipients.
256To:, Cc:, and Bcc: lines will be scanned for recipient addresses.
257The Bcc: line will be deleted before transmission.
258.It Fl U
259Initial (user) submission.
260This should
261.Em always
262be set when called from a user agent such as
263.Nm Mail
264or
265.Nm exmh
266and
267.Em never
268be set when called by a network delivery agent such as
269.Nm rmail .
270.It Fl V Ar envid
271Set the original envelope id.
272This is propagated across SMTP to servers that support DSNs
273and is returned in DSN-compliant error messages.
274.It Fl v
275Go into verbose mode.
276Alias expansions will be announced, etc.
277.It Fl X Ar logfile
278Log all traffic in and out of mailers in the indicated log file.
279This should only be used as a last resort
280for debugging mailer bugs.
281It will log a lot of data very quickly.
282.It Fl -
283Stop processing command flags and use the rest of the arguments
284as addresses.
285.El
286.Ss Options
287There are also a number of processing options that may be set.
288Normally these will only be used by a system administrator.
289Options may be set either on the command line
290using the
291.Fl o
292flag (for short names),
293the
294.Fl O
295flag (for long names),
296or in the configuration file.
297This is a partial list limited to those options that are likely to be useful
298on the command line
299and only shows the long names;
300for a complete list (and details), consult the
301.%T "Sendmail Installation and Operation Guide" .
302The options are:
303.Bl -tag -width Fl
304.It Li AliasFile= Ns Ar file
305Use alternate alias file.
306.It Li HoldExpensive
307On mailers that are considered ``expensive'' to connect to,
308don't initiate immediate connection.
309This requires queueing.
310.It Li CheckpointInterval= Ns Ar N
311Checkpoint the queue file after every
312.Ar N
313successful deliveries (default 10).
314This avoids excessive duplicate deliveries
315when sending to long mailing lists
316interrupted by system crashes.
317.ne 1i
318.It Li DeliveryMode= Ns Ar x
319Set the delivery mode to
320.Ar x .
321Delivery modes are
322.Ql i
323for interactive (synchronous) delivery,
324.Ql b
325for background (asynchronous) delivery,
326.Ql q
327for queue only \- i.e.,
328actual delivery is done the next time the queue is run, and
329.Ql d
330for deferred \- the same as
331.Ql q
332except that database lookups (notably DNS and NIS lookups) are avoided.
333.It Li ErrorMode= Ns Ar x
334Set error processing to mode
335.Ar x .
336Valid modes are
337.Ql m
338to mail back the error message,
339.Ql w
340to ``write'' back the error message
341(or mail it back if the sender is not logged in),
342.Ql p
343to print the errors on the terminal
344(default),
345.Ql q
346to throw away error messages
347(only exit status is returned),
348and
349.Ql e
350to do special processing for the BerkNet.
351If the text of the message is not mailed back
352by
353modes
354.Ql m
355or
356.Ql w
357and if the sender is local to this machine,
358a copy of the message is appended to the file
359.Pa dead.letter
360in the sender's home directory.
361.It Li SaveFromLine
362Save
363.Tn UNIX Ns \-style
364From lines at the front of messages.
365.It Li MaxHopCount= Ar N
366The maximum number of times a message is allowed to ``hop''
367before we decide it is in a loop.
368.It Li IgnoreDots
369Do not take dots on a line by themselves
370as a message terminator.
371.It Li SendMimeErrors
372Send error messages in MIME format.
373If not set, the DSN (Delivery Status Notification) SMTP extension
374is disabled.
375.It Li ConnectionCacheTimeout= Ns Ar timeout
376Set connection cache timeout.
377.It Li ConnectionCacheSize= Ns Ar N
378Set connection cache size.
379.It Li LogLevel= Ns Ar n
380The log level.
381.It Li MeToo
382Send to ``me'' (the sender) also if I am in an alias expansion.
383.It Li CheckAliases
384Validate the right hand side of aliases during a
385.Xr newaliases 1
386command.
387.It Li OldStyleHeaders
388If set, this message may have
389old style headers.
390If not set,
391this message is guaranteed to have new style headers
392(i.e., commas instead of spaces between addresses).
393If set, an adaptive algorithm is used that will correctly
394determine the header format in most cases.
395.It Li QueueDirectory= Ns Ar queuedir
396Select the directory in which to queue messages.
397.It Li StatusFile= Ns Ar file
398Save statistics in the named file.
399.It Li Timeout.queuereturn= Ns Ar time
400Set the timeout on undelivered messages in the queue to the specified time.
401After delivery has failed
402(e.g., because of a host being down)
403for this amount of time,
404failed messages will be returned to the sender.
405The default is five days.
406.It Li UserDatabaseSpec= Ns Ar userdatabase
407If set, a user database is consulted to get forwarding information.
408You can consider this an adjunct to the aliasing mechanism,
409except that the database is intended to be distributed;
410aliases are local to a particular host.
411This may not be available if your sendmail does not have the
412.Dv USERDB
413option compiled in.
414.It Li ForkEachJob
415Fork each job during queue runs.
416May be convenient on memory-poor machines.
417.It Li SevenBitInput
418Strip incoming messages to seven bits.
419.It Li EightBitMode= Ns Ar mode
420Set the handling of eight bit input to seven bit destinations to
421.Ar mode :
422.Li m
423(mimefy) will convert to seven-bit MIME format,
424.Li p
425(pass) will pass it as eight bits (but violates protocols),
426and
427.Li s
428(strict) will bounce the message.
429.It Li MinQueueAge= Ns Ar timeout
430Sets how long a job must ferment in the queue between attempts to send it.
431.It Li DefaultCharSet= Ns Ar charset
432Sets the default character set used to label 8-bit data
433that is not otherwise labelled.
434.It Li DialDelay= Ns Ar sleeptime
435If opening a connection fails,
436sleep for
437.Ar sleeptime
438seconds and try again.
439Useful on dial-on-demand sites.
440.It Li NoRecipientAction= Ns Ar action
441Set the behaviour when there are no recipient headers (To:, Cc: or Bcc:)
442in the message to
443.Ar action :
444.Li none
445leaves the message unchanged,
446.Li add-to
447adds a To: header with the envelope recipients,
448.Li add-apparently-to
449adds an Apparently-To: header with the envelope recipients,
450.Li add-bcc
451adds an empty Bcc: header, and
452.Li add-to-undisclosed
453adds a header reading
454.Ql "To: undisclosed-recipients:;" .
455.It Li MaxDaemonChildren= Ns Ar N
456Sets the maximum number of children that an incoming SMTP daemon
457will allow to spawn at any time to
458.Ar N .
459.It Li ConnectionRateThrottle= Ns Ar N
460Sets the maximum number of connections per second to the SMTP port to
461.Ar N .
462.El
463.Pp
464In aliases,
465the first character of a name may be
466a vertical bar to cause interpretation of
467the rest of the name as a command
468to pipe the mail to.
469It may be necessary to quote the name
470to keep
471.Nm sendmail
472from suppressing the blanks from between arguments.
473For example, a common alias is:
474.Pp
475.Bd -literal -offset indent -compact
476msgs: "|/usr/bin/msgs -s"
477.Ed
478.Pp
479Aliases may also have the syntax
480.Dq :include: Ns Ar filename
481to ask
482.Xr sendmail
483to read the named file for a list of recipients.
484For example, an alias such as:
485.Pp
486.Bd -literal -offset indent -compact
487poets: ":include:/usr/local/lib/poets.list"
488.Ed
489.Pp
490would read
491.Pa /usr/local/lib/poets.list
492for the list of addresses making up the group.
493.Pp
494.Nm Sendmail
495returns an exit status
496describing what it did.
497The codes are defined in
498.Aq Pa sysexits.h :
499.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
500.It Dv EX_OK
501Successful completion on all addresses.
502.It Dv EX_NOUSER
503User name not recognized.
504.It Dv EX_UNAVAILABLE
505Catchall meaning necessary resources
506were not available.
507.It Dv EX_SYNTAX
508Syntax error in address.
509.It Dv EX_SOFTWARE
510Internal software error,
511including bad arguments.
512.It Dv EX_OSERR
513Temporary operating system error,
514such as
515.Dq cannot fork .
516.It Dv EX_NOHOST
517Host name not recognized.
518.It Dv EX_TEMPFAIL
519Message could not be sent immediately,
520but was queued.
521.El
522.Pp
523If invoked as
524.Nm newaliases ,
525.Nm sendmail
526will rebuild the alias database.
527If invoked as
528.Nm mailq ,
529.Nm sendmail
530will print the contents of the mail queue.
531.Sh FILES
532Except for the file
533.Pa /etc/sendmail.cf
534itself and the daemon process ID file,
535the following pathnames are all specified in
536.Pa /etc/sendmail.cf.
537Thus,
538these values are only approximations.
539.Pp
540.Bl -tag -width /usr/lib/sendmail.fc -compact
541.It Pa /etc/aliases
542raw data for alias names
543.It Pa /etc/aliases.db
544data base of alias names
545.It Pa /etc/sendmail.cf
546configuration file
547.It Pa /etc/sendmail.hf
548help file
549.It Pa /var/log/sendmail.st
550collected statistics
551.It Pa /var/spool/mqueue/*
552temp files
553.El
554.Sh SEE ALSO
555.Xr binmail 1 ,
556.Xr mail 1 ,
557.Xr rmail 1 ,
558.Xr syslog 3 ,
559.Xr aliases 5 ,
560.Xr mailaddr 7 ,
561.Xr rc 8 ;
562.Pp
563DARPA
564Internet Request For Comments
565.%T RFC819 ,
566.%T RFC821 ,
567.%T RFC822 .
568.Rs
569.%T "Sendmail \- An Internetwork Mail Router"
570.%V SMM
571.%N \&No. 9
572.Re
573.Rs
574.%T "Sendmail Installation and Operation Guide"
575.%V SMM
576.%N \&No. 8
577.Re
578.Sh HISTORY
579The
580.Nm
581command appeared in
582.Bx 4.2 .
Note: See TracBrowser for help on using the repository browser.