Mail Administration Guide

Appendix B sendmail Options

sendmail Command-Line Arguments

Use command-line arguments on the /usr/lib/sendmail command line. Table B-1 describes these arguments.

Table B-1 sendmail Command-Line Arguments

Argument 

Description 

-Btype

Select the body type (7BIT or 8BITMIME). 

-bx

Set operation mode to x; operation modes are:

 

 

a

Run in ARPANET mode. 

 

 

d

Run as a daemon. 

 

 

i

Initialize the alias database. 

 

 

m

Deliver mail (default). 

 

 

p

Print the mail queue. 

 

 

s

Use SMTP on input side. 

 

 

t

Run in test mode. 

 

 

v

Just verify recipients. 

-Cfile

Use a different configuration file. 

-dlevel

Set debugging level. 

-Fname

Set the full name of this user to name.

-fname

An obsolete form of -r.

-hcnt

Set the "hop count" to cnt. It sets the number of times this message has been processed by sendmail (to the extent that it is supported by the underlying networks). cnt is incremented during processing, and if it reaches the value of configuration option -h, sendmail returns the message with an error.

-Mid

Attempt to deliver the queued with the message-id id.

-n

Do not do aliasing or forwarding. 

-oxvalue

Set configuration option x to the specified value.

-pprotocol

Set the sending protocol; you can enter the protocol field as protocol:host to set both the protocol and the sending host.

-qtime

Try to process the queued mail. If the time is given, sendmail repeatedly runs through the queue at the specified interval to deliver queued mail; otherwise, it runs only once.

-qXstring

Run the queue once, limiting the jobs to those matching Xstring; the letter X can be:

 

 

I

Limit based on queue indentifier (see -M).

 

 

x

Limit based on the recipient (see -R).

 

 

S

Limit based on the sender. 

-Rstring

Attempt to deliver any message with a recipient containing string.

-t

Read the header for To:, Cc:, and Bcc: lines, and send to everyone listed in the header. The Bcc: line is deleted before sending. Any names in the argument vector are deleted from the send list.

-v

Use verbose mode. 

-Xlogfile

Log all traffic in and out of sendmail in the indicated logfile.

"sendmail Configuration Options" describes the options.

You can specify several configuration options as primitive flags. These are the -c, -e, -i, -m, -T, and -v arguments. Also, you can specify the -f configuration option as the -s argument.

sendmail Configuration Options

You can set the options shown in Table B-2 using the -o flag on the command line or the O line in the configuration file.

Table B-2 sendmail Configuration Options

Option 

Description 

-Afile

Use the named file as the alias file instead of /etc/mail/aliases.

If no file is specified, use aliases in the current directory. 

-atime

Wait a set amount of time (in minutes) for an @:@ entry to exist in the alias database before starting. If it does not appear after that time, rebuild the database.

-Bvalue

Blank substitute. Default is the dot (.) character. 

-bn

Disallow empty messages to more than n recipients.

-Cn

Check after n recipients.

-c

If an outgoing mailer is marked as being expensive, do not connect immediately. A queue process must be run to actually send the mail. 

-D

If set, rebuild the alias database if necessary and possible. If this option is not set, sendmail never rebuilds the alias database unless explicitly requested with -bi.

-dx

Deliver in mode x. Legal modes are:

 

i

Deliver interactively (synchronously). 

 

b

Deliver in background (asynchronously). 

 

q

Queue the message (deliver during queue run). 

-Estring

Append error messages with string; if string starts with a slash, it is assumed to be the path name of a file containing a message.

-ex

Dispose of errors, using mode x. The values for x are:

 

p

Print error messages (default). 

 

q

No messages, just give exit status. 

 

m

Mail back errors to sender. 

 

w

Write back errors (mail if user not logged in). 

 

e

Mail back errors and always give zero exit status.

-Fn

The temporary queue file mode, in octal. Values of 644 and 600 are good choices for n.

-f

Save UNIX-style From lines at the front of headers; normally they are assumed to be redundant and discarded.

-gn

Set the default group ID for mailers to run in to n.

-Hfile

Specify the help file for SMTP [Postel 82]. 

-hn

Set maximum hop count to n. 

-I

Insist that the name server be running to resolve host requests. 

-i

Ignore dots in incoming messages. 

-Jpath

Set the path for searching for users .forward files.

-j

Send error messages in MIME format. 

-Ktimeout

Set the maximum amount of time a cached connection will be permitted to be idle.  

-kn

Select the maximum number of open connections that will be cached at a time. The default is 1. 

-Ln

Set the default log level to n. 

-l

If there is an Errors-To: header, send the error messages to the addresses listed there.

-Mxvalue

Set the macro x to value; this is intended only for use from the command line.

-m

Send to the sender also, even if the sender is in an alias expansion. 

-n

Validate the RHS of aliases when rebuilding the aliases database. 

-Ooptions

Set server SMTP options. The options are key=value pairs. The key can be:

 

Addr

Address mask (the default value is INADDR_ANY). 

 

Family

Address family (the default value is INET). 

 

Listen

Size of listen queue (the default value is 10). 

 

Port

Name or number of the listening port (the default value is smtp).

-o

Assume that the headers may be in old format; that is, spaces delimit names. This flag actually turns on an adaptive algorithm: If any recipient name contains a comma, parenthesis, or angle bracket, it is assumed that commas already exist. If this flag is not on, only commas delimit names. Headers are always output with commas between the names. 

-Pname

Send the header from error messages from the MAILER-DAEMON to this name (which is the local postmaster).

-popt,opt

Set privacy options. The value for opt can be:

 

authwarnings

Put X-Authentication-Warning: headers in messages. 

 

goaway

Disallow SMTP status queries. 

 

needexpnhelo

Insist on HELO or EHLO command before EXPN. 

 

needmailhelo

Insist on HELO or EHLO command before MAIL. 

 

needvrfyhelo

Insist on HELO or EHLO command before VRFY. 

 

noexpn

Disallow EXPN. 

 

novrfy

Disallow VRFY. 

 

public

Allow open access. 

 

restrictmailq

Restrict mailq command.

 

restrictqrun

Restrict -q command line flag to root and the owner of the queue. 

-Qdir

Use the named dir as the queue directory.

-qfactor

Use factor as the multipler in the map function to decide when to just queue up jobs rather than run them; defaults to 600000. 

-R

If the mailbox is mounted from a remote server, send any outgoing mail through that server. 

-rtimeouts

Timeout reads after an interval.The timeouts argument is a list of keyword=value pairs.The recognized timeouts, their default and minimum values are:

 

command

Command read [1h, 3m]. 

 

datablock

Data block read [1h, 3m]. 

 

datafinal

Reply to a final "." in data [1h, 10m]. 

 

datainit

Reply to DATA command [5m, 2m]. 

 

helo

Reply to HELO or EHLO commands [5m, none]. 

 

ident

IDENT protocol timeout [30s, none]. 

 

initial

Wait for initial greeting message [5m, 5m]. 

 

mail

Reply to MAIL command [10m, 5m]. 

 

misc

Reply to NOOP or VERB commands [2m, none]. 

 

quit

Reply to QUIT command [2m, none]. 

 

rcpt

Reply to RCPT command [1h, 5m]. 

 

rset

Reply to RSET command [5m, none]. 

-Sfile

Save statistics in the named file.

-s

Always initiate the queue file, even if you are going to try immediate delivery. sendmail always initiates the queue file before returning control to the client under any circumstance.

-Trtime/wtime

Set the queue timeout to rtime. After this interval, messages that have not been successfully sent are returned to the sender. The wtime variable is optional and selects the time after which a warning message is sent.

-ttzinfo

Set the time zone. 

-un

Set the default user ID for mailers to n. Mailers without the -S flag in the mailer definition are run as this user.

-Vfallbackhost

Select fallbackhost to act like a low priority MX on every host.

-v

Run in verbose mode. 

-w

Connect directly to a host as though it has no MX records at all. This option is not recommended. 

-Xn

Set the load average value, so that the sendmail daemon refuses incoming SMTP connections when the system is overloaded to reduce system load. The default is 12; 0 disables this feature.

-xn

Set the load average value so that sendmail simply queues mail (regardless of the -dxoption) to reduce system load. Default is 8; 0 disables this feature.

-Y

Deliver each job that is run from the queue in a separate process.  

-yfactor

The factor is added to the priority for each recipient (thus lowering the priority of the job for messages with many recipients). The default is 30000.

-Zfactor

The factor is added to the priority for each recipient (thus lowering the priority of the job for messages with many recipients). The default is 90000.

-zfactor

The factor is added to the priority every time a job is processed. The default is 1800.

-7

Strip input to 7 bits for compatibility with old systems. 

-|

Consider group writable :include: and .forward files as unsafe, so that entries in these files cannot reference programs or write directly to files.

Mailer Flags

Table B-3 describes the flags that you can set in the mailer description.

Table B-3 sendmail Flags Set in the Mailer Description

Flag 

Description 

-a

Run Extended SMTP protocol. 

-b

Force a blank line at the end of a message. 

-C

Append the @domain clause from the sender to any names in the header that do not have an at sign (@) after being rewritten by rule set 3. This option is not recommended. This flag allows mail with headers with this form:

 

From: user1@local

To: user2, user3@remote

 

to be automatically rewritten as: 

 

From: user1@local

To: user2@local, user3@remote

-c

Do not include comments in addresses. 

-D

Look for a Date: header line.

-E

Escape From lines to be >From (usually specified with -U).

-e

Avoid connecting to this mailer, which is expensive, normally; any necessary connection occurs during a queue run. 

-F

Look for a From: header line.

-f

Look for an -f from flag, but only if this is a network forward operation (that is, the mailer gives an error if the executing user does not have special permissions).

-g

Send error messages from the MAILER-DAEMON instead of using the null return address.

-h

Preserve uppercase in host names for this mailer. 

-I

Select SMTP when contacting another sendmail.

-L

Limit the line lengths as specified in RFC 821. 

-l

Perform final delivery because this mailer is local. 

-M

Look for a Message-Id: header line.

-m

Enable the mailer to send a message to multiple users on the same host in one transaction. When a $u macro occurs in the argv part of the mailer definition, that field is repeated as necessary for all qualifying users. The L= field of the mailer description can be used to limit the total length of the $u expansion.

-n

Do not insert a UNIX-style From line on the front of the message.

-P

Look for a Return-Path: line.

-p

Always add local host name to the MAIL From: line of SMTP, even if there already is one.

-r

Send an -r flag. Performs the same function as -f.

-S

Do not reset the user ID before calling the mailer. This flag would be used in a secure environment where sendmail ran as root. This flag could be used to avoid forged names.

-s

Strip quote characters from the name before calling the mailer. 

-U

Look for UNIX-style From lines with the UUCP-style remote from <host> on the end.

-u

Preserve uppercase in user names for this mailer. 

-X

Use the hidden dot algorithm as specified in RFC 821; basically, any line beginning with a dot will have an extra dot appended (to be stripped at the other end). This flag ensures that lines in the message containing a dot do not terminate the message prematurely. 

-x

Look for a Full-Name: header line.

-7

Strip output to 7 bits.