147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California. 235646Sbostic.\" All rights reserved. 318857Smckusick.\" 443844Strent.\" %sccs.include.redist.man% 518857Smckusick.\" 6*48584Scael.\" @(#)sendmail.8 6.6 (Berkeley) 04/23/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 204*48584Scael.%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. 27147470Scael.It Li L Ns Ar n 27218858SmckusickThe log level. 27347470Scael.It Li m 27418858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 27547470Scael.It Li o 27618858SmckusickIf set, this message may have 27718858Smckusickold style headers. 27818858SmckusickIf not set, 27918858Smckusickthis message is guaranteed to have new style headers 28018858Smckusick(i.e., commas instead of spaces between addresses). 28118858SmckusickIf set, an adaptive algorithm is used that will correctly 28218858Smckusickdetermine the header format in most cases. 28347470Scael.It Li Q Ns Ar queuedir 28418858SmckusickSelect the directory in which to queue messages. 28547470Scael.It Li r Ns Ar timeout 28618858SmckusickThe timeout on reads; 28718858Smckusickif none is set, 28847470Scael.Nm sendmail 28918858Smckusickwill wait forever for a mailer. 29047470ScaelThis option violates the word (if not the intent) of the 29147470Scael.Tn SMTP 29247470Scaelspecification, 29328373Sericshow the timeout should probably be fairly large. 29447470Scael.It Li S Ns Ar file 29518858SmckusickSave statistics in the named file. 29647470Scael.It Li s 29718858SmckusickAlways instantiate the queue file, 29818858Smckusickeven under circumstances where it is not strictly necessary. 29928373SericThis provides safety against system crashes during delivery. 30047470Scael.It Li T Ns Ar time 30128373SericSet the timeout on undelivered messages in the queue to the specified time. 30228373SericAfter delivery has failed 30328373Seric(e.g., because of a host being down) 30428373Sericfor this amount of time, 30528373Sericfailed messages will be returned to the sender. 30618858SmckusickThe default is three days. 30747470Scael.It Li t Ns Ar stz , Ar dtz 30818858SmckusickSet the name of the time zone. 30947470Scael.It Li u Ns Ar N 31018858SmckusickSet the default user id for mailers. 31147470Scael.El 31247470Scael.Pp 31328373SericIn aliases, 31428373Sericthe first character of a name may be 31528373Serica vertical bar to cause interpretation of 31628373Sericthe rest of the name as a command 31718857Smckusickto pipe the mail to. 31828373SericIt may be necessary to quote the name 31918857Smckusickto keep 32047470Scael.Nm sendmail 32118857Smckusickfrom suppressing the blanks from between arguments. 32228373SericFor example, a common alias is: 32347470Scael.Pp 32447470Scael.Bd -literal -offset indent -compact 32547470Scaelmsgs: "|/usr/bin/msgs -s" 32647470Scael.Ed 32747470Scael.Pp 32847470ScaelAliases may also have the syntax 32947470Scael.Dq :include: Ns Ar filename 33028373Sericto ask 33147470Scael.Xr sendmail 33228373Sericto read the named file for a list of recipients. 33328373SericFor example, an alias such as: 33447470Scael.Pp 33547470Scael.Bd -literal -offset indent -compact 33647470Scaelpoets: ":include:/usr/local/lib/poets.list" 33747470Scael.Ed 33847470Scael.Pp 33928373Sericwould read 34047470Scael.Pa /usr/local/lib/poets.list 34128373Sericfor the list of addresses making up the group. 34247470Scael.Pp 34347470Scael.Nm Sendmail 34418857Smckusickreturns an exit status 34518857Smckusickdescribing what it did. 34618858SmckusickThe codes are defined in 34747470Scael.Aq Pa sysexits.h : 34847470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 34947470Scael.It Dv EX_OK 35047470ScaelSuccessful completion on all addresses. 35147470Scael.It Dv EX_NOUSER 35247470ScaelUser name not recognized. 35347470Scael.It Dv EX_UNAVAILABLE 35447470ScaelCatchall meaning necessary resources 35518857Smckusickwere not available. 35647470Scael.It Dv EX_SYNTAX 35747470ScaelSyntax error in address. 35847470Scael.It Dv EX_SOFTWARE 35947470ScaelInternal software error, 36018857Smckusickincluding bad arguments. 36147470Scael.It Dv EX_OSERR 36247470ScaelTemporary operating system error, 36347470Scaelsuch as 36447470Scael.Dq cannot fork . 36547470Scael.It Dv EX_NOHOST 36647470ScaelHost name not recognized. 36747470Scael.It Dv EX_TEMPFAIL 36847470ScaelMessage could not be sent immediately, 36918858Smckusickbut was queued. 37047470Scael.El 37147470Scael.Pp 37218858SmckusickIf invoked as 37347470Scael.Nm newaliases , 37447470Scael.Nm sendmail 37518858Smckusickwill rebuild the alias database. 37618858SmckusickIf invoked as 37747470Scael.Nm mailq , 37847470Scael.Nm sendmail 37918858Smckusickwill print the contents of the mail queue. 38047470Scael.Sh FILES 38147470ScaelExcept for the file 38247470Scael.Pa /etc/sendmail.cf 38347470Scaelitself, 38447470Scaelthe following pathnames are all specified in 38547470Scael.Pa /etc/sendmail.cf. 38618858SmckusickThus, 38718858Smckusickthese values are only approximations. 38847470Scael.Pp 38947470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 39047470Scael.It Pa /etc/aliases 39147470Scaelraw data for alias names 39247470Scael.It Pa /etc/aliases.pag 39347470Scael.It Pa /etc/aliases.dir 39447470Scaeldata base of alias names 39547470Scael.It Pa /etc/sendmail.cf 39647470Scaelconfiguration file 39747470Scael.It Pa /etc/sendmail.fc 39847470Scaelfrozen configuration 39947470Scael.It Pa /etc/sendmail.hf 40047470Scaelhelp file 40147470Scael.It Pa /var/log/sendmail.st 40247470Scaelcollected statistics 40347470Scael.It Pa /var/spool/mqueue/* 40447470Scaeltemp files 40547470Scael.El 40647470Scael.Sh SEE ALSO 40747470Scael.Xr binmail 1 , 40847470Scael.Xr mail 1 , 40947470Scael.Xr rmail 1 , 41047470Scael.Xr syslog 3 , 41147470Scael.Xr aliases 5 , 41247470Scael.Xr mailaddr 7 , 41347470Scael.Xr rc 8 ; 41447470Scael.Pp 41547470ScaelDARPA 41647470ScaelInternet Request For Comments 41747470Scael.%T RFC819 , 41847470Scael.%T RFC821 , 41947470Scael.%T RFC822 . 42047470Scael.Rs 421*48584Scael.%T "Sendmail \- An Internetwork Mail Router" 42247470Scael.%V SMM 42347470Scael.%N \&No. 9 42447470Scael.Re 42547470Scael.Rs 426*48584Scael.%T "Sendmail Installation and Operation Guide" 42747470Scael.%V SMM 42847470Scael.%N \&No. 8 42947470Scael.Re 43047470Scael.Sh HISTORY 43147470ScaelThe 43247470Scael.Nm 43347470Scaelcommand appeared in 43447470Scael.Bx 4.2 . 435