DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

sendmail(ADMN)


sendmail, newaliases, mailq, hoststat, purgestat, smtpd -- an electronic mail transport agent

Syntax

/usr/lib/sendmail [ flags ] [ address ... ]

newaliases

mailq [ -v ]

hoststat

purgestat

smtpd

Description

sendmail sends a message to one or more recipients, routing the message over whatever networks are necessary. sendmail does internetwork forwarding as necessary to deliver the message to the correct place.

sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages.

With no flags, sendmail reads its standard input up to an end-of-file or a line consisting only of a single dot and sends a copy of the message found there to all of the addresses listed. It determines the network(s) to use based on the syntax and contents of the addresses.

Local addresses are looked up in a file and aliased appropriately. Aliasing can be prevented by preceding the address with a backslash. Beginning with 8.10, the sender is included in any alias expansions. For example, if `john' sends to `group', and `group' includes `john' in the expansion, then the letter will also be delivered to `john'.

Flags are:


-B type
Set the body type to type. Current legal values are 7BIT or 8BITMIME.

-ba
Go into ARPANET mode. All input lines must end with a CR-LF, and all messages will be generated with a CR-LF at the end. Also, the ``From'': and ``Sender'': fields are examined for the name of the sender.

-bd
Run as a daemon. sendmail will fork and run in background listening on TCP port 25 for incoming SMTP connections. This is normally invoked from startup scripts in /etc/rc2.d and /etc/init.d.

-bD
Same as -bd, except runs in foreground.

-bh
Print the persistent host status database.

-bH
Purge expired entries from the persistent host status database.

-bi
Initialize the alias database.

-bm
Deliver mail in the usual way (default).

-bp
Print a listing of the mail queue.

-bs
Use the SMTP protocol as described in RFC 821 on standard input and output. This flag implies all the operations of the -ba flag that are compatible with SMTP.

-bt
Run in address test mode. This mode reads addresses and shows the steps in parsing; it is used for debugging configuration tables.

-bv
Verify names only - do not try to collect or deliver a message. Verify mode is normally used for validating users or mailing lists.

-Cfile
Use alternate configuration file. sendmail refuses to run as root if an alternate configuration file is specified.

-dX
Set debugging value to X.

-Ffullname
Set the full name of the sender.

-fname
Set the name of the ``from'' person (that is, the envelope sender of the mail). This address may also be used in the From: header if that header is missing during initial submission. The envelope sender address is used as the recipient for delivery status notifications and may also appear in a Return-Path: header. -f can only be used by ``trusted'' users (normally root, daemon, and network) or if the person you are trying to become is the same as the person you are. Otherwise, an X-Authentication-Warning header will be added to the message.

-hN
This flag sets the ``hop count'' to N. This represents the number of times this message has been processed by sendmail (to the extent that it is supported by the underlying networks). N is incremented during processing, and if it reaches MAXHOP (currently 30) sendmail throws away the message with an error.

-L tag
Set the identifier used in syslog messages to the supplied tag.

-N dsn
Set delivery status notification conditions to dsn, which can be:

never
no notifications or a comma separated list of the values

failure
to be notified if delivery failed

delay
to be notified if delivery is delayed

success
to be notified when the message is successfully delivered

-n
Do not do aliasing.

-ox value
Set option x to the specified value. Options are described below.

-O option=value
Set option to the specified value. This form uses long names. See ``Long name options'' for more details.

-o xvalue

-pprotocol
Set the name of the protocol used to receive the message. This can be a simple protocol name such as ``UUCP'' or a protocol and hostname, such as ``UUCP:ucbvax''.

-q[time]
Process saved messages in the queue at given intervals. If time is omitted, process the queue once. time is given as a tagged number, with s being seconds, m being minutes, h being hours, d being days, and w being weeks. For example, ``-q1h30m'' or ``-q90m'' would both set the timeout to one hour thirty minutes. If time is specified, sendmail will run in background. This option can be used safely with -bd.

-q[I,R,S]string
Run the queue once, limiting the jobs to those matching string. The key letters are:

I
queue identifier

R
recipient

S
sender
A particular queued job is accepted if one of the corresponding addresses contains the indicated string.

-R return
Set the amount of the message to be returned if the message bounces. The return parameter can be:

full
to return the entire message

hdrs
to return only the headers
In the latter case also local bounces return only the headers.

-rname
An alternate and obsolete form of the -f flag.

-t
Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line will be deleted before transmission.

-U
Initial (user) submission. This should always be set when called from a user agent such as Mail or exmh and never be set when called by a network delivery agent such as rmail.

-V envid
Set the original envelope ID. This is propagated across SMTP to servers that support DSNs and is returned in DSN-compliant error messages.

-v
Go into verbose mode. Alias expansions will be announced, and so on.

-Xlogfile
Log all traffic in and out of mailers in the indicated log file. This should only be used as a last resort for debugging mailer bugs. It will log a lot of data very quickly.

--
Stop processing command flags and use the rest of the arguments as addresses.

Short name options

The so-called short name options are of the primary set of processing options that can be set. Normally these will only be used by a system administrator. Options may be set either on the command line using the -o flag or in the configuration file. These are described in detail in ``sendmail administration'' in the Mail and Messaging Guide. The options are:

A spec, spec, ...
Specify possible alias file(s). Each spec should be in the format ``class:file'' where ``class:'' is optional and defaults to implicit. Valid classes are implicit (search through a compiled-in list of alias file types, for back compatibility), hash, dbm, stab (internal symbol table - not normally used unless you have no other database lookup), or nis. If a list of specs are provided, sendmail searches them in order.

aN
If set, wait up to N minutes for an ``@:@'' entry to exist in the alias database before starting up. If it does not appear in N minutes, rebuild the database (if the D option is also set) or issue a warning.

Bc
Set the blank substitution character to c.

bN/M
Require N free disk blocks on the spool filesystem in order to accept mail via SMTP. Advertise M as the largest message size via ESMTP.

CN
Checkpoint the mail-queue every N addresses (default 10).

c
On mailers that are considered ``expensive'' to connect to, do not initiate immediate connection. This requires queuing.

D
Try to automatically rebuild the alias database if necessary. If this option is not set, sendmail will never rebuild the alias database unless explicitly requested to using -bi.

dx
Set the delivery mode to x. Delivery modes are i for interactive (synchronous) delivery, b for background (asynchronous) delivery, and q for queue only - that is, actual delivery is done the next time the queue is run.

Efile/message
Prepend the value of file/message to error messages. This option can only be used by root. If the first character of the value is a ``/'', it will be treated as a file from which to read the text; otherwise, the value is treated as a literal message.

ex
Set error processing to mode x. Valid modes are m to mail back the error message, w to write back the error message (or mail it back if the sender is not logged in), p to print the errors on the terminal (default), q to throw away error messages (only exit status is returned), and e to do special processing for the BerkNet. If the text of the message is not mailed back by modes m or w and if the sender is local to this machine, a copy of the message is appended to the file dead.letter in the sender's home directory.

Fmode
The mode to use when creating temporary files.

f
Save UNIX-style From: lines at the front of messages.

G
Match local mail names against the GECOS portion of the password file.

gN
The default group ID to use when calling mailers.

Hfile
The SMTP help file.

hN
The maximum number of times that a message is allowed to ``hop'' before we decide it is in a loop.

I
Use the Domain Name Server, named.

i
Do not take dots on a line by themselves as a message terminator.

Jpath
Set the path for searching for .forward files to path. path can be a colon-separated list if searching more than one directory is desired.

j
Send error messages in MIME format.

Ktimeout
Set the connection cache timeout to timeout.

kN
Set the connection cache size to N.

Ln
The log level.

l
Pay attention to the ``Errors-To:'' header.

Mx value
Set macro x to value.

m
Send to me (the sender) also if I am in an alias expansion.

n
Validate the right-hand side of aliases during a newaliases(ADMN) command.

Ooptions
Set SMTP server options. options takes the form of key=value pairs. key is one of: Port (defaults to smtp), Addr (defaults to INADDR_ANY), Family (defaults to AF_INET), or Listen (defaults to 10).

o
If set, this message may have old style headers. If not set, this message is guaranteed to have new style headers (i.e., commas instead of spaces between addresses). If set, an adaptive algorithm is used that will correctly determine the header format in most cases.

Ppostmaster
If set, copies of error messages will be sent to postmaster. Only the header of the failed message is sent.

popt,opt,...
Set privacy options to opt. opt can be one of: public, needmailhelo, needexpnhelo, noexpn, needvrfyhelo, novrfy, restrictmailq, or goaway.

Qqueuedir
Select the directory in which to queue messages.

qfactor
Use factor as the multiplier when deciding whether to queue jobs or run them.

R
Don't optimize source routes.

rtimeout
The timeout on reads; if none is set, sendmail will wait forever for a mailer. This option violates the word (if not the intent) of the SMTP specification, so the timeout should probably be fairly large.

Sfile
Save statistics in the named file.

s
Always instantiate the queue file, even under circumstances where it is not strictly necessary. This provides safety against system crashes during delivery.

Ttime
Set the timeout on undelivered messages in the queue to the specified time. After delivery has failed (for example, because of a host being down) for this amount of time, failed messages will be returned to the sender. The default is three days.

tstz,dtz
Set the local time zone name to stz for standard time and dtz for daylight time. This is only used under version six.

Uuserdb
Set the user-database filename to userdb.

uN
Set the default user ID for mailers.

Vfallbackhost
If specified, acts like a low priority MX record for every destination host.

v
Run in verbose mode.

w
Connect directly to the destination host even if we are the lowest preference forwarder listed in MX records.

XLA
When the system load average is higher than LA, refuse new SMTP connections.

xLA
Queue messages and don't deliver them when the system load average is higher than LA .

Y
Fork each job during queue runs. May be convenient on memory-poor machines.

yfact
Add fact to the job priority for each recipient encountered. Effectively lowers the priority of jobs with many recipients. Defaults to 30000.

Zfact
Add fact to the job priority each time a job is processed. Minimizes the impact of a destination host being down for a long time. Defaults to 90000.

zfact
fact is multiplied by the job class and subtracted from the priority. Jobs with a higher priority are favored. Defaults to 1800.

7
Strip incoming messages to seven bits.
In aliases, the first character of a name may be a vertical bar to cause interpretation of the rest of the name as a command to pipe the mail to. It may be necessary to quote the name to keep sendmail from suppressing the blanks from between arguments. For example, a common alias is:
   msgs: "|/usr/ucb/msgs -s"
Aliases may also have the syntax ``:include:filename'' to ask sendmail to read the named file for a list of recipients. For example, an alias such as:
   poets: ":include:/usr/local/lib/poets.list"
would read /usr/local/lib/poets.list for the list of addresses making up the group.

Long name options

As with the short name options, these options can be set either on the command line (using the -O flag) or in the configuration file. The long name options are as follows:

AliasFile=file
Use alternate alias file.

HoldExpensive
On mailers that are considered ``expensive'' to connect to, do not initiate immediate connection. This requires queueing.

CheckpointInterval=N
Checkpoint the queue file after every N successful deliveries (default 10). This avoids excessive duplicate deliveries when sending to long mailing lists interrupted by system crashes.

DeliveryMode=x
Set the delivery mode to x. Delivery modes are

i
interactive (synchronous) delivery

b
background (asynchronous) delivery

q
queue only; that is, actual delivery is done the next time the queue is run

d
deferred; the same as q except that database lookups for maps which have set the -D option (default for the host map) are avoided.

ErrorMode=x
Set error processing to mode x. Valid modes are:

m
mail back the error message

w
``write'' back the error message (or mail it back if the sender is not logged in)

p
print the errors on the terminal (default)

q
throw away error messages (only exit status is returned),

e
do special processing for the BerkNet

If the text of the message is not mailed back by modes m or w and if the sender is local to this machine, a copy of the message is appended to the file dead.letter in the sender's home directory.


SaveFromLine
Save UNIX-style From: lines at the front of messages.

MaxHopCount=N
The maximum number of times a message is allowed to ``hop'' before we decide it is in a loop.

IgnoreDots
Do not take dots on a line by themselves as a message terminator.

SendMimeErrors
Send error messages in MIME format. If not set, the DSN (Delivery Status Notification) SMTP extension is disabled.

ConnectionCacheTimeout=timeout
Set connection cache timeout.

ConnectionCacheSize=N
Set connection cache size.

LogLevel=n
The log level.

MeToo=False
Do not send to ``me'' (the sender) if I am in an alias expansion.

CheckAliases
Validate the right hand side of aliases during a newaliases(ADMN) command.

OldStyleHeaders
If set, this message may have old style headers. If not set, this message is guaranteed to have new style headers (that is, commas instead of spaces between addresses). If set, an adaptive algorithm is used that will correctly determine the header format in most cases.

QueueDirectory=queuedir
Select the directory in which to queue messages.

StatusFile=file
Save statistics in the named file.

Timeout.queuereturn=time
Set the timeout on undelivered messages in the queue to the specified time. After delivery has failed (for examle, because of a host being down) for this amount of time, failed messages will be returned to the sender. The default is five days.

UserDatabaseSpec=userdatabase
If set, a user database is consulted to get forwarding information. You can consider this an adjunct to the aliasing mechanism, except that the database is intended to be distributed; aliases are local to a particular host.

ForkEachJob
Fork each job during queue runs. May be convenient on memory-poor machines.

SevenBitInput
Strip incoming messages to seven bits.

EightBitMode=mode
Set the handling of eight bit input to seven bit destinations to mode:

m
(mimefy) will convert to seven-bit MIME format

p
(pass) will pass it as eight bits (but violates protocols)

s
(strict) will bounce the message

MinQueueAge=timeout
Sets how long a job must ferment in the queue between attempts to send it.

DefaultCharSet=charset
Sets the default character set used to label 8-bit data that is not otherwise labelled.

DialDelay=sleeptime
If opening a connection fails, sleep for sleeptime seconds and try again. Useful on dial-on-demand sites.

NoRecipientAction=action
Set the behavior when there are no recipient headers (To:, Cc: or Bcc:) in the message to action:

none
leaves the message unchanged

add-to
adds a To: header with the envelope recipients

add-apparently-to
adds an Apparently-To: header with the envelope recipients

add-bcc
adds an empty Bcc: header

add-to-undisclosed
adds a header reading ``To: undisclosed-recipients:;''

MaxDaemonChildren=N
Sets the maximum number of children that an incoming SMTP daemon will allow to spawn at any time to N.

ConnectionRateThrottle=N
Sets the maximum number of connections per second to the SMTP port to N.
In aliases, the first character of a name may be a vertical bar to cause interpretation of the rest of the name as a command to pipe the mail to. It may be necessary to quote the name to keep sendmail from suppressing the blanks from between arguments. For example, a common alias is:
   msgs: "|/usr/bin/msgs -s"
Aliases may also have the syntax:
   :include: filename
to ask sendmail to read the named file for a list of recipients. For example, an alias such as:
   poets: ":include:/usr/local/lib/poets.list"
would read /usr/local/lib/poets.list for the list of addresses making up the group.

Exit codes

sendmail returns an exit status describing what it did. The codes are defined in <sysexits.h>:

EX_NOHOST
Host name not recognized.

EX_NOUSER
User name not recognized.

EX_OK
Successful completion on all addresses.

EX_OSERR
Temporary operating system error, such as ``cannot fork''.

EX_SOFTWARE
Internal software error, including bad arguments.

EX_TEMPFAIL
Message could not be sent immediately, but was queued.

EX_UNAVAILABLE
Catchall meaning necessary resources were not available.

EX_SYNTAX
Syntax error in address.
If invoked as newaliases, sendmail will rebuild the alias database.

If invoked as mailq, sendmail will print the contents of the mail queue.

If invoked as hoststat, sendmail will print the persistent host status database.

If invoked as purgestat, sendmail will purge expired entries from the persistent host status database.

If invoked as smtpd, sendmail will act as a daemon, as if the -bd option were specified.

Notes

sendmail often gets blamed for many problems that are actually the result of other problems, such as overly permissive modes on directories. For this reason, sendmail checks the modes on system directories and files to determine if they can be trusted. Although these checks can be turned off and your system security reduced by setting the DontBlameSendmail option, the permission problems should be fixed. For more information, see:

http://www.sendmail.org/tips/DontBlameSendmail.html

Files

Except for /usr/lib/sendmail.cf, these pathnames are all specified in /usr/lib/sendmail.cf. Thus, these values are only approximations.


/etc/sendmail.pid
daemon process id

/usr/lib/mail/aliases
raw data for alias names

/usr/lib/mail/aliases.db
binary alias database

/usr/lib/sendmail.cf
configuration file

/usr/lib/sendmail.hf
help file

/usr/lib/sendmail.st
collected statistics

/usr/spool/mqueue/*
temp files

See also

aliases(SFF), mailx(C), mailaddr(ADMN), newaliases(ADMN)

Standards conformance

sendmail is conformant with:

RFC 819, RFC 821, RFC 822, RFC 1123


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003