147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California.
235646Sbostic.\" All rights reserved.
318857Smckusick.\"
443844Strent.\" %sccs.include.redist.man%
518857Smckusick.\"
6*59099Seric.\"     @(#)sendmail.8	6.15 (Berkeley) 04/15/93
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
60*59099Seric.It Fl B Ns Ar type
61*59099SericSet the body type to
62*59099Seric.Ar type .
63*59099SericCurrent legal values
64*59099Seric.Li 7BIT
65*59099Sericor
66*59099Seric.Li 8BITMIME .
6747470Scael.It Fl ba
6847470ScaelGo into
6947470Scael.Tn ARPANET
7047470Scaelmode.
7118858SmckusickAll input lines must end with a CR-LF,
7218858Smckusickand all messages will be generated with a CR-LF at the end.
7318858SmckusickAlso,
7418858Smckusickthe ``From:'' and ``Sender:''
7518858Smckusickfields are examined for the name of the sender.
7647470Scael.It Fl bd
7747470ScaelRun as a daemon.  This requires Berkeley
7847470Scael.Tn IPC .
7947470Scael.Nm Sendmail
8028373Sericwill fork and run in background
8147470Scaellistening on socket 25 for incoming
8247470Scael.Tn SMTP
8347470Scaelconnections.
8428373SericThis is normally run from
8547470Scael.Pa /etc/rc .
8647470Scael.It Fl bi
8718858SmckusickInitialize the alias database.
8847470Scael.It Fl bm
8918858SmckusickDeliver mail in the usual way (default).
9047470Scael.It Fl bp
9118858SmckusickPrint a listing of the queue.
9247470Scael.It Fl bs
9347470ScaelUse the
9447470Scael.Tn SMTP
9547470Scaelprotocol as described in
9647470Scael.Tn RFC821
9728373Sericon standard input and output.
9818858SmckusickThis flag implies all the operations of the
9947470Scael.Fl ba
10047470Scaelflag that are compatible with
10147470Scael.Tn SMTP .
10247470Scael.It Fl bt
10318858SmckusickRun in address test mode.
10418858SmckusickThis mode reads addresses and shows the steps in parsing;
10518858Smckusickit is used for debugging configuration tables.
10647470Scael.It Fl bv
10718858SmckusickVerify names only \- do not try to collect or deliver a message.
10818858SmckusickVerify mode is normally used for validating
10918858Smckusickusers or mailing lists.
11047470Scael.It Fl bz
11118858SmckusickCreate the configuration freeze file.
11247470Scael.It Fl C Ns Ar file
11318858SmckusickUse alternate configuration file.
11447470Scael.Nm Sendmail
11528373Sericrefuses to run as root if an alternate configuration file is specified.
11628373SericThe frozen configuration file is bypassed.
11747470Scael.It Fl d Ns Ar X
11818858SmckusickSet debugging value to
11947470Scael.Ar X .
12047470Scael.It Fl F Ns Ar fullname
12118858SmckusickSet the full name of the sender.
12247470Scael.It Fl f Ns Ar name
12318858SmckusickSets the name of the ``from'' person
12418858Smckusick(i.e., the sender of the mail).
12547470Scael.Fl f
12618858Smckusickcan only be used
12728373Sericby ``trusted'' users
12828373Seric(normally
12947470Scael.Em root ,
13047470Scael.Em daemon ,
13118857Smckusickand
13247470Scael.Em network )
13318857Smckusickor if the person you are trying to become
13418857Smckusickis the same as the person you are.
13547470Scael.It Fl h Ns Ar N
13618858SmckusickSet the hop count to
13747470Scael.Ar N .
13818858SmckusickThe hop count is incremented every time the mail is
13918858Smckusickprocessed.
14018858SmckusickWhen it reaches a limit,
14118858Smckusickthe mail is returned with an error message,
14218858Smckusickthe victim of an aliasing loop.
14328373SericIf not specified,
14428373Seric``Received:'' lines in the message are counted.
14547470Scael.It Fl n
14618858SmckusickDon't do aliasing.
14747470Scael.It Fl o Ns Ar x Em value
14818858SmckusickSet option
14947470Scael.Ar x
15018858Smckusickto the specified
15147470Scael.Em value .
15218858SmckusickOptions are described below.
15357141Seric.It Fl p Ns Ar protocol
15457141SericSet the name of the protocol used to receive the message.
15557141SericThis can be a simple protocol name such as ``UUCP''
15657141Sericor a protocol and hostname, such as ``UUCP:ucbvax''.
15747470Scael.It Fl q Ns Bq Ar time
15818858SmckusickProcessed saved messages in the queue at given intervals.
15918858SmckusickIf
16047470Scael.Ar time
16118858Smckusickis omitted,
16218858Smckusickprocess the queue once.
16347470Scael.Xr Time
16418858Smckusickis given as a tagged number,
16547470Scaelwith
16647470Scael.Ql s
16747470Scaelbeing seconds,
16847470Scael.Ql m
16947470Scaelbeing minutes,
17047470Scael.Ql h
17147470Scaelbeing hours,
17247470Scael.Ql d
17347470Scaelbeing days,
17418858Smckusickand
17547470Scael.Ql w
17647470Scaelbeing weeks.
17718858SmckusickFor example,
17847470Scael.Ql \-q1h30m
17947470Scaelor
18047470Scael.Ql \-q90m
18118858Smckusickwould both set the timeout to one hour thirty minutes.
18228373SericIf
18347470Scael.Ar time
18428373Sericis specified,
18547470Scael.Nm sendmail
18628373Sericwill run in background.
18728373SericThis option can be used safely with
18847470Scael.Fl bd .
18947470Scael.It Fl r Ns Ar name
19018858SmckusickAn alternate and obsolete form of the
19147470Scael.Fl f
19218858Smckusickflag.
19347470Scael.It Fl t
19418858SmckusickRead message for recipients.
19528373SericTo:, Cc:, and Bcc: lines will be scanned for recipient addresses.
19618858SmckusickThe Bcc: line will be deleted before transmission.
19728373SericAny addresses in the argument list will be suppressed,
19828373Sericthat is,
19928373Sericthey will
20047470Scael.Em not
20128373Sericreceive copies even if listed in the message header.
20247470Scael.It Fl v
20318858SmckusickGo into verbose mode.
20418858SmckusickAlias expansions will be announced, etc.
20547470Scael.El
20647470Scael.Pp
20718858SmckusickThere are also a number of processing options that may be set.
20818858SmckusickNormally these will only be used by a system administrator.
20918858SmckusickOptions may be set either on the command line
21018858Smckusickusing the
21147470Scael.Fl o
21218858Smckusickflag
21318858Smckusickor in the configuration file.
21418858SmckusickThese are described in detail in the
21548584Scael.%T "Sendmail Installation and Operation Guide" .
21618858SmckusickThe options are:
21747470Scael.Bl -tag -width Fl
21847470Scael.It Li A Ns Ar file
21918858SmckusickUse alternate alias file.
22047470Scael.It Li c
22118858SmckusickOn mailers that are considered ``expensive'' to connect to,
22218858Smckusickdon't initiate immediate connection.
22318858SmckusickThis requires queueing.
22451305Seric.It Li C Ar N
22551305SericCheckpoint the queue file after every
22651305Seric.Ar N
22751305Sericsuccessful deliveries (default 10).
22851305SericThis avoids excessive duplicate deliveries
22951305Sericwhen sending to long mailing lists
23051305Sericinterrupted by system crashes.
23147470Scael.It Li d Ns Ar x
23218858SmckusickSet the delivery mode to
23347470Scael.Ar x .
23418858SmckusickDelivery modes are
23547470Scael.Ql i
23647470Scaelfor interactive (synchronous) delivery,
23747470Scael.Ql b
23847470Scaelfor background (asynchronous) delivery,
23918858Smckusickand
24047470Scael.Ql q
24147470Scaelfor queue only \- i.e.,
24218858Smckusickactual delivery is done the next time the queue is run.
24347470Scael.It Li D
24418858SmckusickTry to automatically rebuild the alias database
24518858Smckusickif necessary.
24647470Scael.It Li e Ns Ar x
24718858SmckusickSet error processing to mode
24847470Scael.Ar x .
24918858SmckusickValid modes are
25047470Scael.Ql m
25147470Scaelto mail back the error message,
25247470Scael.Ql w
25347470Scaelto ``write'' back the error message
25418858Smckusick(or mail it back if the sender is not logged in),
25547470Scael.Ql p
25647470Scaelto print the errors on the terminal
25718858Smckusick(default),
25847470Scael.Ql q
25947470Scaelto throw away error messages
26018858Smckusick(only exit status is returned),
26147470Scaeland
26247470Scael.Ql e
26318858Smckusickto do special processing for the BerkNet.
26418858SmckusickIf the text of the message is not mailed back
26518858Smckusickby
26647470Scaelmodes
26747470Scael.Ql m
26847470Scaelor
26947470Scael.Ql w
27018858Smckusickand if the sender is local to this machine,
27118858Smckusicka copy of the message is appended to the file
27247470Scael.Pa dead.letter
27318857Smckusickin the sender's home directory.
27447470Scael.It Li F Ns Ar mode
27518858SmckusickThe mode to use when creating temporary files.
27647470Scael.It Li f
27747470ScaelSave
27847470Scael.Tn UNIX Ns \-style
27947470ScaelFrom lines at the front of messages.
28047470Scael.It Li g Ar N
28118858SmckusickThe default group id to use when calling mailers.
28247470Scael.It Li H Ns Ar file
28347470ScaelThe
28447470Scael.Tn SMTP
28547470Scaelhelp file.
28651305Seric.It Li h Ar N
28751305SericThe maximum number of times a message is allowed to ``hop''
28851305Sericbefore we decide it is in a loop.
28947470Scael.It Li i
29018858SmckusickDo not take dots on a line by themselves
29118858Smckusickas a message terminator.
29247470Scael.It Li L Ns Ar n
29318858SmckusickThe log level.
29447470Scael.It Li m
29518858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion.
29647470Scael.It Li o
29718858SmckusickIf set, this message may have
29818858Smckusickold style headers.
29918858SmckusickIf not set,
30018858Smckusickthis message is guaranteed to have new style headers
30118858Smckusick(i.e., commas instead of spaces between addresses).
30218858SmckusickIf set, an adaptive algorithm is used that will correctly
30318858Smckusickdetermine the header format in most cases.
30447470Scael.It Li Q Ns Ar queuedir
30518858SmckusickSelect the directory in which to queue messages.
30647470Scael.It Li r Ns Ar timeout
30718858SmckusickThe timeout on reads;
30818858Smckusickif none is set,
30947470Scael.Nm sendmail
31018858Smckusickwill wait forever for a mailer.
31147470ScaelThis option violates the word (if not the intent) of the
31247470Scael.Tn SMTP
31347470Scaelspecification,
31428373Sericshow the timeout should probably be fairly large.
31547470Scael.It Li S Ns Ar file
31618858SmckusickSave statistics in the named file.
31747470Scael.It Li s
31818858SmckusickAlways instantiate the queue file,
31918858Smckusickeven under circumstances where it is not strictly necessary.
32028373SericThis provides safety against system crashes during delivery.
32147470Scael.It Li T Ns Ar time
32228373SericSet the timeout on undelivered messages in the queue to the specified time.
32328373SericAfter delivery has failed
32428373Seric(e.g., because of a host being down)
32528373Sericfor this amount of time,
32628373Sericfailed messages will be returned to the sender.
32718858SmckusickThe default is three days.
32847470Scael.It Li t Ns Ar stz , Ar dtz
32918858SmckusickSet the name of the time zone.
33050556Seric.It Li U Ns Ar userdatabase
33150556SericIf set, a user database is consulted to get forwarding information.
33250556SericYou can consider this an adjunct to the aliasing mechanism,
33350556Sericexcept that the database is intended to be distributed;
33450556Sericaliases are local to a particular host.
33550556SericThis may not be available if your sendmail does not have the
33650769Scael.Dv USERDB
33750769Scaeloption compiled in.
33847470Scael.It Li u Ns Ar N
33918858SmckusickSet the default user id for mailers.
34050537Seric.It Li w
34151216SericIf set, name server lookups will us a querytype of ANY
34250537Sericto find types
34350769Scael.Dv CNAME , A ,
34450769Scaeland
34550769Scael.Dv MX ,
34650537Sericand will cause all existing records to be cached by our local server.
34751216SericIf you are certain that there are no wildcard MX records in the local domain
34851216Sericor its parents that are searched, you can
34951216Sericset this option.
35051216SericIf the option is not set,
35151216Sericname server lookups will use a querytype of
35250769Scael.Dv CNAME
35350769Scaelonly;
35450537Sericotherwise, it would cause all fully-qualified names
35550537Sericto match as names in the local domain.
35647470Scael.El
35747470Scael.Pp
35828373SericIn aliases,
35928373Sericthe first character of a name may be
36028373Serica vertical bar to cause interpretation of
36128373Sericthe rest of the name as a command
36218857Smckusickto pipe the mail to.
36328373SericIt may be necessary to quote the name
36418857Smckusickto keep
36547470Scael.Nm sendmail
36618857Smckusickfrom suppressing the blanks from between arguments.
36728373SericFor example, a common alias is:
36847470Scael.Pp
36947470Scael.Bd -literal -offset indent -compact
37047470Scaelmsgs: "|/usr/bin/msgs -s"
37147470Scael.Ed
37247470Scael.Pp
37347470ScaelAliases may also have the syntax
37447470Scael.Dq :include: Ns Ar filename
37528373Sericto ask
37647470Scael.Xr sendmail
37728373Sericto read the named file for a list of recipients.
37828373SericFor example, an alias such as:
37947470Scael.Pp
38047470Scael.Bd -literal -offset indent -compact
38147470Scaelpoets: ":include:/usr/local/lib/poets.list"
38247470Scael.Ed
38347470Scael.Pp
38428373Sericwould read
38547470Scael.Pa /usr/local/lib/poets.list
38628373Sericfor the list of addresses making up the group.
38747470Scael.Pp
38847470Scael.Nm Sendmail
38918857Smckusickreturns an exit status
39018857Smckusickdescribing what it did.
39118858SmckusickThe codes are defined in
39247470Scael.Aq Pa sysexits.h :
39347470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
39447470Scael.It Dv EX_OK
39547470ScaelSuccessful completion on all addresses.
39647470Scael.It Dv EX_NOUSER
39747470ScaelUser name not recognized.
39847470Scael.It Dv EX_UNAVAILABLE
39947470ScaelCatchall meaning necessary resources
40018857Smckusickwere not available.
40147470Scael.It Dv EX_SYNTAX
40247470ScaelSyntax error in address.
40347470Scael.It Dv EX_SOFTWARE
40447470ScaelInternal software error,
40518857Smckusickincluding bad arguments.
40647470Scael.It Dv EX_OSERR
40747470ScaelTemporary operating system error,
40847470Scaelsuch as
40947470Scael.Dq cannot fork .
41047470Scael.It Dv EX_NOHOST
41147470ScaelHost name not recognized.
41247470Scael.It Dv EX_TEMPFAIL
41347470ScaelMessage could not be sent immediately,
41418858Smckusickbut was queued.
41547470Scael.El
41647470Scael.Pp
41718858SmckusickIf invoked as
41847470Scael.Nm newaliases ,
41947470Scael.Nm sendmail
42018858Smckusickwill rebuild the alias database.
42118858SmckusickIf invoked as
42247470Scael.Nm mailq ,
42347470Scael.Nm sendmail
42418858Smckusickwill print the contents of the mail queue.
42547470Scael.Sh FILES
42647470ScaelExcept for the file
42747470Scael.Pa /etc/sendmail.cf
42847470Scaelitself,
42947470Scaelthe following pathnames are all specified in
43047470Scael.Pa /etc/sendmail.cf.
43118858SmckusickThus,
43218858Smckusickthese values are only approximations.
43347470Scael.Pp
43447470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact
43547470Scael.It Pa /etc/aliases
43647470Scaelraw data for alias names
43747470Scael.It Pa /etc/aliases.pag
43847470Scael.It Pa /etc/aliases.dir
43947470Scaeldata base of alias names
44047470Scael.It Pa /etc/sendmail.cf
44147470Scaelconfiguration file
44247470Scael.It Pa /etc/sendmail.fc
44347470Scaelfrozen configuration
44447470Scael.It Pa /etc/sendmail.hf
44547470Scaelhelp file
44647470Scael.It Pa /var/log/sendmail.st
44747470Scaelcollected statistics
44847470Scael.It Pa /var/spool/mqueue/*
44947470Scaeltemp files
45047470Scael.El
45147470Scael.Sh SEE ALSO
45247470Scael.Xr binmail 1 ,
45347470Scael.Xr mail 1 ,
45447470Scael.Xr rmail 1 ,
45547470Scael.Xr syslog 3 ,
45647470Scael.Xr aliases 5 ,
45747470Scael.Xr mailaddr 7 ,
45847470Scael.Xr rc 8 ;
45947470Scael.Pp
46047470ScaelDARPA
46147470ScaelInternet Request For Comments
46247470Scael.%T RFC819 ,
46347470Scael.%T RFC821 ,
46447470Scael.%T RFC822 .
46547470Scael.Rs
46648584Scael.%T "Sendmail \- An Internetwork Mail Router"
46747470Scael.%V SMM
46847470Scael.%N \&No. 9
46947470Scael.Re
47047470Scael.Rs
47148584Scael.%T "Sendmail Installation and Operation Guide"
47247470Scael.%V SMM
47347470Scael.%N \&No. 8
47447470Scael.Re
47547470Scael.Sh HISTORY
47647470ScaelThe
47747470Scael.Nm
47847470Scaelcommand appeared in
47947470Scael.Bx 4.2 .
480