147470Scael.\" Copyright (c) 1988, 1991 The Regents of the University of California. 235646Sbostic.\" All rights reserved. 318857Smckusick.\" 443844Strent.\" %sccs.include.redist.man% 518857Smckusick.\" 6*50556Seric.\" @(#)sendmail.8 6.9 (Berkeley) 07/26/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. 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. 27150537Seric.It Li k Ar N 27250537SericCheckpoint the queue file after every 27350537Seric.Ar N 27450537Sericsuccessful deliveries (default 10). 27550537SericThis avoids excessive duplicate deliveries 27650537Sericwhen sending to long mailing lists 27750537Sericinterrupted by system crashes. 27847470Scael.It Li L Ns Ar n 27918858SmckusickThe log level. 28047470Scael.It Li m 28118858SmckusickSend to ``me'' (the sender) also if I am in an alias expansion. 28247470Scael.It Li o 28318858SmckusickIf set, this message may have 28418858Smckusickold style headers. 28518858SmckusickIf not set, 28618858Smckusickthis message is guaranteed to have new style headers 28718858Smckusick(i.e., commas instead of spaces between addresses). 28818858SmckusickIf set, an adaptive algorithm is used that will correctly 28918858Smckusickdetermine the header format in most cases. 29047470Scael.It Li Q Ns Ar queuedir 29118858SmckusickSelect the directory in which to queue messages. 29247470Scael.It Li r Ns Ar timeout 29318858SmckusickThe timeout on reads; 29418858Smckusickif none is set, 29547470Scael.Nm sendmail 29618858Smckusickwill wait forever for a mailer. 29747470ScaelThis option violates the word (if not the intent) of the 29847470Scael.Tn SMTP 29947470Scaelspecification, 30028373Sericshow the timeout should probably be fairly large. 30147470Scael.It Li S Ns Ar file 30218858SmckusickSave statistics in the named file. 30347470Scael.It Li s 30418858SmckusickAlways instantiate the queue file, 30518858Smckusickeven under circumstances where it is not strictly necessary. 30628373SericThis provides safety against system crashes during delivery. 30747470Scael.It Li T Ns Ar time 30828373SericSet the timeout on undelivered messages in the queue to the specified time. 30928373SericAfter delivery has failed 31028373Seric(e.g., because of a host being down) 31128373Sericfor this amount of time, 31228373Sericfailed messages will be returned to the sender. 31318858SmckusickThe default is three days. 31447470Scael.It Li t Ns Ar stz , Ar dtz 31518858SmckusickSet the name of the time zone. 316*50556Seric.It Li U Ns Ar userdatabase 317*50556SericIf set, a user database is consulted to get forwarding information. 318*50556SericYou can consider this an adjunct to the aliasing mechanism, 319*50556Sericexcept that the database is intended to be distributed; 320*50556Sericaliases are local to a particular host. 321*50556SericThis may not be available if your sendmail does not have the 322*50556SericUSERDB option compiled in. 32347470Scael.It Li u Ns Ar N 32418858SmckusickSet the default user id for mailers. 32550537Seric.It Li w 32650537SericIf not set, name server lookups will us a querytype of ANY 32750537Sericto find types 32850537SericCNAME, A, and MX, 32950537Sericand will cause all existing records to be cached by our local server. 33050537SericIf there is (might be) a wildcard MX in the local domain 33150537Sericor its parents that are searched, you 33250537Seric.ul 33350537Sericmust 33450537Sericset this option, which will use a querytype of CNAME only; 33550537Sericotherwise, it would cause all fully-qualified names 33650537Sericto match as names in the local domain. 33747470Scael.El 33847470Scael.Pp 33928373SericIn aliases, 34028373Sericthe first character of a name may be 34128373Serica vertical bar to cause interpretation of 34228373Sericthe rest of the name as a command 34318857Smckusickto pipe the mail to. 34428373SericIt may be necessary to quote the name 34518857Smckusickto keep 34647470Scael.Nm sendmail 34718857Smckusickfrom suppressing the blanks from between arguments. 34828373SericFor example, a common alias is: 34947470Scael.Pp 35047470Scael.Bd -literal -offset indent -compact 35147470Scaelmsgs: "|/usr/bin/msgs -s" 35247470Scael.Ed 35347470Scael.Pp 35447470ScaelAliases may also have the syntax 35547470Scael.Dq :include: Ns Ar filename 35628373Sericto ask 35747470Scael.Xr sendmail 35828373Sericto read the named file for a list of recipients. 35928373SericFor example, an alias such as: 36047470Scael.Pp 36147470Scael.Bd -literal -offset indent -compact 36247470Scaelpoets: ":include:/usr/local/lib/poets.list" 36347470Scael.Ed 36447470Scael.Pp 36528373Sericwould read 36647470Scael.Pa /usr/local/lib/poets.list 36728373Sericfor the list of addresses making up the group. 36847470Scael.Pp 36947470Scael.Nm Sendmail 37018857Smckusickreturns an exit status 37118857Smckusickdescribing what it did. 37218858SmckusickThe codes are defined in 37347470Scael.Aq Pa sysexits.h : 37447470Scael.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 37547470Scael.It Dv EX_OK 37647470ScaelSuccessful completion on all addresses. 37747470Scael.It Dv EX_NOUSER 37847470ScaelUser name not recognized. 37947470Scael.It Dv EX_UNAVAILABLE 38047470ScaelCatchall meaning necessary resources 38118857Smckusickwere not available. 38247470Scael.It Dv EX_SYNTAX 38347470ScaelSyntax error in address. 38447470Scael.It Dv EX_SOFTWARE 38547470ScaelInternal software error, 38618857Smckusickincluding bad arguments. 38747470Scael.It Dv EX_OSERR 38847470ScaelTemporary operating system error, 38947470Scaelsuch as 39047470Scael.Dq cannot fork . 39147470Scael.It Dv EX_NOHOST 39247470ScaelHost name not recognized. 39347470Scael.It Dv EX_TEMPFAIL 39447470ScaelMessage could not be sent immediately, 39518858Smckusickbut was queued. 39647470Scael.El 39747470Scael.Pp 39818858SmckusickIf invoked as 39947470Scael.Nm newaliases , 40047470Scael.Nm sendmail 40118858Smckusickwill rebuild the alias database. 40218858SmckusickIf invoked as 40347470Scael.Nm mailq , 40447470Scael.Nm sendmail 40518858Smckusickwill print the contents of the mail queue. 40647470Scael.Sh FILES 40747470ScaelExcept for the file 40847470Scael.Pa /etc/sendmail.cf 40947470Scaelitself, 41047470Scaelthe following pathnames are all specified in 41147470Scael.Pa /etc/sendmail.cf. 41218858SmckusickThus, 41318858Smckusickthese values are only approximations. 41447470Scael.Pp 41547470Scael.Bl -tag -width /usr/lib/sendmail.fc -compact 41647470Scael.It Pa /etc/aliases 41747470Scaelraw data for alias names 41847470Scael.It Pa /etc/aliases.pag 41947470Scael.It Pa /etc/aliases.dir 42047470Scaeldata base of alias names 42147470Scael.It Pa /etc/sendmail.cf 42247470Scaelconfiguration file 42347470Scael.It Pa /etc/sendmail.fc 42447470Scaelfrozen configuration 42547470Scael.It Pa /etc/sendmail.hf 42647470Scaelhelp file 42747470Scael.It Pa /var/log/sendmail.st 42847470Scaelcollected statistics 42947470Scael.It Pa /var/spool/mqueue/* 43047470Scaeltemp files 43147470Scael.El 43247470Scael.Sh SEE ALSO 43347470Scael.Xr binmail 1 , 43447470Scael.Xr mail 1 , 43547470Scael.Xr rmail 1 , 43647470Scael.Xr syslog 3 , 43747470Scael.Xr aliases 5 , 43847470Scael.Xr mailaddr 7 , 43947470Scael.Xr rc 8 ; 44047470Scael.Pp 44147470ScaelDARPA 44247470ScaelInternet Request For Comments 44347470Scael.%T RFC819 , 44447470Scael.%T RFC821 , 44547470Scael.%T RFC822 . 44647470Scael.Rs 44748584Scael.%T "Sendmail \- An Internetwork Mail Router" 44847470Scael.%V SMM 44947470Scael.%N \&No. 9 45047470Scael.Re 45147470Scael.Rs 45248584Scael.%T "Sendmail Installation and Operation Guide" 45347470Scael.%V SMM 45447470Scael.%N \&No. 8 45547470Scael.Re 45647470Scael.Sh HISTORY 45747470ScaelThe 45847470Scael.Nm 45947470Scaelcommand appeared in 46047470Scael.Bx 4.2 . 461