147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California.
235646Sbostic.\" All rights reserved.
318857Smckusick.\"
443844Strent.\" %sccs.include.redist.man%
518857Smckusick.\"
6*50769Scael.\"     @(#)sendmail.8	6.10 (Berkeley) 08/05/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.
27150537Seric.It Li k Ar N
27250537SericCheckpoint the queue file after every
27350537Seric.Ar N
27450537Sericsuccessful deliveries (default 10).
27550537SericThis avoids excessive duplicate deliveries
27650537Sericwhen sending to long mailing lists
27750537Sericinterrupted 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.
31650556Seric.It Li U Ns Ar userdatabase
31750556SericIf set, a user database is consulted to get forwarding information.
31850556SericYou can consider this an adjunct to the aliasing mechanism,
31950556Sericexcept that the database is intended to be distributed;
32050556Sericaliases are local to a particular host.
32150556SericThis may not be available if your sendmail does not have the
322*50769Scael.Dv USERDB
323*50769Scaeloption compiled in.
32447470Scael.It Li u Ns Ar N
32518858SmckusickSet the default user id for mailers.
32650537Seric.It Li w
32750537SericIf not set, name server lookups will us a querytype of ANY
32850537Sericto find types
329*50769Scael.Dv CNAME , A ,
330*50769Scaeland
331*50769Scael.Dv MX ,
33250537Sericand will cause all existing records to be cached by our local server.
33350537SericIf there is (might be) a wildcard MX in the local domain
33450537Sericor its parents that are searched, you
33550537Seric.ul
33650537Sericmust
337*50769Scaelset this option, which will use a querytype of
338*50769Scael.Dv CNAME
339*50769Scaelonly;
34050537Sericotherwise, it would cause all fully-qualified names
34150537Sericto match as names in the local domain.
34247470Scael.El
34347470Scael.Pp
34428373SericIn aliases,
34528373Sericthe first character of a name may be
34628373Serica vertical bar to cause interpretation of
34728373Sericthe rest of the name as a command
34818857Smckusickto pipe the mail to.
34928373SericIt may be necessary to quote the name
35018857Smckusickto keep
35147470Scael.Nm sendmail
35218857Smckusickfrom suppressing the blanks from between arguments.
35328373SericFor example, a common alias is:
35447470Scael.Pp
35547470Scael.Bd -literal -offset indent -compact
35647470Scaelmsgs: "|/usr/bin/msgs -s"
35747470Scael.Ed
35847470Scael.Pp
35947470ScaelAliases may also have the syntax
36047470Scael.Dq :include: Ns Ar filename
36128373Sericto ask
36247470Scael.Xr sendmail
36328373Sericto read the named file for a list of recipients.
36428373SericFor example, an alias such as:
36547470Scael.Pp
36647470Scael.Bd -literal -offset indent -compact
36747470Scaelpoets: ":include:/usr/local/lib/poets.list"
36847470Scael.Ed
36947470Scael.Pp
37028373Sericwould read
37147470Scael.Pa /usr/local/lib/poets.list
37228373Sericfor the list of addresses making up the group.
37347470Scael.Pp
37447470Scael.Nm Sendmail
37518857Smckusickreturns an exit status
37618857Smckusickdescribing what it did.
37718858SmckusickThe codes are defined in
37847470Scael.Aq Pa sysexits.h :
37947470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent
38047470Scael.It Dv EX_OK
38147470ScaelSuccessful completion on all addresses.
38247470Scael.It Dv EX_NOUSER
38347470ScaelUser name not recognized.
38447470Scael.It Dv EX_UNAVAILABLE
38547470ScaelCatchall meaning necessary resources
38618857Smckusickwere not available.
38747470Scael.It Dv EX_SYNTAX
38847470ScaelSyntax error in address.
38947470Scael.It Dv EX_SOFTWARE
39047470ScaelInternal software error,
39118857Smckusickincluding bad arguments.
39247470Scael.It Dv EX_OSERR
39347470ScaelTemporary operating system error,
39447470Scaelsuch as
39547470Scael.Dq cannot fork .
39647470Scael.It Dv EX_NOHOST
39747470ScaelHost name not recognized.
39847470Scael.It Dv EX_TEMPFAIL
39947470ScaelMessage could not be sent immediately,
40018858Smckusickbut was queued.
40147470Scael.El
40247470Scael.Pp
40318858SmckusickIf invoked as
40447470Scael.Nm newaliases ,
40547470Scael.Nm sendmail
40618858Smckusickwill rebuild the alias database.
40718858SmckusickIf invoked as
40847470Scael.Nm mailq ,
40947470Scael.Nm sendmail
41018858Smckusickwill print the contents of the mail queue.
41147470Scael.Sh FILES
41247470ScaelExcept for the file
41347470Scael.Pa /etc/sendmail.cf
41447470Scaelitself,
41547470Scaelthe following pathnames are all specified in
41647470Scael.Pa /etc/sendmail.cf.
41718858SmckusickThus,
41818858Smckusickthese values are only approximations.
41947470Scael.Pp
42047470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact
42147470Scael.It Pa /etc/aliases
42247470Scaelraw data for alias names
42347470Scael.It Pa /etc/aliases.pag
42447470Scael.It Pa /etc/aliases.dir
42547470Scaeldata base of alias names
42647470Scael.It Pa /etc/sendmail.cf
42747470Scaelconfiguration file
42847470Scael.It Pa /etc/sendmail.fc
42947470Scaelfrozen configuration
43047470Scael.It Pa /etc/sendmail.hf
43147470Scaelhelp file
43247470Scael.It Pa /var/log/sendmail.st
43347470Scaelcollected statistics
43447470Scael.It Pa /var/spool/mqueue/*
43547470Scaeltemp files
43647470Scael.El
43747470Scael.Sh SEE ALSO
43847470Scael.Xr binmail 1 ,
43947470Scael.Xr mail 1 ,
44047470Scael.Xr rmail 1 ,
44147470Scael.Xr syslog 3 ,
44247470Scael.Xr aliases 5 ,
44347470Scael.Xr mailaddr 7 ,
44447470Scael.Xr rc 8 ;
44547470Scael.Pp
44647470ScaelDARPA
44747470ScaelInternet Request For Comments
44847470Scael.%T RFC819 ,
44947470Scael.%T RFC821 ,
45047470Scael.%T RFC822 .
45147470Scael.Rs
45248584Scael.%T "Sendmail \- An Internetwork Mail Router"
45347470Scael.%V SMM
45447470Scael.%N \&No. 9
45547470Scael.Re
45647470Scael.Rs
45748584Scael.%T "Sendmail Installation and Operation Guide"
45847470Scael.%V SMM
45947470Scael.%N \&No. 8
46047470Scael.Re
46147470Scael.Sh HISTORY
46247470ScaelThe
46347470Scael.Nm
46447470Scaelcommand appeared in
46547470Scael.Bx 4.2 .
466