Reference Tables

This section includes reference tables for sendmail command-line arguments, configuration options, mailer flags, and processing options.

Command-Line Arguments

The following sections describe the arguments for sendmail that you can use on the command line. The arguments are briefly described in Table 15.

Table 15. Command-Line Arguments for sendmail
Argument Description
-bx Set operation mode to x. Operation modes are listed below.
 m Deliver mail (default).
 a Run in Arpanet mode.
 s Speak SMTP on input side.
 d Run as a daemon.
 t Run in test mode.
 v Just verify recipients.
 i Initialize the Aliases database.
 p Print the mail queue.
 z Freeze the configuration file.
-Cfile Use a different configuration file.
-dlevel Set debugging level.
-f name An obsolete form of -r.
-Fname Set the full name of this user to name.
-h cnt Set the hop count to cnt. Show the number of times this message has been processed by sendmail (to the extent that it is supported by the underlying networks). During processing, cnt is incremented; if it reaches the value of configuration option h, sendmail returns the message with an error.
-M msgid Run given message ID from the queue.
-n Do not do aliasing or forwarding.
-oxvalue Set configuration option x to the specified value.
-qtime Try to process the queued-up mail. If you specify time, sendmail repeatedly runs through the queue at the specified interval to deliver queued mail; otherwise, it runs only once.
-r name The sender's name is name. This option is ignored unless the real user is listed as a “trusted user” or if name contains an exclamation point (because of certain restrictions in UUCP).
-R recipient Run messages for given recipient only from the queue.
-t Read the header for To:, CC:, and BCC: lines, and send to everyone listed in those lists. Delete the BCC: line before sending. Delete any names in the argument vector from the send list.

These arguments are described in the next section.

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

Configuration Options

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

Table 16. Configuration Options for sendmail
Option Description
Afile Use the named file as the alias file instead of /etc/mail/aliases. If you specify no file, use aliases in the current directory.
Atime Specify the time to wait for an @:@ entry to exist in the Aliases database before starting up. If the entry does not appear after that time, rebuild the database.
Bvalue Substitute blanks. Default is the dot (.) character.
bn Disallow empty messages to more than 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.
cn Checkpoint after n recipients.
D Rebuild the Aliases database if necessary and possible. If this option is not set, sendmail never rebuilds the Aliases database unless explicitly requested with -bi.
dx Deliver in mode x. Legal modes are shown below.
 i Deliver interactively (synchronously).
 b Deliver in background (asynchronously).
 q Just queue the message (deliver during queue run).
e Mail back errors and give zero exit status always.
ex Dispose of errors using mode x. The values for x are shown below.
 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 is not logged in).
f Save UNIX-style From: lines at the front of headers. Normally, they are assumed redundant and are discarded.
Fn Set the temporary queue file mode in octal. Good choices are 644 (rw-r--r--) and 600 (rw-------).
gn Set to n the default group ID in which mailers are run.
Hfile Specify the help file for SMTP [Postel82].
h n Set maximum hop count to n.
i Ignore dots in incoming messages.
Ln Set the default log level to n.
m Send to me too, even if I am in an alias expansion.
Mxvalue Set the macro x to value. Use this option only from the command line.
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, parentheses, or angle brackets, 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 Set the name of the local postmaster. If defined, error messages from the MAILER-DAEMON send the header to this name.
Qdir Use the directory named in the dir variable as the queue directory.
qlimit Set size limit of messages to be queued under heavy load. Default is 10,000 bytes.
Rserver Remote mode. Deliver through remote SMTP server. Default is location of /var/mail.
rtime Time out reads after time interval.
s Be supersafe when running things; that is, always create the queue file, even if you are going to try immediate delivery. The sendmail program always creates the queue file before returning control to the client under any circumstances.
Sfile Save statistics in the named file.
Ttime Set the queue timeout to time. After this interval, messages that have not been sent successfully are returned to the sender.
un Set the default user ID for mailers to n. Mailers without the S flag in the mailer definition run as this user.
v Run in verbose mode.
Xn Set the load average value so that the sendmail daemon refuses incoming SMTP connections to reduce system load. Default is 0, which disables this feature.
xn Set the load average value so that sendmail simply queues mail (regardless of the dx option) to reduce system load. Default is 0, which disables this feature.
yn Recipient factor. Lower the delivery priority of messages with the specified number of bytes per recipient.
Yname Set NIS map name to be used for aliases. Default is mail.aliases.
Zn Lower the delivery priority of messages with the specified number of bytes per delivery attempts.
zn Lower the delivery priority of messages with the specified number of bytes per class.

Mailer Flags

The flags you can set in the mailer description are described in Table 17.

Table 17. Flags You Can Set in the Mailer Description for sendmail
Flag Description
C If mail is received from a mailer with this flag set, any names in the header that do not have an at sign (@) after being rewritten by ruleset 3 have the @domain clause from the sender tacked on. This flag allows mail with headers of the following form.
From: usera@local
To: userb, userc@remote

to be automatically rewritten as
From: usera@local
To: userb@local, userc@remote

D Set a Date: header line for this mailer.
E Escape From: lines to be >From (usually specified with U).
e Try to avoid connecting normally because this mailer is expensive to connect to; perform any necessary connection during a queue run.
F Set a From: header line for this mailer.
f Set the -f from flag for this mailer, 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.)
h Preserve upper case in host names for this mailer.
L Limit the line lengths as specified in RFC 821.
l Set this mailer as local (that is, final delivery is performed).
M Set a Message-Id: header line for this mailer.
m Send to multiple users on the same host in one transaction for this mailer. 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 Set a Return-Path: line for this mailer.
p Always add local host name to the MAIL From: line of SMTP, even if there already is one.
r Same as f, but send the -r flag.
S Do not reset the user ID before calling the mailer. Use this flag in a secure environment in which sendmail runs as root. This flag can be used to avoid forged names.
s Strip quote characters from the name before calling the mailer.
U Set UNIX-style From: lines with the UUCP-style remote from <host> on the end for this mailer.
u Preserve upper case in user names for this mailer.
X Use the hidden dot algorithm as specified in RFC 821 for this mailer; basically, insert an extra dot at the front of any line beginning with a dot (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 Set a Full-Name: header line for this mailer.

Processing Options

You can set a number of configuration file options from the command line with the -o option. If you want to set these options permanently, include them in your macro configuration file. Options are represented by a single character or by multiple-character names. The syntax for the single-character names sets option x to value.

							Oxvalue
						

Depending on the option, value can be a string, an integer, a boolean (with legal values t, T, f, or F; the default is true), or a time interval.

The multiple-character or long names use the following syntax, which sets the option Longname to argument.

O Longname=argument
						

Long names are beneficial because they are easier to interpret than the single character names.

Not all processing options (see Table 18) have single-character names. In Table 18, the multiple-character name is presented first, followed by the single-character syntax enclosed in parentheses.

Table 18. Processing Options for sendmail
AliasFile (Afile)
 Specify possible alias file(s).
AliasWait (a N)
 Wait up to N minutes for an @:@ entry to exist in the Aliases database before starting up. If it does not appear in N minutes, rebuild the database (if the AutoRebuildAliases option is also set) or issue a warning. Default is 10 minutes.
AllowBogusHELO
 Allow a HELO SMTP command that does not include a host name. By default this option is disabled.
AutoRebuildAliases (D)
 Rebuild the /etc/mail/aliases database if necessary and possible. If this option is not set, sendmail never rebuilds the aliases database unless explicitly requested with -bi or newaliases(1).
 Note that for the database to be rebuilt, root must own and have exclusive write permission to the /etc/mail/aliases* files.
BlankSub (Bc)
 Set the blank substitution character to c. Replace unquoted spaces in addresses with this character. Default is space (that is, no change is made).
CheckAliases (n)
 Validate the RHS of aliases when rebuilding the aliases(4) database.
CheckpointInterval (CN)
 Checkpoint the queue every N addresses sent. If your system crashes during delivery to a large list, this option prevents retransmission to any but the last N recipients. Default is 10.
ClassFactor (zfact)
 Multiply the indicated factor fact by the message class (determined by the Precedence: field in the user header and the P lines in the configuration file) and subtract from the priority. Thus, favor messages with a higher Priority:. Default is 1800.
ColonOkInAddr
 Treat colons as a regular character in addresses. If not set, they are treated as the introducer to the RFC 822 group syntax. This option is on for version 5 and lower configuration files.
ConnectionCacheSize (kN)
 Cache the maximum number of open connections at a time. The default is 1. Delay closing the current connection until either this invocation of sendmail needs to connect to another host or it terminates. Setting this option to 0 default is the old behavior, that is, connections are closed immediately.
ConnectionCacheTimeout (Ktimeout)
 Set the maximum amount of time a cached connection is permitted to idle without activity. If this time is exceeded, immediately close the connection. This value should be small (on the order of 10 minutes). Before sendmail uses a cached connection, it always sends a NOOP (no operation) command to check the connection; if this command fails, sendmail reopens the connection. This behavior keeps your end from failing if the other end times out. This option enables you to be a good network neighbor and avoid using up excessive resources on the other end. The default is 5 minutes.
ConnectionRateThrottle
 Set the maximum number of connections permitted per second. After this time, many connections are accepted, further connections are delayed. If not set or ≤ 0, there is no limit.
DaemonPortOptions (Ooptions)
 Set server SMTP options. The options are key=value pairs. The following keys are known.
 Addr Address mask. Default is INADDR_ANY. The address mask can be a numeric address in dot notation or a network name.
 Family Address family. Default is INET.
 Listen Size of listen queue. Default is 10.
 Port Name/number of listening port. Default is smtp.
 ReceiveSize The size of the TCP/IP receive buffer.
 SendSize The size of the TCP/IP send buffer.
DefaultCharSet
 Set the default character to use when converting unlabeled 8-bit input to MIME.
DefaultUser (ggid) or (uuid)
 Set the default group ID for mailers to run in to gid, or set the default user ID for mailers to uid. Default is 1. The value can also be given as a symbolic group or user name.
DeliveryMode (dx)
 Deliver in mode x. The following modes are legal.
 i Deliver interactively (synchronously).
 b Deliver in background (asynchronously).
 d Deferred mode. Defer database lookups until the actual queue run.
 q Just queue the message (deliver during queue run).
 Default is b if you specify no option, i if you specify it with no argument, that is, Od is equivalent to Odi.
DialDelay If a connection fails, wait the specified number of seconds and try again. 0 means do not retry.
DontBlameSendmail
 Override the file safety checks. This option compromises system security and should not be used. See http://www.sendmail.org/tips/DontBlameSendmail.html for more information.
DontExpandCnames
 Do not expand CNAME records $[... $] in DNS-based lookups.
DontInitGroups
 Never invoke the initgroups(3C) routine. If you set this option, agents that are run on behalf of users have only their primary (/etc/passwd) group permissions.
DontProbeInterfaces
 Do not insert the names and addresses of any local interfaces into the $=w class. If set, you must also include support for these addresses; otherwise, mail to addresses in this list bounces with a configuration error.
DontPruneRoutes (R)
 Do not prune route-addr syntax addresses to the minimum possible.
DoubleBounceAddress
 If an error occurs when an error message is being sent, send that “double bounce” error message to this address.
EightBitMode (8)
 Use 8-bit data handling. This option requires one of the following keys. You can specify the key by using just the first character, but using the full word is better for clarity.
 mimify Do any necessary conversion of 8BITMIME to 7-bit.
 pass Pass unlabeled 8-bit input through as is.
 strict Reject unlabeled 8-bit input.
ErrorHeader (Efile/message)
 Append error messages with the indicated message. If the message begins with a slash, assume it to be the path name of a file containing a message (this is the recommended setting). Otherwise, it is a literal message. The error file might contain the name, e-mail address, or phone number of a local postmaster who could provide assistance to end users. If the option is missing or null or if it names a file that does not exist or is not readable, then print no message.
ErrorMode (ex)
 Dispose of errors by using mode x. You can specify the following values for x.
 e Mail back errors and always return 0 exit status.
 m Mail back errors.
 p Print error messages (default).
 q No messages, just give exit status.
 w Write back errors (mail if user not logged in).
FallbackMXhost (Vfallbackhost)
 Act like a very low priority MX on every host. This option is intended for sites with poor network connectivity.
ForkEachJob (Y)
 Deliver each job that is run from the queue in a separate process. Use this option if you are short of memory because the default tends to consume considerable amounts of memory while the queue is being processed.
ForwardPath (Jpath)
 Set the path for searching for .forward files. The default is $z/.forward. Some sites that use the automounter may prefer to change this path to /var/forward/$u to search a file with the same name as the user in a system directory.
 You can also set it to a sequence of paths separated by colons; sendmail stops at the first file it can successfully and safely open. For example, /var/forward/$u:$z/.forward searches first in /var/forward/username and then in ~username/.forward (but only if the first file does not exist).
HelpFile (Hfile)
 Specify the help file for SMTP.
HoldExpensive (c)
 If an outgoing mailer is marked as being expensive, don't connect immediately.
HostsFile Set the file to use when doing “file” type access of host names.
HostStatusDirectory
 Keep host status on disk between sendmail runs in the named directory tree. If you do not use a full path, then interpret the path relative to the queue directory.
IgnoreDots (i)
 Ignore dots in incoming messages. This option is always disabled (that is, dots are always accepted) when SMTP mail is read.
LogLevel (Ln)
 Set the default log level to n. Default is 9.
MatchGECOS (G)
 Try to match recipient names by using the GECOS field. This option allows mail to be delivered with names defined in the GECOS field in /etc/passwd as well as the login name.
MaxDaemonChildren
 Set the maximum number of children the daemon permits. After this number, reject connections. If not set or ≤0, there is no limit.
MaxHeadersLength
 Limit the length of the sum of all header lines in a message. Default is 32768. Reject incoming messages with headers that exceed this value.
MaxHopCount (hN)
 Set the maximum hop count. Assume that messages have been processed. Default is 25.
MaxMessageSize
 Set the maximum size of messages that are accepted (in bytes).
MaxMimeHeaderLength=M[/N]
 Set the maximum length of certain MIME header field values to M characters. For some of these headers that take parameters, the maximum length of each parameter is set to N if specified. If you do not specify /N, use one half of M. By default, these values are 0, meaning no checks are done.
MaxQueueRunSize
 Limit the maximum size of any given queue run to this number of entries. Stop reading the queue directory after this number of entries is reached; do not use job priority. If not set, there is no limit.
MeToo (M) Send to me too, even if I am in an alias expansion.
MaxRecipientsPerMessage
 Permit no more than the specified number of recipients in an SMTP envelope. Further recipients receive a 452 error code and are deferred until the next delivery attempt.
MinFreeBlocks (bN/M)
 Insist on at least N blocks free on the file system that holds the queue files before accepting e-mail sent through SMTP. If there is insufficient space, sendmail gives a 452 response to the MAIL command. This response invites the sender to try again later. The optional M is a maximum message size advertised in the ESMTP EHLO response. It is currently otherwise unused.
MinQueueAge
 Specify the amount of time a job must sit in the queue between queue runs. This option enables you to set the queue run interval low for better responsiveness without trying all jobs in each run. The default is 0.
MustQuoteChars
 Automatically quote characters in a full name phrase: &,;:()[].
Mxvalue Set the macro x to value. This option is intended for use only from the command line.
NoRecipientAction
 Set action if there are no legal recipient files in the message. The following values are legal.
 add-apparently-to
  Add an Apparently to: header with all the known recipients may expose blind recipients.
 add-bcc Add an empty Bcc: header.
 add-to Add a To: header with all the known recipients may expose blind recipients.
 add-to-undisclosed
  Add a To: undisclosed-recipients: header.
 none Do nothing, leave the message as it is.
OldStyleHeaders (o)
 Assume that the headers may be in old format, that is, spaces delimit names. This option actually turns on an adaptive algorithm: if any recipient address contains a comma, parenthesis, or angle bracket, assume that commas already exist. If this option is not on, only commas delimit names. Headers are always output with commas between the names.
OperatorChars ($o)
 Define the list of characters that can be used to separate the components of an address into tokens.
PostmasterCopy (Ppostmaster)
 Send copies of error messages to the named postmaster. Send only the header of the failed message. Because most errors are user problems, it is probably not a good idea to use this option on large sites. It arguably contains all sorts of privacy violations, but it seems to be popular with certain operating systems vendors.
PrivacyOptions (popt,opt,...)
 Set privacy options. Privacy is really a misnomer; many of these options are simply a way of insisting on stricter adherence to the SMTP protocol.
 The goaway pseudoflag sets all flags except restrictmailq and restrictqrun. If mailq is restricted, only people in the same group as the queue directory can print the queue. If queue runs are restricted, only root and the owner of the queue directory can run the queue. authwarnings adds warnings about various conditions that can indicate attempts to spoof the mail system, such as using a nonstandard queue directory.
 You can specify the following options.
 authwarnings Put X-Authentication-Warning: headers in messages.
 goaway Disallow essentially all 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.
 noetrn Disallow ETRN entirely.
 noexpn Disallow EXPN entirely.
 noreceipts Prevent return receipts.
 novrfy Disallow VRFY entirely.
 public Allow open access.
 restrictmailq Restrict mailq command.
 restrictqrun Restrict -q command-line flag.
QueueDirectory (Qdir)
 Use the named dir as the queue directory.
QueueFactor (qfactor)
 Use factor as the multiplier in the map function to decide when to just queue up jobs instead of run them. This value is divided by the difference between the current load average and the load average limit (xflag) to determine the maximum message priority that is sent. Default is 600000.
QueueLA (xLA)
 When the system load average exceeds LA, just queue messages (that is, do not try to send them). Default is 8.
QueueSortOrder
 Select the queue sort algorithm. The default value is Priority. Other values are Host or Time.
QueueTimeout (Trtime/wtime)
 Set the queue timeout to rtime. After this interval, return to sender all messages that have not been successfully delivered. Default is five days (5d). The optional wtime is the time after which a warning message is sent. If it is missing or 0, then send no warning messages.
RecipientFactor (yfact)
 Add the indicated factor fact to the priority (thus lowering the priority of the job) for each recipient; that is, this value penalizes jobs with large numbers of recipients. Default is 30000.
RefuseLA (XLA)
 When the system load average exceeds LA, refuse incoming SMTP connections. Default is 12.
RemoteMode (>[RemoteMboxHost])
 Enable remote mode by using this host. If you do not specify RemoteMboxHost and if /var/mail is remotely mounted, then enable remote mode by using the remote mount host. If you do not specify RemoteMboxHost and /var/mail is locally mounted, then disable remote mode.
 When remote mode is enabled, all outgoing messages are sent through that server.
ResolverOptions (I)
 Tune DNS lookups.
RetryFactor (Zfact)
 Add the indicated factor fact to the priority every time a job is processed. Thus, each time a job is processed, decrease its priority by the indicated value. In most environments, this value should be positive because hosts that are down are all too often down for a long time. Default is 90000.
RunAsUser Become this user when reading and delivering mail. Intended for use on firewalls where users do not have accounts.
SafeFileEnvironment
 Do a chroot into this directory before writing files.
SaveFromLine (f)
 Save UNIX-style From: lines at the front of headers. Normally, they are assumed redundant and are discarded.
SendMimeErrors (j)
 Send error messages in MIME format (see RFC 1341 and RFC 1344 for details).
ServiceSwitchFile
 Define the path to the service-switch file. Because the service-switch file is defined in the Solaris operating environment, this option is ignored.
SevenBitInput (7)
 Strip input to seven bits for compatibility with old systems. This option should not be needed.
SingleLineFromHeader
 Unwrap From: lines that have embedded newlines onto one line.
SingleThreadDelivery
 If this option and the HostStatusDirectory option are both set, use single-thread deliveries to other hosts.
SmtpGreetingMessage or $e
 Set the initial SMTP greeting message.
StatusFile (Sfile)
 Log statistics in the named file.
SuperSafe (s)
 Be supersafe when running things; that is, always instantiate the queue file, even if you are going to try immediate delivery. sendmail always instantiates the queue file before returning control to the client under any circumstances.
TempFileMode (Fmode)
 Set the file mode for queue files.
Timeout (rtimeouts)
 Time out reads after time interval. The timeouts argument is a list of keyword=value pairs. All but command apply to client SMTP. For backward compatibility, a timeout with no keyword= part sets all of the longer values. The following list contains recognized timeouts, their default values, and their minimum values specified in RFC 1123 section 5.3.2.
 command Command read [1h, 5m].
 connect Initial connect [0, unspecified].
 datablock Data block read [1h, 3m].
 datafinal Reply to final . in data [1h, 10m].
 datainit Reply to DATA command [5m, 2m].
 fileopen File open [60sec, none].
 helo Reply to HELO or EHLO command [5m, none].
 hoststatus Host retry [30m, unspecified].
 iconnect First attempt to connect to a host [0, unspecified].
 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 and VERB commands [2m, none].
 queuereturn Undeliverable message returned [5d].
 queuewarn Deferred warning [4h].
 quit Reply to QUIT command [2m, none].
 rcpt Reply to RCPT command [1h, 5m].
 rset Reply to RSET command [5m, none].
TimeZoneSpec (ttzinfo)
 Set the local time zone to tzinfo, for example, PST8PDT. Actually, if this option is not set, the TZ environment variable is cleared (so the system default is used); if set but null, use the user's TZ variable, and if set and non-null, set the TZ variable to this value.
TryNullMXList (w)
 If you are the “best” (that is, lowest preference) MX for a given host, you should normally detect this situation and treat that condition specially by forwarding the mail to a UUCP feed, treating it as local or whatever is appropriate. However, in some cases (such as Internet firewalls) you may want to try to connect directly to that host as though it had no MX records at all. Setting this option tries a direct connection. The downside is that errors in your configuration are likely to be diagnosed as “host unknown” or “message timed out” instead of something more meaningful. This option is deprecated.
UnixFromLine or $l
 Use the From: line when sending to files or programs.
UnsafeGroupWrites
 Consider group-writable :include: and .forward files unsafe; that is, programs and files cannot be directly referenced from such files.
UseErrorsTo (l)
 If there is an Errors-To: header, send error messages to the addresses listed there. They normally go to the envelope sender. Use of this option violates RFC 1123.
UserDatabaseSpec (U)
 Define the name and location of the file containing User Database information.
Verbose (v) Run in verbose mode. Adjust the HoldExpensive and DeliveryMode options so that all mail is delivered completely in a single job so that you can see the entire delivery process. You should never set the verbose option in the configuration file; it is intended for command-line use only.

You can specify all options on the command line with the -o option, but most relinquish sendmail setuid permissions. The options that do not do this are b,d,e,E,i,L,m,o,p,r,s,v,C, and 7. Also considered “safe” is M (define macro) when you are defining the r or s macros.

If the first character of the user name is a vertical bar, use the rest of the user name as the name of a program to pipe the mail to. You may need to quote the name of the user to keep sendmail from suppressing the blanks between arguments.

If invoked as newaliases, sendmail rebuilds the alias database as long as the /etc/mail/aliases* files are owned by root and root has exclusive write permission. If invoked as mailq, sendmail prints the contents of the mail queue.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.187.116