1SENDMAIL(8) SENDMAIL(8) 2 3 4 5[1mNAME[0m 6 sendmail - an electronic mail transport agent 7 8[1mSYNOPSIS[0m 9 [1msendmail [22m[[4mflags[24m] [[4maddress[24m [4m...[24m] 10 [1mnewaliases[0m 11 [1mmailq [22m[[1m-v[22m] 12 [1mhoststat[0m 13 [1mpurgestat[0m 14 [1msmtpd[0m 15 16[1mDESCRIPTION[0m 17 [1mSendmail [22msends a message to one or more [4mrecipients,[24m routing the message 18 over whatever networks are necessary. [1mSendmail [22mdoes internetwork for- 19 warding as necessary to deliver the message to the correct place. 20 21 [1mSendmail [22mis not intended as a user interface routine; other programs 22 provide user-friendly front ends; [1msendmail [22mis used only to deliver pre- 23 formatted messages. 24 25 With no flags, [1msendmail [22mreads its standard input up to an end-of-file 26 or a line consisting only of a single dot and sends a copy of the mes- 27 sage found there to all of the addresses listed. It determines the 28 network(s) to use based on the syntax and contents of the addresses. 29 30 Local addresses are looked up in a file and aliased appropriately. 31 Aliasing can be prevented by preceding the address with a backslash. 32 Beginning with 8.10, the sender is included in any alias expansions, 33 e.g., if `john' sends to `group', and `group' includes `john' in the 34 expansion, then the letter will also be delivered to `john'. 35 36 [1mParameters[0m 37 [1m-Ac [22mUse submit.cf even if the operation mode does not indicate an 38 initial mail submission. 39 40 [1m-Am [22mUse sendmail.cf even if the operation mode indicates an initial 41 mail submission. 42 43 [1m-B[4m[22mtype[24m Set the body type to [4mtype[24m. Current legal values are 7BIT or 44 8BITMIME. 45 46 [1m-ba [22mGo into ARPANET mode. All input lines must end with a CR-LF, 47 and all messages will be generated with a CR-LF at the end. 48 Also, the ``From:'' and ``Sender:'' fields are examined for the 49 name of the sender. 50 51 [1m-bC [22mCheck the configuration file. 52 53 [1m-bd [22mRun as a daemon. [1mSendmail [22mwill fork and run in background lis- 54 tening on socket 25 for incoming SMTP connections. This is nor- 55 mally run from /etc/rc. 56 57 [1m-bD [22mSame as [1m-bd [22mexcept runs in foreground. 58 59 [1m-bh [22mPrint the persistent host status database. 60 61 [1m-bH [22mPurge expired entries from the persistent host status database. 62 63 [1m-bi [22mInitialize the alias database. 64 65 [1m-bm [22mDeliver mail in the usual way (default). 66 67 [1m-bp [22mPrint a listing of the queue(s). 68 69 [1m-bP [22mPrint number of entries in the queue(s); only available with 70 shared memory support. 71 72 [1m-bs [22mUse the SMTP protocol as described in RFC821 on standard input 73 and output. This flag implies all the operations of the [1m-ba[0m 74 flag that are compatible with SMTP. 75 76 [1m-bt [22mRun in address test mode. This mode reads addresses and shows 77 the steps in parsing; it is used for debugging configuration 78 tables. 79 80 [1m-bv [22mVerify names only - do not try to collect or deliver a message. 81 Verify mode is normally used for validating users or mailing 82 lists. 83 84 [1m-C[4m[22mfile[24m Use alternate configuration file. [1mSendmail [22mgives up any 85 enhanced (set-user-ID or set-group-ID) privileges if an alter- 86 nate configuration file is specified. 87 88 [1m-D [4m[22mlogfile[0m 89 Send debugging output to the indicated log file instead of std- 90 out. 91 92 [1m-d[4m[22mcategory[24m[1m.[4m[22mlevel...[0m 93 Set the debugging flag for [4mcategory[24m to [4mlevel[24m. [4mCategory[24m is 94 either an integer or a name specifying the topic, and [4mlevel[24m an 95 integer specifying the level of debugging output desired. 96 Higher levels generally mean more output. More than one flag 97 can be specified by separating them with commas. A list of 98 numeric debugging categories can be found in the TRACEFLAGS file 99 in the sendmail source distribution. 100 The option [1m-d0.1 [22mprints the version of [1msendmail [22mand the options 101 it was compiled with. 102 Most other categories are only useful with, and documented in, 103 [1msendmail[22m's source code. 104 105 [1m-F[4m[22mfullname[0m 106 Set the full name of the sender. 107 108 [1m-f[4m[22mname[24m Sets the name of the ``from'' person (i.e., the envelope sender 109 of the mail). This address may also be used in the From: header 110 if that header is missing during initial submission. The enve- 111 lope sender address is used as the recipient for delivery status 112 notifications and may also appear in a Return-Path: header. [1m-f[0m 113 should only be used by ``trusted'' users (normally [4mroot[24m, [4mdaemon[24m, 114 and [4mnetwork[24m) or if the person you are trying to become is the 115 same as the person you are. Otherwise, an X-Authentication- 116 Warning header will be added to the message. 117 118 [1m-G [22mRelay (gateway) submission of a message, e.g., when [1mrmail [22mcalls 119 [1msendmail .[0m 120 121 [1m-h[4m[22mN[24m Set the hop count to [4mN[24m. The hop count is incremented every time 122 the mail is processed. When it reaches a limit, the mail is 123 returned with an error message, the victim of an aliasing loop. 124 If not specified, ``Received:'' lines in the message are 125 counted. 126 127 [1m-i [22mDo not strip a leading dot from lines in incoming messages, and 128 do not treat a dot on a line by itself as the end of an incoming 129 message. This should be set if you are reading data from a 130 file. 131 132 [1m-L [4m[22mtag[24m Set the identifier used in syslog messages to the supplied [4mtag[24m. 133 134 [1m-N [4m[22mdsn[24m Set delivery status notification conditions to [4mdsn[24m, which can be 135 `never' for no notifications or a comma separated list of the 136 values `failure' to be notified if delivery failed, `delay' to 137 be notified if delivery is delayed, and `success' to be notified 138 when the message is successfully delivered. 139 140 [1m-n [22mDon't do aliasing. 141 142 [1m-O [4m[22moption[24m=[4mvalue[0m 143 Set option [4moption[24m to the specified [4mvalue[24m. This form uses long 144 names. See below for more details. 145 146 [1m-o[4m[22mx[24m [4mvalue[0m 147 Set option [4mx[24m to the specified [4mvalue[24m. This form uses single 148 character names only. The short names are not described in this 149 manual page; see the [4mSendmail[24m [4mInstallation[24m [4mand[24m [4mOperation[24m [4mGuide[0m 150 for details. 151 152 [1m-p[4m[22mprotocol[0m 153 Set the name of the protocol used to receive the message. This 154 can be a simple protocol name such as ``UUCP'' or a protocol and 155 hostname, such as ``UUCP:ucbvax''. 156 157 [1m-q[22m[[4mtime[24m] 158 Process saved messages in the queue at given intervals. If [4mtime[0m 159 is omitted, process the queue once. [4mTime[24m is given as a tagged 160 number, with `s' being seconds, `m' being minutes (default), `h' 161 being hours, `d' being days, and `w' being weeks. For example, 162 `-q1h30m' or `-q90m' would both set the timeout to one hour 163 thirty minutes. By default, [1msendmail [22mwill run in the back- 164 ground. This option can be used safely with [1m-bd[22m. 165 166 [1m-qp[22m[[4mtime[24m] 167 Similar to [1m-q[4m[22mtime[24m, except that instead of periodically forking a 168 child to process the queue, sendmail forks a single persistent 169 child for each queue that alternates between processing the 170 queue and sleeping. The sleep time is given as the argument; it 171 defaults to 1 second. The process will always sleep at least 5 172 seconds if the queue was empty in the previous queue run. 173 174 [1m-q[22mf Process saved messages in the queue once and do not fork(), but 175 run in the foreground. 176 177 [1m-q[22mG[4mname[0m 178 Process jobs in queue group called [4mname[24m only. 179 180 [1m-q[22m[[4m![24m]I[4msubstr[0m 181 Limit processed jobs to those containing [4msubstr[24m as a substring 182 of the queue id or not when [4m![24m is specified. 183 184 [1m-q[22m[[4m![24m]Q[4msubstr[0m 185 Limit processed jobs to quarantined jobs containing [4msubstr[24m as a 186 substring of the quarantine reason or not when [4m![24m is specified. 187 188 [1m-q[22m[[4m![24m]R[4msubstr[0m 189 Limit processed jobs to those containing [4msubstr[24m as a substring 190 of one of the recipients or not when [4m![24m is specified. 191 192 [1m-q[22m[[4m![24m]S[4msubstr[0m 193 Limit processed jobs to those containing [4msubstr[24m as a substring 194 of the sender or not when [4m![24m is specified. 195 196 [1m-Q[22m[reason] 197 Quarantine a normal queue items with the given reason or unquar- 198 antine quarantined queue items if no reason is given. This 199 should only be used with some sort of item matching using as 200 described above. 201 202 [1m-R [4m[22mreturn[0m 203 Set the amount of the message to be returned if the message 204 bounces. The [4mreturn[24m parameter can be `full' to return the 205 entire message or `hdrs' to return only the headers. In the 206 latter case also local bounces return only the headers. 207 208 [1m-r[4m[22mname[24m An alternate and obsolete form of the [1m-f [22mflag. 209 210 [1m-t [22mRead message for recipients. To:, Cc:, and Bcc: lines will be 211 scanned for recipient addresses. The Bcc: line will be deleted 212 before transmission. 213 214 [1m-V [4m[22menvid[0m 215 Set the original envelope id. This is propagated across SMTP to 216 servers that support DSNs and is returned in DSN-compliant error 217 messages. 218 219 [1m-v [22mGo into verbose mode. Alias expansions will be announced, etc. 220 221 [1m-X [4m[22mlogfile[0m 222 Log all traffic in and out of mailers in the indicated log file. 223 This should only be used as a last resort for debugging mailer 224 bugs. It will log a lot of data very quickly. 225 226 [1m-- [22mStop processing command flags and use the rest of the arguments 227 as addresses. 228 229 [1mOptions[0m 230 There are also a number of processing options that may be set. Nor- 231 mally these will only be used by a system administrator. Options may 232 be set either on the command line using the [1m-o [22mflag (for short names), 233 the [1m-O [22mflag (for long names), or in the configuration file. This is a 234 partial list limited to those options that are likely to be useful on 235 the command line and only shows the long names; for a complete list 236 (and details), consult the [4mSendmail[24m [4mInstallation[24m [4mand[24m [4mOperation[24m [4mGuide[24m. 237 The options are: 238 239 AliasFile=[4mfile[0m 240 Use alternate alias file. 241 242 HoldExpensive 243 On mailers that are considered ``expensive'' to connect to, 244 don't initiate immediate connection. This requires queueing. 245 246 CheckpointInterval=[4mN[0m 247 Checkpoint the queue file after every [4mN[24m successful deliveries 248 (default 10). This avoids excessive duplicate deliveries when 249 sending to long mailing lists interrupted by system crashes. 250 251 DeliveryMode=[4mx[0m 252 Set the delivery mode to [4mx[24m. Delivery modes are `i' for interac- 253 tive (synchronous) delivery, `b' for background (asynchronous) 254 delivery, `q' for queue only - i.e., actual delivery is done the 255 next time the queue is run, and `d' for deferred - the same as 256 `q' except that database lookups for maps which have set the -D 257 option (default for the host map) are avoided. 258 259 ErrorMode=[4mx[0m 260 Set error processing to mode [4mx[24m. Valid modes are `m' to mail 261 back the error message, `w' to ``write'' back the error message 262 (or mail it back if the sender is not logged in), `p' to print 263 the errors on the terminal (default), `q' to throw away error 264 messages (only exit status is returned), and `e' to do special 265 processing for the BerkNet. If the text of the message is not 266 mailed back by modes `m' or `w' and if the sender is local to 267 this machine, a copy of the message is appended to the file 268 [4mdead.letter[24m in the sender's home directory. 269 270 SaveFromLine 271 Save UNIX-style From lines at the front of messages. 272 273 MaxHopCount=[4mN[0m 274 The maximum number of times a message is allowed to ``hop'' 275 before we decide it is in a loop. 276 277 IgnoreDots 278 Do not take dots on a line by themselves as a message termina- 279 tor. 280 281 SendMimeErrors 282 Send error messages in MIME format. If not set, the DSN (Deliv- 283 ery Status Notification) SMTP extension is disabled. 284 285 ConnectionCacheTimeout=[4mtimeout[0m 286 Set connection cache timeout. 287 288 ConnectionCacheSize=[4mN[0m 289 Set connection cache size. 290 291 LogLevel=[4mn[0m 292 The log level. 293 294 MeToo=[4mFalse[0m 295 Don't send to ``me'' (the sender) if I am in an alias expansion. 296 297 CheckAliases 298 Validate the right hand side of aliases during a newaliases(1) 299 command. 300 301 OldStyleHeaders 302 If set, this message may have old style headers. If not set, 303 this message is guaranteed to have new style headers (i.e., com- 304 mas instead of spaces between addresses). If set, an adaptive 305 algorithm is used that will correctly determine the header for- 306 mat in most cases. 307 308 QueueDirectory=[4mqueuedir[0m 309 Select the directory in which to queue messages. 310 311 StatusFile=[4mfile[0m 312 Save statistics in the named file. 313 314 Timeout.queuereturn=[4mtime[0m 315 Set the timeout on undelivered messages in the queue to the 316 specified time. After delivery has failed (e.g., because of a 317 host being down) for this amount of time, failed messages will 318 be returned to the sender. The default is five days. 319 320 UserDatabaseSpec=[4muserdatabase[0m 321 If set, a user database is consulted to get forwarding informa- 322 tion. You can consider this an adjunct to the aliasing mecha- 323 nism, except that the database is intended to be distributed; 324 aliases are local to a particular host. This may not be avail- 325 able if your sendmail does not have the USERDB option compiled 326 in. 327 328 ForkEachJob 329 Fork each job during queue runs. May be convenient on memory- 330 poor machines. 331 332 SevenBitInput 333 Strip incoming messages to seven bits. 334 335 EightBitMode=[4mmode[0m 336 Set the handling of eight bit input to seven bit destinations to 337 [4mmode[24m: m (mimefy) will convert to seven-bit MIME format, p (pass) 338 will pass it as eight bits (but violates protocols), and s 339 (strict) will bounce the message. 340 341 MinQueueAge=[4mtimeout[0m 342 Sets how long a job must ferment in the queue between attempts 343 to send it. 344 345 DefaultCharSet=[4mcharset[0m 346 Sets the default character set used to label 8-bit data that is 347 not otherwise labelled. 348 349 DialDelay=[4msleeptime[0m 350 If opening a connection fails, sleep for [4msleeptime[24m seconds and 351 try again. Useful on dial-on-demand sites. 352 353 NoRecipientAction=[4maction[0m 354 Set the behaviour when there are no recipient headers (To:, Cc: 355 or Bcc:) in the message to [4maction[24m: none leaves the message 356 unchanged, add-to adds a To: header with the envelope recipi- 357 ents, add-apparently-to adds an Apparently-To: header with the 358 envelope recipients, add-bcc adds an empty Bcc: header, and add- 359 to-undisclosed adds a header reading `To: undisclosed-recipi- 360 ents:;'. 361 362 MaxDaemonChildren=[4mN[0m 363 Sets the maximum number of children that an incoming SMTP daemon 364 will allow to spawn at any time to [4mN[24m. 365 366 ConnectionRateThrottle=[4mN[0m 367 Sets the maximum number of connections per second to the SMTP 368 port to [4mN[24m. 369 370 In aliases, the first character of a name may be a vertical bar to 371 cause interpretation of the rest of the name as a command to pipe the 372 mail to. It may be necessary to quote the name to keep [1msendmail [22mfrom 373 suppressing the blanks from between arguments. For example, a common 374 alias is: 375 376 msgs: "|/usr/bin/msgs -s" 377 378 Aliases may also have the syntax ``:include:[4mfilename[24m'' to ask [1msendmail[0m 379 to read the named file for a list of recipients. For example, an alias 380 such as: 381 382 poets: ":include:/usr/local/lib/poets.list" 383 384 would read [4m/usr/local/lib/poets.list[24m for the list of addresses making 385 up the group. 386 387 [1mSendmail [22mreturns an exit status describing what it did. The codes are 388 defined in <[4msysexits.h[24m>: 389 390 EX_OK Successful completion on all addresses. 391 392 EX_NOUSER 393 User name not recognized. 394 395 EX_UNAVAILABLE 396 Catchall meaning necessary resources were not available. 397 398 EX_SYNTAX 399 Syntax error in address. 400 401 EX_SOFTWARE 402 Internal software error, including bad arguments. 403 404 EX_OSERR 405 Temporary operating system error, such as ``cannot fork''. 406 407 EX_NOHOST 408 Host name not recognized. 409 410 EX_TEMPFAIL 411 Message could not be sent immediately, but was queued. 412 413 If invoked as [1mnewaliases[22m, [1msendmail [22mwill rebuild the alias database. If 414 invoked as [1mmailq[22m, [1msendmail [22mwill print the contents of the mail queue. 415 If invoked as [1mhoststat[22m, [1msendmail [22mwill print the persistent host status 416 database. If invoked as [1mpurgestat[22m, [1msendmail [22mwill purge expired entries 417 from the persistent host status database. If invoked as [1msmtpd[22m, [1msend-[0m 418 [1mmail [22mwill act as a daemon, as if the [1m-bd [22moption were specified. 419 420[1mNOTES[0m 421 [1msendmail [22moften gets blamed for many problems that are actually the 422 result of other problems, such as overly permissive modes on directo- 423 ries. For this reason, [1msendmail [22mchecks the modes on system directories 424 and files to determine if they can be trusted. Although these checks 425 can be turned off and your system security reduced by setting the [1mDont-[0m 426 [1mBlameSendmail [22moption, the permission problems should be fixed. For 427 more information, see: 428 429 [4mhttp://www.sendmail.org/tips/DontBlameSendmail.html[0m 430 431[1mFILES[0m 432 Except for the file [4m/etc/mail/sendmail.cf[24m itself the following path- 433 names are all specified in [4m/etc/mail/sendmail.cf[24m. Thus, these values 434 are only approximations. 435 436 437 /etc/mail/aliases 438 raw data for alias names 439 440 /etc/mail/aliases.db 441 data base of alias names 442 443 /etc/mail/sendmail.cf 444 configuration file 445 446 /etc/mail/helpfile 447 help file 448 449 /etc/mail/statistics 450 collected statistics 451 452 /var/spool/mqueue/* 453 temp files 454 455[1mSEE ALSO[0m 456 binmail(1), mail(1), rmail(1), syslog(3), aliases(5), mailaddr(7), 457 rc(8) 458 459 DARPA Internet Request For Comments [4mRFC819[24m, [4mRFC821[24m, [4mRFC822[24m. [4mSendmail[0m 460 [4mInstallation[24m [4mand[24m [4mOperation[24m [4mGuide[24m, No. 8, SMM. 461 462 http://www.sendmail.org/ 463 464 US Patent Numbers 6865671, 6986037. 465 466[1mHISTORY[0m 467 The [1msendmail [22mcommand appeared in 4.2BSD. 468 469 470 471 $Date: 2013-11-22 20:51:56 $ SENDMAIL(8) 472