copyediting for Usenix manuals
[unix-history] / usr / src / usr.sbin / sendmail / src / sendmail.8
CommitLineData
86609a16
KB
1.\" Copyright (c) 1988, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
5412ac7d 3.\"
a280d268 4.\" %sccs.include.redist.man%
08e47b66 5.\"
653ba8b6 6.\" @(#)sendmail.8 8.4 (Berkeley) %G%
5412ac7d 7.\"
b42074ab
CL
8.Dd
9.Dt SENDMAIL 8
10.Os BSD 4
11.Sh NAME
12.Nm sendmail
13.Nd send mail over the internet
14.Sh SYNOPSIS
15.Nm sendmail
16.Op Ar flags
17.Op Ar address ...
18.Nm newaliases
19.Nm mailq
20.Op Fl v
21.Sh DESCRIPTION
22.Nm Sendmail
8e8bec7f 23sends a message to one or more
b42074ab 24.Em recipients ,
8de6f6c6 25routing the message over whatever networks
5412ac7d 26are necessary.
b42074ab 27.Nm Sendmail
8de6f6c6
KM
28does internetwork forwarding as necessary
29to deliver the message to the correct place.
b42074ab
CL
30.Pp
31.Nm Sendmail
5412ac7d 32is not intended as a user interface routine;
8de6f6c6
KM
33other programs provide user-friendly
34front ends;
b42074ab 35.Nm sendmail
8de6f6c6 36is used only to deliver pre-formatted messages.
b42074ab 37.Pp
8de6f6c6 38With no flags,
b42074ab 39.Nm sendmail
5412ac7d 40reads its standard input
8e8bec7f
EA
41up to an end-of-file
42or a line consisting only of a single dot
43and sends a copy of the message found there
5412ac7d 44to all of the addresses listed.
8e8bec7f 45It determines the network(s) to use
8de6f6c6 46based on the syntax and contents of the addresses.
b42074ab 47.Pp
5412ac7d 48Local addresses are looked up in a file
5412ac7d
KM
49and aliased appropriately.
50Aliasing can be prevented by preceding the address
8de6f6c6 51with a backslash.
5412ac7d
KM
52Normally the sender is not included in any alias
53expansions, e.g.,
54if `john' sends to `group',
55and `group' includes `john' in the expansion,
56then the letter will not be delivered to `john'.
7ecdfce3 57.Ss Parameters
b42074ab 58.Bl -tag -width Fl
2802a569
EA
59.It Fl B Ns Ar type
60Set the body type to
61.Ar type .
62Current legal values
63.Li 7BIT
64or
65.Li 8BITMIME .
b42074ab
CL
66.It Fl ba
67Go into
68.Tn ARPANET
69mode.
8de6f6c6
KM
70All input lines must end with a CR-LF,
71and all messages will be generated with a CR-LF at the end.
72Also,
73the ``From:'' and ``Sender:''
74fields are examined for the name of the sender.
b42074ab
CL
75.It Fl bd
76Run as a daemon. This requires Berkeley
77.Tn IPC .
78.Nm Sendmail
8e8bec7f 79will fork and run in background
b42074ab
CL
80listening on socket 25 for incoming
81.Tn SMTP
82connections.
8e8bec7f 83This is normally run from
b42074ab
CL
84.Pa /etc/rc .
85.It Fl bi
8de6f6c6 86Initialize the alias database.
b42074ab 87.It Fl bm
8de6f6c6 88Deliver mail in the usual way (default).
b42074ab 89.It Fl bp
8de6f6c6 90Print a listing of the queue.
b42074ab
CL
91.It Fl bs
92Use the
93.Tn SMTP
94protocol as described in
95.Tn RFC821
8e8bec7f 96on standard input and output.
8de6f6c6 97This flag implies all the operations of the
b42074ab
CL
98.Fl ba
99flag that are compatible with
100.Tn SMTP .
101.It Fl bt
8de6f6c6
KM
102Run in address test mode.
103This mode reads addresses and shows the steps in parsing;
104it is used for debugging configuration tables.
b42074ab 105.It Fl bv
8de6f6c6
KM
106Verify names only \- do not try to collect or deliver a message.
107Verify mode is normally used for validating
108users or mailing lists.
b42074ab 109.It Fl C Ns Ar file
8de6f6c6 110Use alternate configuration file.
b42074ab 111.Nm Sendmail
8e8bec7f 112refuses to run as root if an alternate configuration file is specified.
b42074ab 113.It Fl d Ns Ar X
8de6f6c6 114Set debugging value to
b42074ab 115.Ar X .
653ba8b6 116.ne 1i
b42074ab 117.It Fl F Ns Ar fullname
8de6f6c6 118Set the full name of the sender.
b42074ab 119.It Fl f Ns Ar name
8de6f6c6
KM
120Sets the name of the ``from'' person
121(i.e., the sender of the mail).
b42074ab 122.Fl f
8de6f6c6 123can only be used
8e8bec7f
EA
124by ``trusted'' users
125(normally
b42074ab
CL
126.Em root ,
127.Em daemon ,
5412ac7d 128and
b42074ab 129.Em network )
5412ac7d
KM
130or if the person you are trying to become
131is the same as the person you are.
b42074ab 132.It Fl h Ns Ar N
8de6f6c6 133Set the hop count to
b42074ab 134.Ar N .
8de6f6c6
KM
135The hop count is incremented every time the mail is
136processed.
137When it reaches a limit,
138the mail is returned with an error message,
139the victim of an aliasing loop.
8e8bec7f
EA
140If not specified,
141``Received:'' lines in the message are counted.
b42074ab 142.It Fl n
8de6f6c6 143Don't do aliasing.
b42074ab 144.It Fl o Ns Ar x Em value
8de6f6c6 145Set option
b42074ab 146.Ar x
8de6f6c6 147to the specified
b42074ab 148.Em value .
8de6f6c6 149Options are described below.
440394c6
EA
150.It Fl p Ns Ar protocol
151Set the name of the protocol used to receive the message.
152This can be a simple protocol name such as ``UUCP''
153or a protocol and hostname, such as ``UUCP:ucbvax''.
b42074ab 154.It Fl q Ns Bq Ar time
8de6f6c6
KM
155Processed saved messages in the queue at given intervals.
156If
b42074ab 157.Ar time
8de6f6c6
KM
158is omitted,
159process the queue once.
b42074ab 160.Xr Time
8de6f6c6 161is given as a tagged number,
b42074ab
CL
162with
163.Ql s
164being seconds,
165.Ql m
166being minutes,
167.Ql h
168being hours,
169.Ql d
170being days,
8de6f6c6 171and
b42074ab
CL
172.Ql w
173being weeks.
8de6f6c6 174For example,
b42074ab
CL
175.Ql \-q1h30m
176or
177.Ql \-q90m
8de6f6c6 178would both set the timeout to one hour thirty minutes.
8e8bec7f 179If
b42074ab 180.Ar time
8e8bec7f 181is specified,
b42074ab 182.Nm sendmail
8e8bec7f
EA
183will run in background.
184This option can be used safely with
b42074ab
CL
185.Fl bd .
186.It Fl r Ns Ar name
8de6f6c6 187An alternate and obsolete form of the
b42074ab 188.Fl f
8de6f6c6 189flag.
b42074ab 190.It Fl t
8de6f6c6 191Read message for recipients.
8e8bec7f 192To:, Cc:, and Bcc: lines will be scanned for recipient addresses.
8de6f6c6 193The Bcc: line will be deleted before transmission.
8e8bec7f
EA
194Any addresses in the argument list will be suppressed,
195that is,
196they will
b42074ab 197.Em not
8e8bec7f 198receive copies even if listed in the message header.
b42074ab 199.It Fl v
8de6f6c6
KM
200Go into verbose mode.
201Alias expansions will be announced, etc.
1da0f965
EA
202.It Fl X Ar logfile
203Log all traffic in and out of mailers in the indicated log file.
204This should only be used as a last resort
205for debugging mailer bugs.
206It will log a lot of data very quickly.
b42074ab 207.El
7ecdfce3 208.Ss Options
8de6f6c6
KM
209There are also a number of processing options that may be set.
210Normally these will only be used by a system administrator.
211Options may be set either on the command line
212using the
b42074ab 213.Fl o
8de6f6c6
KM
214flag
215or in the configuration file.
ebf4a41a
KB
216This is a partial list;
217for a complete list (and details), consult the
e3f16e5f 218.%T "Sendmail Installation and Operation Guide" .
8de6f6c6 219The options are:
b42074ab
CL
220.Bl -tag -width Fl
221.It Li A Ns Ar file
8de6f6c6 222Use alternate alias file.
ebf4a41a
KB
223.It Li b Ns Ar nblocks
224The minimum number of free blocks needed on the spool filesystem.
b42074ab 225.It Li c
8de6f6c6
KM
226On mailers that are considered ``expensive'' to connect to,
227don't initiate immediate connection.
228This requires queueing.
0f59c44f
EA
229.It Li C Ar N
230Checkpoint the queue file after every
231.Ar N
232successful deliveries (default 10).
233This avoids excessive duplicate deliveries
234when sending to long mailing lists
235interrupted by system crashes.
b42074ab 236.It Li d Ns Ar x
8de6f6c6 237Set the delivery mode to
b42074ab 238.Ar x .
8de6f6c6 239Delivery modes are
b42074ab
CL
240.Ql i
241for interactive (synchronous) delivery,
242.Ql b
243for background (asynchronous) delivery,
8de6f6c6 244and
b42074ab
CL
245.Ql q
246for queue only \- i.e.,
8de6f6c6 247actual delivery is done the next time the queue is run.
b42074ab 248.It Li D
8de6f6c6
KM
249Try to automatically rebuild the alias database
250if necessary.
b42074ab 251.It Li e Ns Ar x
8de6f6c6 252Set error processing to mode
b42074ab 253.Ar x .
8de6f6c6 254Valid modes are
b42074ab
CL
255.Ql m
256to mail back the error message,
257.Ql w
258to ``write'' back the error message
8de6f6c6 259(or mail it back if the sender is not logged in),
b42074ab
CL
260.Ql p
261to print the errors on the terminal
8de6f6c6 262(default),
b42074ab
CL
263.Ql q
264to throw away error messages
8de6f6c6 265(only exit status is returned),
b42074ab
CL
266and
267.Ql e
8de6f6c6
KM
268to do special processing for the BerkNet.
269If the text of the message is not mailed back
270by
b42074ab
CL
271modes
272.Ql m
273or
274.Ql w
8de6f6c6
KM
275and if the sender is local to this machine,
276a copy of the message is appended to the file
b42074ab 277.Pa dead.letter
5412ac7d 278in the sender's home directory.
b42074ab
CL
279.It Li f
280Save
281.Tn UNIX Ns \-style
282From lines at the front of messages.
ebf4a41a
KB
283.It Li G
284Match local mail names against the GECOS portion of the password file.
b42074ab 285.It Li g Ar N
8de6f6c6 286The default group id to use when calling mailers.
b42074ab
CL
287.It Li H Ns Ar file
288The
289.Tn SMTP
290help file.
0f59c44f
EA
291.It Li h Ar N
292The maximum number of times a message is allowed to ``hop''
293before we decide it is in a loop.
b42074ab 294.It Li i
8de6f6c6
KM
295Do not take dots on a line by themselves
296as a message terminator.
ebf4a41a
KB
297.It Li j
298Send error messages in MIME format.
299.It Li K Ns Ar timeout
300Set connection cache timeout.
301.It Li k Ns Ar N
302Set connection cache size.
b42074ab 303.It Li L Ns Ar n
8de6f6c6 304The log level.
ebf4a41a
KB
305.It Li l
306Pay attention to the Errors-To: header.
b42074ab 307.It Li m
8de6f6c6 308Send to ``me'' (the sender) also if I am in an alias expansion.
ebf4a41a
KB
309.It Li n
310Validate the right hand side of aliases during a
311.Xr newaliases 1
312command.
b42074ab 313.It Li o
8de6f6c6
KM
314If set, this message may have
315old style headers.
316If not set,
317this message is guaranteed to have new style headers
318(i.e., commas instead of spaces between addresses).
319If set, an adaptive algorithm is used that will correctly
320determine the header format in most cases.
b42074ab 321.It Li Q Ns Ar queuedir
8de6f6c6 322Select the directory in which to queue messages.
b42074ab 323.It Li S Ns Ar file
8de6f6c6 324Save statistics in the named file.
b42074ab 325.It Li s
8de6f6c6
KM
326Always instantiate the queue file,
327even under circumstances where it is not strictly necessary.
8e8bec7f 328This provides safety against system crashes during delivery.
b42074ab 329.It Li T Ns Ar time
8e8bec7f
EA
330Set the timeout on undelivered messages in the queue to the specified time.
331After delivery has failed
332(e.g., because of a host being down)
333for this amount of time,
334failed messages will be returned to the sender.
8de6f6c6 335The default is three days.
b42074ab 336.It Li t Ns Ar stz , Ar dtz
8de6f6c6 337Set the name of the time zone.
8a12fae4
EA
338.It Li U Ns Ar userdatabase
339If set, a user database is consulted to get forwarding information.
340You can consider this an adjunct to the aliasing mechanism,
341except that the database is intended to be distributed;
342aliases are local to a particular host.
343This may not be available if your sendmail does not have the
a717bd8e
CL
344.Dv USERDB
345option compiled in.
b42074ab 346.It Li u Ns Ar N
8de6f6c6 347Set the default user id for mailers.
ebf4a41a
KB
348.It Li Y
349Fork each job during queue runs.
350May be convenient on memory-poor machines.
351.It Li 7
352Strip incoming messages to seven bits.
b42074ab
CL
353.El
354.Pp
8e8bec7f
EA
355In aliases,
356the first character of a name may be
357a vertical bar to cause interpretation of
358the rest of the name as a command
5412ac7d 359to pipe the mail to.
8e8bec7f 360It may be necessary to quote the name
5412ac7d 361to keep
b42074ab 362.Nm sendmail
5412ac7d 363from suppressing the blanks from between arguments.
8e8bec7f 364For example, a common alias is:
b42074ab
CL
365.Pp
366.Bd -literal -offset indent -compact
367msgs: "|/usr/bin/msgs -s"
368.Ed
369.Pp
370Aliases may also have the syntax
371.Dq :include: Ns Ar filename
8e8bec7f 372to ask
b42074ab 373.Xr sendmail
8e8bec7f
EA
374to read the named file for a list of recipients.
375For example, an alias such as:
b42074ab
CL
376.Pp
377.Bd -literal -offset indent -compact
378poets: ":include:/usr/local/lib/poets.list"
379.Ed
380.Pp
8e8bec7f 381would read
b42074ab 382.Pa /usr/local/lib/poets.list
8e8bec7f 383for the list of addresses making up the group.
b42074ab
CL
384.Pp
385.Nm Sendmail
5412ac7d
KM
386returns an exit status
387describing what it did.
8de6f6c6 388The codes are defined in
b42074ab
CL
389.Aq Pa sysexits.h :
390.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
391.It Dv EX_OK
392Successful completion on all addresses.
393.It Dv EX_NOUSER
394User name not recognized.
395.It Dv EX_UNAVAILABLE
396Catchall meaning necessary resources
5412ac7d 397were not available.
b42074ab
CL
398.It Dv EX_SYNTAX
399Syntax error in address.
400.It Dv EX_SOFTWARE
401Internal software error,
5412ac7d 402including bad arguments.
b42074ab
CL
403.It Dv EX_OSERR
404Temporary operating system error,
405such as
406.Dq cannot fork .
407.It Dv EX_NOHOST
408Host name not recognized.
409.It Dv EX_TEMPFAIL
410Message could not be sent immediately,
8de6f6c6 411but was queued.
b42074ab
CL
412.El
413.Pp
8de6f6c6 414If invoked as
b42074ab
CL
415.Nm newaliases ,
416.Nm sendmail
8de6f6c6
KM
417will rebuild the alias database.
418If invoked as
b42074ab
CL
419.Nm mailq ,
420.Nm sendmail
8de6f6c6 421will print the contents of the mail queue.
b42074ab
CL
422.Sh FILES
423Except for the file
424.Pa /etc/sendmail.cf
425itself,
426the following pathnames are all specified in
427.Pa /etc/sendmail.cf.
8de6f6c6
KM
428Thus,
429these values are only approximations.
b42074ab
CL
430.Pp
431.Bl -tag -width /usr/lib/sendmail.fc -compact
432.It Pa /etc/aliases
433raw data for alias names
ebf4a41a 434.It Pa /etc/aliases.db
b42074ab
CL
435data base of alias names
436.It Pa /etc/sendmail.cf
437configuration file
b42074ab
CL
438.It Pa /etc/sendmail.hf
439help file
440.It Pa /var/log/sendmail.st
441collected statistics
442.It Pa /var/spool/mqueue/*
443temp files
ebf4a41a
KB
444.It Pa /var/run/sendmail.pid
445The process id of the daemon
b42074ab
CL
446.El
447.Sh SEE ALSO
448.Xr binmail 1 ,
449.Xr mail 1 ,
450.Xr rmail 1 ,
451.Xr syslog 3 ,
452.Xr aliases 5 ,
453.Xr mailaddr 7 ,
454.Xr rc 8 ;
455.Pp
456DARPA
457Internet Request For Comments
458.%T RFC819 ,
459.%T RFC821 ,
460.%T RFC822 .
461.Rs
e3f16e5f 462.%T "Sendmail \- An Internetwork Mail Router"
b42074ab
CL
463.%V SMM
464.%N \&No. 9
465.Re
466.Rs
e3f16e5f 467.%T "Sendmail Installation and Operation Guide"
b42074ab
CL
468.%V SMM
469.%N \&No. 8
470.Re
471.Sh HISTORY
472The
473.Nm
474command appeared in
475.Bx 4.2 .