147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California.
235646Sbostic.\" All rights reserved.
318857Smckusick.\"
443844Strent.\" %sccs.include.redist.man%
518857Smckusick.\"
6*50537Seric.\"     @(#)sendmail.8	6.8 (Berkeley) 07/25/91
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'.
5747470Scael.Pp
5818858SmckusickFlags are:
5947470Scael.Bl -tag -width Fl
6047470Scael.It Fl ba
6147470ScaelGo into
6247470Scael.Tn ARPANET
6347470Scaelmode.
6418858SmckusickAll input lines must end with a CR-LF,
6518858Smckusickand all messages will be generated with a CR-LF at the end.
6618858SmckusickAlso,
6718858Smckusickthe ``From:'' and ``Sender:''
6818858Smckusickfields are examined for the name of the sender.
6947470Scael.It Fl bd
7047470ScaelRun as a daemon.  This requires Berkeley
7147470Scael.Tn IPC .
7247470Scael.Nm Sendmail
7328373Sericwill fork and run in background
7447470Scaellistening on socket 25 for incoming
7547470Scael.Tn SMTP
7647470Scaelconnections.
7728373SericThis is normally run from
7847470Scael.Pa /etc/rc .
7947470Scael.It Fl bi
8018858SmckusickInitialize the alias database.
8147470Scael.It Fl bm
8218858SmckusickDeliver mail in the usual way (default).
8347470Scael.It Fl bp
8418858SmckusickPrint a listing of the queue.
8547470Scael.It Fl bs
8647470ScaelUse the
8747470Scael.Tn SMTP
8847470Scaelprotocol as described in
8947470Scael.Tn RFC821
9028373Sericon standard input and output.
9118858SmckusickThis flag implies all the operations of the
9247470Scael.Fl ba
9347470Scaelflag that are compatible with
9447470Scael.Tn SMTP .
9547470Scael.It Fl bt
9618858SmckusickRun in address test mode.
9718858SmckusickThis mode reads addresses and shows the steps in parsing;
9818858Smckusickit is used for debugging configuration tables.
9947470Scael.It Fl bv
10018858SmckusickVerify names only \- do not try to collect or deliver a message.
10118858SmckusickVerify mode is normally used for validating
10218858Smckusickusers or mailing lists.
10347470Scael.It Fl bz
10418858SmckusickCreate the configuration freeze file.
10547470Scael.It Fl C Ns Ar file
10618858SmckusickUse alternate configuration file.
10747470Scael.Nm Sendmail
10828373Sericrefuses to run as root if an alternate configuration file is specified.
10928373SericThe frozen configuration file is bypassed.
11047470Scael.It Fl d Ns Ar X
11118858SmckusickSet debugging value to
11247470Scael.Ar X .
11347470Scael.It Fl F Ns Ar fullname
11418858SmckusickSet the full name of the sender.
11547470Scael.It Fl f Ns Ar name
11618858SmckusickSets the name of the ``from'' person
11718858Smckusick(i.e., the sender of the mail).
11847470Scael.Fl f
11918858Smckusickcan only be used
12028373Sericby ``trusted'' users
12128373Seric(normally
12247470Scael.Em root ,
12347470Scael.Em daemon ,
12418857Smckusickand
12547470Scael.Em network )
12618857Smckusickor if the person you are trying to become
12718857Smckusickis the same as the person you are.
12847470Scael.It Fl h Ns Ar N
12918858SmckusickSet the hop count to
13047470Scael.Ar N .
13118858SmckusickThe hop count is incremented every time the mail is
13218858Smckusickprocessed.
13318858SmckusickWhen it reaches a limit,
13418858Smckusickthe mail is returned with an error message,
13518858Smckusickthe victim of an aliasing loop.
13628373SericIf not specified,
13728373Seric``Received:'' lines in the message are counted.
13847470Scael.It Fl n
13918858SmckusickDon't do aliasing.
14047470Scael.It Fl o Ns Ar x Em value
14118858SmckusickSet option
14247470Scael.Ar x
14318858Smckusickto the specified
14447470Scael.Em value .
14518858SmckusickOptions are described below.
14647470Scael.It Fl q Ns Bq Ar time
14718858SmckusickProcessed saved messages in the queue at given intervals.
14818858SmckusickIf
14947470Scael.Ar time
15018858Smckusickis omitted,
15118858Smckusickprocess the queue once.
15247470Scael.Xr Time
15318858Smckusickis given as a tagged number,
15447470Scaelwith
15547470Scael.Ql s
15647470Scaelbeing seconds,
15747470Scael.Ql m
15847470Scaelbeing minutes,
15947470Scael.Ql h
16047470Scaelbeing hours,
16147470Scael.Ql d
16247470Scaelbeing days,
16318858Smckusickand
16447470Scael.Ql w
16547470Scaelbeing weeks.
16618858SmckusickFor example,
16747470Scael.Ql \-q1h30m
16847470Scaelor
16947470Scael.Ql \-q90m
17018858Smckusickwould both set the timeout to one hour thirty minutes.
17128373SericIf
17247470Scael.Ar time
17328373Sericis specified,
17447470Scael.Nm sendmail
17528373Sericwill run in background.
17628373SericThis option can be used safely with
17747470Scael.Fl bd .
17847470Scael.It Fl r Ns Ar name
17918858SmckusickAn alternate and obsolete form of the
18047470Scael.Fl f
18118858Smckusickflag.
18247470Scael.It Fl t
18318858SmckusickRead message for recipients.
18428373SericTo:, Cc:, and Bcc: lines will be scanned for recipient addresses.
18518858SmckusickThe Bcc: line will be deleted before transmission.
18628373SericAny addresses in the argument list will be suppressed,
18728373Sericthat is,
18828373Sericthey will
18947470Scael.Em not
19028373Sericreceive copies even if listed in the message header.
19147470Scael.It Fl v
19218858SmckusickGo into verbose mode.
19318858SmckusickAlias expansions will be announced, etc.
19447470Scael.El
19547470Scael.Pp
19618858SmckusickThere are also a number of processing options that may be set.
19718858SmckusickNormally these will only be used by a system administrator.
19818858SmckusickOptions may be set either on the command line
19918858Smckusickusing the
20047470Scael.Fl o
20118858Smckusickflag
20218858Smckusickor in the configuration file.
20318858SmckusickThese are described in detail in the
20448584Scael.%T "Sendmail Installation and Operation Guide" .
20518858SmckusickThe options are:
20647470Scael.Bl -tag -width Fl
20747470Scael.It Li A Ns Ar file
20818858SmckusickUse alternate alias file.
20947470Scael.It Li c
21018858SmckusickOn mailers that are considered ``expensive'' to connect to,
21118858Smckusickdon't initiate immediate connection.
21218858SmckusickThis requires queueing.
21347470Scael.It Li d Ns Ar x
21418858SmckusickSet the delivery mode to
21547470Scael.Ar x .
21618858SmckusickDelivery modes are
21747470Scael.Ql i
21847470Scaelfor interactive (synchronous) delivery,
21947470Scael.Ql b
22047470Scaelfor background (asynchronous) delivery,
22118858Smckusickand
22247470Scael.Ql q
22347470Scaelfor queue only \- i.e.,
22418858Smckusickactual delivery is done the next time the queue is run.
22547470Scael.It Li D
22618858SmckusickTry to automatically rebuild the alias database
22718858Smckusickif necessary.
22847470Scael.It Li e Ns Ar x
22918858SmckusickSet error processing to mode
23047470Scael.Ar x .
23118858SmckusickValid modes are
23247470Scael.Ql m
23347470Scaelto mail back the error message,
23447470Scael.Ql w
23547470Scaelto ``write'' back the error message
23618858Smckusick(or mail it back if the sender is not logged in),
23747470Scael.Ql p
23847470Scaelto print the errors on the terminal
23918858Smckusick(default),
24047470Scael.Ql q
24147470Scaelto throw away error messages
24218858Smckusick(only exit status is returned),
24347470Scaeland
24447470Scael.Ql e
24518858Smckusickto do special processing for the BerkNet.
24618858SmckusickIf the text of the message is not mailed back
24718858Smckusickby
24847470Scaelmodes
24947470Scael.Ql m
25047470Scaelor
25147470Scael.Ql w
25218858Smckusickand if the sender is local to this machine,
25318858Smckusicka copy of the message is appended to the file
25447470Scael.Pa dead.letter
25518857Smckusickin the sender's home directory.
25647470Scael.It Li F Ns Ar mode
25718858SmckusickThe mode to use when creating temporary files.
25847470Scael.It Li f
25947470ScaelSave
26047470Scael.Tn UNIX Ns \-style
26147470ScaelFrom lines at the front of messages.
26247470Scael.It Li g Ar N
26318858SmckusickThe default group id to use when calling mailers.
26447470Scael.It Li H Ns Ar file
26547470ScaelThe
26647470Scael.Tn SMTP
26747470Scaelhelp file.
26847470Scael.It Li i
26918858SmckusickDo not take dots on a line by themselves
27018858Smckusickas a message terminator.
271*50537Seric.It Li k Ar N
272*50537SericCheckpoint the queue file after every
273*50537Seric.Ar N
274*50537Sericsuccessful deliveries (default 10).
275*50537SericThis avoids excessive duplicate deliveries
276*50537Sericwhen sending to long mailing lists
277*50537Sericinterrupted by system crashes.
27847470Scael.It Li L Ns Ar n
27918858SmckusickThe log level.
28047470Scael.It Li m
28118858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion.
28247470Scael.It Li o
28318858SmckusickIf set, this message may have
28418858Smckusickold style headers.
28518858SmckusickIf not set,
28618858Smckusickthis message is guaranteed to have new style headers
28718858Smckusick(i.e., commas instead of spaces between addresses).
28818858SmckusickIf set, an adaptive algorithm is used that will correctly
28918858Smckusickdetermine the header format in most cases.
29047470Scael.It Li Q Ns Ar queuedir
29118858SmckusickSelect the directory in which to queue messages.
29247470Scael.It Li r Ns Ar timeout
29318858SmckusickThe timeout on reads;
29418858Smckusickif none is set,
29547470Scael.Nm sendmail
29618858Smckusickwill wait forever for a mailer.
29747470ScaelThis option violates the word (if not the intent) of the
29847470Scael.Tn SMTP
29947470Scaelspecification,
30028373Sericshow the timeout should probably be fairly large.
30147470Scael.It Li S Ns Ar file
30218858SmckusickSave statistics in the named file.
30347470Scael.It Li s
30418858SmckusickAlways instantiate the queue file,
30518858Smckusickeven under circumstances where it is not strictly necessary.
30628373SericThis provides safety against system crashes during delivery.
30747470Scael.It Li T Ns Ar time
30828373SericSet the timeout on undelivered messages in the queue to the specified time.
30928373SericAfter delivery has failed
31028373Seric(e.g., because of a host being down)
31128373Sericfor this amount of time,
31228373Sericfailed messages will be returned to the sender.
31318858SmckusickThe default is three days.
31447470Scael.It Li t Ns Ar stz , Ar dtz
31518858SmckusickSet the name of the time zone.
31647470Scael.It Li u Ns Ar N
31718858SmckusickSet the default user id for mailers.
318*50537Seric.It Li w
319*50537SericIf not set, name server lookups will us a querytype of ANY
320*50537Sericto find types
321*50537SericCNAME, A, and MX,
322*50537Sericand will cause all existing records to be cached by our local server.
323*50537SericIf there is (might be) a wildcard MX in the local domain
324*50537Sericor its parents that are searched, you
325*50537Seric.ul
326*50537Sericmust
327*50537Sericset this option, which will use a querytype of CNAME only;
328*50537Sericotherwise, it would cause all fully-qualified names
329*50537Sericto match as names in the local domain.
33047470Scael.El
33147470Scael.Pp
33228373SericIn aliases,
33328373Sericthe first character of a name may be
33428373Serica vertical bar to cause interpretation of
33528373Sericthe rest of the name as a command
33618857Smckusickto pipe the mail to.
33728373SericIt may be necessary to quote the name
33818857Smckusickto keep
33947470Scael.Nm sendmail
34018857Smckusickfrom suppressing the blanks from between arguments.
34128373SericFor example, a common alias is:
34247470Scael.Pp
34347470Scael.Bd -literal -offset indent -compact
34447470Scaelmsgs: "|/usr/bin/msgs -s"
34547470Scael.Ed
34647470Scael.Pp
34747470ScaelAliases may also have the syntax
34847470Scael.Dq :include: Ns Ar filename
34928373Sericto ask
35047470Scael.Xr sendmail
35128373Sericto read the named file for a list of recipients.
35228373SericFor example, an alias such as:
35347470Scael.Pp
35447470Scael.Bd -literal -offset indent -compact
35547470Scaelpoets: ":include:/usr/local/lib/poets.list"
35647470Scael.Ed
35747470Scael.Pp
35828373Sericwould read
35947470Scael.Pa /usr/local/lib/poets.list
36028373Sericfor the list of addresses making up the group.
36147470Scael.Pp
36247470Scael.Nm Sendmail
36318857Smckusickreturns an exit status
36418857Smckusickdescribing what it did.
36518858SmckusickThe codes are defined in
36647470Scael.Aq Pa sysexits.h :
36747470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
36847470Scael.It Dv EX_OK
36947470ScaelSuccessful completion on all addresses.
37047470Scael.It Dv EX_NOUSER
37147470ScaelUser name not recognized.
37247470Scael.It Dv EX_UNAVAILABLE
37347470ScaelCatchall meaning necessary resources
37418857Smckusickwere not available.
37547470Scael.It Dv EX_SYNTAX
37647470ScaelSyntax error in address.
37747470Scael.It Dv EX_SOFTWARE
37847470ScaelInternal software error,
37918857Smckusickincluding bad arguments.
38047470Scael.It Dv EX_OSERR
38147470ScaelTemporary operating system error,
38247470Scaelsuch as
38347470Scael.Dq cannot fork .
38447470Scael.It Dv EX_NOHOST
38547470ScaelHost name not recognized.
38647470Scael.It Dv EX_TEMPFAIL
38747470ScaelMessage could not be sent immediately,
38818858Smckusickbut was queued.
38947470Scael.El
39047470Scael.Pp
39118858SmckusickIf invoked as
39247470Scael.Nm newaliases ,
39347470Scael.Nm sendmail
39418858Smckusickwill rebuild the alias database.
39518858SmckusickIf invoked as
39647470Scael.Nm mailq ,
39747470Scael.Nm sendmail
39818858Smckusickwill print the contents of the mail queue.
39947470Scael.Sh FILES
40047470ScaelExcept for the file
40147470Scael.Pa /etc/sendmail.cf
40247470Scaelitself,
40347470Scaelthe following pathnames are all specified in
40447470Scael.Pa /etc/sendmail.cf.
40518858SmckusickThus,
40618858Smckusickthese values are only approximations.
40747470Scael.Pp
40847470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact
40947470Scael.It Pa /etc/aliases
41047470Scaelraw data for alias names
41147470Scael.It Pa /etc/aliases.pag
41247470Scael.It Pa /etc/aliases.dir
41347470Scaeldata base of alias names
41447470Scael.It Pa /etc/sendmail.cf
41547470Scaelconfiguration file
41647470Scael.It Pa /etc/sendmail.fc
41747470Scaelfrozen configuration
41847470Scael.It Pa /etc/sendmail.hf
41947470Scaelhelp file
42047470Scael.It Pa /var/log/sendmail.st
42147470Scaelcollected statistics
42247470Scael.It Pa /var/spool/mqueue/*
42347470Scaeltemp files
42447470Scael.El
42547470Scael.Sh SEE ALSO
42647470Scael.Xr binmail 1 ,
42747470Scael.Xr mail 1 ,
42847470Scael.Xr rmail 1 ,
42947470Scael.Xr syslog 3 ,
43047470Scael.Xr aliases 5 ,
43147470Scael.Xr mailaddr 7 ,
43247470Scael.Xr rc 8 ;
43347470Scael.Pp
43447470ScaelDARPA
43547470ScaelInternet Request For Comments
43647470Scael.%T RFC819 ,
43747470Scael.%T RFC821 ,
43847470Scael.%T RFC822 .
43947470Scael.Rs
44048584Scael.%T "Sendmail \- An Internetwork Mail Router"
44147470Scael.%V SMM
44247470Scael.%N \&No. 9
44347470Scael.Re
44447470Scael.Rs
44548584Scael.%T "Sendmail Installation and Operation Guide"
44647470Scael.%V SMM
44747470Scael.%N \&No. 8
44847470Scael.Re
44947470Scael.Sh HISTORY
45047470ScaelThe
45147470Scael.Nm
45247470Scaelcommand appeared in
45347470Scael.Bx 4.2 .
454