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