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

NOTES

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

FILES

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

SEE ALSO

451       mail(1), rmail(1), syslog(3), aliases(5), mailaddr(7),
452
453       DARPA Internet Request For Comments RFC819, RFC821,  RFC822.   Sendmail
454       Installation and Operation Guide, No. 8, SMM.
455
456       http://www.sendmail.org/
457

HISTORY

459       The sendmail command appeared in 4.2BSD.
460
461
462
463                         $Date: 2003/12/01 17:02:41 $              SENDMAIL(8)
Impressum