1.\" Copyright (c) 1988, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)sendmail.8 6.15 (Berkeley) 04/15/93 7.\" 8.Dd 9.Dt SENDMAIL 8 10.Os BSD 4 11.Sh NAME 12.Nm sendmail 13.Nd send mail over the internet 14.Sh SYNOPSIS 15.Nm sendmail 16.Op Ar flags 17.Op Ar address ... 18.Nm newaliases 19.Nm mailq 20.Op Fl v 21.Sh DESCRIPTION 22.Nm Sendmail 23sends a message to one or more 24.Em recipients , 25routing the message over whatever networks 26are necessary. 27.Nm Sendmail 28does internetwork forwarding as necessary 29to deliver the message to the correct place. 30.Pp 31.Nm Sendmail 32is not intended as a user interface routine; 33other programs provide user-friendly 34front ends; 35.Nm sendmail 36is used only to deliver pre-formatted messages. 37.Pp 38With no flags, 39.Nm sendmail 40reads its standard input 41up to an end-of-file 42or a line consisting only of a single dot 43and sends a copy of the message found there 44to all of the addresses listed. 45It determines the network(s) to use 46based on the syntax and contents of the addresses. 47.Pp 48Local addresses are looked up in a file 49and aliased appropriately. 50Aliasing can be prevented by preceding the address 51with a backslash. 52Normally the sender is not included in any alias 53expansions, e.g., 54if `john' sends to `group', 55and `group' includes `john' in the expansion, 56then the letter will not be delivered to `john'. 57.Pp 58Flags are: 59.Bl -tag -width Fl 60.It Fl B Ns Ar type 61Set the body type to 62.Ar type . 63Current legal values 64.Li 7BIT 65or 66.Li 8BITMIME . 67.It Fl ba 68Go into 69.Tn ARPANET 70mode. 71All input lines must end with a CR-LF, 72and all messages will be generated with a CR-LF at the end. 73Also, 74the ``From:'' and ``Sender:'' 75fields are examined for the name of the sender. 76.It Fl bd 77Run as a daemon. This requires Berkeley 78.Tn IPC . 79.Nm Sendmail 80will fork and run in background 81listening on socket 25 for incoming 82.Tn SMTP 83connections. 84This is normally run from 85.Pa /etc/rc . 86.It Fl bi 87Initialize the alias database. 88.It Fl bm 89Deliver mail in the usual way (default). 90.It Fl bp 91Print a listing of the queue. 92.It Fl bs 93Use the 94.Tn SMTP 95protocol as described in 96.Tn RFC821 97on standard input and output. 98This flag implies all the operations of the 99.Fl ba 100flag that are compatible with 101.Tn SMTP . 102.It Fl bt 103Run in address test mode. 104This mode reads addresses and shows the steps in parsing; 105it is used for debugging configuration tables. 106.It Fl bv 107Verify names only \- do not try to collect or deliver a message. 108Verify mode is normally used for validating 109users or mailing lists. 110.It Fl bz 111Create the configuration freeze file. 112.It Fl C Ns Ar file 113Use alternate configuration file. 114.Nm Sendmail 115refuses to run as root if an alternate configuration file is specified. 116The frozen configuration file is bypassed. 117.It Fl d Ns Ar X 118Set debugging value to 119.Ar X . 120.It Fl F Ns Ar fullname 121Set the full name of the sender. 122.It Fl f Ns Ar name 123Sets the name of the ``from'' person 124(i.e., the sender of the mail). 125.Fl f 126can only be used 127by ``trusted'' users 128(normally 129.Em root , 130.Em daemon , 131and 132.Em network ) 133or if the person you are trying to become 134is the same as the person you are. 135.It Fl h Ns Ar N 136Set the hop count to 137.Ar N . 138The hop count is incremented every time the mail is 139processed. 140When it reaches a limit, 141the mail is returned with an error message, 142the victim of an aliasing loop. 143If not specified, 144``Received:'' lines in the message are counted. 145.It Fl n 146Don't do aliasing. 147.It Fl o Ns Ar x Em value 148Set option 149.Ar x 150to the specified 151.Em value . 152Options are described below. 153.It Fl p Ns Ar protocol 154Set the name of the protocol used to receive the message. 155This can be a simple protocol name such as ``UUCP'' 156or a protocol and hostname, such as ``UUCP:ucbvax''. 157.It Fl q Ns Bq Ar time 158Processed saved messages in the queue at given intervals. 159If 160.Ar time 161is omitted, 162process the queue once. 163.Xr Time 164is given as a tagged number, 165with 166.Ql s 167being seconds, 168.Ql m 169being minutes, 170.Ql h 171being hours, 172.Ql d 173being days, 174and 175.Ql w 176being weeks. 177For example, 178.Ql \-q1h30m 179or 180.Ql \-q90m 181would both set the timeout to one hour thirty minutes. 182If 183.Ar time 184is specified, 185.Nm sendmail 186will run in background. 187This option can be used safely with 188.Fl bd . 189.It Fl r Ns Ar name 190An alternate and obsolete form of the 191.Fl f 192flag. 193.It Fl t 194Read message for recipients. 195To:, Cc:, and Bcc: lines will be scanned for recipient addresses. 196The Bcc: line will be deleted before transmission. 197Any addresses in the argument list will be suppressed, 198that is, 199they will 200.Em not 201receive copies even if listed in the message header. 202.It Fl v 203Go into verbose mode. 204Alias expansions will be announced, etc. 205.El 206.Pp 207There are also a number of processing options that may be set. 208Normally these will only be used by a system administrator. 209Options may be set either on the command line 210using the 211.Fl o 212flag 213or in the configuration file. 214These are described in detail in the 215.%T "Sendmail Installation and Operation Guide" . 216The options are: 217.Bl -tag -width Fl 218.It Li A Ns Ar file 219Use alternate alias file. 220.It Li c 221On mailers that are considered ``expensive'' to connect to, 222don't initiate immediate connection. 223This requires queueing. 224.It Li C Ar N 225Checkpoint the queue file after every 226.Ar N 227successful deliveries (default 10). 228This avoids excessive duplicate deliveries 229when sending to long mailing lists 230interrupted by system crashes. 231.It Li d Ns Ar x 232Set the delivery mode to 233.Ar x . 234Delivery modes are 235.Ql i 236for interactive (synchronous) delivery, 237.Ql b 238for background (asynchronous) delivery, 239and 240.Ql q 241for queue only \- i.e., 242actual delivery is done the next time the queue is run. 243.It Li D 244Try to automatically rebuild the alias database 245if necessary. 246.It Li e Ns Ar x 247Set error processing to mode 248.Ar x . 249Valid modes are 250.Ql m 251to mail back the error message, 252.Ql w 253to ``write'' back the error message 254(or mail it back if the sender is not logged in), 255.Ql p 256to print the errors on the terminal 257(default), 258.Ql q 259to throw away error messages 260(only exit status is returned), 261and 262.Ql e 263to do special processing for the BerkNet. 264If the text of the message is not mailed back 265by 266modes 267.Ql m 268or 269.Ql w 270and if the sender is local to this machine, 271a copy of the message is appended to the file 272.Pa dead.letter 273in the sender's home directory. 274.It Li F Ns Ar mode 275The mode to use when creating temporary files. 276.It Li f 277Save 278.Tn UNIX Ns \-style 279From lines at the front of messages. 280.It Li g Ar N 281The default group id to use when calling mailers. 282.It Li H Ns Ar file 283The 284.Tn SMTP 285help file. 286.It Li h Ar N 287The maximum number of times a message is allowed to ``hop'' 288before we decide it is in a loop. 289.It Li i 290Do not take dots on a line by themselves 291as a message terminator. 292.It Li L Ns Ar n 293The log level. 294.It Li m 295Send to ``me'' (the sender) also if I am in an alias expansion. 296.It Li o 297If set, this message may have 298old style headers. 299If not set, 300this message is guaranteed to have new style headers 301(i.e., commas instead of spaces between addresses). 302If set, an adaptive algorithm is used that will correctly 303determine the header format in most cases. 304.It Li Q Ns Ar queuedir 305Select the directory in which to queue messages. 306.It Li r Ns Ar timeout 307The timeout on reads; 308if none is set, 309.Nm sendmail 310will wait forever for a mailer. 311This option violates the word (if not the intent) of the 312.Tn SMTP 313specification, 314show the timeout should probably be fairly large. 315.It Li S Ns Ar file 316Save statistics in the named file. 317.It Li s 318Always instantiate the queue file, 319even under circumstances where it is not strictly necessary. 320This provides safety against system crashes during delivery. 321.It Li T Ns Ar time 322Set the timeout on undelivered messages in the queue to the specified time. 323After delivery has failed 324(e.g., because of a host being down) 325for this amount of time, 326failed messages will be returned to the sender. 327The default is three days. 328.It Li t Ns Ar stz , Ar dtz 329Set the name of the time zone. 330.It Li U Ns Ar userdatabase 331If set, a user database is consulted to get forwarding information. 332You can consider this an adjunct to the aliasing mechanism, 333except that the database is intended to be distributed; 334aliases are local to a particular host. 335This may not be available if your sendmail does not have the 336.Dv USERDB 337option compiled in. 338.It Li u Ns Ar N 339Set the default user id for mailers. 340.It Li w 341If set, name server lookups will us a querytype of ANY 342to find types 343.Dv CNAME , A , 344and 345.Dv MX , 346and will cause all existing records to be cached by our local server. 347If you are certain that there are no wildcard MX records in the local domain 348or its parents that are searched, you can 349set this option. 350If the option is not set, 351name server lookups will use a querytype of 352.Dv CNAME 353only; 354otherwise, it would cause all fully-qualified names 355to match as names in the local domain. 356.El 357.Pp 358In aliases, 359the first character of a name may be 360a vertical bar to cause interpretation of 361the rest of the name as a command 362to pipe the mail to. 363It may be necessary to quote the name 364to keep 365.Nm sendmail 366from suppressing the blanks from between arguments. 367For example, a common alias is: 368.Pp 369.Bd -literal -offset indent -compact 370msgs: "|/usr/bin/msgs -s" 371.Ed 372.Pp 373Aliases may also have the syntax 374.Dq :include: Ns Ar filename 375to ask 376.Xr sendmail 377to read the named file for a list of recipients. 378For example, an alias such as: 379.Pp 380.Bd -literal -offset indent -compact 381poets: ":include:/usr/local/lib/poets.list" 382.Ed 383.Pp 384would read 385.Pa /usr/local/lib/poets.list 386for the list of addresses making up the group. 387.Pp 388.Nm Sendmail 389returns an exit status 390describing what it did. 391The codes are defined in 392.Aq Pa sysexits.h : 393.Bl -tag -width EX_UNAVAILABLE -compact -offset indent 394.It Dv EX_OK 395Successful completion on all addresses. 396.It Dv EX_NOUSER 397User name not recognized. 398.It Dv EX_UNAVAILABLE 399Catchall meaning necessary resources 400were not available. 401.It Dv EX_SYNTAX 402Syntax error in address. 403.It Dv EX_SOFTWARE 404Internal software error, 405including bad arguments. 406.It Dv EX_OSERR 407Temporary operating system error, 408such as 409.Dq cannot fork . 410.It Dv EX_NOHOST 411Host name not recognized. 412.It Dv EX_TEMPFAIL 413Message could not be sent immediately, 414but was queued. 415.El 416.Pp 417If invoked as 418.Nm newaliases , 419.Nm sendmail 420will rebuild the alias database. 421If invoked as 422.Nm mailq , 423.Nm sendmail 424will print the contents of the mail queue. 425.Sh FILES 426Except for the file 427.Pa /etc/sendmail.cf 428itself, 429the following pathnames are all specified in 430.Pa /etc/sendmail.cf. 431Thus, 432these values are only approximations. 433.Pp 434.Bl -tag -width /usr/lib/sendmail.fc -compact 435.It Pa /etc/aliases 436raw data for alias names 437.It Pa /etc/aliases.pag 438.It Pa /etc/aliases.dir 439data base of alias names 440.It Pa /etc/sendmail.cf 441configuration file 442.It Pa /etc/sendmail.fc 443frozen configuration 444.It Pa /etc/sendmail.hf 445help file 446.It Pa /var/log/sendmail.st 447collected statistics 448.It Pa /var/spool/mqueue/* 449temp files 450.El 451.Sh SEE ALSO 452.Xr binmail 1 , 453.Xr mail 1 , 454.Xr rmail 1 , 455.Xr syslog 3 , 456.Xr aliases 5 , 457.Xr mailaddr 7 , 458.Xr rc 8 ; 459.Pp 460DARPA 461Internet Request For Comments 462.%T RFC819 , 463.%T RFC821 , 464.%T RFC822 . 465.Rs 466.%T "Sendmail \- An Internetwork Mail Router" 467.%V SMM 468.%N \&No. 9 469.Re 470.Rs 471.%T "Sendmail Installation and Operation Guide" 472.%V SMM 473.%N \&No. 8 474.Re 475.Sh HISTORY 476The 477.Nm 478command appeared in 479.Bx 4.2 . 480