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       -bd    Run as a daemon.  Sendmail will fork and run in background  lis‐
52              tening on socket 25 for incoming SMTP connections.  This is nor‐
53              mally run from /etc/rc.
54
55       -bD    Same as -bd except runs in foreground.
56
57       -bh    Print the persistent host status database.
58
59       -bH    Purge expired entries from the persistent host status database.
60
61       -bi    Initialize the alias database.
62
63       -bm    Deliver mail in the usual way (default).
64
65       -bp    Print a listing of the queue(s).
66
67       -bP    Print number of entries in the  queue(s);  only  available  with
68              shared memory support.
69
70       -bs    Use  the  SMTP protocol as described in RFC821 on standard input
71              and output.  This flag implies all the  operations  of  the  -ba
72              flag that are compatible with SMTP.
73
74       -bt    Run  in  address test mode.  This mode reads addresses and shows
75              the steps in parsing; it is  used  for  debugging  configuration
76              tables.
77
78       -bv    Verify  names only - do not try to collect or deliver a message.
79              Verify mode is normally used for  validating  users  or  mailing
80              lists.
81
82       -Cfile Use   alternate  configuration  file.   Sendmail  gives  up  any
83              enhanced (set-user-ID or set-group-ID) privileges if  an  alter‐
84              nate configuration file is specified.
85
86       -D logfile
87              Send  debugging output to the indicated log file instead of std‐
88              out.
89
90       -dcategory.level...
91              Set the debugging flag  for  category  to  level.   Category  is
92              either  an  integer or a name specifying the topic, and level an
93              integer  specifying  the  level  of  debugging  output  desired.
94              Higher  levels  generally  mean more output.  More than one flag
95              can be specified by separating them  with  commas.   A  list  of
96              numeric debugging categories can be found in the TRACEFLAGS file
97              in the sendmail source distribution.
98              The option -d0.1 prints the version of sendmail and the  options
99              it was compiled with.
100              Most  other  categories are only useful with, and documented in,
101              sendmail's source code.
102
103       -Ffullname
104              Set the full name of the sender.
105
106       -fname Sets the name of the ``from'' person (i.e., the envelope  sender
107              of the mail).  This address may also be used in the From: header
108              if that header is missing during initial submission.  The  enve‐
109              lope sender address is used as the recipient for delivery status
110              notifications and may also appear in a Return-Path: header.   -f
111              should only be used by ``trusted'' users (normally root, daemon,
112              and network) or if the person you are trying to  become  is  the
113              same  as  the  person  you are.  Otherwise, an X-Authentication-
114              Warning header will be added to the message.
115
116       -G     Relay (gateway) submission of a message, e.g., when rmail  calls
117              sendmail .
118
119       -hN    Set the hop count to N.  The hop count is incremented every time
120              the mail is processed.  When it reaches a  limit,  the  mail  is
121              returned  with an error message, the victim of an aliasing loop.
122              If  not  specified,  ``Received:''  lines  in  the  message  are
123              counted.
124
125       -i     Do  not strip a leading dot from lines in incoming messages, and
126              do not treat a dot on a line by itself as the end of an incoming
127              message.   This  should  be  set  if you are reading data from a
128              file.
129
130       -L tag Set the identifier used in syslog messages to the supplied tag.
131
132       -N dsn Set delivery status notification conditions to dsn, which can be
133              `never'  for  no  notifications or a comma separated list of the
134              values `failure' to be notified if delivery failed,  `delay'  to
135              be notified if delivery is delayed, and `success' to be notified
136              when the message is successfully delivered.
137
138       -n     Don't do aliasing.
139
140       -O option=value
141              Set option option to the specified value.  This form  uses  long
142              names.  See below for more details.
143
144       -ox value
145              Set  option  x  to  the  specified value.  This form uses single
146              character names only.  The short names are not described in this
147              manual  page;  see the Sendmail Installation and Operation Guide
148              for details.
149
150       -pprotocol
151              Set the name of the protocol used to receive the message.   This
152              can be a simple protocol name such as ``UUCP'' or a protocol and
153              hostname, such as ``UUCP:ucbvax''.
154
155       -q[time]
156              Process saved messages in the queue at given intervals.  If time
157              is  omitted,  process the queue once.  Time is given as a tagged
158              number, with `s' being seconds, `m' being minutes (default), `h'
159              being  hours, `d' being days, and `w' being weeks.  For example,
160              `-q1h30m' or `-q90m' would both set  the  timeout  to  one  hour
161              thirty  minutes.   By  default,  sendmail  will run in the back‐
162              ground.  This option can be used safely with -bd.
163
164       -qp[time]
165              Similar to -qtime, except that instead of periodically forking a
166              child  to  process the queue, sendmail forks a single persistent
167              child for each queue  that  alternates  between  processing  the
168              queue and sleeping.  The sleep time is given as the argument; it
169              defaults to 1 second.  The process will always sleep at least  5
170              seconds if the queue was empty in the previous queue run.
171
172       -qf    Process  saved messages in the queue once and do not fork(), but
173              run in the foreground.
174
175       -qGname
176              Process jobs in queue group called name only.
177
178       -q[!]Isubstr
179              Limit processed jobs to those containing substr as  a  substring
180              of the queue id or not when !  is specified.
181
182       -q[!]Qsubstr
183              Limit  processed jobs to quarantined jobs containing substr as a
184              substring of the quarantine reason or not when !  is specified.
185
186       -q[!]Rsubstr
187              Limit processed jobs to those containing substr as  a  substring
188              of one of the recipients or not when !  is specified.
189
190       -q[!]Ssubstr
191              Limit  processed  jobs to those containing substr as a substring
192              of the sender or not when !  is specified.
193
194       -Q[reason]
195              Quarantine a normal queue items with the given reason or unquar‐
196              antine  quarantined  queue  items  if  no reason is given.  This
197              should only be used with some sort of  item  matching  using  as
198              described above.
199
200       -R return
201              Set  the  amount  of  the  message to be returned if the message
202              bounces.  The return parameter  can  be  `full'  to  return  the
203              entire  message  or  `hdrs'  to return only the headers.  In the
204              latter case also local bounces return only the headers.
205
206       -rname An alternate and obsolete form of the -f flag.
207
208       -t     Read message for recipients.  To:, Cc:, and Bcc: lines  will  be
209              scanned  for recipient addresses.  The Bcc: line will be deleted
210              before transmission.
211
212       -V envid
213              Set the original envelope id.  This is propagated across SMTP to
214              servers that support DSNs and is returned in DSN-compliant error
215              messages.
216
217       -v     Go into verbose mode.  Alias expansions will be announced, etc.
218
219       -X logfile
220              Log all traffic in and out of mailers in the indicated log file.
221              This  should  only be used as a last resort for debugging mailer
222              bugs.  It will log a lot of data very quickly.
223
224       --     Stop processing command flags and use the rest of the  arguments
225              as addresses.
226
227   Options
228       There  are  also  a number of processing options that may be set.  Nor‐
229       mally these will only be used by a system administrator.   Options  may
230       be  set either on the command line using the -o flag (for short names),
231       the -O flag (for long names), or in the configuration file.  This is  a
232       partial  list  limited to those options that are likely to be useful on
233       the command line and only shows the long names;  for  a  complete  list
234       (and  details),  consult the Sendmail Installation and Operation Guide.
235       The options are:
236
237       AliasFile=file
238              Use alternate alias file.
239
240       HoldExpensive
241              On mailers that are  considered  ``expensive''  to  connect  to,
242              don't initiate immediate connection.  This requires queueing.
243
244       CheckpointInterval=N
245              Checkpoint  the  queue  file after every N successful deliveries
246              (default 10).  This avoids excessive duplicate  deliveries  when
247              sending to long mailing lists interrupted by system crashes.
248
249       DeliveryMode=x
250              Set the delivery mode to x.  Delivery modes are `i' for interac‐
251              tive (synchronous) delivery, `b' for  background  (asynchronous)
252              delivery, `q' for queue only - i.e., actual delivery is done the
253              next time the queue is run, and `d' for deferred - the  same  as
254              `q'  except that database lookups for maps which have set the -D
255              option (default for the host map) are avoided.
256
257       ErrorMode=x
258              Set error processing to mode x.  Valid modes  are  `m'  to  mail
259              back  the error message, `w' to ``write'' back the error message
260              (or mail it back if the sender is not logged in), `p'  to  print
261              the  errors  on  the terminal (default), `q' to throw away error
262              messages (only exit status is returned), and `e' to  do  special
263              processing  for  the BerkNet.  If the text of the message is not
264              mailed back by modes `m' or `w' and if the sender  is  local  to
265              this  machine,  a  copy  of  the message is appended to the file
266              dead.letter in the sender's home directory.
267
268       SaveFromLine
269              Save UNIX-style From lines at the front of messages.
270
271       MaxHopCount=N
272              The maximum number of times a  message  is  allowed  to  ``hop''
273              before we decide it is in a loop.
274
275       IgnoreDots
276              Do  not  take dots on a line by themselves as a message termina‐
277              tor.
278
279       SendMimeErrors
280              Send error messages in MIME format.  If not set, the DSN (Deliv‐
281              ery Status Notification) SMTP extension is disabled.
282
283       ConnectionCacheTimeout=timeout
284              Set connection cache timeout.
285
286       ConnectionCacheSize=N
287              Set connection cache size.
288
289       LogLevel=n
290              The log level.
291
292       MeToo=False
293              Don't send to ``me'' (the sender) if I am in an alias expansion.
294
295       CheckAliases
296              Validate  the  right hand side of aliases during a newaliases(1)
297              command.
298
299       OldStyleHeaders
300              If set, this message may have old style headers.   If  not  set,
301              this message is guaranteed to have new style headers (i.e., com‐
302              mas instead of spaces between addresses).  If set,  an  adaptive
303              algorithm  is used that will correctly determine the header for‐
304              mat in most cases.
305
306       QueueDirectory=queuedir
307              Select the directory in which to queue messages.
308
309       StatusFile=file
310              Save statistics in the named file.
311
312       Timeout.queuereturn=time
313              Set the timeout on undelivered messages  in  the  queue  to  the
314              specified  time.   After delivery has failed (e.g., because of a
315              host being down) for this amount of time, failed  messages  will
316              be returned to the sender.  The default is five days.
317
318       UserDatabaseSpec=userdatabase
319              If  set, a user database is consulted to get forwarding informa‐
320              tion.  You can consider this an adjunct to the  aliasing  mecha‐
321              nism,  except  that  the database is intended to be distributed;
322              aliases are local to a particular host.  This may not be  avail‐
323              able  if  your sendmail does not have the USERDB option compiled
324              in.
325
326       ForkEachJob
327              Fork each job during queue runs.  May be convenient  on  memory-
328              poor machines.
329
330       SevenBitInput
331              Strip incoming messages to seven bits.
332
333       EightBitMode=mode
334              Set the handling of eight bit input to seven bit destinations to
335              mode: m (mimefy) will convert to seven-bit MIME format, p (pass)
336              will  pass  it  as  eight  bits  (but violates protocols), and s
337              (strict) will bounce the message.
338
339       MinQueueAge=timeout
340              Sets how long a job must ferment in the queue  between  attempts
341              to send it.
342
343       DefaultCharSet=charset
344              Sets  the default character set used to label 8-bit data that is
345              not otherwise labelled.
346
347       DialDelay=sleeptime
348              If opening a connection fails, sleep for sleeptime  seconds  and
349              try again.  Useful on dial-on-demand sites.
350
351       NoRecipientAction=action
352              Set  the behaviour when there are no recipient headers (To:, Cc:
353              or Bcc:) in the message  to  action:  none  leaves  the  message
354              unchanged,  add-to  adds  a To: header with the envelope recipi‐
355              ents, add-apparently-to adds an Apparently-To: header  with  the
356              envelope recipients, add-bcc adds an empty Bcc: header, and add-
357              to-undisclosed adds a header  reading  `To:  undisclosed-recipi‐
358              ents:;'.
359
360       MaxDaemonChildren=N
361              Sets the maximum number of children that an incoming SMTP daemon
362              will allow to spawn at any time to N.
363
364       ConnectionRateThrottle=N
365              Sets the maximum number of connections per second  to  the  SMTP
366              port to N.
367
368       In  aliases,  the  first  character  of a name may be a vertical bar to
369       cause interpretation of the rest of the name as a command to  pipe  the
370       mail  to.   It may be necessary to quote the name to keep sendmail from
371       suppressing the blanks from between arguments.  For example,  a  common
372       alias is:
373
374              msgs: "|/usr/bin/msgs -s"
375
376       Aliases  may also have the syntax ``:include:filename'' to ask sendmail
377       to read the named file for a list of recipients.  For example, an alias
378       such as:
379
380              poets: ":include:/usr/local/lib/poets.list"
381
382       would  read  /usr/local/lib/poets.list for the list of addresses making
383       up the group.
384
385       Sendmail returns an exit status describing what it did.  The codes  are
386       defined in <sysexits.h>:
387
388       EX_OK  Successful completion on all addresses.
389
390       EX_NOUSER
391              User name not recognized.
392
393       EX_UNAVAILABLE
394              Catchall meaning necessary resources were not available.
395
396       EX_SYNTAX
397              Syntax error in address.
398
399       EX_SOFTWARE
400              Internal software error, including bad arguments.
401
402       EX_OSERR
403              Temporary operating system error, such as ``cannot fork''.
404
405       EX_NOHOST
406              Host name not recognized.
407
408       EX_TEMPFAIL
409              Message could not be sent immediately, but was queued.
410
411       If invoked as newaliases, sendmail will rebuild the alias database.  If
412       invoked as mailq, sendmail will print the contents of the  mail  queue.
413       If  invoked as hoststat, sendmail will print the persistent host status
414       database.  If invoked as purgestat, sendmail will purge expired entries
415       from  the  persistent host status database.  If invoked as smtpd, send‐
416       mail will act as a daemon, as if the -bd option were specified.
417

NOTES

419       sendmail often gets blamed for many  problems  that  are  actually  the
420       result  of  other problems, such as overly permissive modes on directo‐
421       ries.  For this reason, sendmail checks the modes on system directories
422       and  files  to determine if they can be trusted.  Although these checks
423       can be turned off and your system security reduced by setting the Dont‐
424       BlameSendmail  option,  the  permission  problems should be fixed.  For
425       more information, see:
426
427       http://www.sendmail.org/tips/DontBlameSendmail.html
428

FILES

430       Except for the file /etc/mail/sendmail.cf itself  the  following  path‐
431       names  are  all specified in /etc/mail/sendmail.cf.  Thus, these values
432       are only approximations.
433
434        /etc/aliases
435              raw data for alias names
436
437        /etc/aliases.db
438              data base of alias names
439
440        /etc/mail/sendmail.cf
441              configuration file
442
443        /etc/mail/helpfile
444              help file
445
446        /var/log/mail/statistics
447              collected statistics
448
449        /var/spool/mqueue/*
450              temp files
451

SEE ALSO

453       mail(1), rmail(1), syslog(3), aliases(5), mailaddr(7),
454
455       DARPA Internet Request For Comments RFC819, RFC821,  RFC822.   Sendmail
456       Installation and Operation Guide, No. 8, SMM.
457
458       http://www.sendmail.org/
459
460       US Patent Numbers 6865671, 6986037.
461

HISTORY

463       The sendmail command appeared in 4.2BSD.
464
465
466
467                         $Date: 2011/03/07 23:44:48 $              SENDMAIL(8)
Impressum