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*65104Smckusick.\" @(#)sendmail.8 8.4 (Berkeley) 12/11/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'. 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 . 116*65104Smckusick.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. 23647470Scael.It Li d Ns Ar x 23718858SmckusickSet the delivery mode to 23847470Scael.Ar x . 23918858SmckusickDelivery modes are 24047470Scael.Ql i 24147470Scaelfor interactive (synchronous) delivery, 24247470Scael.Ql b 24347470Scaelfor background (asynchronous) delivery, 24418858Smckusickand 24547470Scael.Ql q 24647470Scaelfor queue only \- i.e., 24718858Smckusickactual delivery is done the next time the queue is run. 24847470Scael.It Li D 24918858SmckusickTry to automatically rebuild the alias database 25018858Smckusickif necessary. 25147470Scael.It Li e Ns Ar x 25218858SmckusickSet error processing to mode 25347470Scael.Ar x . 25418858SmckusickValid modes are 25547470Scael.Ql m 25647470Scaelto mail back the error message, 25747470Scael.Ql w 25847470Scaelto ``write'' back the error message 25918858Smckusick(or mail it back if the sender is not logged in), 26047470Scael.Ql p 26147470Scaelto print the errors on the terminal 26218858Smckusick(default), 26347470Scael.Ql q 26447470Scaelto throw away error messages 26518858Smckusick(only exit status is returned), 26647470Scaeland 26747470Scael.Ql e 26818858Smckusickto do special processing for the BerkNet. 26918858SmckusickIf the text of the message is not mailed back 27018858Smckusickby 27147470Scaelmodes 27247470Scael.Ql m 27347470Scaelor 27447470Scael.Ql w 27518858Smckusickand if the sender is local to this machine, 27618858Smckusicka copy of the message is appended to the file 27747470Scael.Pa dead.letter 27818857Smckusickin the sender's home directory. 27947470Scael.It Li f 28047470ScaelSave 28147470Scael.Tn UNIX Ns \-style 28247470ScaelFrom lines at the front of messages. 28363451Sbostic.It Li G 28463451SbosticMatch local mail names against the GECOS portion of the password file. 28547470Scael.It Li g Ar N 28618858SmckusickThe default group id to use when calling mailers. 28747470Scael.It Li H Ns Ar file 28847470ScaelThe 28947470Scael.Tn SMTP 29047470Scaelhelp file. 29151305Seric.It Li h Ar N 29251305SericThe maximum number of times a message is allowed to ``hop'' 29351305Sericbefore we decide it is in a loop. 29447470Scael.It Li i 29518858SmckusickDo not take dots on a line by themselves 29618858Smckusickas a message terminator. 29763451Sbostic.It Li j 29863451SbosticSend error messages in MIME format. 29963451Sbostic.It Li K Ns Ar timeout 30063451SbosticSet connection cache timeout. 30163451Sbostic.It Li k Ns Ar N 30263451SbosticSet connection cache size. 30347470Scael.It Li L Ns Ar n 30418858SmckusickThe log level. 30563451Sbostic.It Li l 30663451SbosticPay attention to the Errors-To: header. 30747470Scael.It Li m 30818858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 30963451Sbostic.It Li n 31063451SbosticValidate the right hand side of aliases during a 31163451Sbostic.Xr newaliases 1 31263451Sbosticcommand. 31347470Scael.It Li o 31418858SmckusickIf set, this message may have 31518858Smckusickold style headers. 31618858SmckusickIf not set, 31718858Smckusickthis message is guaranteed to have new style headers 31818858Smckusick(i.e., commas instead of spaces between addresses). 31918858SmckusickIf set, an adaptive algorithm is used that will correctly 32018858Smckusickdetermine the header format in most cases. 32147470Scael.It Li Q Ns Ar queuedir 32218858SmckusickSelect the directory in which to queue messages. 32347470Scael.It Li S Ns Ar file 32418858SmckusickSave statistics in the named file. 32547470Scael.It Li s 32618858SmckusickAlways instantiate the queue file, 32718858Smckusickeven under circumstances where it is not strictly necessary. 32828373SericThis provides safety against system crashes during delivery. 32947470Scael.It Li T Ns Ar time 33028373SericSet the timeout on undelivered messages in the queue to the specified time. 33128373SericAfter delivery has failed 33228373Seric(e.g., because of a host being down) 33328373Sericfor this amount of time, 33428373Sericfailed messages will be returned to the sender. 33518858SmckusickThe default is three days. 33647470Scael.It Li t Ns Ar stz , Ar dtz 33718858SmckusickSet the name of the time zone. 33850556Seric.It Li U Ns Ar userdatabase 33950556SericIf set, a user database is consulted to get forwarding information. 34050556SericYou can consider this an adjunct to the aliasing mechanism, 34150556Sericexcept that the database is intended to be distributed; 34250556Sericaliases are local to a particular host. 34350556SericThis may not be available if your sendmail does not have the 34450769Scael.Dv USERDB 34550769Scaeloption compiled in. 34647470Scael.It Li u Ns Ar N 34718858SmckusickSet the default user id for mailers. 34863451Sbostic.It Li Y 34963451SbosticFork each job during queue runs. 35063451SbosticMay be convenient on memory-poor machines. 35163451Sbostic.It Li 7 35263451SbosticStrip incoming messages to seven bits. 35347470Scael.El 35447470Scael.Pp 35528373SericIn aliases, 35628373Sericthe first character of a name may be 35728373Serica vertical bar to cause interpretation of 35828373Sericthe rest of the name as a command 35918857Smckusickto pipe the mail to. 36028373SericIt may be necessary to quote the name 36118857Smckusickto keep 36247470Scael.Nm sendmail 36318857Smckusickfrom suppressing the blanks from between arguments. 36428373SericFor example, a common alias is: 36547470Scael.Pp 36647470Scael.Bd -literal -offset indent -compact 36747470Scaelmsgs: "|/usr/bin/msgs -s" 36847470Scael.Ed 36947470Scael.Pp 37047470ScaelAliases may also have the syntax 37147470Scael.Dq :include: Ns Ar filename 37228373Sericto ask 37347470Scael.Xr sendmail 37428373Sericto read the named file for a list of recipients. 37528373SericFor example, an alias such as: 37647470Scael.Pp 37747470Scael.Bd -literal -offset indent -compact 37847470Scaelpoets: ":include:/usr/local/lib/poets.list" 37947470Scael.Ed 38047470Scael.Pp 38128373Sericwould read 38247470Scael.Pa /usr/local/lib/poets.list 38328373Sericfor the list of addresses making up the group. 38447470Scael.Pp 38547470Scael.Nm Sendmail 38618857Smckusickreturns an exit status 38718857Smckusickdescribing what it did. 38818858SmckusickThe codes are defined in 38947470Scael.Aq Pa sysexits.h : 39047470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 39147470Scael.It Dv EX_OK 39247470ScaelSuccessful completion on all addresses. 39347470Scael.It Dv EX_NOUSER 39447470ScaelUser name not recognized. 39547470Scael.It Dv EX_UNAVAILABLE 39647470ScaelCatchall meaning necessary resources 39718857Smckusickwere not available. 39847470Scael.It Dv EX_SYNTAX 39947470ScaelSyntax error in address. 40047470Scael.It Dv EX_SOFTWARE 40147470ScaelInternal software error, 40218857Smckusickincluding bad arguments. 40347470Scael.It Dv EX_OSERR 40447470ScaelTemporary operating system error, 40547470Scaelsuch as 40647470Scael.Dq cannot fork . 40747470Scael.It Dv EX_NOHOST 40847470ScaelHost name not recognized. 40947470Scael.It Dv EX_TEMPFAIL 41047470ScaelMessage could not be sent immediately, 41118858Smckusickbut was queued. 41247470Scael.El 41347470Scael.Pp 41418858SmckusickIf invoked as 41547470Scael.Nm newaliases , 41647470Scael.Nm sendmail 41718858Smckusickwill rebuild the alias database. 41818858SmckusickIf invoked as 41947470Scael.Nm mailq , 42047470Scael.Nm sendmail 42118858Smckusickwill print the contents of the mail queue. 42247470Scael.Sh FILES 42347470ScaelExcept for the file 42447470Scael.Pa /etc/sendmail.cf 42547470Scaelitself, 42647470Scaelthe following pathnames are all specified in 42747470Scael.Pa /etc/sendmail.cf. 42818858SmckusickThus, 42918858Smckusickthese values are only approximations. 43047470Scael.Pp 43147470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 43247470Scael.It Pa /etc/aliases 43347470Scaelraw data for alias names 43463451Sbostic.It Pa /etc/aliases.db 43547470Scaeldata base of alias names 43647470Scael.It Pa /etc/sendmail.cf 43747470Scaelconfiguration file 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 44463451Sbostic.It Pa /var/run/sendmail.pid 44563451SbosticThe 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