This commit was generated by cvs2svn to track changes on a CVS vendor
[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.\"
6f14531a 32.\" @(#)sendmail.8 8.1 (Berkeley) 6/16/93
15637ed4 33.\"
6f14531a 34.Dd June 16, 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.
135.It Fl bz
136Create the configuration freeze file.
137.It Fl C Ns Ar file
138Use alternate configuration file.
139.Nm Sendmail
140refuses to run as root if an alternate configuration file is specified.
141The frozen configuration file is bypassed.
142.It Fl d Ns Ar X
143Set debugging value to
144.Ar X .
145.It Fl F Ns Ar fullname
146Set the full name of the sender.
147.It Fl f Ns Ar name
148Sets the name of the ``from'' person
149(i.e., the sender of the mail).
150.Fl f
151can only be used
152by ``trusted'' users
153(normally
154.Em root ,
155.Em daemon ,
156and
157.Em network )
158or if the person you are trying to become
159is the same as the person you are.
160.It Fl h Ns Ar N
161Set the hop count to
162.Ar N .
163The hop count is incremented every time the mail is
164processed.
165When it reaches a limit,
166the mail is returned with an error message,
167the victim of an aliasing loop.
168If not specified,
169``Received:'' lines in the message are counted.
170.It Fl n
171Don't do aliasing.
172.It Fl o Ns Ar x Em value
173Set option
174.Ar x
175to the specified
176.Em value .
177Options are described below.
6f14531a
RG
178.It Fl p Ns Ar protocol
179Set the name of the protocol used to receive the message.
180This can be a simple protocol name such as ``UUCP''
181or a protocol and hostname, such as ``UUCP:ucbvax''.
15637ed4
RG
182.It Fl q Ns Bq Ar time
183Processed saved messages in the queue at given intervals.
184If
185.Ar time
186is omitted,
187process the queue once.
188.Xr Time
189is given as a tagged number,
190with
191.Ql s
192being seconds,
193.Ql m
194being minutes,
195.Ql h
196being hours,
197.Ql d
198being days,
199and
200.Ql w
201being weeks.
202For example,
203.Ql \-q1h30m
204or
205.Ql \-q90m
206would both set the timeout to one hour thirty minutes.
207If
208.Ar time
209is specified,
210.Nm sendmail
211will run in background.
212This option can be used safely with
213.Fl bd .
214.It Fl r Ns Ar name
215An alternate and obsolete form of the
216.Fl f
217flag.
218.It Fl t
219Read message for recipients.
220To:, Cc:, and Bcc: lines will be scanned for recipient addresses.
221The Bcc: line will be deleted before transmission.
222Any addresses in the argument list will be suppressed,
223that is,
224they will
225.Em not
226receive copies even if listed in the message header.
227.It Fl v
228Go into verbose mode.
229Alias expansions will be announced, etc.
230.El
6f14531a 231.Ss Options
15637ed4
RG
232There are also a number of processing options that may be set.
233Normally these will only be used by a system administrator.
234Options may be set either on the command line
235using the
236.Fl o
237flag
238or in the configuration file.
6f14531a
RG
239This is a partial list;
240for a complete list (and details), consult the
15637ed4
RG
241.%T "Sendmail Installation and Operation Guide" .
242The options are:
243.Bl -tag -width Fl
244.It Li A Ns Ar file
245Use alternate alias file.
6f14531a
RG
246.It Li b Ns Ar nblocks
247The minimum number of free blocks needed on the spool filesystem.
15637ed4
RG
248.It Li c
249On mailers that are considered ``expensive'' to connect to,
250don't initiate immediate connection.
251This requires queueing.
6f14531a
RG
252.It Li C Ar N
253Checkpoint the queue file after every
254.Ar N
255successful deliveries (default 10).
256This avoids excessive duplicate deliveries
257when sending to long mailing lists
258interrupted by system crashes.
15637ed4
RG
259.It Li d Ns Ar x
260Set the delivery mode to
261.Ar x .
262Delivery modes are
263.Ql i
264for interactive (synchronous) delivery,
265.Ql b
266for background (asynchronous) delivery,
267and
268.Ql q
269for queue only \- i.e.,
270actual delivery is done the next time the queue is run.
271.It Li D
272Try to automatically rebuild the alias database
273if necessary.
274.It Li e Ns Ar x
275Set error processing to mode
276.Ar x .
277Valid modes are
278.Ql m
279to mail back the error message,
280.Ql w
281to ``write'' back the error message
282(or mail it back if the sender is not logged in),
283.Ql p
284to print the errors on the terminal
285(default),
286.Ql q
287to throw away error messages
288(only exit status is returned),
289and
290.Ql e
291to do special processing for the BerkNet.
292If the text of the message is not mailed back
293by
294modes
295.Ql m
296or
297.Ql w
298and if the sender is local to this machine,
299a copy of the message is appended to the file
300.Pa dead.letter
301in the sender's home directory.
15637ed4
RG
302.It Li f
303Save
304.Tn UNIX Ns \-style
305From lines at the front of messages.
6f14531a
RG
306.It Li G
307Match local mail names against the GECOS portion of the password file.
15637ed4
RG
308.It Li g Ar N
309The default group id to use when calling mailers.
310.It Li H Ns Ar file
311The
312.Tn SMTP
313help file.
6f14531a
RG
314.It Li h Ar N
315The maximum number of times a message is allowed to ``hop''
316before we decide it is in a loop.
15637ed4
RG
317.It Li i
318Do not take dots on a line by themselves
319as a message terminator.
6f14531a
RG
320.It Li j
321Send error messages in MIME format.
322.It Li K Ns Ar timeout
323Set connection cache timeout.
324.It Li k Ns Ar N
325Set connection cache size.
15637ed4
RG
326.It Li L Ns Ar n
327The log level.
6f14531a
RG
328.It Li l
329Pay attention to the Errors-To: header.
15637ed4
RG
330.It Li m
331Send to ``me'' (the sender) also if I am in an alias expansion.
6f14531a
RG
332.It Li n
333Validate the right hand side of aliases during a
334.Xr newaliases 1
335command.
15637ed4
RG
336.It Li o
337If set, this message may have
338old style headers.
339If not set,
340this message is guaranteed to have new style headers
341(i.e., commas instead of spaces between addresses).
342If set, an adaptive algorithm is used that will correctly
343determine the header format in most cases.
344.It Li Q Ns Ar queuedir
345Select the directory in which to queue messages.
15637ed4
RG
346.It Li S Ns Ar file
347Save statistics in the named file.
348.It Li s
349Always instantiate the queue file,
350even under circumstances where it is not strictly necessary.
351This provides safety against system crashes during delivery.
352.It Li T Ns Ar time
353Set the timeout on undelivered messages in the queue to the specified time.
354After delivery has failed
355(e.g., because of a host being down)
356for this amount of time,
357failed messages will be returned to the sender.
358The default is three days.
359.It Li t Ns Ar stz , Ar dtz
360Set the name of the time zone.
361.It Li U Ns Ar userdatabase
362If set, a user database is consulted to get forwarding information.
363You can consider this an adjunct to the aliasing mechanism,
364except that the database is intended to be distributed;
365aliases are local to a particular host.
366This may not be available if your sendmail does not have the
367.Dv USERDB
368option compiled in.
369.It Li u Ns Ar N
370Set the default user id for mailers.
6f14531a
RG
371.It Li Y
372Fork each job during queue runs.
373May be convenient on memory-poor machines.
374.It Li 7
375Strip incoming messages to seven bits.
15637ed4
RG
376.El
377.Pp
378In aliases,
379the first character of a name may be
380a vertical bar to cause interpretation of
381the rest of the name as a command
382to pipe the mail to.
383It may be necessary to quote the name
384to keep
385.Nm sendmail
386from suppressing the blanks from between arguments.
387For example, a common alias is:
388.Pp
389.Bd -literal -offset indent -compact
390msgs: "|/usr/bin/msgs -s"
391.Ed
392.Pp
393Aliases may also have the syntax
394.Dq :include: Ns Ar filename
395to ask
396.Xr sendmail
397to read the named file for a list of recipients.
398For example, an alias such as:
399.Pp
400.Bd -literal -offset indent -compact
401poets: ":include:/usr/local/lib/poets.list"
402.Ed
403.Pp
404would read
405.Pa /usr/local/lib/poets.list
406for the list of addresses making up the group.
407.Pp
408.Nm Sendmail
409returns an exit status
410describing what it did.
411The codes are defined in
412.Aq Pa sysexits.h :
413.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
414.It Dv EX_OK
415Successful completion on all addresses.
416.It Dv EX_NOUSER
417User name not recognized.
418.It Dv EX_UNAVAILABLE
419Catchall meaning necessary resources
420were not available.
421.It Dv EX_SYNTAX
422Syntax error in address.
423.It Dv EX_SOFTWARE
424Internal software error,
425including bad arguments.
426.It Dv EX_OSERR
427Temporary operating system error,
428such as
429.Dq cannot fork .
430.It Dv EX_NOHOST
431Host name not recognized.
432.It Dv EX_TEMPFAIL
433Message could not be sent immediately,
434but was queued.
435.El
436.Pp
437If invoked as
438.Nm newaliases ,
439.Nm sendmail
440will rebuild the alias database.
441If invoked as
442.Nm mailq ,
443.Nm sendmail
444will print the contents of the mail queue.
445.Sh FILES
446Except for the file
447.Pa /etc/sendmail.cf
448itself,
449the following pathnames are all specified in
450.Pa /etc/sendmail.cf.
451Thus,
452these values are only approximations.
453.Pp
454.Bl -tag -width /usr/lib/sendmail.fc -compact
455.It Pa /etc/aliases
456raw data for alias names
6f14531a 457.It Pa /etc/aliases.db
15637ed4
RG
458data base of alias names
459.It Pa /etc/sendmail.cf
460configuration file
461.It Pa /etc/sendmail.fc
462frozen configuration
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
489.%N \&No. 16
490.Re
491.Rs
492.%T "Sendmail Installation and Operation Guide"
493.%V SMM
494.%N \&No. 7
495.Re
496.Sh HISTORY
497The
498.Nm
499command appeared in
500.Bx 4.2 .