147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California.
235646Sbostic.\" All rights reserved.
318857Smckusick.\"
443844Strent.\" %sccs.include.redist.man%
518857Smckusick.\"
6*63451Sbostic.\"     @(#)sendmail.8	6.16 (Berkeley) 06/16/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
6059099Seric.It Fl B Ns Ar type
6159099SericSet the body type to
6259099Seric.Ar type .
6359099SericCurrent legal values
6459099Seric.Li 7BIT
6559099Sericor
6659099Seric.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.
214*63451SbosticThis is a partial list;
215*63451Sbosticfor a complete list (and details), consult the
21648584Scael.%T "Sendmail Installation and Operation Guide" .
21718858SmckusickThe options are:
21847470Scael.Bl -tag -width Fl
21947470Scael.It Li A Ns Ar file
22018858SmckusickUse alternate alias file.
221*63451Sbostic.It Li b Ns Ar nblocks
222*63451SbosticThe minimum number of free blocks needed on the spool filesystem.
22347470Scael.It Li c
22418858SmckusickOn mailers that are considered ``expensive'' to connect to,
22518858Smckusickdon't initiate immediate connection.
22618858SmckusickThis requires queueing.
22751305Seric.It Li C Ar N
22851305SericCheckpoint the queue file after every
22951305Seric.Ar N
23051305Sericsuccessful deliveries (default 10).
23151305SericThis avoids excessive duplicate deliveries
23251305Sericwhen sending to long mailing lists
23351305Sericinterrupted by system crashes.
23447470Scael.It Li d Ns Ar x
23518858SmckusickSet the delivery mode to
23647470Scael.Ar x .
23718858SmckusickDelivery modes are
23847470Scael.Ql i
23947470Scaelfor interactive (synchronous) delivery,
24047470Scael.Ql b
24147470Scaelfor background (asynchronous) delivery,
24218858Smckusickand
24347470Scael.Ql q
24447470Scaelfor queue only \- i.e.,
24518858Smckusickactual delivery is done the next time the queue is run.
24647470Scael.It Li D
24718858SmckusickTry to automatically rebuild the alias database
24818858Smckusickif necessary.
24947470Scael.It Li e Ns Ar x
25018858SmckusickSet error processing to mode
25147470Scael.Ar x .
25218858SmckusickValid modes are
25347470Scael.Ql m
25447470Scaelto mail back the error message,
25547470Scael.Ql w
25647470Scaelto ``write'' back the error message
25718858Smckusick(or mail it back if the sender is not logged in),
25847470Scael.Ql p
25947470Scaelto print the errors on the terminal
26018858Smckusick(default),
26147470Scael.Ql q
26247470Scaelto throw away error messages
26318858Smckusick(only exit status is returned),
26447470Scaeland
26547470Scael.Ql e
26618858Smckusickto do special processing for the BerkNet.
26718858SmckusickIf the text of the message is not mailed back
26818858Smckusickby
26947470Scaelmodes
27047470Scael.Ql m
27147470Scaelor
27247470Scael.Ql w
27318858Smckusickand if the sender is local to this machine,
27418858Smckusicka copy of the message is appended to the file
27547470Scael.Pa dead.letter
27618857Smckusickin the sender's home directory.
27747470Scael.It Li f
27847470ScaelSave
27947470Scael.Tn UNIX Ns \-style
28047470ScaelFrom lines at the front of messages.
281*63451Sbostic.It Li G
282*63451SbosticMatch local mail names against the GECOS portion of the password file.
28347470Scael.It Li g Ar N
28418858SmckusickThe default group id to use when calling mailers.
28547470Scael.It Li H Ns Ar file
28647470ScaelThe
28747470Scael.Tn SMTP
28847470Scaelhelp file.
28951305Seric.It Li h Ar N
29051305SericThe maximum number of times a message is allowed to ``hop''
29151305Sericbefore we decide it is in a loop.
29247470Scael.It Li i
29318858SmckusickDo not take dots on a line by themselves
29418858Smckusickas a message terminator.
295*63451Sbostic.It Li j
296*63451SbosticSend error messages in MIME format.
297*63451Sbostic.It Li K Ns Ar timeout
298*63451SbosticSet connection cache timeout.
299*63451Sbostic.It Li k Ns Ar N
300*63451SbosticSet connection cache size.
30147470Scael.It Li L Ns Ar n
30218858SmckusickThe log level.
303*63451Sbostic.It Li l
304*63451SbosticPay attention to the Errors-To: header.
30547470Scael.It Li m
30618858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion.
307*63451Sbostic.It Li n
308*63451SbosticValidate the right hand side of aliases during a
309*63451Sbostic.Xr newaliases 1
310*63451Sbosticcommand.
31147470Scael.It Li o
31218858SmckusickIf set, this message may have
31318858Smckusickold style headers.
31418858SmckusickIf not set,
31518858Smckusickthis message is guaranteed to have new style headers
31618858Smckusick(i.e., commas instead of spaces between addresses).
31718858SmckusickIf set, an adaptive algorithm is used that will correctly
31818858Smckusickdetermine the header format in most cases.
31947470Scael.It Li Q Ns Ar queuedir
32018858SmckusickSelect the directory in which to queue messages.
32147470Scael.It Li S Ns Ar file
32218858SmckusickSave statistics in the named file.
32347470Scael.It Li s
32418858SmckusickAlways instantiate the queue file,
32518858Smckusickeven under circumstances where it is not strictly necessary.
32628373SericThis provides safety against system crashes during delivery.
32747470Scael.It Li T Ns Ar time
32828373SericSet the timeout on undelivered messages in the queue to the specified time.
32928373SericAfter delivery has failed
33028373Seric(e.g., because of a host being down)
33128373Sericfor this amount of time,
33228373Sericfailed messages will be returned to the sender.
33318858SmckusickThe default is three days.
33447470Scael.It Li t Ns Ar stz , Ar dtz
33518858SmckusickSet the name of the time zone.
33650556Seric.It Li U Ns Ar userdatabase
33750556SericIf set, a user database is consulted to get forwarding information.
33850556SericYou can consider this an adjunct to the aliasing mechanism,
33950556Sericexcept that the database is intended to be distributed;
34050556Sericaliases are local to a particular host.
34150556SericThis may not be available if your sendmail does not have the
34250769Scael.Dv USERDB
34350769Scaeloption compiled in.
34447470Scael.It Li u Ns Ar N
34518858SmckusickSet the default user id for mailers.
346*63451Sbostic.It Li Y
347*63451SbosticFork each job during queue runs.
348*63451SbosticMay be convenient on memory-poor machines.
349*63451Sbostic.It Li 7
350*63451SbosticStrip incoming messages to seven bits.
35147470Scael.El
35247470Scael.Pp
35328373SericIn aliases,
35428373Sericthe first character of a name may be
35528373Serica vertical bar to cause interpretation of
35628373Sericthe rest of the name as a command
35718857Smckusickto pipe the mail to.
35828373SericIt may be necessary to quote the name
35918857Smckusickto keep
36047470Scael.Nm sendmail
36118857Smckusickfrom suppressing the blanks from between arguments.
36228373SericFor example, a common alias is:
36347470Scael.Pp
36447470Scael.Bd -literal -offset indent -compact
36547470Scaelmsgs: "|/usr/bin/msgs -s"
36647470Scael.Ed
36747470Scael.Pp
36847470ScaelAliases may also have the syntax
36947470Scael.Dq :include: Ns Ar filename
37028373Sericto ask
37147470Scael.Xr sendmail
37228373Sericto read the named file for a list of recipients.
37328373SericFor example, an alias such as:
37447470Scael.Pp
37547470Scael.Bd -literal -offset indent -compact
37647470Scaelpoets: ":include:/usr/local/lib/poets.list"
37747470Scael.Ed
37847470Scael.Pp
37928373Sericwould read
38047470Scael.Pa /usr/local/lib/poets.list
38128373Sericfor the list of addresses making up the group.
38247470Scael.Pp
38347470Scael.Nm Sendmail
38418857Smckusickreturns an exit status
38518857Smckusickdescribing what it did.
38618858SmckusickThe codes are defined in
38747470Scael.Aq Pa sysexits.h :
38847470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
38947470Scael.It Dv EX_OK
39047470ScaelSuccessful completion on all addresses.
39147470Scael.It Dv EX_NOUSER
39247470ScaelUser name not recognized.
39347470Scael.It Dv EX_UNAVAILABLE
39447470ScaelCatchall meaning necessary resources
39518857Smckusickwere not available.
39647470Scael.It Dv EX_SYNTAX
39747470ScaelSyntax error in address.
39847470Scael.It Dv EX_SOFTWARE
39947470ScaelInternal software error,
40018857Smckusickincluding bad arguments.
40147470Scael.It Dv EX_OSERR
40247470ScaelTemporary operating system error,
40347470Scaelsuch as
40447470Scael.Dq cannot fork .
40547470Scael.It Dv EX_NOHOST
40647470ScaelHost name not recognized.
40747470Scael.It Dv EX_TEMPFAIL
40847470ScaelMessage could not be sent immediately,
40918858Smckusickbut was queued.
41047470Scael.El
41147470Scael.Pp
41218858SmckusickIf invoked as
41347470Scael.Nm newaliases ,
41447470Scael.Nm sendmail
41518858Smckusickwill rebuild the alias database.
41618858SmckusickIf invoked as
41747470Scael.Nm mailq ,
41847470Scael.Nm sendmail
41918858Smckusickwill print the contents of the mail queue.
42047470Scael.Sh FILES
42147470ScaelExcept for the file
42247470Scael.Pa /etc/sendmail.cf
42347470Scaelitself,
42447470Scaelthe following pathnames are all specified in
42547470Scael.Pa /etc/sendmail.cf.
42618858SmckusickThus,
42718858Smckusickthese values are only approximations.
42847470Scael.Pp
42947470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact
43047470Scael.It Pa /etc/aliases
43147470Scaelraw data for alias names
432*63451Sbostic.It Pa /etc/aliases.db
43347470Scaeldata base of alias names
43447470Scael.It Pa /etc/sendmail.cf
43547470Scaelconfiguration file
43647470Scael.It Pa /etc/sendmail.fc
43747470Scaelfrozen configuration
43847470Scael.It Pa /etc/sendmail.hf
43947470Scaelhelp file
44047470Scael.It Pa /var/log/sendmail.st
44147470Scaelcollected statistics
44247470Scael.It Pa /var/spool/mqueue/*
44347470Scaeltemp files
444*63451Sbostic.It Pa /var/run/sendmail.pid
445*63451SbosticThe process id of the daemon
44647470Scael.El
44747470Scael.Sh SEE ALSO
44847470Scael.Xr binmail 1 ,
44947470Scael.Xr mail 1 ,
45047470Scael.Xr rmail 1 ,
45147470Scael.Xr syslog 3 ,
45247470Scael.Xr aliases 5 ,
45347470Scael.Xr mailaddr 7 ,
45447470Scael.Xr rc 8 ;
45547470Scael.Pp
45647470ScaelDARPA
45747470ScaelInternet Request For Comments
45847470Scael.%T RFC819 ,
45947470Scael.%T RFC821 ,
46047470Scael.%T RFC822 .
46147470Scael.Rs
46248584Scael.%T "Sendmail \- An Internetwork Mail Router"
46347470Scael.%V SMM
46447470Scael.%N \&No. 9
46547470Scael.Re
46647470Scael.Rs
46748584Scael.%T "Sendmail Installation and Operation Guide"
46847470Scael.%V SMM
46947470Scael.%N \&No. 8
47047470Scael.Re
47147470Scael.Sh HISTORY
47247470ScaelThe
47347470Scael.Nm
47447470Scaelcommand appeared in
47547470Scael.Bx 4.2 .
476