1SENDMAIL(8) System Manager's Manual SENDMAIL(8)
2
3
4
6 sendmail - an electronic mail transport agent
7
9 sendmail [flags] [address ...]
10 newaliases
11 mailq [-v]
12 hoststat
13 purgestat
14 smtpd
15
17 Sendmail sends a message to one or more recipients, routing the message
18 over whatever networks are necessary. Sendmail does internetwork for‐
19 warding as necessary to deliver the message to the correct place.
20
21 Sendmail is not intended as a user interface routine; other programs
22 provide user-friendly front ends; sendmail is used only to deliver pre-
23 formatted messages.
24
25 With no flags, sendmail reads 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 Parameters
37 -Ac Use submit.cf even if the operation mode does not indicate an
38 initial mail submission.
39
40 -Am Use sendmail.cf even if the operation mode indicates an initial
41 mail submission.
42
43 -Btype Set the body type to type. Current legal values are 7BIT or
44 8BITMIME.
45
46 -ba Go 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 -bC Check the configuration file.
52
53 -bd Run as a daemon. Sendmail will 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 -bD Same as -bd except runs in foreground.
58
59 -bh Print the persistent host status database.
60
61 -bH Purge expired entries from the persistent host status database.
62
63 -bi Initialize the alias database.
64
65 -bm Deliver mail in the usual way (default).
66
67 -bp Print a listing of the queue(s).
68
69 -bP Print number of entries in the queue(s); only available with
70 shared memory support.
71
72 -bs Use the SMTP protocol as described in RFC821 on standard input
73 and output. This flag implies all the operations of the -ba
74 flag that are compatible with SMTP.
75
76 -bt Run in address test mode. This mode reads addresses and shows
77 the steps in parsing; it is used for debugging configuration ta‐
78 bles.
79
80 -bv Verify 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 -Cfile Use alternate configuration file. Sendmail gives up any en‐
85 hanced (set-user-ID or set-group-ID) privileges if an alternate
86 configuration file is specified.
87
88 -D logfile
89 Send debugging output to the indicated log file instead of std‐
90 out.
91
92 -dcategory.level...
93 Set the debugging flag for category to level. Category is ei‐
94 ther an integer or a name specifying the topic, and level an in‐
95 teger specifying the level of debugging output desired. Higher
96 levels generally mean more output. More than one flag can be
97 specified by separating them with commas. A list of numeric de‐
98 bugging categories can be found in the TRACEFLAGS file in the
99 sendmail source distribution.
100 The option -d0.1 prints the version of sendmail and the options
101 it was compiled with.
102 Most other categories are only useful with, and documented in,
103 sendmail's source code.
104
105 -Ffullname
106 Set the full name of the sender.
107
108 -fname 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. -f
113 should only be used by ``trusted'' users (normally root, daemon,
114 and network) 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 -G Relay (gateway) submission of a message, e.g., when rmail calls
119 sendmail .
120
121 -hN Set the hop count to N. The hop count is incremented every time
122 the mail is processed. When it reaches a limit, the mail is re‐
123 turned with an error message, the victim of an aliasing loop.
124 If not specified, ``Received:'' lines in the message are
125 counted.
126
127 -i Do 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 -L tag Set the identifier used in syslog messages to the supplied tag.
133
134 -N dsn Set delivery status notification conditions to dsn, 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 -n Don't do aliasing.
141
142 -O option=value
143 Set option option to the specified value. This form uses long
144 names. See below for more details.
145
146 -ox value
147 Set option x to the specified value. This form uses single
148 character names only. The short names are not described in this
149 manual page; see the Sendmail Installation and Operation Guide
150 for details.
151
152 -pprotocol
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 -q[time]
158 Process saved messages in the queue at given intervals. If time
159 is omitted, process the queue once. Time 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, sendmail will run in the back‐
164 ground. This option can be used safely with -bd.
165
166 -qp[time]
167 Similar to -qtime, 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 -qf Process saved messages in the queue once and do not fork(), but
175 run in the foreground.
176
177 -qGname
178 Process jobs in queue group called name only.
179
180 -q[!]Isubstr
181 Limit processed jobs to those containing substr as a substring
182 of the queue id or not when ! is specified.
183
184 -q[!]Qsubstr
185 Limit processed jobs to quarantined jobs containing substr as a
186 substring of the quarantine reason or not when ! is specified.
187
188 -q[!]Rsubstr
189 Limit processed jobs to those containing substr as a substring
190 of one of the recipients or not when ! is specified.
191
192 -q[!]Ssubstr
193 Limit processed jobs to those containing substr as a substring
194 of the sender or not when ! is specified.
195
196 -Q[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 de‐
200 scribed above.
201
202 -R return
203 Set the amount of the message to be returned if the message
204 bounces. The return parameter can be `full' to return the en‐
205 tire message or `hdrs' to return only the headers. In the lat‐
206 ter case also local bounces return only the headers.
207
208 -rname An alternate and obsolete form of the -f flag.
209
210 -t Read 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 -U If a mail submission via the command line requires the use of
215 the SMTPUTF8 argument for the MAIL command, e.g., because a
216 header uses UTF-8 encoding, but the addresses on the command
217 line are all ASCII, then this option must be used. Only avail‐
218 able if EAI support is enabled, and the SMTPUTF8 option is set.
219
220 -V envid
221 Set the original envelope id. This is propagated across SMTP to
222 servers that support DSNs and is returned in DSN-compliant error
223 messages.
224
225 -v Go into verbose mode. Alias expansions will be announced, etc.
226
227 -X logfile
228 Log all traffic in and out of mailers in the indicated log file.
229 This should only be used as a last resort for debugging mailer
230 bugs. It will log a lot of data very quickly.
231
232 -- Stop processing command flags and use the rest of the arguments
233 as addresses.
234
235 Options
236 There are also a number of processing options that may be set. Nor‐
237 mally these will only be used by a system administrator. Options may
238 be set either on the command line using the -o flag (for short names),
239 the -O flag (for long names), or in the configuration file. This is a
240 partial list limited to those options that are likely to be useful on
241 the command line and only shows the long names; for a complete list
242 (and details), consult the Sendmail Installation and Operation Guide.
243 The options are:
244
245 AliasFile=file
246 Use alternate alias file.
247
248 HoldExpensive
249 On mailers that are considered ``expensive'' to connect to,
250 don't initiate immediate connection. This requires queueing.
251
252 CheckpointInterval=N
253 Checkpoint the queue file after every N successful deliveries
254 (default 10). This avoids excessive duplicate deliveries when
255 sending to long mailing lists interrupted by system crashes.
256
257 DeliveryMode=x
258 Set the delivery mode to x. Delivery modes are `i' for interac‐
259 tive (synchronous) delivery, `b' for background (asynchronous)
260 delivery, `q' for queue only - i.e., actual delivery is done the
261 next time the queue is run, and `d' for deferred - the same as
262 `q' except that database lookups for maps which have set the -D
263 option (default for the host map) are avoided.
264
265 ErrorMode=x
266 Set error processing to mode x. Valid modes are `m' to mail
267 back the error message, `w' to ``write'' back the error message
268 (or mail it back if the sender is not logged in), `p' to print
269 the errors on the terminal (default), `q' to throw away error
270 messages (only exit status is returned), and `e' to do special
271 processing for the BerkNet. If the text of the message is not
272 mailed back by modes `m' or `w' and if the sender is local to
273 this machine, a copy of the message is appended to the file
274 dead.letter in the sender's home directory.
275
276 SaveFromLine
277 Save UNIX-style From lines at the front of messages.
278
279 MaxHopCount=N
280 The maximum number of times a message is allowed to ``hop'' be‐
281 fore we decide it is in a loop.
282
283 IgnoreDots
284 Do not take dots on a line by themselves as a message termina‐
285 tor.
286
287 SendMimeErrors
288 Send error messages in MIME format. If not set, the DSN (Deliv‐
289 ery Status Notification) SMTP extension is disabled.
290
291 ConnectionCacheTimeout=timeout
292 Set connection cache timeout.
293
294 ConnectionCacheSize=N
295 Set connection cache size.
296
297 LogLevel=n
298 The log level.
299
300 MeToo=False
301 Don't send to ``me'' (the sender) if I am in an alias expansion.
302
303 CheckAliases
304 Validate the right hand side of aliases during a newaliases(1)
305 command.
306
307 OldStyleHeaders
308 If set, this message may have old style headers. If not set,
309 this message is guaranteed to have new style headers (i.e., com‐
310 mas instead of spaces between addresses). If set, an adaptive
311 algorithm is used that will correctly determine the header for‐
312 mat in most cases.
313
314 QueueDirectory=queuedir
315 Select the directory in which to queue messages.
316
317 StatusFile=file
318 Save statistics in the named file.
319
320 Timeout.queuereturn=time
321 Set the timeout on undelivered messages in the queue to the
322 specified time. After delivery has failed (e.g., because of a
323 host being down) for this amount of time, failed messages will
324 be returned to the sender. The default is five days.
325
326 UserDatabaseSpec=userdatabase
327 If set, a user database is consulted to get forwarding informa‐
328 tion. You can consider this an adjunct to the aliasing mecha‐
329 nism, except that the database is intended to be distributed;
330 aliases are local to a particular host. This may not be avail‐
331 able if your sendmail does not have the USERDB option compiled
332 in.
333
334 ForkEachJob
335 Fork each job during queue runs. May be convenient on memory-
336 poor machines.
337
338 SevenBitInput
339 Strip incoming messages to seven bits.
340
341 EightBitMode=mode
342 Set the handling of eight bit input to seven bit destinations to
343 mode: m (mimefy) will convert to seven-bit MIME format, p (pass)
344 will pass it as eight bits (but violates protocols), and s
345 (strict) will bounce the message.
346
347 MinQueueAge=timeout
348 Sets how long a job must ferment in the queue between attempts
349 to send it.
350
351 DefaultCharSet=charset
352 Sets the default character set used to label 8-bit data that is
353 not otherwise labelled.
354
355 NoRecipientAction=action
356 Set the behaviour when there are no recipient headers (To:, Cc:
357 or Bcc:) in the message to action: none leaves the message un‐
358 changed, add-to adds a To: header with the envelope recipients,
359 add-apparently-to adds an Apparently-To: header with the enve‐
360 lope recipients, add-bcc adds an empty Bcc: header, and add-to-
361 undisclosed adds a header reading `To: undisclosed-recipi‐
362 ents:;'.
363
364 MaxDaemonChildren=N
365 Sets the maximum number of children that an incoming SMTP daemon
366 will allow to spawn at any time to N.
367
368 ConnectionRateThrottle=N
369 Sets the maximum number of connections per second to the SMTP
370 port to N.
371
372 In aliases, the first character of a name may be a vertical bar to
373 cause interpretation of the rest of the name as a command to pipe the
374 mail to. It may be necessary to quote the name to keep sendmail from
375 suppressing the blanks from between arguments. For example, a common
376 alias is:
377
378 msgs: "|/usr/bin/msgs -s"
379
380 Aliases may also have the syntax ``:include:filename'' to ask sendmail
381 to read the named file for a list of recipients. For example, an alias
382 such as:
383
384 poets: ":include:/usr/local/lib/poets.list"
385
386 would read /usr/local/lib/poets.list for the list of addresses making
387 up the group.
388
389 Sendmail returns an exit status describing what it did. The codes are
390 defined in <sysexits.h>:
391
392 EX_OK Successful completion on all addresses.
393
394 EX_NOUSER
395 User name not recognized.
396
397 EX_UNAVAILABLE
398 Catchall meaning necessary resources were not available.
399
400 EX_SYNTAX
401 Syntax error in address.
402
403 EX_SOFTWARE
404 Internal software error, including bad arguments.
405
406 EX_OSERR
407 Temporary operating system error, such as ``cannot fork''.
408
409 EX_NOHOST
410 Host name not recognized.
411
412 EX_TEMPFAIL
413 Message could not be sent immediately, but was queued.
414
415 If invoked as newaliases, sendmail will rebuild the alias database. If
416 invoked as mailq, sendmail will print the contents of the mail queue.
417 If invoked as hoststat, sendmail will print the persistent host status
418 database. If invoked as purgestat, sendmail will purge expired entries
419 from the persistent host status database. If invoked as smtpd, send‐
420 mail will act as a daemon, as if the -bd option were specified.
421
423 sendmail often gets blamed for many problems that are actually the re‐
424 sult of other problems, such as overly permissive modes on directories.
425 For this reason, sendmail checks the modes on system directories and
426 files to determine if they can be trusted. Although these checks can
427 be turned off and your system security reduced by setting the Dont‐
428 BlameSendmail option, the permission problems should be fixed. For
429 more information, see the Sendmail Installation and Operation Guide
430
432 Except for the file /etc/mail/sendmail.cf itself the following path‐
433 names are all specified in /etc/mail/sendmail.cf. Thus, these values
434 are only approximations.
435
436 /etc/aliases
437 raw data for alias names
438
439 /etc/aliases.db
440 data base of alias names
441
442 /etc/mail/sendmail.cf
443 configuration file
444
445 /etc/mail/helpfile
446 help file
447
448 /var/log/mail/statistics
449 collected statistics
450
451 /var/spool/mqueue/*
452 temp files
453
455 mail(1), rmail(1), syslog(3), aliases(5), mailaddr(7),
456
457 DARPA Internet Request For Comments RFC819, RFC821, RFC822. Sendmail
458 Installation and Operation Guide, No. 8, SMM.
459
460 http://www.sendmail.org/
461
462 US Patent Numbers 6865671, 6986037.
463
465 The sendmail command appeared in 4.2BSD.
466
467
468
469 $Date: 2013-11-22 20:51:56 $ SENDMAIL(8)