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