[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4 Files Reference

sendmail.cf File

Purpose

Contains the configuration information for the sendmail command.

Description

The /etc/sendmail.cf configuration file contains the configuration information for the sendmail command. Information contained in this file includes such items as the host name and domain, and the sendmail rule sets.

The /etc/sendmail.cf file:

If your environment includes only these types of mail delivery, you can use the supplied /etc/sendmail.cf file with few, if any, changes.

Control Lines

The /etc/sendmail.cf file consists of a series of control lines, each of which begins with a single character defining how the rest of the line is used. Lines beginning with a space or a tab are continuation lines. Blank lines and lines beginning with a # (pound sign) are comments. Control lines are used for defining:

Each of these control line types are discussed in detail below.

Rewrite Rules

The sendmail command receives addresses in a number of different formats because different mailers use different formats to deliver mail messages. The sendmail command changes the addresses to the format needed to route the message for the mailer program being used. To perform this translation, the sendmail command uses a set of rewrite rules, or rule sets, that are defined in the /etc/sendmail.cf configuration file. Rewrite rules have the following format:

Snumber
Rbefore          after

where number is a integer greater than or equal to zero indicating which ruleset this is, and before and after are symbolic expressions representing a particular pattern of characters. The line beginning with R means "Rewrite the expression before so that it has the same format as the expression after." Sendmail scans through the set of rewrite rules looking for a match on the left-hand side (LHS) of the rule. When a rule matches, the address is replaced by the right-hand side (RHS) of the rule.

Note: There must be at least one TAB character (ASCII code 0x09) between the before and after sections of the /etc/sendmail.cf file. For this reason, any editor that translates TAB characters into a series of spaces (ASCII code 0x20) may not be used to edit the /etc/sendmail.cf file. For example, the GNU eMacs editor can corrupt the sendmail.cf file, but the vi editor does not.

The /etc/sendmail.cf file installed with the sendmail command contains enough rules to perform the translation for BNU and TCP/IP networks using a domain address structure. You should not have to change these rules unless connecting to a system that uses a different addressing scheme.

Macro expansions of the form $x are performed when the configuration file is read. Expansions of the form $&x are performed at run time, using a somewhat less general algorithm. This form is intended only for referencing internally defined macros such as $h that are changed at runtime.

Left-Hand Side (LHS) of Rewrite Rules

The left-hand side of rewrite rules contains a pattern. Normal words are simply matched directly. Metasyntax is introduced using a dollar sign. The metasymbols are:

$* Match zero or more tokens
$+ Match one or more tokens
$- Match exactly one token
$=x Match any phrase in class x
$~x Match any word not in class x

If any of these match, they are assigned to the symbol $n for replacement on the right-hand side, where n is the index in the LHS. For example, if the LHS:

$-:$+

is applied to the input:

UCBARPA:linda

the rule will match, and the values passed to the RHS will be:

$1  UCBARPA
$2  linda

Right-Hand Side (RHS) of Rewrite Rules

When the left-hand side of a rewrite rule matches, the input is deleted and replaced by the right-hand side. Tokens are copied directly from the RHS unless they begin with a dollar sign. Metasymbols are:

$n Substitute indefinite token n from LHS
$[name$] Canonicalize name
$(map key $@arguments $:default $) Generalized keyed mapping function
$>n "Call" ruleset n
$#mailer Resolve to mailer
$@host Specify host
$:user Specify user

The $n syntax substitutes the corresponding value from a $+, $-, $*, $=, or $~ match on the LHS. It may be used anywhere.

A host name enclosed between $[ and $] is looked up in the host database(s) and replaced by the canonical name. For example, $[merlin]" might become "merlin.magician" and "$[[128.32.130.2]$]" would become "king.arthur."

The $( ... $) syntax is a more general form of lookup; it uses a named map instead of an implicit map. If no lookup is found, the indicated default is inserted; if no default is specified and no lookup matches, the value is left unchanged. The arguments are passed to the map for possible use.

The $>n syntax causes the remainder of the line to be substituted as usual and then passed as the argument to ruleset n. The final value of ruleset n then becomes the substitution for this rule. The $> syntax can only be used at the beginning of the right hand side; it can be only be preceded by $@ or $:.

The $# syntax should only be used in ruleset zero or a subroutine of ruleset zero. It causes evaluation of the ruleset to terminate immediately, and signals to sendmail that the address has completely resolved. The complete syntax is:

$#mailer $@host $:user

This specifies the {mailer, host, user} 3-tuple necessary to direct the mailer. If the mailer is local, the host part may be omitted. The mailer must be a single word, but the host and user may be multi-part. If the mailer is the builtin IPC mailer, the host may be a colon-separated list of hosts that are searched in order for the first working address, exactly like MX (machine exchange) records. The user is later rewritten by the mailer-specific envelope rewrite set and assigned to the $u macro. As a special case, if the value to $# is "local" and the first character of the $: value is "@", the "@" is stripped off, and a flag is set in the address descriptor that causes sendmail to not do ruleset 5 processing.

Normally, a rule that matches is retried, that is, the rule loops until it fails. An RHS may also be preceded by a $@ or a $: to change this behavior. A $@ prefix causes the ruleset to return with the remainder of the RHS as the value. A $: prefix causes the rule to terminate immediately, but the ruleset to continue; this can be used to avoid continued application of a rule. The prefix is stripped before continuing.

The $@ and $: prefixes may precede a $> spec. For example:

R$+  $: $>7 $1

matches anything, passes that to ruleset seven, and continues; the $: is necessary to avoid an infinite loop.

Substitution occurs in the order described; that is, parameters from the LHS are substituted, hostnames are canonicalized, "subroutines" are called, and finally $#, $@, and $: are processed.

Semantics of Rewrite Rule Sets

There are five rewrite sets that have specific semantics.

Ruleset three should turn the address into "canonical form." This form should have the basic syntax:

local-part@host-domain-spec

Ruleset three is applied by sendmail before doing anything with any address.

If no "@" sign is specified, then the host-domain-spec may be appended (box "D" in "Rewrite Set Semantics") from the sender address (if the C flag is set in the mailer definition corresponding to the sending mailer).

Ruleset zero is applied after ruleset three to addresses that are going to actually specify recipients. It must resolve to a {mailer, host, user} triple. The mailer must be defined in the mailer definitions from the configuration file. The host is defined into the $h macro for use in the argv expansion of the specified mailer.

IPC Mailers

Some special processing occurs if the ruleset zero resolves to an IPC mailer (that is, a mailer that has "[IPC]" listed as the Path in the M configuration line. The host name passed after "$@" has MX expansion performed; this looks the name up in DNS to find alternate delivery sites.

The host name can also be provided as a dotted quad in square brackets; for example:

[128.32.149.78]

This causes direct conversion of the numeric value to a TCP/IP host address.

The host name passed in after the "$@" may also be a colon-separated list of hosts. Each is separately MX expanded and the results are concatenated to make (essentially) one long MX list. The intent here is to create "fake" MX records that are not published in DNS for private internal networks.

As a final special case, the host name can be passed in as a text string in square brackets:

[any.internet.addr]

This form avoids the MX mapping if the F=0 flag is set for the selected delivery agent.

Note: This is intended only for situations where you have a network firewall (a system or machine that controls the access between outside networks and private networks) or other host that will do special processing for all your mail, so that your MX record points to a gateway machine. This machine could then do direct delivery to machines within your local domain. Use of this feature directly violates RFC 1123 section 5.3.5: it should not be used lightly.

Macros in the sendmail.cf File

Macros in the /etc/sendmail.cf file are interpreted by the sendmail command. A macro is a symbol that represents a value or string. A macro is defined by a D command in the /etc/sendmail.cf file.

D -- Define Macro

Macros are named with a single character or with a word in {braces}. Single-character names may be selected from the entire ASCII set, but user-defined macros should be selected from the set of uppercase letters only. Lowercase letters and special symbols are used internally. Long names beginning with a lowercase letter or a punctuation character are reserved for use by sendmail, so user-defined long macro names should begin with an uppercase letter.

The syntax for macro definitions is:

Dxval

where x is the name of the macro (which may be a single character or a word in braces) and val is the value it should have. There should be no spaces given that do not actually belong in the macro value.

Macros are interpolated using the construct $x, where x is the name of the macro to be interpolated.This interpolation is done when the configuration file is read, except in M lines. The special construct $&x can be used in R lines to get deferred interpolation.

Conditionals can be specified using the syntax:

$?x text1 $| text2 $.

This interpolates text1 if the macro $x is set, and text2 otherwise. The "else" ($|) clause may be omitted.

Lowercase macro names are reserved to have special semantics, used to pass information in or out of sendmail, and special characters are reserved to provide conditionals, and so on. Uppercase names (that is, $A through $Z) are specifically reserved for configuration file authors.

The following macros are defined and/or used internally by sendmail for interpolation into argv's for mailers or for other contexts. The ones marked - are information passed into sendmail, the ones marked = are information passed both in and out of sendmail, and the unmarked macros are passed out of sendmail but are not otherwise used internally. AIX Version 4.2 specifically defines the following macros:

$_ RFC1413-validation & IP source route (V8.1 and above).
$a The origin date in RFC822 format.
$b The current date in RFC822 format.
$(bodytype) The ESMTP BODY parameter.
$B The BITMAP relay.
$c The hop count.
$(client_addr) The connecting host's IP address.
$(client_name) The connecting host's canonical name.
$C The hostname of the DECnet relay (m4 technique).
$d The current date in UNIX (ctime)(3) format.
$e SMTP greeting message (V8.8 and earlier).
$(envid) The original DSN envelope ID (V8.8 and above).
$E X400 relay (unused) (m4 technique).
$f The sender's address.
$F FAX relay (m4 technique).
$g The sender's address relative to the recipient.
$h Host part of the recipient address.
$H The mail hub (m4 technique).
$i The queue identifier.
$j= The official canonical name.
$k The UUCP node name (V8.1 and above).
$l Unix From format (V8.6 and earlier).
$L Local user relay (m4 technique).
$m The DNS domain name (V8.1 and above).
$M Who we are masquerading as (m4 technique).
$n The error messages sender.
$o Token separation characters (V8.6 and earlier).
$opMode The startup operating mode (V8.7 and above).
$p The sendmail process id.
$q- Default form of the sender address (V8.6 and earlier).
$r The protocol used.
$R The relay for unqualified names (m4 technique).
$s The sender's host name.
$S The Smart host (m4 technique).
$t Current time in seconds.
$u The recipient's username.
$U The UUCP name to override $k.
$v The sendmail program's version.
$V The UUCP relay (for class $=V) (m4 technique).
$w The short name of this host.
$W The UUCP relay (for class $=W) (m4 technique).
$x The full name of the sender.
$X The UUCP relay (for class $=X) (m4 technique).
$y The home directory of the recipient.
$z The name of the controlling TTY.
$Y The UUCP relay for unclassified hosts.
$z The recipient's home directory.
$Z The version of this m4 configuration (m4 technique).

There are three types of dates that can be used. The $a and $b macros are in RFC 822 format; $a is the time as extracted from the "Date:" line of the message (if there was one), and $b is the current date and time (used for postmarks). If no "Date:" line is found in the incoming message, $a is set to the current time also. The $d macro is equivalent to the $b macro in UNIX (ctime) format. The $t macro is the current time in seconds.

The macros $w, $j, and $m are set to the identity of this host. Sendmail tries to find the fully qualified name of the host if at all possible; it does this by calling gethostname(2) to get the current hostname and then passing that to gethostbyname(3) which is supposed to return the canonical version of that host name. Assuming this is successful, $j is set to the fully qualified name, and $m is set to the domain part of the name (everything after the first dot). The $w macro is set to the first word (everything before the first dot) if you have a level 5 or higher configuration file; otherwise, it is set to the same value as $j. If the canonification is not successful, it is imperative that the config file set $j to the fully qualified domain name.

The $f macro is the id of the sender as originally determined; when mailing to a specific host, the $g macro is set to the address of the sender relative to the recipient. For example, if a user sends to king@castle.com from the machine vangogh.painter.com, the $f macro will be vincent and the $g macro will be vincent@vangogh.painter.com.

The $x macro is set to the full name of the sender. This can be determined in several ways. It can be passed as flag to sendmail. It can be defined in the NAME environment variable. The third choice is the value of the "Full-Name:" line in the header if it exists, and the fourth choice is the comment field of a "From:" line. If all of these fail, and if the message is being originated locally, the full name is looked up in the /etc/passwd file.

When sending, the $h, $u, and $z macros get set to the host, user, and home directory (if local) of the recipient. The first two are set from the $@ and $: part of the rewrite rules, respectively.

The $p and $t macros are used to create unique strings (for example, for the "Message-Id:" field). The $i macro is set to the queue id on this host; if put into the timestamp line, it can be useful for tracking messages. The $v macro is set to be the version number of sendmail; this is normally put in timestamps and has been proven useful for debugging.

The $c field is set to the "hop count," that is, the number of times this message has been processed. This can be determined by the -h flag on the command line or by counting the timestamps in the message.

The $r and $s fields are set to the protocol used to communicate with sendmail and the sending hostname.They can be set together using the -p command line flag or separately using the -M or -oM flags.

The $_ is set to a validated sender host name. If the sender is running an RFC 1413 compliant IDENT server and the receiver has the IDENT protocol turned on, it will include the user name on that host.

Changing the Domain Name Macro

Note: This function is available in AIX Version 3.2.5 and AIX Version 4.1 only.

The domain name macro, DD, specifies the full domain name of your local group of hosts. The format of the domain name macro is DD followed by, at most, four period-separated names, for example:

DDname1.name2.name3.name4

This macro can be set automatically through the hostname command. The sendmail command reads what has been set with the hostname command and uses it to initialize the host and domain macros and classes. The configuration file macros only need to be changed if you want the sendmail host and domain names to be different from those set by the hostname command.

To change the domain name macro:

  1. Enter the command:
    vi /etc/sendmail.cf
  2. Find the line beginning with DD.

  3. Replace what follows DD with your domain name. For example, if your domain name is newyork.abc.com, enter:
    DDnewyork.abc.com
  4. Save the file and exit the editor.

Changing the Host Name Macro

The host name macro, Dw, specifies the name of your host system used in the return address of all messages you generate. The format of the host name macro is Dw followed by the hostname of this machine, for example:

Dwhostname

By default, the sendmail command reads what has been set with the hostname command and uses it to initialize the host and domain name macros and classes. Change the configuration file macros only if you want the sendmail command host and domain names to be different from those set by the hostname command.

To change the host name macro:

  1. Enter the command:
    vi /etc/sendmail.cf
  2. Find the line beginning with Dw.

  3. Replace what follows Dw with your hostname. For example, if your hostname is brown, enter:
    Dwbrown
  4. Save the file and exit the editor.
    Note: If the Dw macro is defined, you must also define the CW (hostname) class.

Configuration File Revision-Level Macro (DZNumber)

The revision-level Z macro tracks changes you make to the /etc/sendmail.cf file. When you make a change to the /etc/sendmail.cf file, change the value of this macro to show your new version level. You can use any format you wish for the number. For example, if you want the revision-level to be 3.1, make the following entry in the /etc/sendmail.cf file:

DZ3.1

or, use a text string for this macro:

DZthree_one

Recommended Customizations of the sendmail.cf File

The following is a list of the control lines you may want to configure:

Note: These control lines are available for customization in AIX Version 3.2.5 and AIX Version 4.1 only.

Modifying the sendmail.cf File

Before you modify the /etc/sendmail.cf file, make a backup copy. Do this by executing the following command:

cp /etc/sendmail.cf /etc/sendmail.cf.working

If the changes you make cause the mail system not to work properly, you can return to using a copy of the /etc/sendmail.cf file that you know works.

You can modify the /etc/sendmail.cf file by using your favorite text editor. However, some editors store tabs as the number of spaces they represent, not the tab character itself. This can cause unexpected results if the tab character is defined as the field-separator character in rule sets. Use the vi editor to avoid this problem, or change the field-separator character with the J option. (For ease of reference, this discussion assumes you use the vi editor to modify the /etc/sendmail.cf file.)

After changing any information in the /etc/sendmail.cf file, you must compile the file into a database format that the sendmail command can read. See the next section, "Compiling the sendmail.cf File."

Compiling the sendmail.cf File

Note: This function is available in AIX Version 3.2.5 and AIX Version 4.1 only.

To compile the /etc/sendmail.cf file into a database format that the sendmail command can read, enter the command:

/usr/sbin/sendmail -bz

This creates the file /etc/sendmail.cfDB. The /etc/sendmail.cfDB file contains the database version of the configuration information. If you want the changes to take effect immediately, make the sendmail daemon reread the configuration information.

Making the sendmail Daemon Reread the Configuration Information

After you have made changes to the sendmail.cf file, instruct the daemon to reread the file. If you started the sendmail command using the startsrc command, enter the command:

refresh -s sendmail

Or, if you started the sendmail daemon using the /usr/sbin/sendmail command, enter the command:

kill -1 `cat /etc/sendmail.pid`

Both of these commands cause the daemon to reread the /etc/sendmail.cf file, the /etc/aliases file, and the /etc/sendmail.nl file.

Alias Database

The alias database exists in two forms. One is a text form, maintained in the file /etc/aliases. The aliases are of the form:

name: name1, name2, ...

Only local names may be aliased. For example:

linda@cloud.ai.acme.org: linda@CS.

will not have the desired effect. Aliases may be continued by starting any continuation lines with a space or a tab. Blank lines and lines beginning with a pound sign (#) are comments.

The second form is processed by the ndbm or db library. This is the form that sendmail actually uses to resolve aliases. This technique is used to improve performance. This form is in the files:

/etc/aliases.dir and /etc/aliases.pag For AIX Version 4.2 or later.
/etc/aliasesDB/DB.dir and /etc/aliasesDB/DB.pag For AIX Version 3.2.5 and AIX Version 4.1. only.

Beginning with AIX Version 4.2, the control of search order is actually set by the service switch. The entry

OAswitch:aliases

is always added as the first alias entry. Also, the first alias file name without a class (for example, without "nis:" on the front) will be used as the name of the file for a "files" entry in the aliases switch. For example, if the configuration file contains:

OA/etc/aliases

and the service switch contains:

aliases nis files

aliases will first be searched in the NIS database, then in /etc/aliases.

Rebuilding the Alias Database

The DB or DBM version of the database may be rebuilt explicitly by executing the command:

newaliases

This is equivalent to giving sendmail the -bi flag:

/usr/sbin/sendmail -bi

If the RebuildAliases (old D) option is specified in the configuration, sendmail will rebuild the alias database automatically if possible when it is out of date. Auto-rebuild can be dangerous on heavily loaded machines with large alias files. If it might take more than the rebuild timeout (option AliasWait, old a, which is normally five minutes) to rebuild the database, there is a chance that several processes will start the rebuild process simultaneously.

If you have multiple aliases databases specified, the -bi flag rebuilds all the database types. II understands, for example, it can rebuild NDBM databases, but not NIS databases.

Potential Problems with the Alias Database

There are a number of problems that can occur with the alias database. They all result from a sendmail process accessing the DBM version while it is only partially built. This can happen under two circumstances: One process accesses the database while another process is rebuilding it, or the process rebuilding the database dies (due to being killed or a system crash) before completing the rebuild.

Sendmail has three techniques to try to relieve these problems. First, it ignores interrupts while rebuilding the database; this avoids the problem of someone aborting the process leaving a partially rebuilt database. Second, it locks the database source file during the rebuild, but that may not work over NFS or if the file is unwritable. Third, at the end of the rebuild, it adds an alias of the form:

@: @

(which is not normally legal). Before sendmail will access the database, it checks to ensure that this entry exists.

List Owners

If an error occurs on sending to a certain address, for example,"x", sendmail will look for an alias of the form "owner-x" to receive the errors. This is typically useful for a mailing list where the submitter of the list has no control over the maintenance of the list itself. In this case, the list maintainer would be the owner of the list. For example:

unix-wizards: linda@paintbox, wnj@monet, nosuchuser,
  sam@matisse
owner-unix-wizards: unix-wizards-request
unix-wizards-request: linda@paintbox

would cause linda@paintbox to get the error that will occur when someone sends to unix-wizards due to the inclusion of nosuchuser on the list.

List owners also cause the envelope sender address to be modified. The contents of the owner alias are used if they point to a single user. Otherwise, the name of the alias itself is used. For this reason, and to conform to Internet conventions, the "owner-" address normally points at the "-request" address; this causes messages to go out with the typical Internet convention of using "list-request" as the return address.

Per-User Forwarding (.forward Files)

As an alternative to the alias database, users may put a file with the name ".forward" in their home directory. If this file exists, sendmail redirects mail for that user to the list of addresses listed in the .forward file. For example, if the home directory for user "kenly" has a .forward file with contents:

kenly@ernie
joel@renoir

then any mail arriving for "kenly" will be redirected to the specified accounts.

Actually, the configuration file defines a sequence of filenames to check. By default, this is the user's .forward file, but can be defined to be more general using the J option. If you change this, you will have to inform your user base of the change.

IDENT Protocol Support

Beginning with AIX Version 4.2, UCB sendmail 8.7 supports the IDENT protocol as defined in RFC 1413. Although this enhances identification of the author of an e-mail message by doing a ``callback'' to the originating system to include the owner of a particular TCP connection in the audit trail, it is in no sense perfect; a determined forger can easily violate the security of the IDENT protocol.

Note: The AIX operating system does not support the IDENT protocol. The IDENT timeout is set to zero (0) in the /etc/sendmail.cf file to disable IDENT. Modify your sendmail.cf file and set IDENT timeout if you wish to enable IDENT.

The following description is excerpted from RFC 1413:

6. Security Considerations

The information returned by this protocol is at most as trustworthy as the host providing it OR the organization operating the host. For example, a PC in an open lab has few if any controls on it to prevent a user from having this protocol return any identifier the user wants. Likewise, if the host has been compromised the information returned may be completely erroneous and misleading.

The Identification Protocol is not intended as an authorization or access control protocol. At best, it provides some additional auditing information with respect to TCP connections. At worst, it can provide misleading, incorrect, or maliciously incorrect information.

The use of the information returned by this protocol for other than auditing is strongly discouraged. Specifically, using Identification Protocol information to make access control decisions, either as the primary method (that is, no other checks) or as an adjunct to other methods may result in a weakening of normal host security.

An Identification server may reveal information about users, entities, objects or processes which might normally be considered private. An Identification server provides service which is a rough analog of the CallerID services provided by some phone companies and many of the same privacy considerations and arguments that apply to the CallerID service apply to Identification. If you wouldn't run a "finger" server due to privacy considerations you may not want to run this protocol.

Tuning

Beginning with AIX Version 4.2, there are a number of configuration parameters you may want to change, depending on the requirements of your site. Most of these are set using an option in sendmail.cf. For example,the line "O Time-out.queuereturn=5d" sets option "Timeout.queuereturn" to the value "5d" (five days).

Most of these options have appropriate defaults for most sites. However, sites having very high mail loads may find they need to tune them as appropriate for their mail load. In particular, sites experiencing a large number of small messages, many of which are delivered to many recipients, may find that they need to adjust the parameters dealing with queue priorities.

All versions of sendmail prior to version 8.7 had single-character option names. As of version 8.7, options have long (multi-character) names. Although old short names are still accepted, most new options do not have short equivalents.

This section only describes the options you are most likely to want to tweak; read <<add pointer to section 5 here>> for more details.

Timeouts

All time intervals are set using a scaled syntax. For example, "10m" represents ten minutes, whereas "2h30m" represents two and a half hours. The full set of scales is:

s seconds
m minutes
h hours
d days
w weeks

Read Timeouts

Beginning with AIX Version 4.2, timeouts all have option names "Time-out.suboption". The recognized suboptions, their default values, and the minimum values allowed by RFC 1123 section 5.3.2 are :

connect The time to wait for an SMTP connection to open (the connect(2) system call) [0, unspecified]. If zero, uses the kernel default. In no case can this option extend the timeout longer than the kernel provides, but it can shorten it. This is to get around kernels that provide an extremely long connection timeout (90 minutes in one case).
initial The wait for the initial 220 greeting message [5m, 5m].
helo The wait for a reply from a HELO or EHLO command [5m, unspecified]. This may require a host name lookup, so five minutes is probably a reasonable minimum.
mail The wait for a reply from a MAIL command [10m, 5m].
rcpt The wait for a reply from a RCPT command [1h, 5m]. This should be long because it could be pointing at a list that takes a long time to expand (see below).
datainit The wait for a reply from a DATA command [5m, 2m].
datablock The wait for reading a data block (that is, the body of the message). [1h, 3m]. This should be long because it also applies to programs piping input to sendmail which have no guarantee of promptness.
datafinal The wait for a reply from the dot terminating a message. [1h,10m]. If this is shorter than the time actually needed for the receiver to deliver the message, duplicates will be generated. This is discussed in RFC1047.
rset The wait for a reply from a RSET command [5m, unspecified].
quit The wait for a reply from a QUIT command [2m, unspecified].
misc The wait for a reply from miscellaneous (but short) commands such as NOOP (no-operation) and VERB (go into verbose mode). [2m, unspecified].
command In server SMTP, the time to wait for another command. [1h, 5m].
ident The timeout waiting for a reply to an IDENT query [30s11, unspecified].

For compatibility with old configuration files, if no suboption is specified, all the timeouts marked with - are set to the indicated value.

Timeout Options (for AIX Version 3.2.5 and AIX Version 4.1 Only)

The sendmail command process can produce many types of timeouts. The time values for the different timeouts can be changed in the /etc/sendmail.cf file. You can set the timeout options for:

For No Data Received The sendmail command times-out if it receives no data for a certain time, when reading standard input or from a remote SMTP protocol. The default configuration file sets this value to 5 minutes. If you need to change the time-out value, change the r option in the configuration file:

OrTimeValue

TimeValue is the length of time the sendmail command waits before timing out.

When a Message Cannot be Sent After a message has been in the queue for a period of time, the sendmail command notifies the sender that the message could not be sent. The default time out is 3 days. To set this time out with the T option in the /etc/sendmail.cf configuration file, enter:

OTTimeValue

TimeValue is the length of time the sendmail command leaves a message in the queue before sending it back.

Message Timeouts

After sitting in the queue for a few days, a message will time out. This is to ensure that at least the sender is aware of the inability to send a message. The timeout is typically set to five days. It is sometimes considered convenient to also send a warning message if the message is in the queue longer than a few hours (assuming you normally have good connectivity; if your messages normally took several hours to send, you would not want to do this because it would not be an unusual event). These timeouts are set using the Timeout.queuereturn and Timeout.queuewarn options in the configuration file (previously both were set using the T option).

Since these options are global, and since you cannot know how long another host outside your domain will be down, a five-day timeout is recommended. This allows a recipient to fix the problem even if it occurs at the beginning of a long weekend. RFC 1123 section 5.3.1.1 says that this parameter should be``at least 4-5 days''.

The Timeout.queuewarn value can be piggybacked on the T option by indicating a time after which a warning message should be sent; the two timeouts are separated by a slash. For example, the line:

OT5d/4h

causes e-mail to fail after five days, but a warning message will be sent after four hours. This should be large enough that the message will have been tried several times.

Queue interval

The argument to the -q flag specifies how often a subdaemon will run the queue. This is typically set to between fifteen minutes and one hour. RFC 1123, section 5.3.1.1 recommends this be at least 30 minutes.

Forking During Queue Runs

By setting the ForkEachJob (Y) option, sendmail will fork before each individual message while running the queue. This will prevent sendmail from consuming large amounts of memory, so it may be useful in memory-poor environments. However, if the ForkEachJob option is not set, sendmail will keep track of hosts that are down during a queue run, which can improve performance dramatically.

If the ForkEachJob option is set, sendmail cannot use connection caching.

Queue Priorities

Every message is assigned a priority when it is first instantiated, consisting of the message size (in bytes) offset by the message class (which is determined from the Precedence: header) times the "work class factor"and the number of recipients times the "work recipient factor." The priority is used to order the queue. Higher numbers for the priority mean that the message will be processed later when running the queue.

The message size is included so that large messages are penalized relative to small messages. The message class allows users to send "high priority" messages by including a "Precedence:" field in their message; the value of this field is looked up in the P lines of the configuration file. Since the number of recipients affects the amount of load a message presents to the system, this is also included into the priority.

The recipient and class factors can be set in the configuration file using the RecipientFactor (y) and ClassFactor (z) options respectively. They default to 30000 (for the recipient factor) and 1800 (for the class factor). The initial priority is:

pri = msgsize - (class times bold ClassFactor) + (nrcpt times bold 
RecipientFactor)

(Remember that higher values for this parameter actually mean that the job will be treated with lower priority.)

The priority of a job can also be adjusted each time it is processed (that is, each time an attempt is made to deliver it) using the "work time factor," set by the RetryFactor(Z) option. This is added to the priority, so it normally decreases the precedence of the job, on the grounds that jobs that have failed many times will tend to fail again in the future. The RetryFactor option defaults to 90000.

Load Limiting

Sendmail can be asked to queue (but not deliver) mail if the system load average gets too high using the QueueLA (x) option. When the load average exceeds the value of the QueueLA option, the delivery mode is set to q (queue only) if the QueueFactor (q) option divided by the difference in the current load average and the QueueLA option plus one exceeds the priority of the message; that is, the message is queued if:

pri > { bold QueueFactor } over { LA - { bold QueueLA } + 1 }

The QueueFactor option defaults to 600000, so each point of load average is worth 600000 priority points (as described above).

For drastic cases, the RefuseLA (X) option defines a load average at which sendmail will refuse to accept network connections. Locally generated mail (including incoming UUCP mail) is still accepted.

Delivery Mode

There are a number of delivery modes that sendmail can operate in, set by the DeliveryMode (d) configuration option. These modes specify how quickly mail will be delivered. Legal modes are:

i Deliver interactively (synchronously)
b Deliver in background (asynchronously)
q Queue only (do not deliver)
d Defer delivery attempts (do not deliver). The d mode is available beginning with AIX Version 4.2.

There are tradeoffs. Mode i gives the sender the quickest feedback, but may slow down some mailers and is hardly ever necessary. Mode b delivers promptly, but can cause large numbers of processes if you have a mailer that takes a long time to deliver a message. Mode q minimizes the load on your machine, but means that delivery may be delayed for up to the queue interval. Mode d is identical to mode q except that it also prevents all the early map lookups from working; it is intended for "dial on demand'' sites where DNS lookups might be very expensive. Some simple error messages (for example, host unknown during the SMTP protocol) will be delayed using this mode. Mode b is the default.

If you run in mode q (queue only), d (defer), or b (deliver in background), sendmail will not expand aliases and follow .forward files upon initial receipt of the mail. This speeds up the response to RCPT commands. Mode i cannot be used by the SMTP server.

Log Level

The level of logging can be set for sendmail. The default using a standard configuration table is level 9. The levels for AIX Version 4.2 (or later) are as follows:

0 No logging.
1 Serious system failures and potential security problems.
2 Lost communications (network problems) and protocol failures.
3 Other serious failures.
4 Minor failures.
5 Message collection statistics.
6 Creation of error messages, VRFY and EXPN commands.
7 Delivery failures (host or user unknown, etc.).
8 Successful deliveries and alias database rebuilds.
9 Messages being deferred (due to a host being down, etc.).
10 Database expansion (alias, forward,and userdb lookups).
20 Logs attempts to run locked queue files. These are not errors, but can be useful to note if your queue appears to be clogged.
30 Lost locks (only if using lockf instead of flock).

The following log levels apply to AIX Version 3.2.5 and AIX Version 4.1 only:

0 Logs major activities only (building a configuration file or creating an alias database).
1 Logs major problems only.
2 Logs message collections and unsuccessful deliveries.
3 Logs successful deliveries.
4 Logs deferred messages (for example, due to a host being down).
5 Logs messages that are placed in the queue (normal event).
6 Logs unusual but nonharmful incidents (for example, trying to process a locked file).
9 Logs the internal queue ID to external message ID mappings. This can be useful for tracing a message as it travels between several hosts. (This is the default.)
12 Logs several messages useful when debugging.
22 Logs verbose information regarding the queue and other activities.

Additionally, values above 64 are reserved for extremely verbose debugging output.

File Modes

The modes used for files depend on what functionality you want and the level of security you require.

The database that sendmail actually uses is represented by the following two files:

/etc/aliases.dir and /etc/aliases.pag For AIX Version 4.2 or later.
/etc/aliasesDB/DB.dir and /etc/aliasesDB/DB.pag For AIX Version 3.2.5 and AIX Version 4.1. only.

The mode on these files should match the mode of /etc/aliases. If aliases is writable and the files for AIX Version 4.2 (or later) are not, users will be unable to reflect their desired changes through to the actual database. However, if aliases is read-only and the AIX Version 4.2 (or later) DBM files are writable, a slightly sophisticated user can arrange to steal mail anyway.

If your AIX Version 4.2 (or later) DBM files are not writable,or you do not have auto-rebuild enabled (with the AutoRebuildAliases option), then you must be careful to reconstruct the alias database each time you change the text version:

newaliases

If this step is ignored or forgotten, any intended changes will be lost.

Connection Caching

Beginning with AIX Version 4.2, when processing the queue, sendmail will try to keep the last few open connections open to avoid startup and shutdown costs. This only applies to IPC connections.

When trying to open a connection, the cache is first searched. If an open connection is found, it is probed to see if it is still active by sending a NOOP command. It is not an error if this fails; instead, the connection is closed and reopened.

Two parameters control the connection cache. The ConnectionCacheSize (k) option defines the number of simultaneous open connections that will be permitted. If it is set to zero, connections will be closed as quickly as possible. The default is one. This should be set as appropriate for your system size; it will limit the amount of system resources that sendmail will use during queue runs. Never set this higher than 4.

The ConnectionCacheTimeout (K) option specifies the maximum time that any cached connection will be permitted to idle. When the idle time exceeds this value, the connection is closed. This number should be small (under ten minutes) to prevent you from grabbing too many resources from other hosts. The default is five minutes.

Name Server Access

If you want machine exchange (MX) support, you must be using Domain Name Services (DNS).

The ResolverOptions(I) option allows you to tweak name server options. The command line takes a series of flags as documented inresolver(3) (with the leading "RES_" deleted). Each can be preceded by an optional `+' or `-'. For example, the line:

O ResolverOptions=+AAONLY -DNSRCH

turns on the AAONLY (Accept Authoritative Answers only) and turns off the DNSRCH (search the domain path) options. Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE flags on and all others off. You can also include "HasWildcardMX" to specify that there is a wildcard MX record matching your domain; this turns off MX matching when canonifying names, which can lead to inappropriate canonifications.

Moving the Per-User Forward Files

Note: This function is available beginning in AIX Version 4.2 only.

Some sites mount each user's home directory from a local disk on their workstation, so that local access is fast. However, the result is that .forward file lookups are slow. In some cases, mail can even be delivered on machines inappropriately because of a file server being down. The performance can be especially bad if you run the automounter.

The ForwardPath (J) option allows you to set a path of forward files. For example, the config file line:

O ForwardPath=/var/forward/$u:$z/.forward.$w

would first look for a file with the same name as the user's login in /var/forward. If that is not found (or is inaccessible), the file ".forward.machinename" in the user's home directory is searched.

If you create a directory such as /var/forward, it should be mode 1777 (that is, the sticky bit should be set). Users should create the files mode 644.

Free Space

Note: This function is available beginning in AIX Version 4.2 only.

On systems that have one of the system calls in the statfs(2) family (including statvfs and ustat), you can specify a minimum number of free blocks on the queue filesystem using the MinFreeBlocks (b) option. If there are fewer than the indicated number of blocks free on the filesystem on which the queue is mounted, the SMTP server will reject mail with the 452 error code. This invites the SMTP client to try again later.

Attention: Be careful not to set this option too high; it can cause rejection of e-mail when that mail would be processed without difficulty.

Maximum Message Size

Note: This function is available beginning in AIX Version 4.2 only.

To avoid overflowing your system with a large message, the MaxMessageSize option can set an absolute limit on the size of any one message. This will be advertised in the ESMTP dialogue and checked during message collection.

Privacy Flags

Note: This function is available beginning in AIX Version 4.2 only.

The PrivacyOptions (p) option allows you to set certain "privacy" flags. Actually, many of them don't give you any extra privacy, rather just insisting that client SMTP servers use the HELO command before using certain commands or adding extra headers to indicate possible security violations.

The option takes a series of flag names; the final privacy is the inclusive or of those flags. For example:

O PrivacyOptions=needmailhelo, noexpn

insists that the HELO or EHLO command be used before a MAIL command is accepted and disables the EXPN command.

The flags are detailed in RFC 1123 S 5.1.6.

Send to Me Too

Normally, sendmail deletes the (envelope) sender from any list expansions. For example, if "linda" sends to a list that contains "linda" as one of the members, she will not get a copy of the message. If the -m (me too) command line flag, or if the MeToo (m) option is set in the configuration file, this behavior is suppressed.

C and F -- Define Classes

Classes of phrases may be defined to match on the left hand side of rewrite rules, where a "phrase" is a sequence of characters that do not contain space characters. For example, a class of all local names for this site might be created so that attempts to send to oneself can be eliminated. These can either be defined directly in the configuration file or read in from another file. Classes are named as a single letter or a word in {braces}. Class names beginning with lowercase letters and special characters are reserved for system use. Classes defined in config files may be given names from the set of uppercase letters for short names or beginning with an uppercase letter for long names.

Ccphrase1 phrase2...
Fcfile

The first form defines the class c to match any of the named words. It is permissible to split them among multiple lines; for example, the two forms:

CHmonet ucbmonet

and

CHmonet
CHucbmonet

are equivalent. The ``F'' form reads the elements of the class c from the named file.

Elements of classes can be accessed in rules using $= or $~. The $~ (match entries not in class) only matches a single word; multi-word entries in the class are ignored in this context.

The class $=w is set to be the set of all names this host is known by. This can be used to match local hostnames.

The class $=k is set to be the same as $k, that is, the UUCP node name.

The class $=m is set to the set of domains by which this host is known, initially just $m.

The class $=t is set to the set of trusted users by the T configuration line. If you want to read trusted users from a file, use Ft/file/name.

The class $=n can be set to the set of MIME body types that can never be eight to seven bit encoded. It defaults to "multipart/signed". Message types "message/*" and "multipart/*" are never encoded directly. Multipart messages are always handled recursively. The handling of message/* messages are controlled by class $=s. The class $=e contains the Content-Transfer-Encodings that can be 8->7 bit encoded. It is predefined to contain "7bit", "8bit", and "binary". The class $=s contains the set of subtypes of message that can be treated recursively. By default it contains only "rfc822". Other "message/*" types cannot be 8->7 bit encoded. If a message containing eight-bit data is sent to a seven-bit host, and that message cannot be encoded into seven bits, it will be stripped to 7 bits.

Beginning with AIX Version 4.2, the three classes $=U, $=Y, and $=Z are defined to describe the hosts requiring the use of a uucp mailer. Specifically, $=U should contain all hosts requiring the uucp-old mailer. $=Y should contain all hosts requiring the the uucp-new mailer. Finally, $=Z should contain all hosts requiring the uucp-uudom mailer. Each uucp host should belong to one of these classes.

Sendmail can be compiled to allow a scanf(3) string on the F line. This lets you do simplistic parsing of text files. For example, to read all the user names in your system /etc/passwd file into a class, use:

FL/etc/passwd %[^:]

which reads every line up to the first colon.

Changing the Host Name

Cw contains all the possible names for the local host. It defines aliases. Cw specifies the name and all aliases for your host system. If your system uses different names for two different network connections, enter both names as part of the host name class. If you do not define both names, mail sent to the undefined name is returned to the sender.

CwCw alias aliasn... 

By default, the sendmail command reads what has been set with the hostname command and uses it to initialize the host and domain name macros and classes. Change the configuration file macros only if you want the sendmail host and domain names to be different from those set by the hostname command.

To change the host name:

  1. Enter the command:

    vi /etc/sendmail.cf

  2. Find the lines beginning with Dj, Dn, and Dw. Dj, Dn, and Dw override the host and domain names set with "hostname".

  3. Replace Dj, Dn, and Dw with the new hostname information. For example, if your hostname is brown.newyork.abc.com, and you have one alias, brown2, enter:
  4. Save the file and exit the editor.
Creating a Class Using a File

To define a class whose members are listed in an external file (one member per line), use a control line that begins with the letter F. The syntax for the F class definition is:

FClass FileName [Format]

Class is the name of the class that matches any of the words listed in FileName. Filename is the full path name of file (for convenience, you may wish to put the file in the /etc directory). Format is an optional scanf subroutine format specifier that indicates the format of the elements of the class in FileName. The Format specifier can contain only one conversion specification.

M -- Define Mailer

Programs and interfaces to mailers are defined in this line. The format is:

Mname, {field=value}*

where name is the name of the mailer (used internally only) and the "field=name" pairs define attributes of the mailer. Fields are:

Path The pathname of the mailer
Flags Special flags for this mailer
Sender Rewrite set(s) for sender addresses
Recipient Rewrite set(s) for recipient addresses
Argv An argument vector to pass to this mailer
Eol The end-of-line string for this maile
Maxsize The maximum message length to this mailer
Linelimit The maximum line length in the message body (field available beginning with AIX Version 4.2)
Directory The working directory for the mailer (field available beginning with AIX Version 4.2)
Userid The default user and group id to run as (field available beginning with AIX Version 4.2)
Nice The nice(2) increment for the mailer (field available beginning with AIX Version 4.2)
Charset The default character set for 8-bit characters (field available beginning with AIX Version 4.2)
Type The MTS type information (used for error messages) (field available beginning with AIX Version 4.2)

Only the first character of the field name is checked.

The flags in the following list may be set in the mailer description. Any other flags may be used freely to conditionally assign headers to messages destined for particular mailers. Flags marked with - are not interpreted by the sendmail binary; these are conventionally used to correlate to the flags portion of the H line. Flags marked with = apply to the mailers for the sender address rather than the usual recipient mailers.

a Run Extended SMTP (ESMTP) protocol (defined in RFCs 1651, 1652, and 1653). This flag defaults on if the SMTP greeting message includes the word "ESMTP". (Flag available beginning with AIX Version 4.2)
A Look up the user part of the address in the alias database. Normally this is only set for local mailers. (Flag available beginning with AIX Version 4.2)
b Force a blank line on the end of a message. This is intended to work around some versions of /bin/mail that require a blank line, but do not provide it themselves. It would not normally be used on network mail. (Flag available beginning with AIX Version 4.2)
c Do not include comments in addresses. This should only be used if you have to work around a remote mailer that gets confused by comments. This strips addresses of the form "Phrase <address>" or "address (Comment)" down to just "address". (Flag available beginning with AIX Version 4.2)
C= If mail is received from a mailer with this flag set, any addresses in the header that do not have an at sign ("@") after being rewritten by ruleset three will have the "@domain" clause from the sender envelope address tacked on. This allows mail with headers of the form:
From: usera@hosta
To: userb@hostb, userc

to be rewritten automatically as:

From: usera@hosta
To: userb@hostb, userc@hosta
d Do not include angle brackets around route-address syntax addresses. This is useful on mailers that are going to pass addresses to a shell that might interpret angle brackets as I/O redirection.
D- This mailer wants a "Date:" header line.
e This mailer is expensive to connect to, so try to avoid connecting normally. Any necessary connection will occur during a queue run.
E Escape lines beginning with "From" in the message with a `>' sign.
f The mailer wants a -f from flag, but only if this is a network forward operation (that is, the mailer will give an error if the executing user does not have special permissions).
F- This mailer wants a "From:" header line.
g Normally, sendmail sends internally generated error messages using the null return address as required by RFC 1123. However, some mailers don't accept a null return address. If necessary, you can set the g flag to prevent sendmail from obeying the standards; error messages will be sent as from the MAILER-DAEMON (actually, the value of the $n macro). (Flag available beginning with AIX Version 4.2)
h Uppercase should be preserved in host names for this mailer.
I This mailer will be speaking SMTP to another sendmail, as such it can use special protocol features. This option is not required (i.e., if this option is omitted the transmission will still operate successfully, although perhaps not as efficiently as possible).
j Do User Database rewriting on recipients as well as senders.
k Normally when sendmail connects to a host via SMTP, it checks to make sure that this isn't accidentally the same host name as might happen if sendmail is misconfigured or if a long-haul network interface is set in loopback mode. This flag disables the loopback check. It should only be used under very unusual circumstances. (Flag available beginning with AIX Version 4.2)
K Currently unimplemented. Reserved for chunking.
l This mailer is local (that is, final delivery will be performed).
L Limit the line lengths as specified in RFC821. This deprecated option should be replaced by the L= mail declaration. For historic reasons, the L flag also sets the 7 flag.
m This mailer can send 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 will be repeated as necessary for all qualifying users.
M- This mailer wants a "Message-Id:" header line.
n Do not insert a UNIX-style "From" line on the front of the message.
o Always run as the owner of the recipient mailbox. Normally sendmail runs as the sender for locally generated mail or as "daemon" (actually, the user specified in the u option) when delivering network mail. The normal behavior is required by most local mailers, which will not allow the envelope sender address to be set unless the mailer is running as daemon. This flag is ignored if the S flag is set. (Flag available beginning with AIX Version 4.2)
p Use the route-addr style reverse-path in the SMTP "MAIL FROM:" command rather than just the return address; although this is required in RFC821 section 3.1, many hosts do not process reverse-paths properly. Reverse-paths are officially discouraged by RFC 1123.
P- This mailer wants a "Return-Path:" line.
q When an address that resolves to this mailer is verified (SMTP VRFY command), generate 250 responses instead of 252 responses. This will imply that the address is local.
r Same as f, but sends an -r flag.
R Open SMTP connections from a "secure" port. Secure ports aren't secure except on UNIX machines, so it is unclear that this adds anything.
s Strip quote characters (" and \) off the address before calling the mailer.
S Don't reset the userid before calling the mailer. This would be used in a secure environment where sendmail ran as root. This could be used to avoid forged addresses. If the U= field is also specified, this flag causes the userid to always be set to that user and group (instead of leaving it as root).
u Uppercase should be preserved in user names for this mailer.
U This mailer wants UUCP-style "From" lines with the "remote from <host>" on the end.
w The user must have a valid account on this machine (getpwnam must succeed). If not, the mail is bounced. This is required to get ".forward" capability. (Flag available beginning with AIX Version 4.2)
x- This mailer wants a "Full-Name:" header line.
X This mailer want to use the hidden dot algorithm as specified in RFC821; basically, any line beginning with a dot will have an extra dot prepended (to be stripped at the other end). This ensures that lines in the message containing a dot will not terminate the message prematurely.
0 Don't look up Mx records for hosts via SMTP.
3 Extend the list of characters converted to =XX notation when converting to Quoted-Printable to include those that don't map cleanly between ASCII and EBCDIC. Useful if you have IBM mainframes on site.
5 If no aliases are found for this address, pass the address through ruleset 5 for possible alternate resolution. This is intended to forward the mail to an alternate delivery spot. (Flag available beginning with AIX Version 4.2)
7 Strip all output to seven bits. This is the default if the L flag is set. Note that clearing this option is not sufficient to get full eight-bit data passed through sendmail. If the 7 option is set, this is essentially always set, since the eighth bit was stripped on input. Note that this option will only impact messages that didn't have 8->7 bit MIME conversions performed. (Flag available beginning with AIX Version 4.2)
8 If set, it is acceptable to send eight bit data to this mailer; the usual attempt to do 8->7 bit MIME conversions will be bypassed. (Flag available beginning with AIX Version 4.2)
9 If set, do limited 7->8 bit MIME conversions. These conversions are limited to text/plain data.
: Check addresses to see if they begin ":include:". If they do,convert them to the "*include*" mailer. (Flag available beginning with AIX Version 4.2)
| Check addresses to see if they begin with a `|'. If they do, convert them to the "prog" mailer. (Flag available beginning with AIX Version 4.2)
/ Check addresses to see if they begin with a `/'. If they do, convert them to the "*file*" mailer. (Flag available beginning with AIX Version 4.2)
@ Look up addresses in the user database. (Flag available beginning with AIX Version 4.2)
Note: Configuration files prior to level 6 assume the `A', `w', `5', `:', `|', `/', and `@' options on the mailer named "local".

The mailer with the special name "error" can be used to generate a user error. The (optional) host field is an exit status to be returned, and the user field is a message to be printed. The exit status may be numeric or one of the values USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG to return the corresponding EX_ exit code. For example, the entry:

$#error $@ NOHOST $: Host unknown in this domain

on the RHS of a rule will cause the specified error to be generated and the "Host unknown" exit status to be returned if the LHS matches. It is always available for use in O, S, and check_ ... rulesets and it cannnot be defined with M commands.

The mailer named "local" must be defined in every configuration file. This is used to deliver local mail, and is treated specially in several ways. Additionally, three other mailers named "prog", "*file*",and "*include*" may be defined to tune the delivery of messages to programs, files, and :include: lists respectively. They default to:

Mprog, P=/bin/sh, F=lsD, A=sh -c $u
M*file*, P=/dev/null, F=lsDFMPEu, A=FILE <this line AIX 4.2 or later only>
M*include*, P=/dev/null, F=su, A=INCLUDE <this line AIX 4.2 or later 
only>

The Sender and Recipient rewrite sets may either be a simple ruleset id or may be two ids separated by a slash If so, the first rewrite set is applied to envelope addresses, and the second is applied to headers.

Mailer Specifications Examples
  1. To specify a local delivery mailer enter:
    Mlocal, P=/usr/bin/bellmail, F=lsDFMmn, S=10, R=20, A=mail $u
    The mailer is called local. Its path name is /usr/bin/bellmail. The mailer uses the following flags:
    l Specifies local delivery.
    s Strips quotation marks from addresses.
    DFM Requires Date:, From:, and Message-ID: fields.
    m Delivers to multiple users.
    n Does not need an operating system From line at the start of the message.
    Rule set 10 should be applied to sender addresses in the message. Rule set 20 should be applied to recipient addresses. Additional information sent to the mailer in the A field is the word mail and words containing the recipient's name.

H -- Define Header

The format of the header lines that sendmail inserts into the message are defined by the H line. The syntax of this line is:

H[?mflags?]hname: htemplate

Continuation lines in this spec are reflected directly into the outgoing message. The htemplate is macro expanded before insertion into the message. If the mflags (surrounded by question marks) are specified, at least one of the specified flags must be stated in the mailer definition for this header to be automatically output. If one of these headers is in the input, it is reflected to the output regardless of these flags.

Some headers have special semantics that will be described later.

Message Headings in the sendmail.cf File

Lines in the configuration file that begin with a capital letter H, define the format of the headers used in messages. The format of the H command is:

Lines in the configuration file that begin with a capital letter H, define the format of the headers used in messages. The format of the H control line is:

H[?MailerFlags?]FieldName: Content

The variable parameters are defined as:

MailerFlags Determines whether the H line is used. This parameter is optional. If you supply this parameter, surround it with ? (question marks). If the mailer requires the field defined by this control line (as indicated in the mailer definition's flags field), then the H control line is included when formatting the heading. Otherwise, the H control line is ignored.
FieldName Contains the text displayed as the name of the field in the heading information. Typical field names include From:, To:, and Subject:.
Content Defines the information that is displayed following the field name. Usually macros specify this information.

These example lines are from a typical /etc/sendmail.cf file:

H?P?Return-Path: <$g> Defines a field called Return-Path that displays the content of the $g macro (sender address relative to the recipient). The ?P? portion indicates this line is only used if the mailer uses the P flag (the mailer requires a Return-Path line). The header is generated only if the mailer has the indicated flag. If the header appears in the input message, it is passed through unchanged.
HReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
                           Defines a field called Received. This field includes:
$?sfrom $s $.
                           Displays the text from followed by the content of the $s macro if an s macro is defined (sender's host name).
by $j Displays the text by followed by the content of the $j macro (official name for a specific location).
($v/$Z) Displays the version of the sendmail command ($v) and the version of the /etc/sendmail.cf file ($Z), set off by parentheses and separated by a slash.
id $i; Displays the text id followed by the content of the $i macro (mail-queue ID of the message) and a ; (semicolon).
$b Displays the current date.

O -- Set Option

For information on the options for AIX Version 4.2 or later, see "sendmail.cf File Options (for AIX Version 4.2 or Later)".

For information on the options for AIX Version 3.2.5 and AIX Version 4.1, see "sendmail.cf File Options (for AIX Version 3.2.5 or AIX Version 4.1)".

P -- Precedence Definitions

Values for the "Precedence:" field may be defined using the P control line. The syntax of this field is:

Pname=num

When the name is found in a "Precedence:" field, the message class is set to num. Higher numbers mean higher precedence. Numbers less than zero have the special property that if an error occurs during processing, the body of the message will not be returned; this is expected to be used for "bulk" mail such as through mailing lists. The default precedence is zero. For example, the list of default precedences is:

V -- Configuration Version Level

The V configuration command was added to V8 sendmail to prevent old versions of configuration files from breaking when used with V8 sendmail. The syntax for the V configuration command looks like this:


  Vlevel             <-- V8.1 and above
     Vlevel/vendor      <-- V8.6 and above

Here, level is a positive integer, and /vendor is a string. We will cover the vendor part soon.

If level is higher than the maximum allowed for the current version, sendmail prints the following warning and accepts the value:

     Warning: .cf version level (lev ) exceeds program functionality (max)

If level is less than 0 or if the V configuration command is omitted, the default level is 0.

The effects of the various version levels are relatively minor. As sendmail continues to develop, they may become more pronounced. Currently, the version levels are as follows:
0 The check for a valid shell in /etc/shells is ignored.
0-1 MX records are looked up with the RES_DEFNAMES and RES_DNSRCH cleared. The high bit is always stripped from the body of every mail message.
2+ The sendmail program automatically adds a -a. to the "host host" map if that map isn't declared in the configuration file. RES_DEFNAMES and RES_DNSRCH are not turned off as they were for older versions. Rule set 5 behavior is enabled.
0-2 Set UseErrorsTo (1) option to true automatically.
2+ Automatically sets the $w macro to be the short name instead of the fully qualified local hostname ($j still contains the fully qualified name and $m the local domain).
3+ You may use the new-style comments.
0-5 For V8-7 and above sendmail, level 5 or lower causes the F=5Aw:|/@ flags to automatically be set for the local deliver agent and the F=o flag to automatically be set for the prog and *file* delivery agents.
0-6 Looking up MX records with HasWildcardMX listed with the ResolverOptions (I) option causes RES_QUERY to be used in place of RES_SEARCH. Default the ColonOkInAddr option to false. Set the SmtpGreetingMessage option with the value of $e if $e has a value. Set the OperatorChars option with the value of $o if $o has a value. Beginning with V8.8 sendmail, a level of 6 or less causes the F=q flag for the local, prog, and *file* delivery agents to be automatically set.
7 As of V8.8, the current version.

K -- Key File Declaration

Note: This function is available beginning in AIX Version 4.2 only.

Special maps can be defined using the line:

Kmapname mapclass arguments

The mapname is the name by which this map is referenced in the rewrite rules. The mapclass is the name of a type of map; these are compiled in to sendmail. The arguments are interpreted depending on the class; typically, there would be a single argument naming the file containing the map.

Maps are referenced using the syntax:

$( map key $@ arguments $: default $)

where either or both of the arguments or default portion may be omitted. The $@ arguments may appear more than once. The indicated key and arguments are passed to the appropriate mapping function. If it returns a value, it replaces the input. If it does not return a value and the default is specified, the default replaces the input. Otherwise, the input is unchanged.

During replacement of either a map value or default, the string "%n" (where n is a digit) is replaced by the corresponding argument. Argument zero is always the database key. For example, the rule:

R$- ! $+    $: $(uucp $1 $@ $2 $: %1 @ %0 . UUCP 
$)

looks up the UUCP name in a (user-defined) UUCP map. If not found, it turns it into ".UUCP" form. The database might contain records like:

decvax          %1@
%0.DEC.COM
research        %1@%0.ATT.COM

The builtin map with both name and class "host" is the host name canonicalization lookup. Thus, the syntax:

$(host hostname$)

is equivalent to:

$[hostname$]

There are many defined classes.

dbm Database lookups using the ndbm(3) library. Sendmail must be compiled with NDBM defined.
nis NIS lookups. Sendmail must be compiled with NIS defined.
text Text file lookups. The format of the text file is defined by the -k (key field number), -v (value field number), and -z (field delimiter) flags.
stab Internal symbol table lookups. Used internally for aliasing.
implicit Really should be called "alias." This is used to get the default lookups for alias files, and is the default if no class is specified for alias files.
user Looks up users using getpwnam(3). The -v flag can be used to specify the name of the field to return (although this is normally used only to check the existence of a user).
host Canonifies host domain names. Given a host name, it calls the name server to find the canonical name for that host.
sequence The arguments on the `K' line are a list of maps; the resulting map searches the argument maps in order until it finds a match for the indicated key. For example, if the key definition is:
Kmap1 ...
Kmap1 ...
Kseqmap sequence map1 map2

then a lookup against "seqmap" first does a lookup in map1. If that is found, it returns immediately. Otherwise, the same key is used for map2.

switch Much like the "sequence" map except that the order of maps is determined by the service switch. The argument is the name of the service to be looked up; the values from the service switch are appended to the map name to create new map names. For example, consider the key definition:
Kali switch aliases

together with the service switch entry:

aliases    nis files

This causes a query against the map "ali" to search maps named "ali.nis" and "ali.files" in that order.

dequote Strip double quotes (") from a name. It does not strip backslashes, and will not strip quotes if the resulting string would contain unscannable syntax (that is, basic errors like unbalanced angle brackets; more sophisticated errors such as unknown hosts are not checked). The intent is for use when trying to accept mail from systems such as DECnet that routinely quote odd syntax such as:
"49ers::ubell"

A typical use is probably something like:

Kdequote dequote
...
R$-        $: $(dequote $1 $)
R$- $+     $: $>3 $1 $2
   

Care must be taken to prevent unexpected results; for example,

"|someprogram < input > output"

will have quotes stripped, but the result is probably not what you had intended. Fortunately, these cases are rare.

Most of these accept as arguments the same optional flags and a filename (or a mapname for NIS; the filename is the root of the database path, so that ".db" or some other extension appropriate for the database type will be added to get the actual database name). Known flags are:

-o Indicates that this map is optional. That is, if it cannot be opened, no error is produced, and sendmail will behave as if the map existed but was empty.
-N, -O If neither -N or -O are specified, sendmail uses an adaptive algorithm to decide whether or not to look for null bytes on the end of keys. It starts by trying both; if it finds any key with a null byte, it never tries again without a null byte and vice versa. If -N is specified, it never tries without a null byte and if -O is specified, it never tries with a null byte. Setting one of these can speed matches but are never necessary. If both -N and -O are specified, sendmail will never try any matches at all. That is, everything will appear to fail.
-ax Append the string x on successful matches. For example, the default host map appends a dot on successful matches.
-f Do not fold upper to lower case before looking up the key.
-m Match only (without replacing the value). If you only care about the existence of a key and not the value (as you might when searching the NIS map "hosts.byname" for example), this flag prevents the map from substituting the value. However, The -a argument is still appended on a match, and the default is still taken if the match fails.
-kkeycol The key column name (for NIS+) or number (for text lookups).
-vvalcol The value column name (for NIS+) or number (for text lookups).
-zdelim The column delimiter (for text lookups). It can be a single character or one of the special strings "\n" or "\t" to indicate newline or tab respectively. If omitted entirely, the column separator is any sequence of whitespace.
-sspacesub For the dequote map only, the character to use to replace space characters after a successful dequote.

The dbm map appends the strings ".pag" and ".dir" to the given filename; the two db-based maps append ".db". For example, the map specification

Kuucp dbm -o -N /usr/lib/uucpmap

specifies an optional map named "uucp" of class "dbm"; it always has null bytes at the end of every string, and the data is located in /usr/lib/uucpmap.{dir,pag}.

Commands and Operands

CXWord1 Word2... Defines the class of words that can be used to match the left-hand side of rewrite rules. Class specifiers (X) may be any of the uppercase letters from the ASCII character set. Lowercase letters and special characters are reserved for system use.
DXValue Defines a macro (X) and its associated Value. Macro specifiers may be any of the uppercase letters from the ASCII character set. Lowercase letters and special characters are reserved for system use.
FXFileName [Format] Reads the elements of the class (X) from the FileName variable, using an optional scanf format specifier. The format specifier contains only one conversion specification. One class number is read for each line in the FileName variable.
H[?MFlags?]HeaderName: HeaderTemplate Defines the header format the sendmail command inserts into a message. Continuation lines are a part of the definition. The HeaderTemplate is macro-expanded before insertion into the message. If the MFlags are specified and at least one of the specified flags is included in the mailer definition, this header is automatically written to the output message. If the header appears in the input message, it is written to the output message regardless of the MFlags variable.
MName, [Field=Value] Defines a Mail program where the Name variable is the name of the Mail program and Field=Value pair defines the attributes of the mailer.
Ox[Value] Sets the option to the value of x. If the option is a valued option, you must also specify the Value variable. Options may also be selected from the command line.
Note: For valid values, see "sendmail.cf File Options (for AIX Version 4.2 or Later)" or "sendmail.cf File Options (for AIX Version 3.2.5 or AIX Version 4.1)".
PName=Number Defines values for the Precedence: header field. When the Name variables found in a message's Precedence: field, the message's precedence is set to the Number variable. Higher numbers indicate higher precedences. Negative numbers indicate that error messages are not returned. The default Number is 0.
RLeftHandSide RightHandSide Comments Defines a rewrite rule. One or more tab characters separate the three fields of this command. If space characters are used as field separators, option J must be set. The J option allows spaces as well as tabs to separate the left- and right-hand sides of rewrite rules. The J option allows rewrite rules to be modified using an editor that replaces tabs with spaces.
Sx Sets the rule set currently defined to the specified number(x). If a rule set definition is started more than once, the new definition overwrites the old.
TUser1 User2 ... Defines user IDs for the system administrators. These IDs have permission to override the sender address using the -f flag. More than one ID can be specified per line.

sendmail.cf File Options (for AIX Version 4.2 or Later)

There are a number of global options that can be set from a configuration file. Options are represented by full words. Some can also be represented as single characters for back compatibility. The syntax of this line is:

O option=value

This sets option to be value. Note that there must be a space between the letter `O' and the name of the option. An older version is:

Oovalue

where the option o is a single character. Depending on the option, value may be a string, an integer, a boolean (with legal values "t", "T", "f", or "F"; the default is TRUE), or a time interval.

The options supported are as follows. You can also use the single-character names; they are shown in brackets in the following list:

AliasFile=spec, spec, ... [A] Specify possible alias file(s). Each spec should be in the format ``class: file'' where class: is optional and defaults to ``implicit''. Depending on how sendmail is compiled, valid classes are as follows, or if a list of specs is provided, sendmail searches them in order.
dbm If NDBM is specified
nis If NIS is specified.
AliasWait=timeout [a] If set, wait up to timeout (units default to minutes) for an "@:@" entry to exist in the alias database before starting up. If it does not appear in the timeout interval, rebuild the database (if the AutoRebuildAliases option is also set) or issue a warning.
AllowBogusHELO [no short name] If set, allow HELO SMTP commands that don't include a host name. Setting this violates RFC 1123, section 5.2.5, but is necessary to interoperate with several SMTP clients. If there is a value, it is still checked for legitimacy. This option is valid for sendmail version 8.8 and above.
AutoRebuildAliases [D] If set, rebuild the alias database if necessary and possible. If this option is not set, sendmail will never rebuild the alias database unless explicitly requested using -bi. Not recommended, since it can cause thrashing.
BlankSub=c [B] Set the blank substitution character to c. Unquoted spaces in addresses are replaced by this character. Defaults to space (no change is made).
CheckAliases [n] Validate the RHS of aliases when rebuilding the alias database.
CheckpointInterval=N [C] Checkpoints the queue every N (default 10) addresses sent. If your system crashes during delivery to a large list, this prevents retransmission to any but the last recipients.
ClassFactor=fact [z] The indicated factor is multiplied by the message class (determined by the Precedence: field in the user header and the P lines in the configuration file) and subtracted from the priority. Thus, messages with a higher Priority: will be favored. Defaults to 1800.
ColonOkInAddr [no short name] If set, colons are acceptable in e-mail addresses (for example, "host:user"). If not set, colons indicate the beginning of a RFC 822 group construct ("groupname: member1, member2, ... memberN;"). Doubled colons are always acceptable ("nodename::user") and proper route-addr nesting is understood ("<@relay:user@host>"). Furthermore, this option defaults on if the configuration version level is less than 6 (for back compatibility). However, it must be off for full compatibility with RFC 822.
ConnectionCacheSize=N [k] The maximum number of open connections that will be cached at a time. The default is one. This delays closing the current connection until either this invocation of sendmail needs to connect to another host or it terminates. Setting it to zero defaults to the old behavior, that is, connections are closed immediately. Since this consumes file descriptors, the connection cache should be kept small; 4 is probably a practical maximum.
ConnectionCacheTimeout=timeout [K] The maximum amount of time a cached connection will be permitted to idle without activity. If this time is exceeded, the connection is immediately closed. This value should be small (approximately ten minutes). Before sendmail uses a cached connection, it always sends a RSET command to check the connection; if this fails, it reopens the connection. This keeps your end from failing if the other end times out. This option avoids using up excessive resources on the other end. The default is five minutes.
ConnectionRateThrottle=N [no short name] If set to a positive value, allow no more that N incoming daemon connections in a one-second period. This is intended to flatten out peaks and allow the load average checking to cut in. Defaults to zero (no limits). This option is valid for sendmail version 8.8 and above.
DaemonPortOptions=options [O] Set server SMTP options. The options are key=value pairs. Known keys are:
Port Name/number of listening port (defaults to "smtp")
Addr Address mask (defaults INADDR_ANY)
Family Address family (defaults to INET)
Listen Size of listen queue (defaults to 10)
SndBufSize Size of TCP send buffer
RcvBufSize Size of TCP receive buffer

The Address mask may be a numeric address in dot notation or a network name.

DefaultCharSet=charset [no short name] When a message that has 8-bit characters but is not in MIME format is converted to MIME (see the EightBitMode option), a character set must be included in the Content-Type: header. This character set is normally set from the Charset= field of the mailer descriptor. If that is not set, the value of this option is used. If this option is not set, the value "unknown-8bit" is used.
DefaultUser=user:group [u] Set the default userid for mailers to user:group. If group is omitted and user is a user name (as opposed to a numeric user id), the default group listed in the /etc/passwd file for that user is used as the default group. Both user and group may be numeric. Mailers without the S flag in the mailer definition will run as this user. Defaults to 1:1. The value can also be given as a symbolic user name.
DeliveryMode=x [d] Deliver in mode x. Legal modes are:
i Deliver interactively (synchronously)
b Deliver in background (asynchronously)
q Just queue the message (deliver during queue run)
d Defer delivery and all map lookups (deliver during queuerun) (This mode is available beginning with AIX Version 4.2).

Defaults to b if no option is specified, i if it is specified but given no argument (for example, ``Od'' is equivalent to '`Odi''). The -v command line flag sets this to i.

DialDelay=sleeptime [no short name] Dial-on-demand network connections can see timeouts if a connection is opened before the call is set up. If this is set to an interval and a connection times out on the first connection being attempted, sendmail will sleep for this amount of time and try again. This should give your system time to establish the connection to your service provider. Units default to seconds, so "DialDelay=5" uses a five second delay. Defaults to zero (no retry).
DontExpandCnames [no short name] The standards say that all host addresses used in a mail message must be fully canonical. For example, if your host is named "Cruft.Foo.ORG" and also has an alias of "FTP.Foo.ORG", the former name must be used at all times. This is enforced during host name canonification ($[ ... $] lookups). If this option is set, the protocols are ignored and the "wrong" thing is done. However, the IETF is moving toward changing this standard, so the behavior may become acceptable. Please note that hosts downstream may still rewrite the address to be the true canonical name.
DontInitGroups [no short name] If set, sendmail will avoid using the initgroups(3) call. If you are running NIS, this causes a sequential scan of the groups.byname map, which can cause your NIS server to be badly overloaded in a large domain. The cost of this is that the only group found for users will be their primary group (the one in the password file), which will make file access permissions somewhat more restrictive. Has no effect on systems that do not have group lists.
DontPruneRoutes [R] Normally, sendmail tries to eliminate any unnecessary explicit routes when sending an error message (as discussed in RFC 1123 S 5.2.6). For example, when sending an error message to:
<@known1,@known2,@known3:user@unknown>

sendmail will strip off the "@known1,@known2" in order to make the route as direct as possible. However, if the R option is set, this will be disabled, and the mail will be sent to the first address in the route, even if later addresses are known. This may be useful if you are behind a firewall.

DoubleBounceAddress=error-address [no short name] If an error occurs when sending an error message, send the error report (termed a "double bounce" because it is an error "bounce" that occurs when trying to send another error "bounce") to the indicated address. If not set, defaults to "postmaster". This option is valid for sendmail version 8.8 and above.
EightBitMode=action [8] Set handling of eight-bit data. There are two kinds of eight-bit data: that declared as such using the BODY=8BITMIME ESMTP declaration or the -B8BITMIME command line flag, and undeclared 8-bit data, that is, input that just happens to be eight bits. There are three basic operations that can happen: undeclared 8-bit data can be automatically converted to 8BITMIME, undeclared 8-bit data can be passed as is, without conversion to MIME, and declared 8-bit data can be converted to 7-bits for transmission to a non-8BITMIME mailer. The possible actions are:
s Reject undeclared 8-bit data (``strict'')
m Convert undeclared 8-bit data to MIME (``mime'')
p Pass undeclared 8-bit data (``pass'')

In all cases, properly declared 8BITMIME data will be converted to 7BIT as needed.

ErrorHeader=file-or-message [E] Prepend error messages with the indicated message. If it begins with a slash, it is assumed to be the pathname 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, and/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 which does not exist or which is not readable, no message is printed.
ErrorMode=x [e] 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
w Write back errors (mail if user not logged in)
e Mail back errors and give zero exit stat always
FallbackMXhost=fallbackhost [V] If specified, the fallbackhost acts like a very low priority MX on every host. This is intended to be used by sites with poor network connectivity.
ForkEachJob [Y] If set, deliver each job that is run from the queue in a separate process. Use this option if you are short of memory, since the default tends to consume considerable amounts of memory while the queue is being processed.
ForwardPath=path [J] Set the path for searching for users' .forward files. The default is "$z/.forward". Some sites that use the automounter may prefer to change this to "/var/forward/$u" to search a file with the same name as the user in a system directory. It can also be set 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" will search first in /var/forward/username and then in ~username/.forward (but only if the first file does not exist).
HoldExpensive [c] If an outgoing mailer is marked as being expensive, don't connect immediately. This requires that queueing be compiled in, since it will depend on a queue run process to actually send the mail.
HostsFile=path [no short name] The path to the hosts database, normally /etc/hosts. This option is only consulted when sendmail is canonifying addresses, and then only when "files" is in the "hosts" service switch entry. In particular, this file is never used when looking up host addresses; that is, under the control of the system gethostbyname(3) routine. This option is valid for sendmail version 8.8 and above.
HostStatusDirectory=path [no short name] The location of the long term host status information. When set, information about the status of hosts (for example, host down or not accepting connections) will be shared between all sendamil processes; normally, this information is only held within a single queue run. This option requires a connection cache of at least 1 to function. If the option begins with a leading `/', it is an absolute pathname; otherwise, it is relative to the mail queue directory. A suggested value for sites desiring persistent host status is .hoststat (that is, a subdirectory of the queue directory). This option is valid for sendmail version 8.8 and above.
IgnoreDots [i] Ignore dots in incoming messages. This is always disabled (that is, dots are always accepted) when reading SMTPmail.
LogLevel=n [L] Set the default log level to n. Defaults to 9.
Mxvalue [no long version] Set the macro x to value. This is intended only for use from the command line. The -M flag is preferred.
MatchGECOS [G] Allow fuzzy matching on the GECOS field. If this flag is set, and the usual user name lookups fail (that is, there is no alias with this name and a getpwnam fails), sequentially search the password file for a matching entry in the GECOS field. This also requires that MATCHGECOS be turned on during compilation. This option is not recommended.
MaxDaemonChildren=N [no short name] If set, sendmail will refuse connections when it has more than N children processing incoming mail. This does not limit the number of outgoing connections. If not set, there is no limit to the number of children; that is, the system load averaging controls this. This option is valid for sendmail version 8.8 and above.
MaxHopCount=N [h] The maximum hop count. Messages that have been processed more than N times are assumed to be in a loop and are rejected. Defaults to 25.
MaxQueueRunSize=N [no short name] The maximum number of jobs that will be processed in a single queue run. If not set, there is no limit on the size. If you have very large queues or a very short queue run interval, this could be unstable. However, since the first N jobs in queue directory order are run (rather than the N highest priority jobs), this should be set as high as possible to avoid "losing" jobs that happen to fall late in the queue directory.
MeToo [m] Send to me too, even if I am in an alias expansion.
MaxMessageSize=N [no short name] Specify the maximum message size to be advertised in the ESMTP EHLO response. Messages larger than this will be rejected.
MinFreeBlocks=N [b] Insist on at least N blocks free on the filesystem that holds the queue files before accepting e-mail via SMTP. If there is insufficient space, sendmail gives a 452 response to the MAIL command. This invites the sender to try again later.
MinQueueAge=age [no short name] Don't process any queued jobs that have been in the queue less than the indicated time interval. This is intended to allow you to get responsiveness by processing the queue fairly frequently without thrashing your system by trying jobs too often. The default units are minutes.
MustQuoteChars=s [no short name] Sets the list of characters that must be quoted if used in a full name; that is, in the phrase part of a ``phrase <address>'' syntax. The default is ``.''. The characters ``@,;:\()[]'' are always added to this list. This option is valid for sendmail version 8.8 and above.
NameServOpt Set this option to use MB, MG, and MR resource records in the name server.
MB Uses mailbox (MB) records to resolve recipient user names.
MG Uses mail group (MG) records to resolve recipient user names.
MR Uses mail rename (MR) records to resolve recipient user names.
NoRecipientAction [no short name] The action to take when you receive a message that has no valid recipient headers (To:, Cc:, Bcc:). It can be:
None To pass the message on unmodified, which violates the protocol
Add-To To add a To: header with any recipients it can find in the envelope (which might expose Bcc: recipients)
Add-Apparently-To To add an Apparently-To: header (this is only for back compatibility and is officially deprecated)
Add-To-Undisclosed To add a header "To: undisclosed-recipients:;" to make the header legal without disclosing anything
Add-Bcc To add an empty Bcc: header.
OldStyleHeaders [o] Assume that the headers may be in old format, that is, spaces delimit names. This actually turns on an adaptive algorithm: if any recipient address contains a comma, parenthesis, or angle bracket, it will be assumed that commas already exist. If this flag is not on, only commas delimit names. Headers are always output with commas between the names. Defaults to off.
OperatorChars=charlist [$o macro] The list of characters that are considered to be "operators;" that is, characters that delimit tokens. All operator characters are tokens by themselves; sequences of non-operator characters are also tokens. White space characters separate tokens but are not tokens themselves. For example, "AAA.BBB" has three tokens, but "AAA BBB" has two. If not set, OperatorChars defaults to ".:@[]"; additionally, the characters "()<>,;" are always operators.
PostmasterCopy=postmaster [P] If set, copies of error messages will be sent to the named postmaster. Only the header of the failed message is sent. Since most errors are user problems, this is probably not a good idea on large sites, and arguably contains privacy violations. Defaults to no postmaster copies.
PrivacyOptions=opt,opt,... [p] Set the privacy options. "Privacy" is really a misnomer; many of these are just a way of insisting on stricter adherence to the SMTP protocol. The options can be selected from:
public Allow open access
needmailhelo Insist on HELO or EHLO command before MAIL
needexpnhelo Insist on HELO or EHLO command before EXPN
noexpn Disallow EXPN entirely
needvrfyhelo Insist on HELO or EHLO command before VRFY
novrfy Disallow VRFY entirely
restrictmailq Restrict mailq command
restrictqrun Restrict -q command line flag
noreceipts Do not return success DSNs
goaway Disallow essentially all SMTP status queries
authwarnings Put X-Authentication-Warning: headers in messages

The "goaway" pseudo-flag 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. Authentication Warnings add warnings about various conditions that may indicate attempts to violate the mail system security, such as using an nonstandard queue directory.

QueueDirectory=dir [Q] Use the named dir as the queue directory.
QueueFactor=factor [q] Use factor as the multiplier in the map function to decide when to just queue up jobs rather than run them. This value is divided by the difference between the current load average and the load average limit (QueueLA option) to determine the maximum message priority that will be sent. Defaults to 600000.
QueueLA=LA [x] When the system load average exceeds LA, just queue messages (do not try to send them). Defaults to 8.
QueueSortOrder=algorithm [no short name] Sets the algorithm used for sorting the queue. Only the first character of the value is used. Legal values are "host" (to order by the name of the first host name of the first recipient) and "priority" (to order strictly by message priority). Host ordering makes better use of the connection cache, but may tend to process low-priority messages that go to a single host over high-priority messages that go to several hosts; it probably should not be used on slow network links. Priority ordering is the default.
QueueTimeout=timeout [T] A synonym for "Timeout.queuereturn". This option is valid for sendmail version 8.8 and above.
RecipientFactor=fact [y] The indicated factor is added to the priority (thus lowering the priority of the job) for each recipient. That is, this value penalizes jobs with large numbers of recipients. Defaults to 30000.
RefuseLA=LA [X] When the system load average exceeds LA, refuse incoming SMTP connections. Defaults to 12.
ResolverOptions=options [I] Set resolver options. Values can be set using +flag and cleared using - flag; the flags can be "debug", "aaonly", "usevc", "primary", "igntc", "recurse", "defnames", "stayopen",or "dnsrch". The string "HasWildcardMX " (without a + or -) can be specified to turn off matching against MX records when doing name canonifications.
You must be using the name server when defining this option.
RetryFactor=fact [Z] The factor is added to the priority every time a job is processed. Thus, each time a job is processed, its priority will be decreased by the indicated value. In most environments this should be positive, since hosts that are down can be down for a long time. Defaults to 90000.
RunAsUser=user [no short name] The user parameter may be a user name (looked up in /etc/passwd) or a numeric user id; either form can have ":group" attached (where group can be numeric or symbolic). If set to a non-zero (non-root) value, sendmail will change to this user id shortly after startup[20]. This avoids a certain class of security problems. However, this means that all ".forward" and ":include:" files must be readable by the indicated user, and on systems that don't support the saved uid bit properly, all files to be written must be writable by user and all programs will be executed by user. It is also incompatible with the SafeFileEnvironment option. In other words, it may not actually add much to security on an average system, and may, in fact, detract from security (because other file permissions must be loosened). However, it should be useful on firewalls and other places where users don't have accounts and the aliases file is well constrained. This option is valid for sendmail version 8.8 and above.
SafeFileEnvironment=dir [no short name] If this option is set, sendmail will do a chroot(2) call into the indicated directory before doing any file writes. If the file name specified by the user begins with dir, that partial path name will be stripped off before writing, so (for example) if the SafeFileEnvironment variable is set to "/safe", then aliases of "/safe/logs/file" and "/logs/file" actually indicate the same file. Additionally, if this option is set, sendmail refuses to deliver to symbolic links.
SaveFromLine [f] Save UNIX-style "From" lines at the front of headers. Normally they are assumed redundant and discarded.
SendMIMEErrors [j] If set, send error messages in MIME format (see RFC1521 and RFC1344 for details).
SevenBitInput [7] Strip input to seven bits for compatibility with old systems. This should not be necessary.
SingleLineFromHeader [no short name] If set, From: lines that have embedded newlines are unwrapped onto one line. This is to get around a botch in Lotus Notes that apparently cannot understand legally wrapped RFC822 headers. This option is valid for sendmail version 8.8 and above.
SingleThreadDelivery [no short name] If set, a client machine will never try to open two SMTP connections to a single server machine at the same time, even in different processes. That is, if another sendmail is already talking to some host, a new sendmail will not open another connection. This property is of mixed value; although this reduces the load on the other machine, it can cause mail to be delayed (for example, if one sendmail is delivering a huge message, other sendmails won't be able to send even small messages). Also, it requires another file descriptor (for the lock file) per connection, so you may have to reduce the ConnectionCacheSize option to avoid running out of per-process file descriptors. Requires the HostStatusDirectory option. This option is valid for sendmail version 8.8 and above.
SmtpGreetingMessage=message [$e macro] The message printed when the SMTP server starts up. Defaults to "$j Sendmail $v ready at $b".
StatusFile=file [S] Log summary statistics in the named file. If not set, no summary statistics are saved. This file does not grow in size. It can be printed using the mailstats program.
SuperSafe [s] Be super-safe when running things. That is, always instantiate the queue file, even if you are going to attempt immediate delivery. sendmail always instantiates the queue file before returning control to the client under any circumstances. It is recommended that this always be set.
TempFileMode=mode [F] The file mode for queue files. It is interpreted in octal by default. Defaults to 0600.
Timeout.type=timeout [r; subsumes old T option as well] Set timeout values. The actual timeout is indicated by the type. The recognized timeouts and their default values, and their minimum values specified in RFC 1123 section 5.3.2 are:
initial Wait for initial greeting message [5m, 5m]
helo Reply to HELO or EHLO command [5m, none]
mail Reply to MAIL command [10m, 5m]
rcpt Reply to RCPT command [1h, 5m]
datainit Reply to DATA command [5m, 2m]
datablock Data block read [1h, 3m]
datafinal Reply to final ``.'' in data [1h, 10m]
rset Reply to RSET command [5m, none]
quit Reply to QUIT command [2m, none]
misc Reply to NOOP and VERB commands [2m, none]
ident IDENT protocol timeout [30s, none]
fileopen- Timeout on opening .forward and .include: files [60s, none]
command- Command read [1h, 5m]
queuereturn- How long until a message is returned [5d, 5d]
queuewarn- How long until a warning is sent [none, none]

All but those marked with a (-) apply to client SMTP. If the message is submitted using the NOTIFY SMTP extension, warning messages will only be sent if NOTIFY=DELAY is specified. The queuereturn and queuewarn timeouts can be further qualified with a tag based on the Precedence: field in the message; they must be one of the following:

urgent Indicating a positive non-zero precedence
normal Indicating a zero precedence
nonurgent Indicating negative precedences.

For example, setting "Time-out.queuewarn.urgent=1h" sets the warning timeout for urgent messages only to one hour. The default if no precedence is indicated is to set the timeout for all precedences.

TimeZoneSpec=tzinfo [t] Set the local time zone info to tzinfo; for example, "PST8PDT". Actually, if this is not set, the TZ environment variable is cleared (so the system default is used). If set but null, the user's TZ variable is used, and if set and non-null, the TZ variable is set to this value.
TryNullMXList [w] If this system is the "best" (that is, lowest preference) MX for a given host, its configuration rules should normally detect this situation and treat that condition specially by forwarding the mail to a UUCP feed, treating it as local. 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 causes sendmail to try this. Errors in your configuration are likely to be diagnosed as "host unknown" or "message timed out" instead of something more meaningful. This option is not recommended.
UnixFromLine=fromline [$l macro] Defines the format used when sendmail must add a UNIX-style From_ line (that is, a line beginning "From<space>user"). Defaults to "From $g $d". Do not change this unless your system uses a different UNIX mailbox format.
UnsafeGroupWrites [no short name] If set, :include: and .forward files that are group writable are considered "unsafe", that is, they cannot reference programs or write directly to files. World writable :include: and .forward files are always unsafe. This option is valid for sendmail version 8.8 and above.
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 causes sendmail to violate RFC 1123. This option is not recommended.
Verbose [v] Run in verbose mode. If this is set, sendmail adjusts options HoldExpensive (old c) and DeliveryMode (old d) so that all mail is delivered completely in a single job so that you can see the entire delivery process. Option Verbose should never be set in the configuration file; it is intended for command line use only.

All options can be specified on the command line using the -O or -o flag, but most will cause sendmail to relinquish its setuid permissions. The options that will not cause this are MinFreeBlocks [b], DeliveryMode [d], ErrorMode [e], IgnoreDots [i], LogLevel [L], MeToo [m], OldStyleHeaders [o], PrivacyOptions [p], Timeouts [r], SuperSafe [s], Verbose [v], CheckpointInterval [C], and SevenBitInput [7]. Also, M (define macro) when defining the r or s macros is also considered "safe."

Note: The ServicesSwitchFile option is not supported. AIX sendmail uses AIX name resolution, which means that it uses either /etc/netsvc.conf, the NSORDER environment variable, or the default name resolution (DNS). If you do not want sendmail to use the DNS, you must specify the type of name resolution to use in either /etc/netsvc.conf or the NSORDER environment variable (for example, NSRODER=local). For more information, see "Name Resolution" in the TCP/IP chapter of AIX Version 4.3 System Management Guide: Communications and Networks

sendmail.cf File Options (for AIX Version 3.2.5 or AIX Version 4.1)

Set configuration options for the sendmail command by using a control line in the configuration file. The options are the same as those specified with the sendmail command and the -o flag. Name an option with a single character; for example:

OOption[Value]

Where Option is a single-character name for the option being set. Value is either a string, an integer, a time interval, or a Boolean option. Values for a Boolean option are t, T, y, Y for a true value and f or F for a false value. If you do not specify a value for a Boolean option, the default is true.

The options supported are as follows:

AFile Uses the File specified as the alias file.
bCodeSet Specifies the National Language Support code set of the network in Japanese environments. The sendmail command converts mail to or from the code set of the network from or to the code set of the locale. For NLS code set values see, "Understanding ISO Code Sets" or "Understanding IBM PC Code Sets" in AIX Kernel Extensions and Device Support Programming Concepts.
BCharacter Sets the blank substitution Character. In addresses, the sendmail command replaces spaces without quotes with the specified Character. The supplied configuration file uses a . (period) for the value of the Character variable. This option prohibits the sendmail command from receiving messages through SMTP. The sendmail command cannot recognize the end of the message, a . (period), when receiving messages through SMTP.
c Causes the sendmail command to queue messages without sending them if an outgoing mailer is marked as expensive to use. The queue can be run when costs are lower or when the queue is large enough to send the message efficiently.
d The sendmail command operates in several delivery modes. The default configuration file sets the delivery mode to b (the default value). However, you can change the Od delivery mode with the OdValue option in the configuration file. This mode specifies how promptly mail is delivered. Value can be:
i Delivers interactively
b Delivers in background (the default)
q Queues the message and delivers during queue run.
e 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
w Write back errors (mail if user not logged in)
e Mail back errors and give zero exit stat always
ETimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the local SMTP protocol waits, after sending the rcpt command, for a reply from the remote SMTP protocol.
f Saves From lines at the front of messages. These lines are normally discarded.
FValue Sets the file mode for temporary files created by sendmail in the queue directory. Value is an octal file mode value. The default temporary file mode is 0660.
gNumber Sets the default group ID to the value specified by the Number variable.
GTimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the SMTP protocol waits for completion of sending data.
h The sendmail Oh option limits the number of alternate addresses tried for multihomed hosts. Without the option, only the first address is tried. The format for this option is:
OhNumber

The Number variable specifies the number of alternate addresses to be tried.

i Does not interpret a . (period) on a line by itself as a message terminator. This option prohibits the sendmail command from receiving messages through SMTP. The sendmail command cannot recognize the end of the message, a . (period), when receiving messages through SMTP.
I Treats a failure to connect to the name server as a temporary error. The message is queued and delivery can be retried later.
J Allows spaces as well as tabs to separate the left-hand side and right-hand side of rewrite rules. This option allows rewrite rules to be modified using an editor that replaces tabs with spaces.
k Prevents character-set conversions for outgoing mail messages. Any National Language Support (NLS) extended characters are sent to other systems intact.
K[Value] Sets the types of name server resource records that the sendmail command uses to resolve recipient addresses. If using more than one KValue option, separate them with a space. Value can be:
MB Uses mailbox (MB) records to resolve recipient user names.
MG Uses mail group (MG) records to resolve recipient user names.
MR Uses mail rename (MR) records to resolve recipient user names.
MX Uses mail exchanger (MX) records to resolve recipient users.
ANY Query for ANY records.
ALL Uses all of the above.
lFile Sets the National Language Support (NLS) configuration file to File.
m Sends messages to the sender if the sender appears in an alias expansion of a recipient address. The default action removes the sender's address from recipient alias expansions.
MMacro Value Defines the Macro variable as the Value specified. This option is normally used from the sendmail command line only.
n Validates the right-hand side of alias definitions when performing the newaliases function.
o Indicates that this message can have old-style headers. Without this option, the message has new style headers (commas instead of spaces between addresses). If this option is set, an adaptive algorithm correctly determines the header format in most cases.
OCodeSet Specifies the National Language Support code set of the local site in Japanese environments. The sendmail command converts mail to or from the code set of the locale to or from the code set of the network. For NLS code set values see, "Understanding ISO Code Sets" or "Understanding IBM PC Code Sets" in AIX Kernel Extensions and Device Support Programming Concepts.
pMapName Sets the map name of NIS aliases when using NIS. If mail aliases are not found in the local /etc/aliases file, a search begins in a domainwide NIS database, usually located on a central machine.
PAddress Identifies the Address to receive a copy of all returned mail.
qValue Use value as the multiplier in the map function to decide when to just queue up jobs rather than run them. This value is divided by the difference between the current load average and the load average limit (x option) to determine the maximum message priority that will be sent. Defaults to 600000.
QDirectory Sets the directory for queuing messages. A directory is created if one does not exist.
RTimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the local SMTP protocol waits, after sending the data command, for a reply from the remote SMTP protocol.
s Enqueues messages before delivery, even during immediate delivery mode.
SFile Specifies the path name of the File where the sendmail command stores data about delivered and received messages. Statistics are only collected if the file exists. This file must be created by the user.
uNumber Sets the default user ID to the value specified by the Number variable.
UTimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the local SMTP protocol waits for the 220 greeting message from the remote SMTP protocol.
v Runs in verbose mode.
VTimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the local SMTP protocol waits, after sending the mail command, for a reply from the remote SMTP protocol.
w Causes all incoming mail that has 8-bit characters to be treated as ISO-8859/1 mail. These characters are converted to the equivalent National Language Support (NLS) extended characters.
WTimeValue To comply with RFC 1123, which specifies per-command time-outs for the SMTP protocol, uncomment this line in the /etc/sendmail.cf configuration file, where TimeValue is the length of time the local SMTP protocol waits, after sending the mail termination . (period) command, for a reply from the remote SMTP protocol.
x=Value When the system load average exceeds value, just queue messages (do not try to send them). Defaults to 8.
X=Value When the system load average exceeds value, refuse incoming SMTP connections. Defaults to 12.
y=Value The indicated value is added to the priority (thus lowering the priority of the job) for each recipient. That is, this value penalizes jobs with large numbers of recipients. Defaults to 30000.
Y Delivers each message in the mail queue from a separate process. This option is not required. If used, the option increases overhead in the workstation environment. In addition, unavailable destination hosts may be retried during a queue run.
+ Turns on secure SMTP. When enabled, this option disables the VRFY and EXPN commands. These commands are required and do run, but they echo their argument back to the user rather than expanding the argument to indicate whether it is valid or invalid.
- Turns on SMTP security logging. When enabled, any use of the VRFY and EXPN commands is logged, even if the commands are disabled by the + option. Any invalid user given to the RCPT command is also logged. The log message is sent to syslogd as a mail.warning message. The message includes the date, time, user's hostname, command, and argument given to SMTP.

Implementation Specifics

This sendmail.cf file is part of Base Operating System (BOS) Runtime.

Files

/etc/sendmail.cf Specifies the path of the sendmail.cf file.
/etc/passwd Contains basic user attributes.
/etc/aliases Contains alias definitions for the sendmail command.

Related Information

The sendmail command.

The /etc/passwd file.


[ Previous | Next | Contents | Glossary | Home | Search ]