147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California. 235646Sbostic.\" All rights reserved. 318857Smckusick.\" 443844Strent.\" %sccs.include.redist.man% 518857Smckusick.\" 6*51305Seric.\" @(#)sendmail.8 6.12 (Berkeley) 10/03/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. 213*51305Seric.It Li C Ar N 214*51305SericCheckpoint the queue file after every 215*51305Seric.Ar N 216*51305Sericsuccessful deliveries (default 10). 217*51305SericThis avoids excessive duplicate deliveries 218*51305Sericwhen sending to long mailing lists 219*51305Sericinterrupted by system crashes. 22047470Scael.It Li d Ns Ar x 22118858SmckusickSet the delivery mode to 22247470Scael.Ar x . 22318858SmckusickDelivery modes are 22447470Scael.Ql i 22547470Scaelfor interactive (synchronous) delivery, 22647470Scael.Ql b 22747470Scaelfor background (asynchronous) delivery, 22818858Smckusickand 22947470Scael.Ql q 23047470Scaelfor queue only \- i.e., 23118858Smckusickactual delivery is done the next time the queue is run. 23247470Scael.It Li D 23318858SmckusickTry to automatically rebuild the alias database 23418858Smckusickif necessary. 23547470Scael.It Li e Ns Ar x 23618858SmckusickSet error processing to mode 23747470Scael.Ar x . 23818858SmckusickValid modes are 23947470Scael.Ql m 24047470Scaelto mail back the error message, 24147470Scael.Ql w 24247470Scaelto ``write'' back the error message 24318858Smckusick(or mail it back if the sender is not logged in), 24447470Scael.Ql p 24547470Scaelto print the errors on the terminal 24618858Smckusick(default), 24747470Scael.Ql q 24847470Scaelto throw away error messages 24918858Smckusick(only exit status is returned), 25047470Scaeland 25147470Scael.Ql e 25218858Smckusickto do special processing for the BerkNet. 25318858SmckusickIf the text of the message is not mailed back 25418858Smckusickby 25547470Scaelmodes 25647470Scael.Ql m 25747470Scaelor 25847470Scael.Ql w 25918858Smckusickand if the sender is local to this machine, 26018858Smckusicka copy of the message is appended to the file 26147470Scael.Pa dead.letter 26218857Smckusickin the sender's home directory. 26347470Scael.It Li F Ns Ar mode 26418858SmckusickThe mode to use when creating temporary files. 26547470Scael.It Li f 26647470ScaelSave 26747470Scael.Tn UNIX Ns \-style 26847470ScaelFrom lines at the front of messages. 26947470Scael.It Li g Ar N 27018858SmckusickThe default group id to use when calling mailers. 27147470Scael.It Li H Ns Ar file 27247470ScaelThe 27347470Scael.Tn SMTP 27447470Scaelhelp file. 275*51305Seric.It Li h Ar N 276*51305SericThe maximum number of times a message is allowed to ``hop'' 277*51305Sericbefore we decide it is in a loop. 27847470Scael.It Li i 27918858SmckusickDo not take dots on a line by themselves 28018858Smckusickas a message terminator. 28147470Scael.It Li L Ns Ar n 28218858SmckusickThe log level. 28347470Scael.It Li m 28418858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 28547470Scael.It Li o 28618858SmckusickIf set, this message may have 28718858Smckusickold style headers. 28818858SmckusickIf not set, 28918858Smckusickthis message is guaranteed to have new style headers 29018858Smckusick(i.e., commas instead of spaces between addresses). 29118858SmckusickIf set, an adaptive algorithm is used that will correctly 29218858Smckusickdetermine the header format in most cases. 29347470Scael.It Li Q Ns Ar queuedir 29418858SmckusickSelect the directory in which to queue messages. 29547470Scael.It Li r Ns Ar timeout 29618858SmckusickThe timeout on reads; 29718858Smckusickif none is set, 29847470Scael.Nm sendmail 29918858Smckusickwill wait forever for a mailer. 30047470ScaelThis option violates the word (if not the intent) of the 30147470Scael.Tn SMTP 30247470Scaelspecification, 30328373Sericshow the timeout should probably be fairly large. 30447470Scael.It Li S Ns Ar file 30518858SmckusickSave statistics in the named file. 30647470Scael.It Li s 30718858SmckusickAlways instantiate the queue file, 30818858Smckusickeven under circumstances where it is not strictly necessary. 30928373SericThis provides safety against system crashes during delivery. 31047470Scael.It Li T Ns Ar time 31128373SericSet the timeout on undelivered messages in the queue to the specified time. 31228373SericAfter delivery has failed 31328373Seric(e.g., because of a host being down) 31428373Sericfor this amount of time, 31528373Sericfailed messages will be returned to the sender. 31618858SmckusickThe default is three days. 31747470Scael.It Li t Ns Ar stz , Ar dtz 31818858SmckusickSet the name of the time zone. 31950556Seric.It Li U Ns Ar userdatabase 32050556SericIf set, a user database is consulted to get forwarding information. 32150556SericYou can consider this an adjunct to the aliasing mechanism, 32250556Sericexcept that the database is intended to be distributed; 32350556Sericaliases are local to a particular host. 32450556SericThis may not be available if your sendmail does not have the 32550769Scael.Dv USERDB 32650769Scaeloption compiled in. 32747470Scael.It Li u Ns Ar N 32818858SmckusickSet the default user id for mailers. 32950537Seric.It Li w 33051216SericIf set, name server lookups will us a querytype of ANY 33150537Sericto find types 33250769Scael.Dv CNAME , A , 33350769Scaeland 33450769Scael.Dv MX , 33550537Sericand will cause all existing records to be cached by our local server. 33651216SericIf you are certain that there are no wildcard MX records in the local domain 33751216Sericor its parents that are searched, you can 33851216Sericset this option. 33951216SericIf the option is not set, 34051216Sericname server lookups will use a querytype of 34150769Scael.Dv CNAME 34250769Scaelonly; 34350537Sericotherwise, it would cause all fully-qualified names 34450537Sericto match as names in the local domain. 34547470Scael.El 34647470Scael.Pp 34728373SericIn aliases, 34828373Sericthe first character of a name may be 34928373Serica vertical bar to cause interpretation of 35028373Sericthe rest of the name as a command 35118857Smckusickto pipe the mail to. 35228373SericIt may be necessary to quote the name 35318857Smckusickto keep 35447470Scael.Nm sendmail 35518857Smckusickfrom suppressing the blanks from between arguments. 35628373SericFor example, a common alias is: 35747470Scael.Pp 35847470Scael.Bd -literal -offset indent -compact 35947470Scaelmsgs: "|/usr/bin/msgs -s" 36047470Scael.Ed 36147470Scael.Pp 36247470ScaelAliases may also have the syntax 36347470Scael.Dq :include: Ns Ar filename 36428373Sericto ask 36547470Scael.Xr sendmail 36628373Sericto read the named file for a list of recipients. 36728373SericFor example, an alias such as: 36847470Scael.Pp 36947470Scael.Bd -literal -offset indent -compact 37047470Scaelpoets: ":include:/usr/local/lib/poets.list" 37147470Scael.Ed 37247470Scael.Pp 37328373Sericwould read 37447470Scael.Pa /usr/local/lib/poets.list 37528373Sericfor the list of addresses making up the group. 37647470Scael.Pp 37747470Scael.Nm Sendmail 37818857Smckusickreturns an exit status 37918857Smckusickdescribing what it did. 38018858SmckusickThe codes are defined in 38147470Scael.Aq Pa sysexits.h : 38247470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 38347470Scael.It Dv EX_OK 38447470ScaelSuccessful completion on all addresses. 38547470Scael.It Dv EX_NOUSER 38647470ScaelUser name not recognized. 38747470Scael.It Dv EX_UNAVAILABLE 38847470ScaelCatchall meaning necessary resources 38918857Smckusickwere not available. 39047470Scael.It Dv EX_SYNTAX 39147470ScaelSyntax error in address. 39247470Scael.It Dv EX_SOFTWARE 39347470ScaelInternal software error, 39418857Smckusickincluding bad arguments. 39547470Scael.It Dv EX_OSERR 39647470ScaelTemporary operating system error, 39747470Scaelsuch as 39847470Scael.Dq cannot fork . 39947470Scael.It Dv EX_NOHOST 40047470ScaelHost name not recognized. 40147470Scael.It Dv EX_TEMPFAIL 40247470ScaelMessage could not be sent immediately, 40318858Smckusickbut was queued. 40447470Scael.El 40547470Scael.Pp 40618858SmckusickIf invoked as 40747470Scael.Nm newaliases , 40847470Scael.Nm sendmail 40918858Smckusickwill rebuild the alias database. 41018858SmckusickIf invoked as 41147470Scael.Nm mailq , 41247470Scael.Nm sendmail 41318858Smckusickwill print the contents of the mail queue. 41447470Scael.Sh FILES 41547470ScaelExcept for the file 41647470Scael.Pa /etc/sendmail.cf 41747470Scaelitself, 41847470Scaelthe following pathnames are all specified in 41947470Scael.Pa /etc/sendmail.cf. 42018858SmckusickThus, 42118858Smckusickthese values are only approximations. 42247470Scael.Pp 42347470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 42447470Scael.It Pa /etc/aliases 42547470Scaelraw data for alias names 42647470Scael.It Pa /etc/aliases.pag 42747470Scael.It Pa /etc/aliases.dir 42847470Scaeldata base of alias names 42947470Scael.It Pa /etc/sendmail.cf 43047470Scaelconfiguration file 43147470Scael.It Pa /etc/sendmail.fc 43247470Scaelfrozen configuration 43347470Scael.It Pa /etc/sendmail.hf 43447470Scaelhelp file 43547470Scael.It Pa /var/log/sendmail.st 43647470Scaelcollected statistics 43747470Scael.It Pa /var/spool/mqueue/* 43847470Scaeltemp files 43947470Scael.El 44047470Scael.Sh SEE ALSO 44147470Scael.Xr binmail 1 , 44247470Scael.Xr mail 1 , 44347470Scael.Xr rmail 1 , 44447470Scael.Xr syslog 3 , 44547470Scael.Xr aliases 5 , 44647470Scael.Xr mailaddr 7 , 44747470Scael.Xr rc 8 ; 44847470Scael.Pp 44947470ScaelDARPA 45047470ScaelInternet Request For Comments 45147470Scael.%T RFC819 , 45247470Scael.%T RFC821 , 45347470Scael.%T RFC822 . 45447470Scael.Rs 45548584Scael.%T "Sendmail \- An Internetwork Mail Router" 45647470Scael.%V SMM 45747470Scael.%N \&No. 9 45847470Scael.Re 45947470Scael.Rs 46048584Scael.%T "Sendmail Installation and Operation Guide" 46147470Scael.%V SMM 46247470Scael.%N \&No. 8 46347470Scael.Re 46447470Scael.Sh HISTORY 46547470ScaelThe 46647470Scael.Nm 46747470Scaelcommand appeared in 46847470Scael.Bx 4.2 . 469