1*63861Sbostic.\" Copyright (c) 1988, 1991, 1993 2*63861Sbostic.\" The Regents of the University of California. All rights reserved. 318857Smckusick.\" 443844Strent.\" %sccs.include.redist.man% 518857Smckusick.\" 6*63861Sbostic.\" @(#)sendmail.8 8.1 (Berkeley) 07/18/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 bz 11018858SmckusickCreate the configuration freeze file. 11147470Scael.It Fl C Ns Ar file 11218858SmckusickUse alternate configuration file. 11347470Scael.Nm Sendmail 11428373Sericrefuses to run as root if an alternate configuration file is specified. 11528373SericThe frozen configuration file is bypassed. 11647470Scael.It Fl d Ns Ar X 11718858SmckusickSet debugging value to 11847470Scael.Ar X . 11947470Scael.It Fl F Ns Ar fullname 12018858SmckusickSet the full name of the sender. 12147470Scael.It Fl f Ns Ar name 12218858SmckusickSets the name of the ``from'' person 12318858Smckusick(i.e., the sender of the mail). 12447470Scael.Fl f 12518858Smckusickcan only be used 12628373Sericby ``trusted'' users 12728373Seric(normally 12847470Scael.Em root , 12947470Scael.Em daemon , 13018857Smckusickand 13147470Scael.Em network ) 13218857Smckusickor if the person you are trying to become 13318857Smckusickis the same as the person you are. 13447470Scael.It Fl h Ns Ar N 13518858SmckusickSet the hop count to 13647470Scael.Ar N . 13718858SmckusickThe hop count is incremented every time the mail is 13818858Smckusickprocessed. 13918858SmckusickWhen it reaches a limit, 14018858Smckusickthe mail is returned with an error message, 14118858Smckusickthe victim of an aliasing loop. 14228373SericIf not specified, 14328373Seric``Received:'' lines in the message are counted. 14447470Scael.It Fl n 14518858SmckusickDon't do aliasing. 14647470Scael.It Fl o Ns Ar x Em value 14718858SmckusickSet option 14847470Scael.Ar x 14918858Smckusickto the specified 15047470Scael.Em value . 15118858SmckusickOptions are described below. 15257141Seric.It Fl p Ns Ar protocol 15357141SericSet the name of the protocol used to receive the message. 15457141SericThis can be a simple protocol name such as ``UUCP'' 15557141Sericor a protocol and hostname, such as ``UUCP:ucbvax''. 15647470Scael.It Fl q Ns Bq Ar time 15718858SmckusickProcessed saved messages in the queue at given intervals. 15818858SmckusickIf 15947470Scael.Ar time 16018858Smckusickis omitted, 16118858Smckusickprocess the queue once. 16247470Scael.Xr Time 16318858Smckusickis given as a tagged number, 16447470Scaelwith 16547470Scael.Ql s 16647470Scaelbeing seconds, 16747470Scael.Ql m 16847470Scaelbeing minutes, 16947470Scael.Ql h 17047470Scaelbeing hours, 17147470Scael.Ql d 17247470Scaelbeing days, 17318858Smckusickand 17447470Scael.Ql w 17547470Scaelbeing weeks. 17618858SmckusickFor example, 17747470Scael.Ql \-q1h30m 17847470Scaelor 17947470Scael.Ql \-q90m 18018858Smckusickwould both set the timeout to one hour thirty minutes. 18128373SericIf 18247470Scael.Ar time 18328373Sericis specified, 18447470Scael.Nm sendmail 18528373Sericwill run in background. 18628373SericThis option can be used safely with 18747470Scael.Fl bd . 18847470Scael.It Fl r Ns Ar name 18918858SmckusickAn alternate and obsolete form of the 19047470Scael.Fl f 19118858Smckusickflag. 19247470Scael.It Fl t 19318858SmckusickRead message for recipients. 19428373SericTo:, Cc:, and Bcc: lines will be scanned for recipient addresses. 19518858SmckusickThe Bcc: line will be deleted before transmission. 19628373SericAny addresses in the argument list will be suppressed, 19728373Sericthat is, 19828373Sericthey will 19947470Scael.Em not 20028373Sericreceive copies even if listed in the message header. 20147470Scael.It Fl v 20218858SmckusickGo into verbose mode. 20318858SmckusickAlias expansions will be announced, etc. 20447470Scael.El 20563452Seric.Ss Options 20618858SmckusickThere are also a number of processing options that may be set. 20718858SmckusickNormally these will only be used by a system administrator. 20818858SmckusickOptions may be set either on the command line 20918858Smckusickusing the 21047470Scael.Fl o 21118858Smckusickflag 21218858Smckusickor in the configuration file. 21363451SbosticThis is a partial list; 21463451Sbosticfor a complete list (and details), consult the 21548584Scael.%T "Sendmail Installation and Operation Guide" . 21618858SmckusickThe options are: 21747470Scael.Bl -tag -width Fl 21847470Scael.It Li A Ns Ar file 21918858SmckusickUse alternate alias file. 22063451Sbostic.It Li b Ns Ar nblocks 22163451SbosticThe minimum number of free blocks needed on the spool filesystem. 22247470Scael.It Li c 22318858SmckusickOn mailers that are considered ``expensive'' to connect to, 22418858Smckusickdon't initiate immediate connection. 22518858SmckusickThis requires queueing. 22651305Seric.It Li C Ar N 22751305SericCheckpoint the queue file after every 22851305Seric.Ar N 22951305Sericsuccessful deliveries (default 10). 23051305SericThis avoids excessive duplicate deliveries 23151305Sericwhen sending to long mailing lists 23251305Sericinterrupted by system crashes. 23347470Scael.It Li d Ns Ar x 23418858SmckusickSet the delivery mode to 23547470Scael.Ar x . 23618858SmckusickDelivery modes are 23747470Scael.Ql i 23847470Scaelfor interactive (synchronous) delivery, 23947470Scael.Ql b 24047470Scaelfor background (asynchronous) delivery, 24118858Smckusickand 24247470Scael.Ql q 24347470Scaelfor queue only \- i.e., 24418858Smckusickactual delivery is done the next time the queue is run. 24547470Scael.It Li D 24618858SmckusickTry to automatically rebuild the alias database 24718858Smckusickif necessary. 24847470Scael.It Li e Ns Ar x 24918858SmckusickSet error processing to mode 25047470Scael.Ar x . 25118858SmckusickValid modes are 25247470Scael.Ql m 25347470Scaelto mail back the error message, 25447470Scael.Ql w 25547470Scaelto ``write'' back the error message 25618858Smckusick(or mail it back if the sender is not logged in), 25747470Scael.Ql p 25847470Scaelto print the errors on the terminal 25918858Smckusick(default), 26047470Scael.Ql q 26147470Scaelto throw away error messages 26218858Smckusick(only exit status is returned), 26347470Scaeland 26447470Scael.Ql e 26518858Smckusickto do special processing for the BerkNet. 26618858SmckusickIf the text of the message is not mailed back 26718858Smckusickby 26847470Scaelmodes 26947470Scael.Ql m 27047470Scaelor 27147470Scael.Ql w 27218858Smckusickand if the sender is local to this machine, 27318858Smckusicka copy of the message is appended to the file 27447470Scael.Pa dead.letter 27518857Smckusickin the sender's home directory. 27647470Scael.It Li f 27747470ScaelSave 27847470Scael.Tn UNIX Ns \-style 27947470ScaelFrom lines at the front of messages. 28063451Sbostic.It Li G 28163451SbosticMatch local mail names against the GECOS portion of the password file. 28247470Scael.It Li g Ar N 28318858SmckusickThe default group id to use when calling mailers. 28447470Scael.It Li H Ns Ar file 28547470ScaelThe 28647470Scael.Tn SMTP 28747470Scaelhelp file. 28851305Seric.It Li h Ar N 28951305SericThe maximum number of times a message is allowed to ``hop'' 29051305Sericbefore we decide it is in a loop. 29147470Scael.It Li i 29218858SmckusickDo not take dots on a line by themselves 29318858Smckusickas a message terminator. 29463451Sbostic.It Li j 29563451SbosticSend error messages in MIME format. 29663451Sbostic.It Li K Ns Ar timeout 29763451SbosticSet connection cache timeout. 29863451Sbostic.It Li k Ns Ar N 29963451SbosticSet connection cache size. 30047470Scael.It Li L Ns Ar n 30118858SmckusickThe log level. 30263451Sbostic.It Li l 30363451SbosticPay attention to the Errors-To: header. 30447470Scael.It Li m 30518858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 30663451Sbostic.It Li n 30763451SbosticValidate the right hand side of aliases during a 30863451Sbostic.Xr newaliases 1 30963451Sbosticcommand. 31047470Scael.It Li o 31118858SmckusickIf set, this message may have 31218858Smckusickold style headers. 31318858SmckusickIf not set, 31418858Smckusickthis message is guaranteed to have new style headers 31518858Smckusick(i.e., commas instead of spaces between addresses). 31618858SmckusickIf set, an adaptive algorithm is used that will correctly 31718858Smckusickdetermine the header format in most cases. 31847470Scael.It Li Q Ns Ar queuedir 31918858SmckusickSelect the directory in which to queue messages. 32047470Scael.It Li S Ns Ar file 32118858SmckusickSave statistics in the named file. 32247470Scael.It Li s 32318858SmckusickAlways instantiate the queue file, 32418858Smckusickeven under circumstances where it is not strictly necessary. 32528373SericThis provides safety against system crashes during delivery. 32647470Scael.It Li T Ns Ar time 32728373SericSet the timeout on undelivered messages in the queue to the specified time. 32828373SericAfter delivery has failed 32928373Seric(e.g., because of a host being down) 33028373Sericfor this amount of time, 33128373Sericfailed messages will be returned to the sender. 33218858SmckusickThe default is three days. 33347470Scael.It Li t Ns Ar stz , Ar dtz 33418858SmckusickSet the name of the time zone. 33550556Seric.It Li U Ns Ar userdatabase 33650556SericIf set, a user database is consulted to get forwarding information. 33750556SericYou can consider this an adjunct to the aliasing mechanism, 33850556Sericexcept that the database is intended to be distributed; 33950556Sericaliases are local to a particular host. 34050556SericThis may not be available if your sendmail does not have the 34150769Scael.Dv USERDB 34250769Scaeloption compiled in. 34347470Scael.It Li u Ns Ar N 34418858SmckusickSet the default user id for mailers. 34563451Sbostic.It Li Y 34663451SbosticFork each job during queue runs. 34763451SbosticMay be convenient on memory-poor machines. 34863451Sbostic.It Li 7 34963451SbosticStrip incoming messages to seven bits. 35047470Scael.El 35147470Scael.Pp 35228373SericIn aliases, 35328373Sericthe first character of a name may be 35428373Serica vertical bar to cause interpretation of 35528373Sericthe rest of the name as a command 35618857Smckusickto pipe the mail to. 35728373SericIt may be necessary to quote the name 35818857Smckusickto keep 35947470Scael.Nm sendmail 36018857Smckusickfrom suppressing the blanks from between arguments. 36128373SericFor example, a common alias is: 36247470Scael.Pp 36347470Scael.Bd -literal -offset indent -compact 36447470Scaelmsgs: "|/usr/bin/msgs -s" 36547470Scael.Ed 36647470Scael.Pp 36747470ScaelAliases may also have the syntax 36847470Scael.Dq :include: Ns Ar filename 36928373Sericto ask 37047470Scael.Xr sendmail 37128373Sericto read the named file for a list of recipients. 37228373SericFor example, an alias such as: 37347470Scael.Pp 37447470Scael.Bd -literal -offset indent -compact 37547470Scaelpoets: ":include:/usr/local/lib/poets.list" 37647470Scael.Ed 37747470Scael.Pp 37828373Sericwould read 37947470Scael.Pa /usr/local/lib/poets.list 38028373Sericfor the list of addresses making up the group. 38147470Scael.Pp 38247470Scael.Nm Sendmail 38318857Smckusickreturns an exit status 38418857Smckusickdescribing what it did. 38518858SmckusickThe codes are defined in 38647470Scael.Aq Pa sysexits.h : 38747470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 38847470Scael.It Dv EX_OK 38947470ScaelSuccessful completion on all addresses. 39047470Scael.It Dv EX_NOUSER 39147470ScaelUser name not recognized. 39247470Scael.It Dv EX_UNAVAILABLE 39347470ScaelCatchall meaning necessary resources 39418857Smckusickwere not available. 39547470Scael.It Dv EX_SYNTAX 39647470ScaelSyntax error in address. 39747470Scael.It Dv EX_SOFTWARE 39847470ScaelInternal software error, 39918857Smckusickincluding bad arguments. 40047470Scael.It Dv EX_OSERR 40147470ScaelTemporary operating system error, 40247470Scaelsuch as 40347470Scael.Dq cannot fork . 40447470Scael.It Dv EX_NOHOST 40547470ScaelHost name not recognized. 40647470Scael.It Dv EX_TEMPFAIL 40747470ScaelMessage could not be sent immediately, 40818858Smckusickbut was queued. 40947470Scael.El 41047470Scael.Pp 41118858SmckusickIf invoked as 41247470Scael.Nm newaliases , 41347470Scael.Nm sendmail 41418858Smckusickwill rebuild the alias database. 41518858SmckusickIf invoked as 41647470Scael.Nm mailq , 41747470Scael.Nm sendmail 41818858Smckusickwill print the contents of the mail queue. 41947470Scael.Sh FILES 42047470ScaelExcept for the file 42147470Scael.Pa /etc/sendmail.cf 42247470Scaelitself, 42347470Scaelthe following pathnames are all specified in 42447470Scael.Pa /etc/sendmail.cf. 42518858SmckusickThus, 42618858Smckusickthese values are only approximations. 42747470Scael.Pp 42847470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 42947470Scael.It Pa /etc/aliases 43047470Scaelraw data for alias names 43163451Sbostic.It Pa /etc/aliases.db 43247470Scaeldata base of alias names 43347470Scael.It Pa /etc/sendmail.cf 43447470Scaelconfiguration file 43547470Scael.It Pa /etc/sendmail.fc 43647470Scaelfrozen configuration 43747470Scael.It Pa /etc/sendmail.hf 43847470Scaelhelp file 43947470Scael.It Pa /var/log/sendmail.st 44047470Scaelcollected statistics 44147470Scael.It Pa /var/spool/mqueue/* 44247470Scaeltemp files 44363451Sbostic.It Pa /var/run/sendmail.pid 44463451SbosticThe process id of the daemon 44547470Scael.El 44647470Scael.Sh SEE ALSO 44747470Scael.Xr binmail 1 , 44847470Scael.Xr mail 1 , 44947470Scael.Xr rmail 1 , 45047470Scael.Xr syslog 3 , 45147470Scael.Xr aliases 5 , 45247470Scael.Xr mailaddr 7 , 45347470Scael.Xr rc 8 ; 45447470Scael.Pp 45547470ScaelDARPA 45647470ScaelInternet Request For Comments 45747470Scael.%T RFC819 , 45847470Scael.%T RFC821 , 45947470Scael.%T RFC822 . 46047470Scael.Rs 46148584Scael.%T "Sendmail \- An Internetwork Mail Router" 46247470Scael.%V SMM 46347470Scael.%N \&No. 9 46447470Scael.Re 46547470Scael.Rs 46648584Scael.%T "Sendmail Installation and Operation Guide" 46747470Scael.%V SMM 46847470Scael.%N \&No. 8 46947470Scael.Re 47047470Scael.Sh HISTORY 47147470ScaelThe 47247470Scael.Nm 47347470Scaelcommand appeared in 47447470Scael.Bx 4.2 . 475