1SENDMAIL(8)                 System Manager's Manual                SENDMAIL(8)
2
3
4

NAME

6       sendmail - an electronic mail transport agent
7

SYNOPSIS

9       sendmail [flags] [address ...]
10       newaliases
11       mailq [-v]
12       hoststat
13       purgestat
14       smtpd
15

DESCRIPTION

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
78              tables.
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
85              enhanced (set-user-ID or set-group-ID) privileges if  an  alter‐
86              nate 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
94              either  an  integer or a name specifying the topic, and level 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 -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
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       -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
200              described 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
205              entire  message  or  `hdrs'  to return only the headers.  In the
206              latter 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       -V envid
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       -v     Go into verbose mode.  Alias expansions will be announced, etc.
220
221       -X logfile
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       --     Stop processing command flags and use the rest of the  arguments
227              as addresses.
228
229   Options
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 -o flag (for short names),
233       the -O flag (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 Sendmail Installation and Operation Guide.
237       The options are:
238
239       AliasFile=file
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=N
247              Checkpoint  the  queue  file after every N successful deliveries
248              (default 10).  This avoids excessive duplicate  deliveries  when
249              sending to long mailing lists interrupted by system crashes.
250
251       DeliveryMode=x
252              Set the delivery mode to x.  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=x
260              Set error processing to mode x.  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              dead.letter in the sender's home directory.
269
270       SaveFromLine
271              Save UNIX-style From lines at the front of messages.
272
273       MaxHopCount=N
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=timeout
286              Set connection cache timeout.
287
288       ConnectionCacheSize=N
289              Set connection cache size.
290
291       LogLevel=n
292              The log level.
293
294       MeToo=False
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=queuedir
309              Select the directory in which to queue messages.
310
311       StatusFile=file
312              Save statistics in the named file.
313
314       Timeout.queuereturn=time
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=userdatabase
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=mode
336              Set the handling of eight bit input to seven bit destinations to
337              mode: 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=timeout
342              Sets how long a job must ferment in the queue  between  attempts
343              to send it.
344
345       DefaultCharSet=charset
346              Sets  the default character set used to label 8-bit data that is
347              not otherwise labelled.
348
349       DialDelay=sleeptime
350              If opening a connection fails, sleep for sleeptime  seconds  and
351              try again.  Useful on dial-on-demand sites.
352
353       NoRecipientAction=action
354              Set  the behaviour when there are no recipient headers (To:, Cc:
355              or Bcc:) in the message  to  action:  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=N
363              Sets the maximum number of children that an incoming SMTP daemon
364              will allow to spawn at any time to N.
365
366       ConnectionRateThrottle=N
367              Sets the maximum number of connections per second  to  the  SMTP
368              port to N.
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 sendmail from
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:filename'' to ask sendmail
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  /usr/local/lib/poets.list for the list of addresses making
385       up the group.
386
387       Sendmail returns an exit status describing what it did.  The codes  are
388       defined in <sysexits.h>:
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 newaliases, sendmail will rebuild the alias database.  If
414       invoked as mailq, sendmail will print the contents of the  mail  queue.
415       If  invoked as hoststat, sendmail will print the persistent host status
416       database.  If invoked as purgestat, sendmail will purge expired entries
417       from  the  persistent host status database.  If invoked as smtpd, send‐
418       mail will act as a daemon, as if the -bd option were specified.
419

NOTES

421       sendmail often 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, sendmail checks 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 Dont‐
426       BlameSendmail  option,  the  permission  problems should be fixed.  For
427       more information, see:
428
429       http://www.sendmail.org/tips/DontBlameSendmail.html
430

FILES

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

SEE ALSO

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

HISTORY

465       The sendmail command appeared in 4.2BSD.
466
467
468
469                         $Date: 2013-11-22 20:51:56 $              SENDMAIL(8)
Impressum