163861Sbostic.\" Copyright (c) 1988, 1991, 1993
263861Sbostic.\"	The Regents of the University of California.  All rights reserved.
318857Smckusick.\"
443844Strent.\" %sccs.include.redist.man%
518857Smckusick.\"
6*69727Seric.\"     @(#)sendmail.8	8.6 (Berkeley) 05/27/95
735646Sbostic.\"
847470Scael.Dd
947470Scael.Dt SENDMAIL 8
1047470Scael.Os BSD 4
1147470Scael.Sh NAME
1247470Scael.Nm sendmail
1347470Scael.Nd send mail over the internet
1447470Scael.Sh SYNOPSIS
1547470Scael.Nm sendmail
1647470Scael.Op Ar flags
1747470Scael.Op Ar address ...
1847470Scael.Nm newaliases
1947470Scael.Nm mailq
2047470Scael.Op Fl v
2147470Scael.Sh DESCRIPTION
2247470Scael.Nm Sendmail
2328373Sericsends a message to one or more
2447470Scael.Em recipients ,
2518858Smckusickrouting the message over whatever networks
2618857Smckusickare necessary.
2747470Scael.Nm Sendmail
2818858Smckusickdoes internetwork forwarding as necessary
2918858Smckusickto deliver the message to the correct place.
3047470Scael.Pp
3147470Scael.Nm Sendmail
3218857Smckusickis not intended as a user interface routine;
3318858Smckusickother programs provide user-friendly
3418858Smckusickfront ends;
3547470Scael.Nm sendmail
3618858Smckusickis used only to deliver pre-formatted messages.
3747470Scael.Pp
3818858SmckusickWith no flags,
3947470Scael.Nm sendmail
4018857Smckusickreads its standard input
4128373Sericup to an end-of-file
4228373Sericor a line consisting only of a single dot
4328373Sericand sends a copy of the message found there
4418857Smckusickto all of the addresses listed.
4528373SericIt determines the network(s) to use
4618858Smckusickbased on the syntax and contents of the addresses.
4747470Scael.Pp
4818857SmckusickLocal addresses are looked up in a file
4918857Smckusickand aliased appropriately.
5018857SmckusickAliasing can be prevented by preceding the address
5118858Smckusickwith a backslash.
5218857SmckusickNormally the sender is not included in any alias
5318857Smckusickexpansions, e.g.,
5418857Smckusickif `john' sends to `group',
5518857Smckusickand `group' includes `john' in the expansion,
5618857Smckusickthen the letter will not be delivered to `john'.
5763452Seric.Ss Parameters
5847470Scael.Bl -tag -width Fl
5959099Seric.It Fl B Ns Ar type
6059099SericSet the body type to
6159099Seric.Ar type .
6259099SericCurrent legal values
6359099Seric.Li 7BIT
6459099Sericor
6559099Seric.Li 8BITMIME .
6647470Scael.It Fl ba
6747470ScaelGo into
6847470Scael.Tn ARPANET
6947470Scaelmode.
7018858SmckusickAll input lines must end with a CR-LF,
7118858Smckusickand all messages will be generated with a CR-LF at the end.
7218858SmckusickAlso,
7318858Smckusickthe ``From:'' and ``Sender:''
7418858Smckusickfields are examined for the name of the sender.
7547470Scael.It Fl bd
7647470ScaelRun as a daemon.  This requires Berkeley
7747470Scael.Tn IPC .
7847470Scael.Nm Sendmail
7928373Sericwill fork and run in background
8047470Scaellistening on socket 25 for incoming
8147470Scael.Tn SMTP
8247470Scaelconnections.
8328373SericThis is normally run from
8447470Scael.Pa /etc/rc .
8547470Scael.It Fl bi
8618858SmckusickInitialize the alias database.
8747470Scael.It Fl bm
8818858SmckusickDeliver mail in the usual way (default).
8947470Scael.It Fl bp
9018858SmckusickPrint a listing of the queue.
9147470Scael.It Fl bs
9247470ScaelUse the
9347470Scael.Tn SMTP
9447470Scaelprotocol as described in
9547470Scael.Tn RFC821
9628373Sericon standard input and output.
9718858SmckusickThis flag implies all the operations of the
9847470Scael.Fl ba
9947470Scaelflag that are compatible with
10047470Scael.Tn SMTP .
10147470Scael.It Fl bt
10218858SmckusickRun in address test mode.
10318858SmckusickThis mode reads addresses and shows the steps in parsing;
10418858Smckusickit is used for debugging configuration tables.
10547470Scael.It Fl bv
10618858SmckusickVerify names only \- do not try to collect or deliver a message.
10718858SmckusickVerify mode is normally used for validating
10818858Smckusickusers or mailing lists.
10947470Scael.It Fl C Ns Ar file
11018858SmckusickUse alternate configuration file.
11147470Scael.Nm Sendmail
11228373Sericrefuses to run as root if an alternate configuration file is specified.
11347470Scael.It Fl d Ns Ar X
11418858SmckusickSet debugging value to
11547470Scael.Ar X .
11665104Smckusick.ne 1i
11747470Scael.It Fl F Ns Ar fullname
11818858SmckusickSet the full name of the sender.
11947470Scael.It Fl f Ns Ar name
12018858SmckusickSets the name of the ``from'' person
12118858Smckusick(i.e., the sender of the mail).
12247470Scael.Fl f
12318858Smckusickcan only be used
12428373Sericby ``trusted'' users
12528373Seric(normally
12647470Scael.Em root ,
12747470Scael.Em daemon ,
12818857Smckusickand
12947470Scael.Em network )
13018857Smckusickor if the person you are trying to become
13118857Smckusickis the same as the person you are.
13247470Scael.It Fl h Ns Ar N
13318858SmckusickSet the hop count to
13447470Scael.Ar N .
13518858SmckusickThe hop count is incremented every time the mail is
13618858Smckusickprocessed.
13718858SmckusickWhen it reaches a limit,
13818858Smckusickthe mail is returned with an error message,
13918858Smckusickthe victim of an aliasing loop.
14028373SericIf not specified,
14128373Seric``Received:'' lines in the message are counted.
14247470Scael.It Fl n
14318858SmckusickDon't do aliasing.
14447470Scael.It Fl o Ns Ar x Em value
14518858SmckusickSet option
14647470Scael.Ar x
14718858Smckusickto the specified
14847470Scael.Em value .
14918858SmckusickOptions are described below.
15057141Seric.It Fl p Ns Ar protocol
15157141SericSet the name of the protocol used to receive the message.
15257141SericThis can be a simple protocol name such as ``UUCP''
15357141Sericor a protocol and hostname, such as ``UUCP:ucbvax''.
15447470Scael.It Fl q Ns Bq Ar time
15518858SmckusickProcessed saved messages in the queue at given intervals.
15618858SmckusickIf
15747470Scael.Ar time
15818858Smckusickis omitted,
15918858Smckusickprocess the queue once.
16047470Scael.Xr Time
16118858Smckusickis given as a tagged number,
16247470Scaelwith
16347470Scael.Ql s
16447470Scaelbeing seconds,
16547470Scael.Ql m
16647470Scaelbeing minutes,
16747470Scael.Ql h
16847470Scaelbeing hours,
16947470Scael.Ql d
17047470Scaelbeing days,
17118858Smckusickand
17247470Scael.Ql w
17347470Scaelbeing weeks.
17418858SmckusickFor example,
17547470Scael.Ql \-q1h30m
17647470Scaelor
17747470Scael.Ql \-q90m
17818858Smckusickwould both set the timeout to one hour thirty minutes.
17928373SericIf
18047470Scael.Ar time
18128373Sericis specified,
18247470Scael.Nm sendmail
18328373Sericwill run in background.
18428373SericThis option can be used safely with
18547470Scael.Fl bd .
186*69727Seric.It Fl qI Ns Ar substr
187*69727SericLimit processed jobs to those containing
188*69727Seric.Ar substr
189*69727Sericas a substring of the queue id.
190*69727Seric.It Fl qR Ns Ar substr
191*69727SericLimit processed jobs to those containing
192*69727Seric.Ar substr
193*69727Sericas a substring of one of the recipients.
194*69727Seric.It Fl qS Ns Ar substr
195*69727SericLimit processed jobs to those containing
196*69727Seric.Ar substr
197*69727Sericas a substring of the sender.
19847470Scael.It Fl r Ns Ar name
19918858SmckusickAn alternate and obsolete form of the
20047470Scael.Fl f
20118858Smckusickflag.
20247470Scael.It Fl t
20318858SmckusickRead message for recipients.
20428373SericTo:, Cc:, and Bcc: lines will be scanned for recipient addresses.
20518858SmckusickThe Bcc: line will be deleted before transmission.
20628373SericAny addresses in the argument list will be suppressed,
20728373Sericthat is,
20828373Sericthey will
20947470Scael.Em not
21028373Sericreceive copies even if listed in the message header.
21147470Scael.It Fl v
21218858SmckusickGo into verbose mode.
21318858SmckusickAlias expansions will be announced, etc.
21463862Seric.It Fl X Ar logfile
21563862SericLog all traffic in and out of mailers in the indicated log file.
21663862SericThis should only be used as a last resort
21763862Sericfor debugging mailer bugs.
21863862SericIt will log a lot of data very quickly.
21947470Scael.El
22063452Seric.Ss Options
22118858SmckusickThere are also a number of processing options that may be set.
22218858SmckusickNormally these will only be used by a system administrator.
22318858SmckusickOptions may be set either on the command line
22418858Smckusickusing the
22547470Scael.Fl o
22618858Smckusickflag
22718858Smckusickor in the configuration file.
22863451SbosticThis is a partial list;
22963451Sbosticfor a complete list (and details), consult the
23048584Scael.%T "Sendmail Installation and Operation Guide" .
23118858SmckusickThe options are:
23247470Scael.Bl -tag -width Fl
23347470Scael.It Li A Ns Ar file
23418858SmckusickUse alternate alias file.
23563451Sbostic.It Li b Ns Ar nblocks
23663451SbosticThe minimum number of free blocks needed on the spool filesystem.
23747470Scael.It Li c
23818858SmckusickOn mailers that are considered ``expensive'' to connect to,
23918858Smckusickdon't initiate immediate connection.
24018858SmckusickThis requires queueing.
24151305Seric.It Li C Ar N
24251305SericCheckpoint the queue file after every
24351305Seric.Ar N
24451305Sericsuccessful deliveries (default 10).
24551305SericThis avoids excessive duplicate deliveries
24651305Sericwhen sending to long mailing lists
24751305Sericinterrupted by system crashes.
24867332Sah.ne 1i
24947470Scael.It Li d Ns Ar x
25018858SmckusickSet the delivery mode to
25147470Scael.Ar x .
25218858SmckusickDelivery modes are
25347470Scael.Ql i
25447470Scaelfor interactive (synchronous) delivery,
25547470Scael.Ql b
25647470Scaelfor background (asynchronous) delivery,
25718858Smckusickand
25847470Scael.Ql q
25947470Scaelfor queue only \- i.e.,
26018858Smckusickactual delivery is done the next time the queue is run.
26147470Scael.It Li D
26218858SmckusickTry to automatically rebuild the alias database
26318858Smckusickif necessary.
26447470Scael.It Li e Ns Ar x
26518858SmckusickSet error processing to mode
26647470Scael.Ar x .
26718858SmckusickValid modes are
26847470Scael.Ql m
26947470Scaelto mail back the error message,
27047470Scael.Ql w
27147470Scaelto ``write'' back the error message
27218858Smckusick(or mail it back if the sender is not logged in),
27347470Scael.Ql p
27447470Scaelto print the errors on the terminal
27518858Smckusick(default),
27647470Scael.Ql q
27747470Scaelto throw away error messages
27818858Smckusick(only exit status is returned),
27947470Scaeland
28047470Scael.Ql e
28118858Smckusickto do special processing for the BerkNet.
28218858SmckusickIf the text of the message is not mailed back
28318858Smckusickby
28447470Scaelmodes
28547470Scael.Ql m
28647470Scaelor
28747470Scael.Ql w
28818858Smckusickand if the sender is local to this machine,
28918858Smckusicka copy of the message is appended to the file
29047470Scael.Pa dead.letter
29118857Smckusickin the sender's home directory.
29247470Scael.It Li f
29347470ScaelSave
29447470Scael.Tn UNIX Ns \-style
29547470ScaelFrom lines at the front of messages.
29663451Sbostic.It Li G
29763451SbosticMatch local mail names against the GECOS portion of the password file.
29847470Scael.It Li g Ar N
29918858SmckusickThe default group id to use when calling mailers.
30047470Scael.It Li H Ns Ar file
30147470ScaelThe
30247470Scael.Tn SMTP
30347470Scaelhelp file.
30451305Seric.It Li h Ar N
30551305SericThe maximum number of times a message is allowed to ``hop''
30651305Sericbefore we decide it is in a loop.
30747470Scael.It Li i
30818858SmckusickDo not take dots on a line by themselves
30918858Smckusickas a message terminator.
31063451Sbostic.It Li j
31163451SbosticSend error messages in MIME format.
31263451Sbostic.It Li K Ns Ar timeout
31363451SbosticSet connection cache timeout.
31463451Sbostic.It Li k Ns Ar N
31563451SbosticSet connection cache size.
31647470Scael.It Li L Ns Ar n
31718858SmckusickThe log level.
31863451Sbostic.It Li l
31963451SbosticPay attention to the Errors-To: header.
32047470Scael.It Li m
32118858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion.
32263451Sbostic.It Li n
32363451SbosticValidate the right hand side of aliases during a
32463451Sbostic.Xr newaliases 1
32563451Sbosticcommand.
32647470Scael.It Li o
32718858SmckusickIf set, this message may have
32818858Smckusickold style headers.
32918858SmckusickIf not set,
33018858Smckusickthis message is guaranteed to have new style headers
33118858Smckusick(i.e., commas instead of spaces between addresses).
33218858SmckusickIf set, an adaptive algorithm is used that will correctly
33318858Smckusickdetermine the header format in most cases.
33447470Scael.It Li Q Ns Ar queuedir
33518858SmckusickSelect the directory in which to queue messages.
33647470Scael.It Li S Ns Ar file
33718858SmckusickSave statistics in the named file.
33847470Scael.It Li s
33918858SmckusickAlways instantiate the queue file,
34018858Smckusickeven under circumstances where it is not strictly necessary.
34128373SericThis provides safety against system crashes during delivery.
34247470Scael.It Li T Ns Ar time
34328373SericSet the timeout on undelivered messages in the queue to the specified time.
34428373SericAfter delivery has failed
34528373Seric(e.g., because of a host being down)
34628373Sericfor this amount of time,
34728373Sericfailed messages will be returned to the sender.
34818858SmckusickThe default is three days.
34947470Scael.It Li t Ns Ar stz , Ar dtz
35018858SmckusickSet the name of the time zone.
35150556Seric.It Li U Ns Ar userdatabase
35250556SericIf set, a user database is consulted to get forwarding information.
35350556SericYou can consider this an adjunct to the aliasing mechanism,
35450556Sericexcept that the database is intended to be distributed;
35550556Sericaliases are local to a particular host.
35650556SericThis may not be available if your sendmail does not have the
35750769Scael.Dv USERDB
35850769Scaeloption compiled in.
35947470Scael.It Li u Ns Ar N
36018858SmckusickSet the default user id for mailers.
36163451Sbostic.It Li Y
36263451SbosticFork each job during queue runs.
36363451SbosticMay be convenient on memory-poor machines.
36463451Sbostic.It Li 7
36563451SbosticStrip incoming messages to seven bits.
36647470Scael.El
36747470Scael.Pp
36828373SericIn aliases,
36928373Sericthe first character of a name may be
37028373Serica vertical bar to cause interpretation of
37128373Sericthe rest of the name as a command
37218857Smckusickto pipe the mail to.
37328373SericIt may be necessary to quote the name
37418857Smckusickto keep
37547470Scael.Nm sendmail
37618857Smckusickfrom suppressing the blanks from between arguments.
37728373SericFor example, a common alias is:
37847470Scael.Pp
37947470Scael.Bd -literal -offset indent -compact
38047470Scaelmsgs: "|/usr/bin/msgs -s"
38147470Scael.Ed
38247470Scael.Pp
38347470ScaelAliases may also have the syntax
38447470Scael.Dq :include: Ns Ar filename
38528373Sericto ask
38647470Scael.Xr sendmail
38728373Sericto read the named file for a list of recipients.
38828373SericFor example, an alias such as:
38947470Scael.Pp
39047470Scael.Bd -literal -offset indent -compact
39147470Scaelpoets: ":include:/usr/local/lib/poets.list"
39247470Scael.Ed
39347470Scael.Pp
39428373Sericwould read
39547470Scael.Pa /usr/local/lib/poets.list
39628373Sericfor the list of addresses making up the group.
39747470Scael.Pp
39847470Scael.Nm Sendmail
39918857Smckusickreturns an exit status
40018857Smckusickdescribing what it did.
40118858SmckusickThe codes are defined in
40247470Scael.Aq Pa sysexits.h :
40347470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
40447470Scael.It Dv EX_OK
40547470ScaelSuccessful completion on all addresses.
40647470Scael.It Dv EX_NOUSER
40747470ScaelUser name not recognized.
40847470Scael.It Dv EX_UNAVAILABLE
40947470ScaelCatchall meaning necessary resources
41018857Smckusickwere not available.
41147470Scael.It Dv EX_SYNTAX
41247470ScaelSyntax error in address.
41347470Scael.It Dv EX_SOFTWARE
41447470ScaelInternal software error,
41518857Smckusickincluding bad arguments.
41647470Scael.It Dv EX_OSERR
41747470ScaelTemporary operating system error,
41847470Scaelsuch as
41947470Scael.Dq cannot fork .
42047470Scael.It Dv EX_NOHOST
42147470ScaelHost name not recognized.
42247470Scael.It Dv EX_TEMPFAIL
42347470ScaelMessage could not be sent immediately,
42418858Smckusickbut was queued.
42547470Scael.El
42647470Scael.Pp
42718858SmckusickIf invoked as
42847470Scael.Nm newaliases ,
42947470Scael.Nm sendmail
43018858Smckusickwill rebuild the alias database.
43118858SmckusickIf invoked as
43247470Scael.Nm mailq ,
43347470Scael.Nm sendmail
43418858Smckusickwill print the contents of the mail queue.
43547470Scael.Sh FILES
43647470ScaelExcept for the file
43747470Scael.Pa /etc/sendmail.cf
43847470Scaelitself,
43947470Scaelthe following pathnames are all specified in
44047470Scael.Pa /etc/sendmail.cf.
44118858SmckusickThus,
44218858Smckusickthese values are only approximations.
44347470Scael.Pp
44447470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact
44547470Scael.It Pa /etc/aliases
44647470Scaelraw data for alias names
44763451Sbostic.It Pa /etc/aliases.db
44847470Scaeldata base of alias names
44947470Scael.It Pa /etc/sendmail.cf
45047470Scaelconfiguration file
45147470Scael.It Pa /etc/sendmail.hf
45247470Scaelhelp file
45347470Scael.It Pa /var/log/sendmail.st
45447470Scaelcollected statistics
45547470Scael.It Pa /var/spool/mqueue/*
45647470Scaeltemp files
45763451Sbostic.It Pa /var/run/sendmail.pid
45863451SbosticThe process id of the daemon
45947470Scael.El
46047470Scael.Sh SEE ALSO
46147470Scael.Xr binmail 1 ,
46247470Scael.Xr mail 1 ,
46347470Scael.Xr rmail 1 ,
46447470Scael.Xr syslog 3 ,
46547470Scael.Xr aliases 5 ,
46647470Scael.Xr mailaddr 7 ,
46747470Scael.Xr rc 8 ;
46847470Scael.Pp
46947470ScaelDARPA
47047470ScaelInternet Request For Comments
47147470Scael.%T RFC819 ,
47247470Scael.%T RFC821 ,
47347470Scael.%T RFC822 .
47447470Scael.Rs
47548584Scael.%T "Sendmail \- An Internetwork Mail Router"
47647470Scael.%V SMM
47747470Scael.%N \&No. 9
47847470Scael.Re
47947470Scael.Rs
48048584Scael.%T "Sendmail Installation and Operation Guide"
48147470Scael.%V SMM
48247470Scael.%N \&No. 8
48347470Scael.Re
48447470Scael.Sh HISTORY
48547470ScaelThe
48647470Scael.Nm
48747470Scaelcommand appeared in
48847470Scael.Bx 4.2 .
489