163861Sbostic.\" Copyright (c) 1988, 1991, 1993 263861Sbostic.\" The Regents of the University of California. All rights reserved. 318857Smckusick.\" 443844Strent.\" %sccs.include.redist.man% 518857Smckusick.\" 6*67332Sah.\" @(#)sendmail.8 8.5 (Berkeley) 06/01/94 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'. 5763452Seric.Ss Parameters 5847470Scael.Bl -tag -width Fl 5959099Seric.It Fl B Ns Ar type 6059099SericSet the body type to 6159099Seric.Ar type . 6259099SericCurrent legal values 6359099Seric.Li 7BIT 6459099Sericor 6559099Seric.Li 8BITMIME . 6647470Scael.It Fl ba 6747470ScaelGo into 6847470Scael.Tn ARPANET 6947470Scaelmode. 7018858SmckusickAll input lines must end with a CR-LF, 7118858Smckusickand all messages will be generated with a CR-LF at the end. 7218858SmckusickAlso, 7318858Smckusickthe ``From:'' and ``Sender:'' 7418858Smckusickfields are examined for the name of the sender. 7547470Scael.It Fl bd 7647470ScaelRun as a daemon. This requires Berkeley 7747470Scael.Tn IPC . 7847470Scael.Nm Sendmail 7928373Sericwill fork and run in background 8047470Scaellistening on socket 25 for incoming 8147470Scael.Tn SMTP 8247470Scaelconnections. 8328373SericThis is normally run from 8447470Scael.Pa /etc/rc . 8547470Scael.It Fl bi 8618858SmckusickInitialize the alias database. 8747470Scael.It Fl bm 8818858SmckusickDeliver mail in the usual way (default). 8947470Scael.It Fl bp 9018858SmckusickPrint a listing of the queue. 9147470Scael.It Fl bs 9247470ScaelUse the 9347470Scael.Tn SMTP 9447470Scaelprotocol as described in 9547470Scael.Tn RFC821 9628373Sericon standard input and output. 9718858SmckusickThis flag implies all the operations of the 9847470Scael.Fl ba 9947470Scaelflag that are compatible with 10047470Scael.Tn SMTP . 10147470Scael.It Fl bt 10218858SmckusickRun in address test mode. 10318858SmckusickThis mode reads addresses and shows the steps in parsing; 10418858Smckusickit is used for debugging configuration tables. 10547470Scael.It Fl bv 10618858SmckusickVerify names only \- do not try to collect or deliver a message. 10718858SmckusickVerify mode is normally used for validating 10818858Smckusickusers or mailing lists. 10947470Scael.It Fl C Ns Ar file 11018858SmckusickUse alternate configuration file. 11147470Scael.Nm Sendmail 11228373Sericrefuses to run as root if an alternate configuration file is specified. 11347470Scael.It Fl d Ns Ar X 11418858SmckusickSet debugging value to 11547470Scael.Ar X . 11665104Smckusick.ne 1i 11747470Scael.It Fl F Ns Ar fullname 11818858SmckusickSet the full name of the sender. 11947470Scael.It Fl f Ns Ar name 12018858SmckusickSets the name of the ``from'' person 12118858Smckusick(i.e., the sender of the mail). 12247470Scael.Fl f 12318858Smckusickcan only be used 12428373Sericby ``trusted'' users 12528373Seric(normally 12647470Scael.Em root , 12747470Scael.Em daemon , 12818857Smckusickand 12947470Scael.Em network ) 13018857Smckusickor if the person you are trying to become 13118857Smckusickis the same as the person you are. 13247470Scael.It Fl h Ns Ar N 13318858SmckusickSet the hop count to 13447470Scael.Ar N . 13518858SmckusickThe hop count is incremented every time the mail is 13618858Smckusickprocessed. 13718858SmckusickWhen it reaches a limit, 13818858Smckusickthe mail is returned with an error message, 13918858Smckusickthe victim of an aliasing loop. 14028373SericIf not specified, 14128373Seric``Received:'' lines in the message are counted. 14247470Scael.It Fl n 14318858SmckusickDon't do aliasing. 14447470Scael.It Fl o Ns Ar x Em value 14518858SmckusickSet option 14647470Scael.Ar x 14718858Smckusickto the specified 14847470Scael.Em value . 14918858SmckusickOptions are described below. 15057141Seric.It Fl p Ns Ar protocol 15157141SericSet the name of the protocol used to receive the message. 15257141SericThis can be a simple protocol name such as ``UUCP'' 15357141Sericor a protocol and hostname, such as ``UUCP:ucbvax''. 15447470Scael.It Fl q Ns Bq Ar time 15518858SmckusickProcessed saved messages in the queue at given intervals. 15618858SmckusickIf 15747470Scael.Ar time 15818858Smckusickis omitted, 15918858Smckusickprocess the queue once. 16047470Scael.Xr Time 16118858Smckusickis given as a tagged number, 16247470Scaelwith 16347470Scael.Ql s 16447470Scaelbeing seconds, 16547470Scael.Ql m 16647470Scaelbeing minutes, 16747470Scael.Ql h 16847470Scaelbeing hours, 16947470Scael.Ql d 17047470Scaelbeing days, 17118858Smckusickand 17247470Scael.Ql w 17347470Scaelbeing weeks. 17418858SmckusickFor example, 17547470Scael.Ql \-q1h30m 17647470Scaelor 17747470Scael.Ql \-q90m 17818858Smckusickwould both set the timeout to one hour thirty minutes. 17928373SericIf 18047470Scael.Ar time 18128373Sericis specified, 18247470Scael.Nm sendmail 18328373Sericwill run in background. 18428373SericThis option can be used safely with 18547470Scael.Fl bd . 18647470Scael.It Fl r Ns Ar name 18718858SmckusickAn alternate and obsolete form of the 18847470Scael.Fl f 18918858Smckusickflag. 19047470Scael.It Fl t 19118858SmckusickRead message for recipients. 19228373SericTo:, Cc:, and Bcc: lines will be scanned for recipient addresses. 19318858SmckusickThe Bcc: line will be deleted before transmission. 19428373SericAny addresses in the argument list will be suppressed, 19528373Sericthat is, 19628373Sericthey will 19747470Scael.Em not 19828373Sericreceive copies even if listed in the message header. 19947470Scael.It Fl v 20018858SmckusickGo into verbose mode. 20118858SmckusickAlias expansions will be announced, etc. 20263862Seric.It Fl X Ar logfile 20363862SericLog all traffic in and out of mailers in the indicated log file. 20463862SericThis should only be used as a last resort 20563862Sericfor debugging mailer bugs. 20663862SericIt will log a lot of data very quickly. 20747470Scael.El 20863452Seric.Ss Options 20918858SmckusickThere are also a number of processing options that may be set. 21018858SmckusickNormally these will only be used by a system administrator. 21118858SmckusickOptions may be set either on the command line 21218858Smckusickusing the 21347470Scael.Fl o 21418858Smckusickflag 21518858Smckusickor in the configuration file. 21663451SbosticThis is a partial list; 21763451Sbosticfor a complete list (and details), consult the 21848584Scael.%T "Sendmail Installation and Operation Guide" . 21918858SmckusickThe options are: 22047470Scael.Bl -tag -width Fl 22147470Scael.It Li A Ns Ar file 22218858SmckusickUse alternate alias file. 22363451Sbostic.It Li b Ns Ar nblocks 22463451SbosticThe minimum number of free blocks needed on the spool filesystem. 22547470Scael.It Li c 22618858SmckusickOn mailers that are considered ``expensive'' to connect to, 22718858Smckusickdon't initiate immediate connection. 22818858SmckusickThis requires queueing. 22951305Seric.It Li C Ar N 23051305SericCheckpoint the queue file after every 23151305Seric.Ar N 23251305Sericsuccessful deliveries (default 10). 23351305SericThis avoids excessive duplicate deliveries 23451305Sericwhen sending to long mailing lists 23551305Sericinterrupted by system crashes. 236*67332Sah.ne 1i 23747470Scael.It Li d Ns Ar x 23818858SmckusickSet the delivery mode to 23947470Scael.Ar x . 24018858SmckusickDelivery modes are 24147470Scael.Ql i 24247470Scaelfor interactive (synchronous) delivery, 24347470Scael.Ql b 24447470Scaelfor background (asynchronous) delivery, 24518858Smckusickand 24647470Scael.Ql q 24747470Scaelfor queue only \- i.e., 24818858Smckusickactual delivery is done the next time the queue is run. 24947470Scael.It Li D 25018858SmckusickTry to automatically rebuild the alias database 25118858Smckusickif necessary. 25247470Scael.It Li e Ns Ar x 25318858SmckusickSet error processing to mode 25447470Scael.Ar x . 25518858SmckusickValid modes are 25647470Scael.Ql m 25747470Scaelto mail back the error message, 25847470Scael.Ql w 25947470Scaelto ``write'' back the error message 26018858Smckusick(or mail it back if the sender is not logged in), 26147470Scael.Ql p 26247470Scaelto print the errors on the terminal 26318858Smckusick(default), 26447470Scael.Ql q 26547470Scaelto throw away error messages 26618858Smckusick(only exit status is returned), 26747470Scaeland 26847470Scael.Ql e 26918858Smckusickto do special processing for the BerkNet. 27018858SmckusickIf the text of the message is not mailed back 27118858Smckusickby 27247470Scaelmodes 27347470Scael.Ql m 27447470Scaelor 27547470Scael.Ql w 27618858Smckusickand if the sender is local to this machine, 27718858Smckusicka copy of the message is appended to the file 27847470Scael.Pa dead.letter 27918857Smckusickin the sender's home directory. 28047470Scael.It Li f 28147470ScaelSave 28247470Scael.Tn UNIX Ns \-style 28347470ScaelFrom lines at the front of messages. 28463451Sbostic.It Li G 28563451SbosticMatch local mail names against the GECOS portion of the password file. 28647470Scael.It Li g Ar N 28718858SmckusickThe default group id to use when calling mailers. 28847470Scael.It Li H Ns Ar file 28947470ScaelThe 29047470Scael.Tn SMTP 29147470Scaelhelp file. 29251305Seric.It Li h Ar N 29351305SericThe maximum number of times a message is allowed to ``hop'' 29451305Sericbefore we decide it is in a loop. 29547470Scael.It Li i 29618858SmckusickDo not take dots on a line by themselves 29718858Smckusickas a message terminator. 29863451Sbostic.It Li j 29963451SbosticSend error messages in MIME format. 30063451Sbostic.It Li K Ns Ar timeout 30163451SbosticSet connection cache timeout. 30263451Sbostic.It Li k Ns Ar N 30363451SbosticSet connection cache size. 30447470Scael.It Li L Ns Ar n 30518858SmckusickThe log level. 30663451Sbostic.It Li l 30763451SbosticPay attention to the Errors-To: header. 30847470Scael.It Li m 30918858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 31063451Sbostic.It Li n 31163451SbosticValidate the right hand side of aliases during a 31263451Sbostic.Xr newaliases 1 31363451Sbosticcommand. 31447470Scael.It Li o 31518858SmckusickIf set, this message may have 31618858Smckusickold style headers. 31718858SmckusickIf not set, 31818858Smckusickthis message is guaranteed to have new style headers 31918858Smckusick(i.e., commas instead of spaces between addresses). 32018858SmckusickIf set, an adaptive algorithm is used that will correctly 32118858Smckusickdetermine the header format in most cases. 32247470Scael.It Li Q Ns Ar queuedir 32318858SmckusickSelect the directory in which to queue messages. 32447470Scael.It Li S Ns Ar file 32518858SmckusickSave statistics in the named file. 32647470Scael.It Li s 32718858SmckusickAlways instantiate the queue file, 32818858Smckusickeven under circumstances where it is not strictly necessary. 32928373SericThis provides safety against system crashes during delivery. 33047470Scael.It Li T Ns Ar time 33128373SericSet the timeout on undelivered messages in the queue to the specified time. 33228373SericAfter delivery has failed 33328373Seric(e.g., because of a host being down) 33428373Sericfor this amount of time, 33528373Sericfailed messages will be returned to the sender. 33618858SmckusickThe default is three days. 33747470Scael.It Li t Ns Ar stz , Ar dtz 33818858SmckusickSet the name of the time zone. 33950556Seric.It Li U Ns Ar userdatabase 34050556SericIf set, a user database is consulted to get forwarding information. 34150556SericYou can consider this an adjunct to the aliasing mechanism, 34250556Sericexcept that the database is intended to be distributed; 34350556Sericaliases are local to a particular host. 34450556SericThis may not be available if your sendmail does not have the 34550769Scael.Dv USERDB 34650769Scaeloption compiled in. 34747470Scael.It Li u Ns Ar N 34818858SmckusickSet the default user id for mailers. 34963451Sbostic.It Li Y 35063451SbosticFork each job during queue runs. 35163451SbosticMay be convenient on memory-poor machines. 35263451Sbostic.It Li 7 35363451SbosticStrip incoming messages to seven bits. 35447470Scael.El 35547470Scael.Pp 35628373SericIn aliases, 35728373Sericthe first character of a name may be 35828373Serica vertical bar to cause interpretation of 35928373Sericthe rest of the name as a command 36018857Smckusickto pipe the mail to. 36128373SericIt may be necessary to quote the name 36218857Smckusickto keep 36347470Scael.Nm sendmail 36418857Smckusickfrom suppressing the blanks from between arguments. 36528373SericFor example, a common alias is: 36647470Scael.Pp 36747470Scael.Bd -literal -offset indent -compact 36847470Scaelmsgs: "|/usr/bin/msgs -s" 36947470Scael.Ed 37047470Scael.Pp 37147470ScaelAliases may also have the syntax 37247470Scael.Dq :include: Ns Ar filename 37328373Sericto ask 37447470Scael.Xr sendmail 37528373Sericto read the named file for a list of recipients. 37628373SericFor example, an alias such as: 37747470Scael.Pp 37847470Scael.Bd -literal -offset indent -compact 37947470Scaelpoets: ":include:/usr/local/lib/poets.list" 38047470Scael.Ed 38147470Scael.Pp 38228373Sericwould read 38347470Scael.Pa /usr/local/lib/poets.list 38428373Sericfor the list of addresses making up the group. 38547470Scael.Pp 38647470Scael.Nm Sendmail 38718857Smckusickreturns an exit status 38818857Smckusickdescribing what it did. 38918858SmckusickThe codes are defined in 39047470Scael.Aq Pa sysexits.h : 39147470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 39247470Scael.It Dv EX_OK 39347470ScaelSuccessful completion on all addresses. 39447470Scael.It Dv EX_NOUSER 39547470ScaelUser name not recognized. 39647470Scael.It Dv EX_UNAVAILABLE 39747470ScaelCatchall meaning necessary resources 39818857Smckusickwere not available. 39947470Scael.It Dv EX_SYNTAX 40047470ScaelSyntax error in address. 40147470Scael.It Dv EX_SOFTWARE 40247470ScaelInternal software error, 40318857Smckusickincluding bad arguments. 40447470Scael.It Dv EX_OSERR 40547470ScaelTemporary operating system error, 40647470Scaelsuch as 40747470Scael.Dq cannot fork . 40847470Scael.It Dv EX_NOHOST 40947470ScaelHost name not recognized. 41047470Scael.It Dv EX_TEMPFAIL 41147470ScaelMessage could not be sent immediately, 41218858Smckusickbut was queued. 41347470Scael.El 41447470Scael.Pp 41518858SmckusickIf invoked as 41647470Scael.Nm newaliases , 41747470Scael.Nm sendmail 41818858Smckusickwill rebuild the alias database. 41918858SmckusickIf invoked as 42047470Scael.Nm mailq , 42147470Scael.Nm sendmail 42218858Smckusickwill print the contents of the mail queue. 42347470Scael.Sh FILES 42447470ScaelExcept for the file 42547470Scael.Pa /etc/sendmail.cf 42647470Scaelitself, 42747470Scaelthe following pathnames are all specified in 42847470Scael.Pa /etc/sendmail.cf. 42918858SmckusickThus, 43018858Smckusickthese values are only approximations. 43147470Scael.Pp 43247470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 43347470Scael.It Pa /etc/aliases 43447470Scaelraw data for alias names 43563451Sbostic.It Pa /etc/aliases.db 43647470Scaeldata base of alias names 43747470Scael.It Pa /etc/sendmail.cf 43847470Scaelconfiguration file 43947470Scael.It Pa /etc/sendmail.hf 44047470Scaelhelp file 44147470Scael.It Pa /var/log/sendmail.st 44247470Scaelcollected statistics 44347470Scael.It Pa /var/spool/mqueue/* 44447470Scaeltemp files 44563451Sbostic.It Pa /var/run/sendmail.pid 44663451SbosticThe process id of the daemon 44747470Scael.El 44847470Scael.Sh SEE ALSO 44947470Scael.Xr binmail 1 , 45047470Scael.Xr mail 1 , 45147470Scael.Xr rmail 1 , 45247470Scael.Xr syslog 3 , 45347470Scael.Xr aliases 5 , 45447470Scael.Xr mailaddr 7 , 45547470Scael.Xr rc 8 ; 45647470Scael.Pp 45747470ScaelDARPA 45847470ScaelInternet Request For Comments 45947470Scael.%T RFC819 , 46047470Scael.%T RFC821 , 46147470Scael.%T RFC822 . 46247470Scael.Rs 46348584Scael.%T "Sendmail \- An Internetwork Mail Router" 46447470Scael.%V SMM 46547470Scael.%N \&No. 9 46647470Scael.Re 46747470Scael.Rs 46848584Scael.%T "Sendmail Installation and Operation Guide" 46947470Scael.%V SMM 47047470Scael.%N \&No. 8 47147470Scael.Re 47247470Scael.Sh HISTORY 47347470ScaelThe 47447470Scael.Nm 47547470Scaelcommand appeared in 47647470Scael.Bx 4.2 . 477