Chapter 24. The O (Options) Configuration Command

Options affect the operation of the sendmail program. Options can be specified in the command line, in the sendmail.cf file, and in the mc configuration file. Options can change, tune, or affect:

  • Locations of all the other files that sendmail needs to access, such as the aliases file.

  • Locations of queue directories and the use of queue groups.

  • Time limits that should be applied to the TTL in the queue, the length of time to wait for an SMTP connection, and so on.

  • Default permissions for files and the default user and group identities to use when not running as another user.

  • Degree of privacy desired, such as what kinds of inquiry to reject or who can examine the queue.

  • Modes of behavior, such as always queuing or running as a daemon and listening for incoming connections.

  • Limits that should be placed on system resources. Should one queue only under high load? Should one reserve minimal space in the queue?

  • Small bits of sendmail’s behavior, such as allowing colons to appear in addresses and stripping newlines from sender addresses.

Most options are preset in your sendmail.cf file to be appropriate for your site. Those that need local definitions will usually be indicated by comments.[357] Some sites, especially those that have high mail loads or those connected to many different networks, will need to tune many of the options according to their unique needs.

Overview

Options are declared in the configuration file by beginning a line with the letter O:

OQ/var/spool/mqueue                     ← single-character name (prior to V8.7)

Prior to V8.7 sendmail, option names could be only a single character. The short (single-character) name of the option (here, Q) immediately follows the O with no intervening space. The value assigned to a single-character option immediately follows the option letter with no intervening space.

Beginning with V8.7 sendmail, option names can be composed of multiple characters:

O QueueDirectory=/var/spool/mqueue      ← multicharacter name (beginning with V8.7)exactly one space

To use multicharacter names, you must separate the name (here, QueueDirectory) from the O command with exactly one space character.[358] The value assigned to the multicharacter option follows an equals sign. The equals sign can be surrounded by optional spaces.

Some options have both a single- and a multicharacter name, in which case the two names are equivalent, and the modern multicharacter name is preferred:

OQ/var/spool/mqueue                     ← define location of queue directory
O QueueDirectory=/var/spool/mqueue      ← the same and preferred

The short name is retained so that old configuration files will still work with newer versions of sendmail. They should, however, be considered deprecated, and support for them might disappear in future releases of sendmail. Most options (especially the newer ones) have only multicharacter names:

O ServiceSwitchFile=/etc/service.switch       ← only multicharacter form available

The values for some options are strings (such as /tmp). The values for others can be numbers (such as 3), time durations (such as 3d for three days), or a boolean value (such as True). There are no hard rules for which type of value goes with which option. Instead, you’ll need to look up each option in Table 24-4 on page 959 and use the type indicated there.

Command-Line Options

Beginning with V8.7 sendmail, command-line options can have multicharacter option names. Prior to V8.7, only single-character names were allowed. We describe the old form first, and then the new.

Pre-V8.7 Command-Line Option Declarations

Prior to V8.7, option names that are declared on the command line could be only a single character long:

-oXargumentprior to V8.7

The -o switch (lowercase o) is immediately followed (with no intervening space) by the one-letter name of the option (here, X). The one-letter names are case-sensitive (x is not the same as X). Depending on the option selected, an argument might be required. If that argument is present, it must immediately follow the option name with no intervening space. Only one option can be specified for each -o switch.

Under V8 sendmail, a space can appear between the -o and the X, but no space can exist between the X and its argument. This is because V8 sendmail uses getopt(3) to parse its command line.

If an unknown single-character option name is used, sendmail will print and log the following error:

readcf: unknown option name 0x31

Here, the unknown character was a 1, printed in hexadecimal notation.

Multicharacter Command-Line Options

Beginning with V8.7, option names can be single-character or multicharacter. Single-character options are declared with the -o (lowercase) switch as described earlier. Multicharacter options, which are preferred, are declared with a -O (uppercase) switch:

-OLongName=argument       ← beginning with V8.7uppercase

Space can optionally exist between the -O and the LongName. In the command line, space cannot exist between the LongName, the =, and the argument unless they are quoted:

-O "LongName = argument"

Only one option can be specified for each -O switch.

The sendmail program ignores case when it considers multicharacter names. Therefore, the following three command lines have the same effect, and none produces an error:

-OQueueDirectory=/var/spool/mqueue
-Oqueuedirectory=/var/spool/mqueue
-OQuEuEdIrEcToRy=/var/spool/mqueue

Multicharacter names are beneficial because they allow option names to have mnemonic recognition. For example, the multicharacter name ForwardPath, which lists the default path for ~/.forward files, is much more recognizable than the single-character name J.

If an unknown multicharacter option name is specified, the following is logged and printed:

readcf: unknown option name bad name here

Multicharacter name shorthand

Beginning with V8.7, multicharacter names in the command line can be specified by using the fewest unique leftmost characters in the name. For example, you can specify the queue directory with the complete QueueDirectory long name:

% /usr/sbin/sendmail -OQueueDirectory=/var/spool/mqueue

But if you need to run this command line frequently,[359] you might find it handy to use an abbreviation:

% /usr/sbin/sendmail -OQueueDir=/var/spool/mqueue
Option QueueDir used as abbreviation for QueueDirectory

Whenever a multicharacter name is abbreviated, sendmail prints a warning (the second line in the preceding example) to discourage you from using abbreviations inside your configuration file. It will also warn you if you specify too few leftmost letters:

% /usr/sbin/sendmail -OQueue=/var/spool/mqueue
readcf: ambiguous option name Queue (matches QueueFactor and QueueDirectory)

If you misspell the single-character or multicharacter name, the following error is printed, and the option declaration is skipped:

% /usr/sbin/sendmail -OQueDirectory=/var/spool/mqueue
readcf: unknown option name QueDirectory

Although these abbreviations can be handy on command lines, it is vital that you always use nonabbreviated names in your configuration file. New options will be added to sendmail over time, and the use of abbreviations can lead to future unexpected or ambiguous effects.

Appropriateness of Options

Some options are intended for use only on the command line and make little or no sense when used in the configuration file. Options that are inappropriate in the configuration file are shown in Table 24-1.

Table 24-1. Options inappropriate to the configuration file

Option name

 

§

Description

IgnoreDots

(i)

IgnoreDots on page 1038

Ignore dots. If you need to use this option, use the -i command-line switch (see -i on page 243) to set it.

(no long name)

(M)

M on page 1118

Define a macro. Use the D configuration command instead (see Configuration-File Definitions on page 787).

Verbose

(v)

Verbose on page 1117

Run in verbose mode. Instead use the -v command-line switch (see -v on page 249).

Options That Are Safe

Security considerations normally require that sendmail give up any special privileges for most command-line options specified by the ordinary user. But the ordinary user can specify a few options that allow sendmail to keep its special privilege. Those options are called “safe” and are shown in Table 24-2.

Table 24-2. Options that are safe

Option name

 

§

Description

AllowBogusHELO

 

AllowBogusHELO on page 974

Allow no-host with HELO or EHLO.

BadRcptThrottle

 

BadRcptThrottle on page 979

Slow excess bad RCPT To: commands.

CheckpointInterval

(C)

CheckpointInterval on page 983

Checkpoint the queue.

ColonOkInAddr

 

ColonOkInAddr on page 986

Allow colons in addresses.

DefaultCharSet

 

DefaultCharSet on page 1000

Define Content-Type: character set.

DeliveryMode

(d)

DeliveryMode on page 1004

Set delivery mode.

DialDelay

 

DialDelay on page 1007

Delay after connect failure.

EightBitMode

(8)

EightBitMode on page 1025

How to convert MIME input.

ErrorMode

(e)

ErrorMode on page 1028

Specify mode of error handling.

IgnoreDots

(i)

IgnoreDots on page 1038

Ignore leading dots in messages.

LogLevel

(L)

LogLevel on page 1040

Set (increase) logging level.[a]

MaxQueueRunSize

 

MaxQueueRunSize on page 1050

Maximum queue messages processed.

MaxRecipientsPerMessage

 

MaxRecipientsPerMessage on page 1050

Maximum recipients per envelope.

MeToo

(m)

MeToo on page 1051

Send to me too.

MinFreeBlocks

(b)

MinFreeBlocks on page 1057

Define minimum free disk blocks.

MinQueueAge

 

MinQueueAge on page 1057

Skip queue file if too young.

NoRecipientAction

 

NoRecipientAction on page 1060

How to handle no recipients in header.

OldStyleHeaders

(o)

OldStyleHeaders on page 1061

Allow spaces in recipient lists.

PrivacyOptions

(p)

PrivacyOptions on page 1065

Increase privacy of the daemon.

QueueSortOrder

 

QueueSortOrder on page 1073

How to presort queue.

SendMimeErrors

(j)

SendMimeErrors on page 1086

Return MIME format errors.

SevenBitInput

(7)

SevenBitInput on page 1090

Force 7-bit input.

SingleLineFromHeader

 

SingleLineFromHeader on page 1092

Strip newlines from From: headers.

SuperSafe

(s)

SuperSafe on page 1096

Queue everything just in case.

Verbose

(v)

Verbose on page 1117

Run in verbose mode.

[a] * V8.7.3 was accidentally released with the LogLevel option marked as not safe.

For example, the AliasFile option (location of the aliases file) is unsafe (and is not in Table 24-2). If you were to send mail by specifying a new location with the AliasFile option, sendmail would change its identity from root to an ordinary user (you), thus preventing sendmail from being able to queue its mail:

/var/spool/mqueue: Permission denied

Note that prior to V8.8.4, the DontInitGroups and TryNullMXList options were wrongly set to safe. This is yet another reason to always upgrade to the latest version of sendmail.

Configuration File Options

Beginning with V8.7 sendmail, configuration file options can use multicharacter option names. Prior to V8.7, only single characters were allowed. We describe the old form first, and then the new.

Pre-V8.7 Configuration File Declarations

The old form for an option command in the sendmail.cf file is:

OXargumentprior to V8.7

Like all configuration commands, the uppercase letter O must begin the line. It is immediately followed (with no intervening space) by another single letter, which selects a specific option. Uppercase letters are distinct from lowercase for single-character option names (that is, X is different from x). Depending on the option selected, an argument might be required. There must be no intervening space between the single-character option name and its argument.

Single-character option names should be considered deprecated in favor of the more modern multicharacter option names.

V8.7 Configuration File Declarations

Beginning with V8.7, option names can be single-character or multicharacter. A space is used to differentiate between single-character and multicharacter (long) names:

O LongName=argument       ←  beginning with V8.7a space (not a tab)

Whenever the O configuration command is followed by a space (not a tab), everything following that space is taken as the declaration of a multicharacter option. Unlike single-letter option names, multicharacter names are interpreted by sendmail without regard to case. Therefore, the following three examples all produce the same effect:

O QueueDirectory=/var/spool/mqueue
O queuedirectory=/var/spool/mqueue
O QuEuEdIrEcToRy=/var/spool/mqueue

Optional space (not tab) characters can surround the = character:

O QueueDirectory = /var/spool/mqueue
                ↑ ↑
               spaces, not tabs

Multicharacter names in the configuration file ought not be abbreviated or expressed in shorthand:

O QueueDirectory=/var/spool/mqueue     ← good
O QueueDir=/var/spool/mqueue          ← bad, but allowed

Failure to use the full multicharacter name will cause sendmail to print spurious warnings every time it is run. The possible warnings are listed in Multicharacter name shorthand on page 950.

Options in the mc File

When you create a configuration file with the mc configuration technique (see Chapter 17 on page 584), you can tune each option by including an appropriate statement in your .mc configuration file:[360]

define(`option',`value')enclose in opposing single quotes
define(`confAUTO_REBUILD',`True')   ← for example
DAEMON_OPTIONS(`Port=1097')         ← for example

The option is selected from one of the mc option names shown in the leftmost column of Table 24-3. The value is an appropriate value for that option, as described in the reference section at the end of this chapter. Note that the option and the value should each be enclosed in opposing single quotes to prevent m4 from wrongly recognizing either as a keyword or macro. The leftmost single quote is the reverse apostrophe, and the rightmost is the normal apostrophe.

Table 24-3. All option mc macros ordered by name

mc name

Option name

§

ALIAS_FILE

AliasFile

AliasFile on page 970

CLIENT_OPTIONS( )

ClientPortOptions

ClientPortOptions on page 986

confALIAS_WAIT

AliasWait

AliasWait on page 973

confALLOW_BOGUS_HELO

AllowBogusHELO

AllowBogusHELO on page 974

confAUTH_MAX_BITS

AuthMaxBits

AuthMaxBits on page 975

confAUTH_MECHANISMS

AuthMechanisms

AuthMechanisms on page 975

confAUTH_OPTIONS

AuthOptions

AuthOptions on page 977

confAUTH_REALM

AuthRealm

AuthRealm on page 978

confAUTO_REBUILD

AutoRebuildAliases

AutoRebuildAliases on page 978

confBAD_RCPT_THROTTLE

BadRcptThrottle

BadRcptThrottle on page 979

confBIND_OPTS

ResolverOptions

ResolverOptions on page 1080

confBLANK_SUB

BlankSub

BlankSub on page 980

confCACERT

CACertFile

CACertFile on page 981

confCACERT_PATH

CACertPath

CACertPath on page 982

confCHECKPOINT_INTERVAL

CheckpointInterval

CheckpointInterval on page 983

confCHECK_ALIASES

CheckAliases

CheckAliases on page 982

confCLIENT_CERT

ClientCertFile

ClientCertFile on page 984

confCLIENT_KEY

ClientKeyFile

ClientKeyFile on page 985

confCLIENT_OPTIONS (deprecated)

ClientPortOptions

ClientPortOptions on page 986

confCOLON_OK_IN_ADDR

ColonOkInAddr

ColonOkInAddr on page 986

confCONNECTION_RATE_THROTTLE

ConnectionRateThrottle

ConnectionRateThrottle on page 988

confCONNECTION_RATE_WINDOW_SIZE

ConnectionRateWindowSize

ConnectionRateWindowSize on page 989

confCONNECT_ONLY_TO

ConnectOnlyTo

ConnectOnlyTo on page 990

confCONTROL_SOCKET_NAME

ControlSocketName

ControlSocketName on page 990

confCON_EXPENSIVE

HoldExpensive

HoldExpensive on page 1036

confCOPY_ERRORS_TO

PostmasterCopy

PostmasterCopy on page 1064

confCRL

CRLFile

CRLFile on page 992

confDAEMON_OPTIONS (deprecated); use DAEMON_OPTIONS()

DaemonPortOptions

DaemonPortOptions on page 993

confDEAD_LETTER_DROP

DeadLetterDrop

DeadLetterDrop on page 998

confDEF_AUTH_INFO

DefaultAuthInfo

DefaultAuthInfo on page 999

confDEF_CHAR_SET

DefaultCharSet

DefaultCharSet on page 1000

confDEF_USER_ID

DefaultUser

DefaultUser on page 1000

confDELAY_LA

DelayLA

DelayLA on page 1002

confDELIVERY_MODE

DeliveryMode

DeliveryMode on page 1004

confDELIVER_BY_MIN

DeliverByMin

DeliverByMin on page 1003

confDF_BUFFER_SIZE

DataFileBufferSize

DataFileBufferSize on page 998

confDH_PARAMETERS

DHParameters

DHParameters on page 1006

confDIAL_DELAY

DialDelay

DialDelay on page 1007

confDIRECT_SUBMISSION_MODIFIERS

DirectSubmissionModifiers

DirectSubmissionModifiers on page 1008

confDONT_BLAME_SENDMAIL

DontBlameSendmail

DontBlameSendmail on page 1009

confDONT_EXPAND_CNAMES

DontExpandCnames

DontExpandCnames on page 1022

confDONT_INIT_GROUPS

DontInitGroups

DontInitGroups on page 1023

confDONT_PROBE_INTERFACES

DontProbeInterfaces

DontProbeInterfaces on page 1023

confDONT_PRUNE_ROUTES

DontPruneRoutes

DontPruneRoutes on page 1024

confDOUBLE_BOUNCE_ADDRESS

DoubleBounceAddress

DoubleBounceAddress on page 1025

confEIGHT_BIT_HANDLING

EightBitMode

EightBitMode on page 1025

confERROR_MESSAGE

ErrorHeader

ErrorHeader on page 1027

confERROR_MODE

ErrorMode

ErrorMode on page 1028

confFALLBACK_MX

FallbackMXhost

FallbackMXhost on page 1030

confFALLBACK_SMARTHOST

FallBackSmartHost

FallBackSmartHost on page 1031

confFAST_SPLIT

FastSplit

FastSplit on page 1032

confFORWARD_PATH

ForwardPath

ForwardPath on page 1034

confFROM_LINE

UnixFromLine

UnixFromLine on page 1113

confHELO_NAME

HeloName

HeloName on page 1034

confHOSTS_FILE

HostsFile

HostsFile on page 1037

confHOST_STATUS_DIRECTORY

HostStatusDirectory

HostStatusDirectory on page 1037

confIGNORE_DOTS

IgnoreDots

IgnoreDots on page 1038

confINPUT_MAIL_FILTERS

InputMailFilters

InputMailFilters on page 1039

confLDAP_DEFAULT_SPEC

LDAPDefaultSpec

LDAPDefaultSpec on page 1039

confLOG_LEVEL

LogLevel

LogLevel on page 1040

confMAILBOX_DATABASE

MailboxDatabase

MailboxDatabase on page 1042

confMATCH_GECOS

MatchGECOS

MatchGECOS on page 1043

confMAX_ALIAS_RECURSION

MaxAliasRecursion

MaxAliasRecursion on page 1044

confMAX_DAEMON_CHILDREN

MaxDaemonChildren

MaxDaemonChildren on page 1044

confMAX_HEADERS_LENGTH

MaxHeadersLength

MaxHeadersLength on page 1045

confMAX_HOP

MaxHopCount

MaxHopCount on page 1046

confMAX_MESSAGE_SIZE

MaxMessageSize

MaxMessageSize on page 1047

confMAX_MIME_HEADER_LENGTH

MaxMimeHeaderLength

MaxMimeHeaderLength on page 1047

confMAX_NOOP_COMMANDS

MaxNOOPCommands

MaxNOOPCommands on page 1048

confMAX_QUEUE_CHILDREN

MaxQueueChildren

MaxQueueChildren on page 1049

confMAX_QUEUE_RUN_SIZE

MaxQueueRunSize

MaxQueueRunSize on page 1050

confMAX_RCPTS_PER_MESSAGE

MaxRecipientsPerMessage

MaxRecipientsPerMessage on page 1050

confMAX_RUNNERS_PER_QUEUE

MaxRunnersPerQueue

MaxRunnersPerQueue on page 1051

confMCI_CACHE_SIZE

ConnectionCacheSize

ConnectionCacheSize on page 987

confMCI_CACHE_TIMEOUT

ConnectionCacheTimeout

ConnectionCacheTimeout on page 988

confMESSAGE_TIMEOUT (deprecated)

QueueTimeout

QueueTimeout on page 1075

confME_TOO

MeToo

MeToo on page 1051

confMILTER_LOG_LEVEL

Milter.LogLevel

Milter.LogLevel on page 1053

confMILTER_MACROS_CONNECT

Milter.macros.connect

Milter.macros.connect on page 1054

confMILTER_MACROS_ENVFROM

Milter.macros.envfrom

Milter.macros.envfrom on page 1054

confMILTER_MACROS_ENVRCPT

Milter.macros.envrcpt

Milter.macros.envrcpt on page 1055

confMILTER_MACROS_DATA

Milter.macros.data

Milter.macros.data on page 1055

confMILTER_MACROS_EOH

Milter.macros.eoh

Milter.macros.eoh on page 1056

confMILTER_MACROS_EOM

Milter.macros.eom

Milter.macros.eom on page 1056

confMILTER_MACROS_HELO

Milter.macros.helo

Milter.macros.connect on page 1054

confMIME_FORMAT_ERRORS

SendMimeErrors

SendMimeErrors on page 1086

confMIN_FREE_BLOCKS

MinFreeBlocks

MinFreeBlocks on page 1057

confMIN_QUEUE_AGE

MinQueueAge

MinQueueAge on page 1057

confMUST_QUOTE_CHARS

MustQuoteChars

MustQuoteChars on page 1058

confNICE_QUEUE_RUN

NiceQueueRun

NiceQueueRun on page 1059

confNO_RCPT_ACTION

NoRecipientAction

NoRecipientAction on page 1060

confOLD_STYLE_HEADERS

OldStyleHeaders

OldStyleHeaders on page 1061

confOPERATORS

OperatorChars

OperatorChars on page 1062

confPID_FILE

PidFile

PidFile on page 1063

confPRIVACY_FLAGS

PrivacyOptions

PrivacyOptions on page 1065

confPROCESS_TITLE_PREFIX

ProcessTitlePrefix

ProcessTitlePrefix on page 1069

confQUEUE_FACTOR

QueueFactor

QueueFactor on page 1071

confQUEUE_FILE_MODE

QueueFileMode

QueueFileMode on page 1071

confQUEUE_LA

QueueLA

QueueLA on page 1072

confQUEUE_SORT_ORDER

QueueSortOrder

QueueSortOrder on page 1073

confRAND_FILE

RandFile

RandFile on page 1076

confREAD_TIMEOUT (deprecated)

Timeout

Timeout on page 1097

confREFUSE_LA

RefuseLA

RefuseLA on page 1078

confREJECT_LOG_INTERVAL

RejectLogInterval

RejectLogInterval on page 1079

confREQUIRES_DIR_FSYNC

RequiresDirFsync

RequiresDirFsync on page 1082

confRRT_IMPLIES_DSN

RrtImpliesDsn

RrtImpliesDsn on page 1083

confRUN_AS_USER

RunAsUser

RunAsUser on page 1083

confSAFE_FILE_ENV

SafeFileEnvironment

SafeFileEnvironment on page 1084

confSAFE_QUEUE

SuperSafe

SuperSafe on page 1096

confSAVE_FROM_LINES

SaveFromLine

SaveFromLine on page 1085

confSEPARATE_PROC

ForkEachJob

ForkEachJob on page 1033

confSERVER_CERT

ServerCertFile

ServerCertFile on page 1087

confSERVER_KEY

ServerKeyFile

ServerKeyFile on page 1088

confSERVICE_SWITCH_FILE

ServiceSwitchFile

ServiceSwitchFile on page 1088

confSEVEN_BIT_INPUT

SevenBitInput

SevenBitInput on page 1090

confSHARED_MEMORY_KEY

SharedMemoryKey

SharedMemoryKey on page 1090

confSHARED_MEMORY_KEY_FILE

SharedMemoryKeyFile

SharedMemoryKeyFile on page 1091

confSINGLE_LINE_FROM_HEADER

SingleLineFromHeader

SingleLineFromHeader on page 1092

confSINGLE_THREAD_DELIVERY

SingleThreadDelivery

SingleThreadDelivery on page 1092

confSMTP_LOGIN_MSG

SmtpGreetingMessage

SmtpGreetingMessage on page 1093

confSOFT_BOUNCE

SoftBounce

SoftBounce on page 1094

confTEMP_FILE_MODE

TempFileMode

TempFileMode on page 1097

confTIME_ZONE

TimeZoneSpec

TimeZoneSpec on page 1110

confTLS_SRV_OPTIONS

TLSSrvOptions

TLSSrvOptions on page 1111

confTO_ACONNECT

Timeout.aconnect

Timeout.aconnect (V8.12 and later) on page 1099

confTO_AUTH

Timeout.auth

Timeout.auth (V8.12 and later) on page 1100

confTO_COMMAND

Timeout.command

Timeout.command (V8.6 and later) on page 1100

confTO_CONNECT

Timeout.connect

Timeout.connect (V8.6 and later) on page 1101

confTO_CONTROL

Timeout.control

Timeout.control (V8.10 and later) on page 1101

confTO_DATABLOCK

Timeout.datablock

Timeout.datablock (V8.6 and later) on page 1101

confTO_DATAFINAL

Timeout.datafinal

Timeout.datafinal (V8.6 and later) on page 1102

confTO_DATAINIT

Timeout.datainit

Timeout.datainit (V8.6 and later) on page 1102

confTO_FILEOPEN

Timeout.fileopen

Timeout.fileopen (V8.7 and later) on page 1102

confTO_HELO

Timeout.helo

Timeout.helo (V8.6 and later) on page 1102

confTO_HOSTSTATUS

Timeout.hoststatus

Timeout.hoststatus (V8.8 and later) on page 1103

confTO_ICONNECT

Timeout.iconnect

Timeout.iconnect (V8.8 and later) on page 1103

confTO_IDENT

Timeout.ident

Timeout.ident (V8.6 and later) on page 1104

confTO_INITIAL

Timeout.initial

Timeout.initial (V8.6 and later) on page 1104

confTO_LHLO

Timeout.lhlo

Timeout.lhlo (V8.12 and later) on page 1105

confTO_MAIL

Timeout.mail

Timeout.mail (V8.6 and later) on page 1105

confTO_MISC

Timeout.misc

Timeout.misc (V8.6 and later) on page 1105

confTO_QUEUERETURN

Timeout.queuereturn

Timeout.queuereturn (V8.7 and later) on page 1106

confTO_QUEUERETURN_DSN

Timeout.queuereturn.dsn

Timeout.queuereturn (V8.7 and later) on page 1106

confTO_QUEUERETURN_NONURGENT

Timeout.queuereturn.non-urgent

Timeout.queuereturn (V8.7 and later) on page 1106

confTO_QUEUERETURN_NORMAL

Timeout.queuereturn.normal

Timeout.queuereturn (V8.7 and later) on page 1106

confTO_QUEUERETURN_URGENT

Timeout.queuereturn.urgent

Timeout.queuereturn (V8.7 and later) on page 1106

confTO_QUEUEWARN

Timeout.queuewarn

Timeout.queuewarn (V8.7 and later) on page 1107

confTO_QUEUEWARN_DSN

Timeout.queuewarn.dsn

Timeout.queuewarn (V8.7 and later) on page 1107

confTO_QUEUEWARN_NONURGENT

Timeout.queuewarn.non-urgent

Timeout.queuewarn (V8.7 and later) on page 1107

confTO_QUEUEWARN_NORMAL

Timeout.queuewarn.normal

Timeout.queuewarn (V8.7 and later) on page 1107

confTO_QUEUEWARN_URGENT

Timeout.queuewarn.urgent

Timeout.queuewarn (V8.7 and later) on page 1107

confTO_QUIT

Timeout.quit

Timeout.quit (V8.6 and later) on page 1108

confTO_RCPT

Timeout.rcpt

Timeout.rcpt (V8.6 and later) on page 1108

confTO_RESOLVER_RETRANS

Timeout.resolver.retrans

Timeout.resolver (V8.10 and later) on page 1108

confTO_RESOLVER_RETRANS_FIRST

Timeout.resolver.retrans.first

Timeout.resolver (V8.10 and later) on page 1108

confTO_RESOLVER_RETRANS_NORMAL

Timeout.resolver.retrans.normal

Timeout.resolver (V8.10 and later) on page 1108

confTO_RESOLVER_RETRY

Timeout.resolver.retry

Timeout.resolver (V8.10 and later) on page 1108

confTO_RESOLVER_RETRY_FIRST

Timeout.resolver.retry.first

Timeout.resolver (V8.10 and later) on page 1108

confTO_RESOLVER_RETRY_NORMAL

Timeout.resolver.retry.normal

Timeout.resolver (V8.10 and later) on page 1108

confTO_RSET

Timeout.rset

Timeout.rset (V8.6 and later) on page 1109

confTO_STARTTLS

Timeout.starttls

Timeout.starttls (V8.12 and later) on page 1110

confTRUSTED_USER

TrustedUser

TrustedUser on page 1112

confTRY_NULL_MX_LIST

TryNullMXList

TryNullMXList on page 1112

confUNSAFE_GROUP_WRITES (deprecated)

UnsafeGroupWrites

UnsafeGroupWrites on page 1114

confUSERDB_SPEC

UserDatabaseSpec

UserDatabaseSpec on page 1116

confUSE_ERRORS_TO

UseErrorsTo

UseErrorsTo on page 1115

confUSE_MSP

UseMSP

UseMSP on page 1115

confWORK_CLASS_FACTOR

ClassFactor

ClassFactor on page 984

confWORK_RECIPIENT_FACTOR

RecipientFactor

RecipientFactor on page 1077

confWORK_TIME_FACTOR

RetryFactor

RetryFactor on page 1081

confXF_BUFFER_SIZE

XscriptFileBufferSize

XscriptFileBufferSize on page 1117

DAEMON_OPTIONS( )

DaemonPortOptions

DaemonPortOptions on page 993

HELP_FILE

HelpFile

HelpFile on page 1035

INPUT_MAIL_FILTER( )

InputMailFilters

InputMailFilters on page 1039

QUEUE_DIR

QueueDirectory

QueueDirectory on page 1070

STATUS_FILE

StatusFile

StatusFile on page 1095

Alphabetical Table of All Options

In this section, we present a table of all options in alphabetical order. The leftmost column of Table 24-4 lists the multicharacter names first and then the old single-character names. The types of arguments that options are explained in the next section.

Table 24-4. All options ordered by option name

Option name

 

§

Description

AliasFile

(A)

AliasFile on page 970

Define the locations of the aliases files.

AliasWait

(a)

AliasWait on page 973

Wait for aliases file rebuild.

AllowBogusHELO

 

AllowBogusHELO on page 974

Allow no host with HELO or EHLO SMTP command.

AuthMaxBits

 

AuthMaxBits on page 975

Limit max encryption strength for SASL and STARTTLS.

AuthMechanisms

 

AuthMechanisms on page 975

The AUTH mechanisms.

AuthOptions

 

AuthOptions on page 977

Tune authentication parameters.

AuthRealm

 

AuthRealm on page 978

Cyrus SASL authentication realm.

AutoRebuildAliases

(D)

AutoRebuildAliases on page 978

Auto-rebuild the aliases database (V8.11 and earlier) (deprecated).

BadRcptThrottle

 

BadRcptThrottle on page 979

Slow excess bad RCPT To: commands.

BlankSub

(B)

BlankSub on page 980

Set unquoted space replacement character.

CACertFile

 

CACertFile on page 981

File containing certificate authority certs.

CACertPath

 

CACertPath on page 982

Directory with certificate authority certs.

CheckAliases

(n)

CheckAliases on page 982

Check RHS of aliases.

CheckpointInterval

(C)

CheckpointInterval on page 983

Checkpoint the queue.

ClassFactor

(z)

ClassFactor on page 984

Multiplier for priority increments.

ClientCertFile

 

ClientCertFile on page 984

File containing the client’s public certificate.

ClientKeyFile

 

ClientKeyFile on page 985

File with the client certificate’s private key.

ClientPortOptions

 

ClientPortOptions on page 986

Client port option settings.

ColonOkInAddr

 

ColonOkInAddr on page 986

Allow colons in addresses.

ConnectionCacheSize

(k)

ConnectionCacheSize on page 987

SMTP connection cache size.

ConnectionCacheTimeout

(K)

ConnectionCacheTimeout on page 988

SMTP connection cache timeout.

ConnectionRateThrottle

 

ConnectionRateThrottle on page 988

Incoming SMTP connection rate.

ConnectionRateWindowSize

 

ConnectionRateWindowSize on page 989

Size of window in which to measure connection rates (V8.13 and later).

ConnectOnlyTo

 

ConnectOnlyTo on page 990

Connect only to one specified host.

ControlSocketName

 

ControlSocketName on page 990

Path to control socket.

CRLFile

 

CRLFile on page 992

Location of certificate revocation file (V8.13 and later).

DaemonPortOptions

(O)

DaemonPortOptions on page 993

Options for the daemon.

DataFileBufferSize

 

DataFileBufferSize on page 998

Buffered I/O df size.

DeadLetterDrop

 

DeadLetterDrop on page 998

Define dead.letter file location.

DefaultAuthInfo

 

DefaultAuthInfo on page 999

Source of AUTH information (deprecated).

DefaultCharSet

 

DefaultCharSet on page 1000

Define Content-Type: character set.

DefaultUser

(u)

DefaultUser on page 1000

Default delivery agent identity.

DefaultGroup

(g)

DefaultUser on page 1000

Default delivery agent group identity (deprecated).

DelayLA

 

DelayLA on page 1002

Add one second SMTP sleep on high load.

DeliverByMin

 

DeliverByMin on page 1003

Set default DELIVERBY minimum.

DeliveryMode

(d)

DeliveryMode on page 1004

Set delivery mode.

DHParameters

 

DHParameters on page 1006

Parameters for DSA/DH cipher suite.

DialDelay

 

DialDelay on page 1007

Connect failure retry time.

DirectSubmissionModifiers

 

DirectSubmissionModifiers on page 1008

Daemon direct submission flags.

DontBlameSendmail

 

DontBlameSendmail on page 1009

Relax file security checks.

DontExpandCnames

 

DontExpandCnames on page 1022

Prevent CNAME expansion.

DontInitGroups

 

DontInitGroups on page 1023

Don’t use initgroups(3).

DontProbeInterfaces

 

DontProbeInterfaces on page 1023

Don’t probe interfaces for $=w.

DontPruneRoutes

(R)

DontPruneRoutes on page 1024

Don’t prune route addresses.

DoubleBounceAddress

 

DoubleBounceAddress on page 1025

Errors when sending errors.

EightBitMode

(8)

EightBitMode on page 1025

How to convert 8-bit input.

ErrorHeader

(E)

ErrorHeader on page 1027

Set error message header.

ErrorMode

(e)

ErrorMode on page 1028

Specify mode of error handling.

FallbackMXhost

(V)

FallbackMXhost on page 1030

Fallback MX host.

FallBackSmartHost

 

FallBackSmartHost on page 1031

Fallback SmartHost (V8.13 and later).

FastSplit

 

FastSplit on page 1032

Suppress MX lookups on initial submission.

ForkEachJob

(Y)

ForkEachJob on page 1033

Process queue files individually.

ForwardPath

(J)

ForwardPath on page 1034

Set forward file search path.

HeloName

 

HeloName on page 1034

Use a value other than $j for the HELO/EHLO greeting (V8.14 and later).

HelpFile

(H)

HelpFile on page 1035

Specify location of the help file.

HoldExpensive

(c)

HoldExpensive on page 1036

Queue mail destined for expensive delivery agents.

HostsFile

 

HostsFile on page 1037

Specify alternative /etc/hosts file.

HostStatusDirectory

 

HostStatusDirectory on page 1037

Location of persistent host status.

IgnoreDots

(i)

IgnoreDots on page 1038

Ignore leading dots in messages.

InputMailFilters

 

InputMailFilters on page 1039

Set the order of input filters.

LDAPDefaultSpec

 

LDAPDefaultSpec on page 1039

Default LDAP switches.

LogLevel

(L)

LogLevel on page 1040

Set (increase) the logging level.

MailboxDatabase

 

MailboxDatabase on page 1042

Choose a mailbox database.

MatchGECOS

(G)

MatchGECOS on page 1043

Match recipient in GECOS field.

MaxAliasRecursion

 

MaxAliasRecursion on page 1044

Maximum recursion of aliases.

MaxDaemonChildren

 

MaxDaemonChildren on page 1044

Maximum forked daemon children.

MaxHeadersLength

 

MaxHeadersLength on page 1045

Set maximum header length.

MaxHopCount

(h)

MaxHopCount on page 1046

Set maximum hop count.

MaxMessageSize

 

MaxMessageSize on page 1047

Maximum incoming ESMTP message size.

MaxMimeHeaderLength

 

MaxMimeHeaderLength on page 1047

Maximum MIME header length.

MaxNOOPCommands

 

MaxNOOPCommands on page 1048

Maximum useless commands before a slowdown (V8.14 and later).

MaxQueueChildren

 

MaxQueueChildren on page 1049

Limit total concurrent queue processors.

MaxQueueRunSize

 

MaxQueueRunSize on page 1050

Maximum queue messages processed.

MaxRecipientsPerMessage

 

MaxRecipientsPerMessage on page 1050

Maximum recipients per envelope.

MaxRunnersPerQueue

 

MaxRunnersPerQueue on page 1051

Limit concurrent queue processors per queue group.

MeToo

(m)

MeToo on page 1051

Send to me too (deprecated).

Milter

 

Milter on page 1052

Tune interactions with the Milter program.

MinFreeBlocks

(b)

MinFreeBlocks on page 1057

Define minimum free disk blocks.

MinQueueAge

 

MinQueueAge on page 1057

Skip queue file if too young.

MustQuoteChars

 

MustQuoteChars on page 1058

Quote nonaddress characters.

NiceQueueRun

 

NiceQueueRun on page 1059

Default nice(3) setting for queue processors.

NoRecipientAction

 

NoRecipientAction on page 1060

How to handle no recipients in header.

OldStyleHeaders

(o)

OldStyleHeaders on page 1061

Allow spaces in recipient lists.

OperatorChars

$o

OperatorChars on page 1062

Set token separation operators.

PidFile

 

PidFile on page 1063

Location of the sendmail pid file.

PostmasterCopy

(P)

PostmasterCopy on page 1064

Extra copies of bounce messages.

PrivacyOptions

(p)

PrivacyOptions on page 1065

Increase privacy of the daemon.

ProcessTitlePrefix

 

ProcessTitlePrefix on page 1069

Process listing prefix.

QueueDirectory

(Q)

QueueDirectory on page 1070

Location of queue directory.

QueueFactor

(q)

QueueFactor on page 1071

Factor for high-load queuing.

QueueFileMode

 

QueueFileMode on page 1071

Default permissions for queue files.

QueueLA

(x)

QueueLA on page 1072

On high load, queue only.

QueueSortOrder

 

QueueSortOrder on page 1073

How to presort the queue.

QueueTimeout

(T)

QueueTimeout on page 1075

Limit life of a message in the queue (deprecated).

RandFile

 

RandFile on page 1076

Source for random numbers.

RecipientFactor

(y)

RecipientFactor on page 1077

Penalize large recipient lists.

RefuseLA

(X)

RefuseLA on page 1078

Refuse connections on high load.

RejectLogInterval

 

RejectLogInterval on page 1079

How often to log that high load continues connection refusal (V8.13 and later).

ResolverOptions

(I)

ResolverOptions on page 1080

Tune DNS lookups.

RetryFactor

(Z)

RetryFactor on page 1081

Increment per job priority.

RequiresDirFsync

 

RequiresDirFsync on page 1082

Turn off directory fsync(2) at runtime (V8.13 and later).

RrtImpliesDsn

 

RrtImpliesDsn on page 1083

Return-Receipt-To: is DSN request.

RunAsUser

 

RunAsUser on page 1083

Run as non-root (on a firewall).

SafeFileEnvironment

 

SafeFileEnvironment on page 1084

Directory for safe file writes

SaveFromLine

(f)

SaveFromLine on page 1085

Save Unix-style From lines.

SendMimeErrors

(j)

SendMimeErrors on page 1086

Return MIME-format errors.

ServerCertFile

 

ServerCertFile on page 1087

File containing the server’s certificate.

ServerKeyFile

 

ServerKeyFile on page 1088

File with the server certificate’s private key.

ServiceSwitchFile

 

ServiceSwitchFile on page 1088

Switched services file

SevenBitInput

(7)

SevenBitInput on page 1090

Force 7-bit input.

SharedMemoryKey

 

SharedMemoryKey on page 1090

Enable shared memory by setting the key.

SharedMemoryKeyFile

 

SharedMemoryKeyFile on page 1091

Allow sendmail to set the key and store it in a file (V8.14 and later).

SingleLineFromHeader

 

SingleLineFromHeader on page 1092

Strip newlines from From: headers.

SingleThreadDelivery

 

SingleThreadDelivery on page 1092

Set single-threaded delivery.

SmtpGreetingMessage

$e

SmtpGreetingMessage on page 1093

The SMTP greeting message.

SoftBounce

 

SoftBounce on page 1094

Reject with 4yz, not 5yz, for testing (8.14 and later).

StatusFile

(S)

StatusFile on page 1095

Specify statistics file.

SuperSafe

(s)

SuperSafe on page 1096

Queue everything just in case.

TempFileMode

(F)

TempFileMode on page 1097

Permissions for temporary files.

Timeout

(r)

Timeout on page 1097

Set timeouts.

TimeZoneSpec

(t)

TimeZoneSpec on page 1110

Set time zone.

TLSSrvOptions

 

TLSSrvOptions on page 1111

Tune the server TLS settings.

TrustedUser

 

TrustedUser on page 1112

Alternative to root administration.

TryNullMXList

(w)

TryNullMXList on page 1112

If no best MX record, use A or AAAA.

UnixFromLine

$l

UnixFromLine on page 1113

Define the From format.

UnsafeGroupWrites

 

UnsafeGroupWrites on page 1114

Check unsafe group permissions (deprecated).

UseErrorsTo

(l)

UseErrorsTo on page 1115

Use Errors-To: for errors.

UseMSP

 

UseMSP on page 1115

Run as a mail submission program.

UserDatabaseSpec

(U)

UserDatabaseSpec on page 1116

Specify user database.

Verbose

(v)

Verbose on page 1117

Run in verbose mode.

XscriptFileBufferSize

 

XscriptFileBufferSize on page 1117

Set xf file buffered I/O limit.

(no long name)

(M)

M on page 1118

Define a macro.

Option Argument Types

Each option’s argument is restricted to a single type. The allowable types are the following:

Boolean

A Boolean-type argument can have only one of two possible values: true or false. If the Boolean argument is present, its first letter is compared to the four letters T, t, Y, and y. If that first letter matches any of those four, the option is set to true; otherwise, it is set to false. If a Boolean argument is absent, the option defaults to true. For example:

O HoldExpensive             ← Boolean absent, option is set to true
O HoldExpensive=True        ← Boolean=`T'rue, option is set to true
O HoldExpensive=False       ← Boolean=`F'alse, option is set to false
Character

A character type is a single ASCII character. Options that take a single character as an argument can also take a whole word or sentence, but in that instance, only the first character is recognized:

O DeliveryMode=b            ← b for background mode
O DeliveryMode=background   ← same

The argument is case-sensitive—that is, the character b is considered to be different from the character B:

O DeliveryMode=b            ← b for background mode
O DeliveryMode=B            ← meaningless
Numeric

A numeric type is an ASCII representation of an integer value. It can be positive, zero, or negative. The base is determined after any leading sign is handled. A leading 0 causes the octal base to be used. A leading 0x or 0X causes the hexadecimal base to be used. Decimal is best to use for options such as the hop count (option MaxHopCount):

O MaxHopCount=15            ← decimal for hop count
String

A string type is a line of ASCII text. A string is all text from the single-character option name up to the end of the line. If the following line is a continuation line (one that begins with a tab or a space), it is joined (appended) to the string. Prior to V8, the maximum length of a string was defined by MAXLINE in conf.h. Beginning with V8 sendmail, strings can be of virtually unlimited length. If the string is quoted, the quotation marks are not stripped by sendmail:

O AliasFile=/etc/mail/aliases              ← location of the aliases file
O AliasFile="/etc/mail/aliases"            ← bad, quotes are retained

The string is considered to begin at the first nonspace character following the = character of a multicharacter option declaration:

O AliasFile =  /etc/mail/aliases
               ↑
               from here
Octal

An octal type is like the numeric type discussed earlier but is always interpreted as an octal (base 8) number even if the leading zero is absent. This type is specially designed for file permissions:

O TempFileMode=0600         ← octal for file permissions
O TempFileMode=600          ← octal even without the leading zero
Time

A time type is the expression of a period of time. Time is expressed as a number modified by a trailing letter. The recognized letters (shown in Table 24-5) determine what the number means. For example, 24h means 24 hours, and 15m means 15 minutes.

Table 24-5. Option time argument units

Letter

Units

s

Seconds

m

Minutes

h

Hours

d

Days

w

Weeks

Times can be mixed; for example, 1h30m means 1 hour and 30 minutes. If the letter modifier is missing, pre-V8 versions of sendmail default the time to days:

Or2h                       ← SMTP timeout is 2 hours
OT2                        ← life in queue is 2 days

V8 sendmail uses different default units depending on the specific option. For consistent results, always include the units for all versions of sendmail.

Prior to V8.7, unrecognized unit characters (such as j when you really meant h) would silently default to days. Beginning with V8.7, unrecognized unit characters cause sendmail to print the following error and default the units to those specified by the particular option:

Invalid time unit `character'

Interrelating Options

At the end of this chapter, we describe all the options in detail, with those descriptions in alphabetical order for easy lookup. Here, we present them grouped by application with only a brief description.

File Locations

sendmail knows the location of only its configuration file.[361] Options in the configuration file tell sendmail where all other files and directories are located. The options that specify file locations are summarized in Table 24-6. All file location options are of type string.

Table 24-6. File location options

Option name

 

§

File

AliasFile

(A)

AliasFile on page 970

aliases file and its database files.

CACertFile

 

CACertFile on page 981

File containing certificates for certificate authorities.

CACertPath

 

CACertPath on page 982

Directory with certificates of certificate authorities.

ClientCertFile

 

ClientCertFile on page 984

File containing the client’s public certificate.

ClientKeyFile

 

ClientKeyFile on page 985

File with the client certificate’s private key.

ControlSocketName

 

ControlSocketName on page 990

Path to control socket.

CRLFile

 

CRLFile on page 992

File that contains the OpenSSL certificate revocation list (V8.13 and later).

DeadLetterDrop

 

DeadLetterDrop on page 998

Define dead.letter file location.

DHParameters

 

DHParameters on page 1006

Parameters for DSA/DH cipher suite.

ErrorHeader

(E)

ErrorHeader on page 1027

Set error message header.

ForwardPath

(J)

ForwardPath on page 1034

Set forward file search path.

HelpFile

(H)

HelpFile on page 1035

Specify location of the help file.

HostsFile

 

HostsFile on page 1037

Specify alternative /etc/hosts file.

HostStatusDirectory

 

HostStatusDirectory on page 1037

Location of persistent host status.

PidFile

 

PidFile on page 1063

Location of the sendmail pid file.

QueueDirectory

(Q)

QueueDirectory on page 1070

Location of queue directory.

RandFile

 

RandFile on page 1076

Source for random numbers.

SafeFileEnvironment

 

SafeFileEnvironment on page 1084

Directory for safe file writes.

ServerCertFile

 

ServerCertFile on page 1087

File containing the server’s certificate.

ServerKeyFile

 

ServerKeyFile on page 1088

File with the server certificate’s private key.

ServiceSwitchFile

 

ServiceSwitchFile on page 1088

Specify file for switched services.

SharedMemoryKeyFile

 

SharedMemoryKeyFile on page 1091

Automatically set a shared memory key and save that key in a file (V8.14 and later).

StatusFile

(S)

StatusFile on page 1095

Specify statistics file.

UserDatabaseSpec

(U)

UserDatabaseSpec on page 1116

Specify user database.

File and directory locations should be expressed as full pathnames. Use of relative names will cause the location to become relative to the queue directory or, for some options, cause the name to be interpreted as something other than a file or directory.

The Queue

Several options combine to determine your site’s policy for managing the sendmail queue (see Chapter 11 on page 394). Among them is one that specifies the location of the queue directory and another that sets the permissions given to files in that directory. The list of many options that affect the queue is shown in Table 24-7.

Table 24-7. Options that affect the queue

Option name

 

§

Description

[a]

CheckpointInterval

(C)

CheckpointInterval on page 983

Checkpoint the queue.

DaemonPortOptions

 

DaemonPortOptions on page 993

Tune queuing under load per daemon (V8.14 and later).

DataFileBufferSize

 

DataFileBufferSize on page 998

Buffered I/O df limit.

HoldExpensive

(c)

HoldExpensive on page 1036

Queue for expensive mailers.

MaxQueueChildren

 

MaxQueueChildren on page 1049

Limit total concurrent queue processors.

MaxQueueRunSize

 

MaxQueueRunSize on page 1050

Maximum queue messages processed.

MaxRunnersPerQueue

 

MaxRunnersPerQueue on page 1051

Limit concurrent queue processors per queue group.

MinFreeBlocks

(b)

MinFreeBlocks on page 1057

Define minimum free disk blocks.

MinQueueAge

 

MinQueueAge on page 1057

Skip queue file if too young.

NiceQueueRun

 

NiceQueueRun on page 1059

Default nice(3) setting for queue processors.

PrivacyOptions

(p)

PrivacyOptions on page 1065

Increase privacy of the daemon.

QueueDirectory

(Q)

QueueDirectory on page 1070

Location of queue directory.

QueueFactor

(q)

QueueFactor on page 1071

Factor for high-load queuing.

QueueFileMode

 

QueueFileMode on page 1071

Default permissions for queue files.

QueueLA

(x)

QueueLA on page 1072

On high load, queue only.

QueueSortOrder

 

QueueSortOrder on page 1073

How to presort the queue.

QueueTimeout

(T)

QueueTimeout on page 1075

Limit life of a message in the queue to days.

RecipientFactor

(y)

RecipientFactor on page 1077

Penalize large recipient lists.

RetryFactor

(Z)

RetryFactor on page 1081

Increment per job priority.

RunAsUser

 

RunAsUser on page 1083

Run as non-root.[a]

SharedMemoryKey

 

SharedMemoryKey on page 1090

Enable shared memory by setting the key.

SharedMemoryKeyFile

 

SharedMemoryKeyFile on page 1091

Automatically set a shared memory key and save that key in a file (V8.14 and later).

SuperSafe

(s)

SuperSafe on page 1096

Queue everything just in case.

TempFileMode

(F)

TempFileMode on page 1097

Permissions for temporary files.

Timeout.queuereturn

 

Timeout.queuereturn (V8.7 and later) on page 1106

Timeout life in queue.

Timeout.queuewarn

 

Timeout.queuewarn (V8.7 and later) on page 1107

Timeout for still-in-queue warnings.

TrustedUser

 

TrustedUser on page 1112

Alternative to root administration.

XscriptFileBufferSize

 

XscriptFileBufferSize on page 1117

Set xf file buffered I/O limit.

[a] a This is not strictly related to queueing, but it does have indirect bearing on the permissions of the process.

Managing Aliases

In addition to knowing the location of the aliases file, some options determine how that file and its associated database files will be used. For example, there is an option that tells sendmail to check the right side of the aliases for validity. The various aliases-related options are shown in Table 24-8.

Table 24-8. Options for managing aliases

Option name

 

§

Description

AliasFile

(A)

AliasFile on page 970

Define the location of the aliases file.

AliasWait

(a)

AliasWait on page 973

Wait for aliases file rebuild.

AutoRebuildAliases

(D)

AutoRebuildAliases on page 978

Auto-rebuild the aliases database (V8.11 and earlier).

CheckAliases

(n)

CheckAliases on page 982

Check RHS of aliases.

DefaultUser

(u)

DefaultUser on page 1000

Default delivery agent identity.

DontBlameSendmail

 

DontBlameSendmail on page 1009

Relax file security checks.

MaxAliasRecursion

 

MaxAliasRecursion on page 1044

Maximum recursion of aliases.

ServiceSwitchFile

 

ServiceSwitchFile on page 1088

Specify file for switched services.

TrustedUser

 

TrustedUser on page 1112

Alternative to root administration.

Controlling Machine Load

Several options control the sendmail program’s behavior under high-machine-load conditions. They are intended to reduce the impact of sendmail on machines that provide other services and to help protect sendmail from overburdening a machine. The list of options that determine and help to prevent high-load conditions is shown in Table 24-9.

Table 24-9. Options that determine load

Option name

 

§

Description

ClassFactor

(z)

ClassFactor on page 984

Multiplier for priority increments.

ConnectionRateThrottle

 

ConnectionRateThrottle on page 988

Incoming SMTP connection rate.

ConnectionRateWindowSize

 

ConnectionRateWindowSize on page 989

Window size for FEATURE(conncontrol) and FEATURE(ratecontrol) (V8.13 and later).

DaemonPortOptions

 

DaemonPortOptions=delayLA= (8.14 and later) on page 995

The DaemonPortOptions option’s keyword delayLA overrides the setting of the DelayLA option for this daemon (V8.14 and later).

DaemonPortOptions

 

DaemonPortOptions=children= (8.14 and later) on page 994

The DaemonPortOptions option’s keyword children overrides the setting of the MaxDaemonChildren option for this daemon (V8.14 and later).

DaemonPortOptions

 

DaemonPortOptions=queueLA= (8.14 and later) on page 997

The DaemonPortOptions option keyword queueLA overrides the setting of the QueueLA option for this daemon (V8.14 and later).

DaemonPortOptions

 

DaemonPortOptions=refuseLA= (8.14 and later) on page 997

The DaemonPortOptions option keyword refuseLA overrides the setting of the RefuseLA option for this daemon (V8.14 and later).

DelayLA

 

DelayLA on page 1002

Add one-second SMTP sleep on high load.

DeliveryMode

(d)

DeliveryMode on page 1004

Set delivery mode.

HoldExpensive

(c)

HoldExpensive on page 1036

Queue for expensive mailers.

MaxDaemonChildren

 

MaxDaemonChildren on page 1044

Maximum forked children.

MaxQueueRunSize

 

MaxQueueRunSize on page 1050

Maximum queue messages processed.

MaxRunnersPerQueue

 

MaxRunnersPerQueue on page 1051

Limit concurrent queue processors per queue group.

MinQueueAge

 

MinQueueAge on page 1057

Skip queue file if too young.

NiceQueueRun

 

NiceQueueRun on page 1059

Default nice(3) setting for queue processors.

QueueFactor

(q)

QueueFactor on page 1071

Factor for high-load queuing.

QueueLA

(x)

QueueLA on page 1072

On high load, queue only.

QueueSortOrder

 

QueueSortOrder on page 1073

How to presort the queue.

RefuseLA

(X)

RefuseLA on page 1078

Refuse connections on high load.

StatusFile

 

StatusFile on page 1095

Disable use of statistics (V8.14 and later).

SuperSafe

 

SuperSafe on page 1096

PostMilter setting delays fsync() until after all Milters have reviewed the message (V8.13 and later).

Timeout

(r)

Timeout on page 1097

Set timeouts.

Connection Caching

Connection caching improves the performance of SMTP-transported mail. In processing the queue or delivering to a long list of recipients, keeping a few SMTP connections open (just in case another message is for one of those same sites) will improve the speed of transfers. Caching is of greatest benefit on busy mail hub machines but can benefit any machine that sends a great deal of network mail. Table 24-10 lists the options that determine how connections will be cached.

Table 24-10. Options that determine connection caching

Option name

 

§

Description

ConnectionCacheSize

(k)

ConnectionCacheSize on page 987

SMTP connection cache size.

ConnectionCacheTimeout

(K)

ConnectionCacheTimeout on page 988

SMTP connection cache timeout.

HostStatusDirectory

 

HostStatusDirectory on page 1037

Location of persistent host status.

SingleThreadDelivery

 

SingleThreadDelivery on page 1092

Set single-threaded delivery.

Note that beginning with V8.13, the ConnectionCacheSize and ConnectionCacheTimeout options now also affect delivery agents that use P=[LPC] for delivery.

Problem Solving

The sendmail program offers a few options that will help in locating and solving some mail delivery problems. Table 24-11 lists the available options.

Table 24-11. Options that help with problem solving

Option name

 

§

Description

CheckAliases

(n)

CheckAliases on page 982

Check RHS of aliases.

DoubleBounceAddress

 

DoubleBounceAddress on page 1025

Errors when sending errors.

LogLevel

(L)

LogLevel on page 1040

Set (increase) the logging level.

PostmasterCopy

(P)

PostmasterCopy on page 1064

Extra copies of bounce messages (not V5 BSD).

Verbose

(v)

Verbose on page 1117

Run in verbose mode.

Other means to solve problems are described in Chapter 15 on page 530, which discusses the -d debugging command-line switch, and in Chapter 14 (specifically Log Transactions with -X on page 512), which covers the -X traffic-logging command-line switch.

Other Options

The sendmail program supports a vast array of options, each of which is described at the end of this chapter. For now, study each one well enough to get a basic feeling for what it does. Then, as you gain experience with sendmail, you’ll know where to look for the particular option that will meet your needs.

Pitfalls

  • Under very old versions of sendmail (prior to V8.7), accidentally placing a space character between the O and the option letter wrongly causes sendmail to silently accept the space character as the option name. For example, the space in O A/etc/aliases gives to the option “space” the argument A/etc/aliases. Beginning with V8.7, a space option causes a multicharacter option name to be recognized (V8.7 Configuration File Declarations on page 952).

  • Options are parsed from the top of the sendmail.cf file down. For most options, later declarations supersede earlier declarations. For example, if you try to change the location of the queue directory by placing the line OQ/mail/spool/mqueue at the top of your sendmail.cf file, that change is masked (ignored) by the existence of OQ/var/spool/mqueue later in the file. Other options, such as AliasFile, add the new definition to the prior one.

  • For the most part, command-line options supersede the sendmail.cf file options because the command line is parsed after the sendmail.cf file is parsed. One way to change the location of the aliases file (perhaps for testing) is with a command-line argument such as:

    -OAliasFile=/tmp/aliases
  • For security reasons, however, not all command-line options are available to the ordinary user. (See Table 24-2 on page 951 for a list of those that are available.)

Alphabetized Options

In the following sections, we present all the options that are currently available for V8 sendmail. They are in alphabetical order sorted by the multicharacter name. The multicharacter name appears at the left of each major section header. If an old single-character name exists, it is displayed parenthetically to the right of the multicharacter name. In a few cases, multicharacter names have replaced macros. In those instances, the macro is displayed nonparenthetically.

AliasFile

Define the aliases file location All versions

The AliasFile option must be declared for sendmail to do aliasing. If you omit this option, sendmail might silently assume that you do not want to do aliasing at all. There is no default compiled into sendmail for the location of the aliases file.[362] For mc configurations, an appropriate default will be defined based on your operating system.

If you specify a file that doesn’t exist (such as /et/mail/aliases if you really meant /etc/mail/aliases) or one that is unreadable, sendmail complains with, for example:

Can't open /et/mail/aliases

This is a nonfatal error. The sendmail program prints it and continues to run but assumes that it shouldn’t do aliasing.

The forms of the AliasFile option are as follows:

O AliasFile=locationconfiguration file (V8.7 and later)
-OAliasFile=locationcommand line (V8.7 and later)
define(`ALIAS_FILE',`location')   ← mc configuration (V8.7 and later)
OAlocationconfiguration file (deprecated)
-oAlocationcommand line (deprecated)

The location is an argument of type string and can be an absolute or a relative pathname. A relative path (such as ../aliases) can be used for testing but should never be used in the production version of your sendmail.cf file. To do so opens a security hole. Such a path is interpreted by sendmail as relative to the queue directory.

This option can be used to change the name of the aliases file (a possible consideration for security). If you change the location or name of the aliases file, be aware that other programs (such as emacs and Sun’s nis services) might cease to work properly.

Note that with the mc technique the only way to eliminate the default alias file declaration is to undefine ALIAS_FILE like this:

undefine(`ALIAS_FILE')

If you need to turn off all aliasing, you must instead turn off alias support at the delivery-agent flag level by removing the F=A flag (F=A on page 767) from all local delivery agents, as, for example:

MODIFY_MAILER_FLAGS(`LOCAL', `-A')
MODIFY_MAILER_FLAGS(`CYRUS', `-A')
MODIFY_MAILER_FLAGS(`CYRUSV2', `-A')

The sendmail program also allows you to use several alias databases simultaneously. They are listed with the AliasFile option as, for example:

O AliasFile=/etc/aliases/users,/etc/aliases/maillists

In this case, sendmail will look up an alias first in the database /etc/aliases/users. If it is not found, sendmail will then look in /etc/aliases/maillists. The number of simultaneous alias files is limited to MAXALIASDB (MAX... on page 120) as defined in conf.h (the default is 12). The -bi command-line switch will rebuild all alias databases in the order listed in this AliasFile option. Multiple declaration lines can appear in the file, each adding an alias database to the list:

O AliasFile=/etc/aliases/users     # aliases local users first
O AliasFile=/etc/aliases/maillists # then mailing lists
O AliasFile=/etc/aliases/retired   # then retired accounts

Duplicates are not detected. Therefore, the following causes /etc/aliases to be searched and rebuilt twice each time:

O AliasFile=/etc/aliases
O AliasFile=/etc/aliases

Multiple alias files can similarly be specified on the command line with the -O switch. But be aware that any alias files declared in the command line cause all the configuration file alias declarations to be ignored.

In addition to the name of alias databases, sendmail also allows you to specify the type of each. The type is the same as the types that are available for the K configuration command (The K Configuration Command on page 882). The type prefixes the name, and the two are separated by a colon:

O AliasFile=nis:mail.aliases

This example tells sendmail to look up aliases in the nis type (the nis) database called mail.aliases. The type can include command-line-style switches that mean the same thing as those allowed for the K configuration command.

For example:

O AliasFile=nis:-N mail.aliases

Here, the -N database-map switch causes lookups to include a trailing null byte with each key.[363]

The types that are reasonable to use with this option are shown in Table 24-12. But note that it is generally better to use the service-switch file to select services because it is less confusing.

Table 24-12. Database-map types reasonable for aliases

Type

§

Versions

Description

btree

btree on page 901

V8.1 and above

A db(3) form of database

dbm

dbm on page 903

V8.1 and above

Really ndbm supplied with most versions of Unix

hash

hash on page 908

V8.1 and above

A db(3) form of database

hesiod

hesiod on page 909

V8.7 and above

MIT network user authentication services

ldap

ldap (was ldapx) on page 912

V8.8 and above

The Lightweight Directory Access Protocol

netinfo

netinfo on page 926

V8.7 and above

NeXT, Darwin, and Mac OS X NetInfo

nis

nis on page 927

V8.1 and above

Sun’s NIS

nisplus

nisplus on page 928

V8.7 and above

Sun’s newer version of NIS

nsd

nsd on page 929

V8.10 and above

IRIX nsd database maps

program

program on page 931

V8.7 and above

Run an external program to look up the key

text

text on page 941

V8.7 and above

Look up in flat text files

userdb

userdb on page 942

V8.7 and above

Look up in the User Database

If a type is not known (that is, if it is completely unknown, rather than one that is not in this shortened table) and if the -d27 command-line switch (-d27.1 on page 556) is specified, sendmail prints:

Unknown alias class bad type here

If the type cannot support aliasing (as defined by MCF_ALIASOK in conf.c) and if the -d27 command-line switch is specified, sendmail prints:

setalias: map class bad type can't handle aliases

In both cases, the bad type is the offending map type. Both errors cause the AliasFile option’s alias file declaration to be ignored.

Beginning with V8.7 sendmail, the declaration and use of alias files is further complicated[364] by the introduction of switched-services files (ServiceSwitchFile on page 1088). If the file defined by the ServiceSwitchFile option exists, and if it defines the type and location of alias information, each alias definition is used just as if it were included in the configuration file (although the syntax differs). On Solaris, Ultrix, and OSF systems, switched-service files are supplied by the operating system. With these you should beware the silent introduction of unexpected alias services. On other operating systems, you can set up a V8.7 switched-service file that can be used for aliases if you wish.

The AliasFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AliasWait

Wait for aliases file rebuild All versions

Whenever sendmail rebuilds the aliases database, it first clears the old database. It then rebuilds the database and, when done, adds the special entry @:@. Before sendmail attempts to use the database, it first looks in that database for the special entry @:@ that should be present. This curious entry is employed because it is always illegal in an aliases file. If sendmail doesn’t find that entry (whether because a user ran newaliases or because another invocation of sendmail is currently rebuilding it), it waits two seconds for that entry to appear, then checks again. If the entry is still unavailable, the wait is doubled (up to a maximum wait of 60 seconds). The total time waited (after all the sleeps without success) is the interval specified by this AliasWait option.

When the @:@ appears, sendmail checks to see whether the database still needs to be rebuilt and rebuilds it if it does. If the special entry @:@ does not appear after the specified time, sendmail assumes that some other process died while that other process was rebuilding the database. This assumption paves the way for sendmail to go ahead and rebuild the database.

The forms of the AliasWait option are as follows:

O AliasWait=delayconfiguration file (V8.7 and later)
-OAliasWait=delaycommand line (V8.7 and later)
define(`confALIAS_WAIT',delay)   ← mc configuration (V8.7 and later)
Oadelayconfiguration file (deprecated)
-oadelaycommand line (deprecated)

The delay argument is of type time and, if omitted, defaults to five minutes. If the entire AliasWait option is omitted or if delay is zero or non-numeric, the database is not automatically rebuilt. If the unit of time desired is omitted, the delay defaults to minutes. If you use the mc configuration, the default for confALIAS_WAIT is 10 minutes.

The AliasWait option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AllowBogusHELO

Allow HELO or EHLO sans host V8.8 and later

Prior to V8.7, sendmail would accept without complaint an SMTP HELO command (or an EHLO) that omitted the hostname:

220-oldsite.uofa.edu  Sendmail 8.6.13/8.6.13 ready at Fri, 13 Dec 2002 08:11:44 −0700
220 ESMTP spoken here
HELO
250 oldsite.uofa.edu Hello here.ufa.edu [123.45.67.89], pleased to meet you

RFC1123, Section 5.2.5 specifies that all HELO and EHLO commands must be followed by a fully qualified hostname:

HELO here.uofa.edu
EHLO here.uofa.edu

Beginning with V8.7, omitting the hostname results in one of the following errors:[365]

501 5.0.0 HELO requires domain address
501 5.0.0 EHLO requires domain address

Note that there is no check to see that the hostname is actually that of the connecting host unless PICKY_HELO_CHECK is declared when sendmail is compiled (PICKY_HELO_CHECK on page 133). Also note that the specified hostname must appear to be a correctly formed hostname. If it is not, the following is printed:

501 5.0.0 Invalid domain name

If you favor forcing other sites to obey the RFCs, don’t enable this option. But note that you might need to enable it if your site accepts connections from other sites that don’t obey the protocols.

The AllowBogusHELO option is used like this:

O AllowBogusHELO=boolconfiguration file (V8.8 and
later)
-OAllowBogusHELO=boolcommand line (V8.8 and later)
define(`confALLOW_BOGUS_HELO', `bool')        ← mc configuration (V8.8 and later)

The bool is of type Boolean. If it is absent, the option defaults to true (do allow the hostname to be omitted). If the entire option declaration is missing, the default is false (require the hostname to be present).

The AllowBogusHELO option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

AuthMaxBits

Limit max encryption strength for SASL V8.12 and later

When a client’s site connects to the server, the server can offer authentication by presenting the AUTH keyword, followed by authentication mechanisms supported:

250-host.domain Hello some.domain, pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5 KERBEROS-V4             ← note this line
250-DELIVERBY
250 HELP

If the connecting site wishes to authenticate itself, it replies with an AUTH command indicating the desired mechanism:

AUTH CRAM-MD5
← authentication challenge hereauthentication reply here
235 Authentication successful.           ← server replies

This interaction automatically establishes an authenticated stream using the CRAM-MD5 method.

If you wish to turn off additional encryption in SASL when STARTTLS is already encrypting the communication, you do so by defining this AuthMaxBits option. When set, this option limits the maximum encryption strength for the security layer in SMTP AUTH. When not set (the default), encryption strength is essentially unlimited. The AuthMaxBits option is used like this:

O AuthMaxBits=limitconfiguration file (V8.12 and later)
-OAuthMaxBits=limitcommand line (V8.12 and later)
define(`confAUTH_MAX_BITS', `limit')    ← mc configuration (V8.12 and later)

Here, limit is the maximum number of bits in the key length. The existing encryption strength is taken into account when choosing an algorithm for the security layer. For example, if STARTTLS is used and the symmetric cipher is DES, the key length (in bits) will be 168. By setting this option to:

define(`confAUTH_MAX_BITS', `168')

any encryption in SASL will be disabled.

The AuthMaxBits option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AuthMechanisms

The AUTH mechanisms V8.10 and later

The AuthMechanisms option is used to declare the types of authentication you want to allow to be passed in the AUTH ESMTP extension (see RFC2554). You use this option by listing the mechanisms you wish to set as its value.

O AuthMechanisms=mechanismsconfiguration file (V8.10 and
later)
-OAuthMechanisms=mechanismsconfiguration file (V8.10 and
later)
define(`confAUTH_MECHANISMS', `mechanisms')  ← mc configuration (V8.10 and later)

When there is more than one preferred mechanism, each is separated from the others by space characters. For example:

define(`confAUTH_MECHANISMS', `CRAM-MD5 KERBEROS_V4')

Before the actual AUTH is generated, sendmail produces an intersection of the mechanisms you want and those supported by the SASL software you have installed. Only those that are specified by this option and those supported by your software are listed by the issued AUTH command:

250-AUTH CRAM-MD5

Here, you wanted both CRAM-MD5 and KERBEROS_V4 offered as mechanisms. But if the SASL software installed on your machine, for example, supports only CRAM-MD5 and DIGEST-MD5, the common or intersecting mechanism will be CRAM-MD5, so that is all that will be advertised.

When more than one mechanism is listed, the other side will negotiate them one at a time, until one succeeds. For example, the interplay of the offered mechanisms and the counters by the other side might look like this:

220 other.domain ESMTP Sendmail 8.12.7/8.12.7; Sat, 18 Dec 1999 09:17:09 −0800 (PST)
EHLO host.your.domain
250-host.your.domain Hello you@host.your.domain [122.45.67.8], pleased to meet you
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-AUTH CRAM-MD5 KERBEROS_V4                   ← we support
250-XUSR
250 HELP
AUTH CRAM-MD5                                   ← they first try this
334← authentication challenge hereauthentication reply here
504 5.7.0 Authentication failure                ← that fails
AUTH KERBEROS_V4                                ← so they try this
334← authentication challenge hereauthentication reply here
235 2.0.0 OK Authenticated                      ← which succeeds

The following mechanisms are the maximum set of those recognized by the cyrus-sasl-1.5.16 distribution. Not all will be compiled in, so not all will be supported.

ANONYMOUS

The ANONYMOUS mechanism allows anyone to use the service. Authentication parallels that of the anonymous ftp login.

CRAM-MD5

The CRAM-MD5 mechanism is the style of authentication used by POP servers known as APOP.

DIGEST-MD5

The DIGEST-MD5 mechanism is a stronger version of the CRAM-MD5 mechanism that also supports encryption.

GSSAPI

The GSSAPI mechanism implements an API for general security services that also support encryption. One example is support for Kerberos V5, which is achieved using GSSAPI.

KERBEROS_V4

The KERBEROS_V4 mechanism implements authentication based on MIT’s Kerberos 4.

PLAIN

The PLAIN mechanism can perform plain text password authentication (in a single step) with either PAM, KERBEROS_V4, or /etc/passwd (or /etc/shadow) authentication.

LOGIN

The LOGIN mechanism is a two-step version of PLAIN.

The complete list of current mechanisms, and the RFC that describes each, can be found at http://www.iana.org/assignments/sasl-mechanisms/ and http://www.sendmail.org/~ca/email/mel/sasl_info.html.

The AuthMechanisms option is available only if sendmail is compiled with SASL (SASL on page 137) defined.

The AuthMechanisms option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AuthOptions

Tune authentication parameters V8.10 and later

AuthOptions provides a list of general tuning parameters that affect authentication. It is declared like this:

O AuthOptions=stringconfiguration file (V8.10 and later)
-OAuthOptions=stringconfiguration file (V8.10 and later)
define(`confAUTH_OPTIONS', `string')  ← mc configuration (V8.10 and later)

The argument, of type string, is a list of characters selected from those shown in Table 24-13, where each character sets a particular tuning parameter. If more than one character is listed, each character must be separated from the next by either a comma or a space.

Table 24-13. AuthOptions character settings

Character

Meaning

A

Use the AUTH= parameter from the MAIL From: command only when authentication succeeds. This character can be specified as a workaround for broken MTAs that do not correctly implement RFC2554. (Client only)

a

Provide protection from active (nondictionary) attacks during the authentication exchange. (Server only)

c

Allow only selected mechanisms (those that can pass client credentials) to be used with client credentials. (Server only)

d

Don’t permit use of mechanisms that are susceptible to passive dictionary attacks. (Server only)

f

Require forward-secrecy between sessions (where breaking one won’t help break the next). (Server only)

m

Require the use of mechanisms that support mutual authentication. (Server only) (V8.13 and above)

p

Don’t permit mechanisms to be used if they are susceptible to simple passive attack (that is, disallow use of PLAIN and LOGIN), unless a security layer is already active (as, for example, provided by STARTTLS). (Server only)

T

The opposite of A. (pre-V8.12 only, client only)

y

Don’t permit the use of any mechanism that allows anonymous login. (Server only)

If string is missing, sendmail will issue the following error and skip this option declaration:

Warning: Option: AuthOptions requires parameter(s)

If any letter is specified other than those listed in the table—for example, Hsendmail issues the following warning and skips this option declaration:

Warning: Option: AuthOptions unknown parameter 'H'

Note that macros cannot be used to define the list of characters.

The AuthOptions option is available only if sendmail is compiled with SASL (SASL on page 137) defined as true. For examples of how to use AuthOptions, see The AuthOptions option on page 192.

The AuthOptions option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AuthRealm

Cyrus SASL authentication realm V8.13 and later

Prior to V8.13, the authentication realm passed to the Cyrus SASL library was always the value of the $j macro. Beginning with V8.13, the AuthRealm option allows you to specify a different authentication realm:

O AuthRealm=realm                    ← configuration file (V8.13 and later)
-OAuthRealm=realm                    ← command line (V8.13 and later)
define(`confAUTH_REALM',`realm')     ← mc configuration (V8.13 and later)

Here, realm is of type string and specifies the authentication realm to use in place of the $j macro’s value. If realm is missing, the effect is the same as if the entire option was omitted, that is, the value of $j is used.

The AuthRealm option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

AutoRebuildAliases

Auto-rebuild the aliases database Deprecated

Beginning with V8.10 sendmail, it was discovered that auto-rebuilding the aliases database held the potential for a denial-of-service attack. If a user could kill sendmail during a rebuild, the aliases database could be left in an incomplete state, resulting in possible lost and misdirected email. As a consequence, this AutoRebuildAliases option is deprecated. Although it is present in V8.10 and V8.11, you should not use it. This option has been eliminated since V8.12.

Prior to V8.10 sendmail, the need to auto-rebuild the aliases database was determined by comparing the modification time of the aliases source file, as defined by the AliasFile option (AliasFile on page 970), to the modification time of the corresponding aliases.pag and aliases.dir, or aliases.db, database files. If the source file was newer and if this AutoRebuildAliases option was set, sendmail attempted to rebuild the aliases database. If this option was not set, sendmail printed the following warning and used the information in the old database:

Warning: alias database fname out of date

Here, fname is the name of the source file. If you wish to set this to AutoRebuildAliases, despite the risk, be sure that the AliasWait option (AliasWait on page 973) is also declared and given a nonzero time argument. (Note that file locking, to prevent simultaneous rebuilds, is described under the AliasWait option.)

The forms of this AutoRebuildAliases option are as follows:

O AutoRebuildAliases=boolconfiguration file (V8.7 to V8.11)
-OAutoRebuildAliases=boolcommand line (V8.7 to V8.11)
define(`confAUTO_REBUILD',bool)   ← mc configuration (V8.7 to V8.11)
ODboolconfiguration file (V8.11 and earlier)
-oDboolcommand line (V8.11 and earlier)

With no argument, AutoRebuildAliases is set to true (the aliases database is automatically rebuilt). If the entire AutoRebuildAliases option is missing, it defaults to false (no automatic rebuilds).

IDA sendmail uses fcntl(3) to prevent simultaneous rebuilds. Ancient versions of sendmail used flock(3). V8 sendmail uses either fcntl(3) or flock(3), depending on how it was compiled.

The AutoRebuildAliases option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

BadRcptThrottle

Slow excess bad RCPT To: commands V8.12 and later

One method used to gather addresses for spamming is to misuse the RCPT To: command. To illustrate, consider the following fragment of an SMTP session:

RCPT To:<aa@your.domain>
550 5.1.1 <aa@your.domain>... User unknown
RCPT To:<ab@your.domain>
550 5.1.1 <ab@your.domain>... User unknown
RCPT To:<ac@your.domain>
550 5.1.1 <ac@your.domain>... User unknown
RCPT To:<ad@your.domain>
550 5.1.1 <ad@your.domain>... User unknown
RCPT To:<ae@your.domain>
250 2.1.0 <ae@your.domain>... Recipient ok
RCPT To:<af@your.domain>
550 5.1.1 <af@your.domain>... User unknown

Here, some other site has connected to your sendmail and started sending bad RCPT To: commands for a series of possible usernames. These are alphabetical, but other such abuses might be based on lists of common names. Whenever sendmail replies with a 250, the other site knows that address is good, and adds it to its list of spam addresses.

With V8.12 and later sendmail, it is possible to impose a penalty on sites that send too many bad RCPT To: commands. You do that by defining the BadRcptThrottle, like this:

O BadRcptThrottle=numconfiguration file (V8.12 and later)
-OBadRcptThrottle=numcommand line (V8.12 and later)
define(`confBAD_RCPT_THROTTLE',`num')   ← mc configuration (V8.12 and later

Here, num is a textual representation of a positive integer. If num is negative, non-numeric, or zero (the default), bad RCPT To: commands are accepted without penalty. If num is positive, only that number of bad RCPT To: commands are allowed in a single SMTP session before a penalty is imposed.

The penalty begins by logging the following warning:

other site: Possible SMTP RCPT flood, throttling.

Thereafter, every RCPT To: command will be received by the local sendmail, which will sleep for one second before replying. The choice of one second is hardcoded in sendmail and cannot be changed.

The BadRcptThrottle option can be used in combination with the MaxRecipientsPerMessage option (MaxRecipientsPerMessage on page 1050) to further limit the number of recipients per message.

The BadRcptThrottle option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

BlankSub

Set unquoted space replacement character All versions

Some mailer programs have difficulty handling addresses that contain spaces. Such addresses are both illegal under RFC2821 and RFC2822 and subject to gross misinterpretation. For example, the address:

John Q Public@wash.dc.gov        ← decidedly not kosher

is viewed by some MUA programs as being composed of three separate addresses: John, Q, and Public@wash.dc.gov. To prevent this misinterpretation, such MUAs usually either quote the user portion or escape each space with a backslash:

"John Q Public"@wash.dc.gov        ← quoted
John\ Q\ Public@wash.dc.gov        ← escaped

The BlankSub option is intended to handle an address that contains internal spaces, and is neither quoted nor escaped. For sendmail, a space is any character defined by the C-language library routine isspace(3).

Most sites use a . (dot or period) or an _ (underscore) character to replace unquoted space characters. That is, they declare the BlankSub option as one of the following:

O BlankSub=.
O BlankSub=_

Feeding the address:

John Q Public@wash.dc.gov

through sendmail with the option BlankSub set to a dot yields:

John.Q.Public@wash.dc.gov

The forms of the BlankSub option are as follows:

O BlankSub=charconfiguration file (V8.7 and later)
-OBlankSub=char                ← command line (V8.7 and later)
define(`confBLANK_SUB',char)   ← mc configuration (V8.7 and later)
OBcharconfiguration file (deprecated)
-oBcharcommand line (deprecated)

The argument char is of type character and is a single character. The default, if this option is omitted or if the char argument is omitted, is that an unquoted space character is replaced with a space character (which does nothing to correct the problem). The default for the mc technique is the dot (.) character.

Note that old-style addresses are delimited from each other with spaces rather than commas. Such addresses can be wrongly joined into a single address if the char is other than a space. Acceptance of such old-style addresses is determined by the setting of the OldStyleHeaders option (OldStyleHeaders on page 1061).

Also note that this BlankSub option can also be used when tokenized addresses are reassembled (see Pasting Addresses Back Together on page 656).

The BlankSub option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

CACertFile

File containing certificate authority certs V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you must provide is a file that contains the certificate of the authority that signed your local server (ServerCertFile on page 1087) and client (ClientCertFile on page 984) certificates. This certificate of authority (CA) contains information (the distinguished name, or DN) that is sent to a connecting or connected-to site. The location of the CA certificate file is specified with this CACertFile option, using a declaration that looks like this:

O CACertFile=pathconfiguration file (V8.11 and later)
-OCACertFile=pathcommand line (V8.11 and later)
define(`confCACERT',`path')     ← mc configuration (V8.11 and later

Here, path is a full path specification of the file containing the CA certificate. The path can contain sendmail macros, and if so, those macros will be expanded (their values used) when the configuration file, or command line, is read:

define(`confCACERT', `${MyCERTPath}/CAcert.pem')

The path must be a full pathname (must begin with a slash) and must also live in a directory that is safe (every component of which is writable only by root or the trusted user specified in the TrustedUser option) and must itself be safe (owned by and writable only by root or the trusted user specified in the TrustedUser option; see TrustedUser on page 1112). If it is not, it will be rejected and the following error logged:

STARTTLS=server: file path unsafe: reason
STARTTLS=client: file path unsafe: reason

But even if all goes well this far, there is still a chance that the SSL software will reject the certificate, and sendmail will log the following:

STARTTLS=server, error: load verify locs dir,  path  failed: num
STARTTLS=client, error: load verify locs dir,  path  failed: num

Here, dir is the directory specified by the CACertPath option (CACertPath on page 982) and path is the file specified by this option. The num is the error number returned by the ssl(8) software.

The CACertFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

CACertPath

Directory with certificate authority certs V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you must provide is a directory that contains the certificate of the authority for the server (ServerCertFile on page 1087) and client (ClientCertFile on page 984) as well as other certificates of authority you wish to trust. This directory contains both the certificates of authority and hashes of those certificates (more about this soon). The location of the CA certificate directory is specified with this CACertPath option, with declarations that look like this:

O CACertPath=dirconfiguration file (V8.12 and later)
-OCACertPath=dircommand line (V8.12 and later)
define(`confCACERT_PATH',`dir')    ← mc configuration (V8.12 and later

Here, dir is a full path specification of the directory containing the CA certificate files and their hashes. The dir can contain sendmail macros, and if so, those macros will be expanded (their values used) when the configuration file, or command line, is read:

define(`confCACERT_PATH', `${MyCERTPath}')

The dir must be a full pathname (must begin with a slash), or the directory will be rejected and the following error logged:

STARTTLS=server: file dir unsafe: reason
STARTTLS=client: file dir unsafe: reason

Here, dir is the directory separately specified by the CACertPath option (CACertPath on page 982) and path is the file specified by this option. The num is the error number returned by the ssl(8) software.

The dir must contain the hashes of each certificate of authority, where each hash is either a file, or a link to the certificate. Symbolic links can be generated with a command such as the following:[366]

% ln -s cert_file `openssl x509 -noout -hash <    cert_file`.0

The CACertFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

CheckAliases

Check righthand side of aliases V8.1 and later

Ordinarily, when sendmail rebuilds an aliases database (as defined by the AliasFile option, AliasFile on page 970), it checks only the addresses to the left of the colon to make sure they all resolve to a delivery agent that has the F=A flag set (F=A on page 767). It is possible to also have addresses to the right of the colon checked for validity by setting the CheckAliases option to true.

The forms of the CheckAliases option are as follows:

O CheckAliases=boolconfiguration file (V8.7 and later)
-OCheckAliases=boolcommand line (V8.7 and later)
define(`confCHECK_ALIASES',True)   ← mc configuration (V8.7 and later)
Onboolconfiguration file (deprecated)
-onboolcommand line (deprecated)
-on                                ← commandline shorthand (V8.7 and later)

The bool is of type Boolean. If it is absent, the option defaults to true (do check the RHS of aliases). If the entire option declaration is missing, the default is false (don’t check the RHS of aliases). The default for the mc configuration technique is false.

Addresses to the right of the colon are checked only to be sure they are good addresses. Each is processed by the canonify rule set 3 and then the parse rule set 0 to select a delivery agent. Processing merely needs successfully to select any non-#error delivery agent (see error on page 720). The sendmail program prints and logs the following warning and skips any address that fails to select a valid delivery agent:

address... bad address

If the address selects an #error delivery agent, the error text for that error is printed instead:

address... user address required

The CheckAliases option is further described in Check the Right Side of Aliases on page 479.

The CheckAliases option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

CheckpointInterval

Checkpoint the queue V8.1 and later

When a single email message is sent to many recipients (those on a mailing list, for example), a single sendmail process handles all the recipients. Should that sendmail process die or be killed halfway through processing, there is no record that the first half was delivered. As a result, when the queue is later reprocessed, the recipients in that first half will receive the message a second time.

The FastSplit option (FastSplit on page 1032) and this CheckpointInterval option can limit that duplication. The CheckpointInterval option tells sendmail to rewrite (checkpoint) its qf file (which contains the list of recipients; see The Queue Control File: qf on page 399) after each group of a specified number of recipients has been delivered. Recipients who have already received mail are deleted from the list, and that list is rewritten to the qf file. The forms of the CheckpointInterval option are as follows:

O CheckpointInterval=numconfiguration file (V8.7 and later)
-OCheckpointInterval=numcommand line (V8.7 and later)
define(`confCHECKPOINT_INTERVAL',`num') ← mc configuration (V8.7 and later)
OCnumconfiguration file (deprecated)
-oCnumcommand line (deprecated)

The num argument is of type numeric and specifies the number of recipients in each group. If num is entirely missing, is non-numeric, or is zero, this feature is disabled. If the entire CheckpointInterval option is missing, the default is 10. There is a small performance penalty that increases as num approaches 1. A good starting value is 4, meaning that at most, four people will get duplicate deliveries. Note that the F=m flag on local delivery will try as many recipients as possible before checkpointing, even if that number is greater than the value of this CheckpointInterval option.

The CheckpointInterval option is safe. Even if it is specified from the command line, sendmail retains its special privileges. Prior to V8.13, the CheckpointInterval option could have its value raised by anyone using the command line. But beginning with V8.13, only the trusted user, as defined by the TrustedUser option (TrustedUser on page 1112) may raise this value on the command line.

ClassFactor

Multiplier for priority increments All versions

This ClassFactor option specifies a multiplying weight (factor) for a message’s precedence when determining a message’s priority. This option interacts with the RecipientFactor option (RecipientFactor on page 1077) and both options are described under that latter option.

The forms of the ClassFactor option are as follows:

O ClassFactor=factorconfiguration file (V8.7 and later)
-OClassFactor=factorcommand line (V8.7 and later)
define(`confWORK_CLASS_FACTOR',factor)   ← mc configuration (V8.7 and later)
Ozfactorconfiguration file (deprecated)
-ozfactorcommand line (deprecated)

The argument factor is of type numeric. If that argument is missing, the default value is zero. If the entire option is missing, the default value is 1800. The default for the mc technique is to omit this option.

The ClassFactor option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ClientCertFile

File containing the client’s public certificate V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you might need to create, or purchase, to set up stream encryption is a certificate for your client side. A client certificate is used by sendmail when it is acting in the role of a sender (dispatching outbound email). It is contained in a file whose location is set with this ClientCertFile option, using declarations that look like this:

O ClientCertFile=pathconfiguration file (V8.11 and later)
-OClientCertFile=pathcommand line (V8.11 and later)
define(`confCLIENT_CERT',`path')     ← mc configuration (V8.11 and later)

Here, path is a full path specification of the file containing the certificate. The path can contain sendmail macros, and if so, those macros will be expanded (their values used) when the configuration file, or command line, is read:

define(`confSERVER_CERT', `${MyCERTPath}/ClntCert.pem')

The path must be a full pathname (must begin with a slash), or the file will be rejected and the following error logged:

STARTTLS: ClientCertFile missing

The path must also live in a directory that is safe (every component of which is writable only by root or the trusted user specified in the TrustedUser option) and must itself be safe (owned by and writable only by root or the trusted user specified in the TrustedUser option; see TrustedUser on page 1112). If it is not, it will be rejected and the following error logged:

STARTTLS=client: file path unsafe: reason

But even if all goes well this far, there is still a chance that the SSL software will reject the certificate, and sendmail will log the following:

STARTTLS=client, error: SSL_CTX_use_certificate_file(path) failed

The ServerCertFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ClientKeyFile

File with the client certificate’s private key V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you might need to set up is a key file that corresponds to a certificate file. The client key is used by sendmail when it acts in the roll of a sender (dispatching outbound email). The key file is contained in a file whose location is set with this ClientKeyFile option, using declarations that look like this:

O ClientKeyFile=pathconfiguration file (V8.11 and later)
-OClientKeyFile=pathcommand line (V8.11 and later)
define(`confCLIENT_KEY',`path')     ← mc configuration (V8.11 and later)

Here, path is a full path specification of the file containing the key. The path can contain sendmail macros, and if so, those macros will be expanded (their values used) when the configuration file, or command line, is read:

define(`confCLIENT_KEY', `${MyCERTPath}/ClntKey.pem')

The path must be a full pathname (must begin with a slash) and must also live in a directory that is safe (every component of which is writable only by root or the trusted user specified in the TrustedUser option) and must itself be safe (owned by and writable only by root or the trusted user specified in the TrustedUser option; see TrustedUser on page 1112). If it is not, it will be rejected and the following error logged:

STARTTLS=client: file path unsafe: reason

Note that the file must not be group- or world-readable.

But even if all goes well this far, there is still a chance that the SSL software will reject the certificate, and sendmail will log the following:

STARTTLS=client, error: SSL_CTX_use_PrivateKey_file(path=) failed

This error means the key doesn’t belong to the certificate, or that the key was encrypted.

The ClientKeyFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ClientPortOptions

Client port option settings V8.10 and later

The sendmail program can run in two connection modes: as a daemon, accepting connections; or as a client, making connections. Each mode can connect to a port to do its work. The options for the daemon port are set by the DaemonPortOptions option (DaemonPortOptions on page 993). The options for the client are set by this ClientPortOptions option.

This ClientPortOptions option sets the options for the outgoing connection. The form for this option is as follows:

O ClientPortOptions=pair,pair,pairconfiguration file (V8.10 and
later)
-OClientPortOptions=pair,pair,paircommand line (V8.10 and later)
define(`confCLIENT_OPTIONS',``pair,pair,pair'')   ← mc configuration (V8.10 through
V8.11)
CLIENT_OPTIONS(``pair,pair,pair'')                ← mc configuration (V8.12 and
later)

The ClientPortOptions option is followed by a comma-separated list of pairs,[367] in which each pair is of the form:

key=value

The complete list of key and value pairs is can be found under the DaemonPortOptions option (see DaemonPortOptions on page 993). All of those pairs apply to this option, except the Listen key. The flags set by the ClientPortOptions option are saved in the {client_flags} macro (${client_flags} on page 812) and are thereby made available to rule sets.

As of V8.12, you can have multiple ClientPortOptions option declarations, one per Family key type. That is, for example, one for the family of IPv4 addresses, and another for the family of IPv6 addresses.

The ClientPortOptions option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ColonOkInAddr

Allow colons in addresses V8.7 and later

One possible form of an address is called “list syntax” and looks like this:

group: list;

Here, group is the name of a mailing list, and list is a list of zero or more addresses to which the message should be delivered. To understand this kind of address, sendmail needs to view the prefix and colon as a comment and the trailing semicolon as a comment. This is similar to treating everything outside an angle-bracketed address as a comment:

group:  list  ;
group: <list> ;

For such addresses to be recognizable, it is necessary to prohibit the use of other addresses that contain colons, unless those colons appear inside a part of the address that is surrounded by angle brackets. That is, to use list syntax, addresses such as the following cannot be allowed:

host:george@wash.dc.gov

To handle this situation, V8.7 sendmail introduced the ColonOkInAddr option. It is used like this:

O ColonOkInAddr=boolconfiguration file (V8.7 and later)
-OColonOkInAddr=boolcommand line (V8.7 and later)
define(`confCOLON_OK_IN_ADDR',bool)   ← mc configuration (V8.7 and later)

The argument bool is of type Boolean. If it is absent, this option is true (colons are OK, so list syntax is not recognized). If this option is entirely omitted or if bool is false, colons are not OK, so list syntax is recognized. Note that for version 5 or earlier configuration files (see The V Configuration Command on page 580 for a description of the V configuration command), this option is automatically set to true. Also note that for mc configurations, this option is absent (false) by default.

Note that DECnet-style addresses (Handling Specialty Addresses on page 693) legitimately contain double colons (e.g., host::user). DECnet addresses are correctly recognized regardless of how this ColonOkInAddr option is set.

The ColonOkInAddr option is safe. If it is specified from the command line, sendmail will not relinquish its special privileges.

ConnectionCacheSize

SMTP connection cache size V8.1 and later

Without a connection cache, sendmail uses a single autonomous SMTP session to transmit one email message to another host. It connects to the other host, transmits the message, and closes the connection. Although this approach is sufficient for most mail, there are times when sending multiple messages during a single connection is preferable. This is called caching connections.

When sendmail caches a connection, it connects to the host and transmits the mail message as usual. But instead of closing the connection, it keeps the connection open so that it can transmit additional mail messages without the additional overhead of opening and closing the connection each time. The ConnectionCacheSize option of V8 sendmail specifies that open connections to other hosts should be maintained, and it specifies the maximum number of those connections. The forms of the ConnectionCacheSize option are as follows:

O ConnectionCacheSize=numconfiguration file (V8.7 and later)
-OConnectionCacheSize=numcommand line (V8.7 and later)
define(`confMCI_CACHE_SIZE',num)    ← mc configuration (V8.7 and later)
Oknumconfiguration file (V8.6 and later)
-oknumcommand line (V8.6 and later)

Optional whitespace can precede the num. The num is an integer that specifies the maximum number of simultaneous connections to keep open. If num is zero, this caching feature is turned off. A value of 1 is good for workstations that forward all mail to a central mail server and is the default that is used if this option is entirely missing. When configuring with the mc technique, the default is 2. A value of 4 is the maximum for most machines that forward mail directly over the Internet. Higher values might require that you increase the number of open files allowed per process at the system level.

Caching is of greatest benefit in processing the queue. V8 sendmail automatically adapts to conditions to avoid caching connections for each invocation of sendmail. Maintenance of an open connection can delay return to the user’s program, for example, and too many open connections to a common target host can create a high load on that host.

Beginning with V8.13, this option affects delivery agents that receive messages using SMTP over the standard input/output (that is, with P=[LPC]).

When caching is enabled with this ConnectionCacheSize option, the ConnectionCacheTimeout option should also be declared to set the connection timeout. The ConnectionCacheSize option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ConnectionCacheTimeout

SMTP connection cache timeout V8.1 and later

Maintaining a cached connection to another host (ConnectionCacheSize on page 987) imposes a penalty on both the local host and the other host. Each connection means that the other host is running a forked sendmail process (or other MTA) that is either waiting for an SMTP QUIT command to close the connection or for more mail to arrive. The local host has open sockets that consume system resources.

To limit the impact on other hosts, V8 sendmail offers the ConnectionCacheTimeout option. This option tells sendmail how long to wait for another mail message before closing the connection.

The forms of the ConnectionCacheTimeout option are as follows:

O ConnectionCacheTimeout=waitconfiguration file (V8.7 and later)
-OConnectionCacheTimeout=waitcommand line (V8.7 and later)
define(`confMCI_CACHE_TIMEOUT',wait)   ← mc configuration (V8.7 and later)
OKwaitconfiguration file (V8.6 and later)
-oKwaitcommand line (V8.6 and later)

Optional whitespace can precede the wait. The wait is of type time and specifies the period to wait before timing out a cached connection. If this option is entirely missing, the default (for both the configuration file and the mc configuration technique) is 300 seconds (5 minutes). When specifying the wait, be sure to include a trailing s character. If you don’t, the number that you specify is interpreted by default as a number of minutes. The wait should never be longer than five minutes. A value of 0 essentially turns off caching.

Beginning with V8.13, this option affects delivery agents that receive messages using SMTP over the standard input/output (that is, with P=[LPC]).

This ConnectionCacheTimeout option has an effect only if the ConnectionCacheSize option (ConnectionCacheSize on page 987) is also declared.

The ConnectionCacheTimeout option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ConnectionRateThrottle

Incoming SMTP connection rate V8.8 and later

Whenever an outside site connects to sendmail’s SMTP port, sendmail fork(2)s a copy of itself. That copy (the child) processes the incoming connection and its message. The primary load-limiting mechanisms are the QueueLA (QueueLA on page 1072), RefuseLA (RefuseLA on page 1078), and DelayLA (DelayLA on page 1002) options. However, these options rely on the system load average, which can generally be sluggish and can lag behind events. This ConnectionRateThrottle option, and similar options, exist to help flatten out the actual load until the load average can catch up. The ConnectionRateThrottle option is used like this:

O ConnectionRateThrottle=numconfiguration file (V8.8 and
later)
-OConnectionRateThrottle=numcommand line (V8.8 and later)
define(`confCONNECTION_RATE_THROTTLE', `num')     ← mc configuration (V8.8 and
later)

The num is of type numeric. If it is present and greater than zero, connections are slowed when more than that number of connections arrive within one second. If num is less than or equal to zero, or absent, no threshold is enforced. If the entire option is missing, the default becomes zero. The default for the mc technique is to omit this option.

To illustrate how the slowdown operates, consider a situation in which num is set to 3, and 12 connections come in simultaneously. The first three connections are handled immediately. The next three are handled after one second. The three after that are handled after two seconds, and so on. The twelfth connection would be handled after a delay of three seconds.

Note that this option and the MaxDaemonChildren option (MaxDaemonChildren on page 1044) affect incoming connections differently. Also see the DelayLA option (DelayLA on page 1002) as a way to delay incoming messages on high load.

The ConnectionRateThrottle option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ConnectionRateWindowSize

Window of time in which to measure connection rates V8.13 and later

Under V8.13, two new sendmail macros, called ${client_rate} (${client_rate} on page 814) and ${total_rate} (${total_rate} on page 847), are available to control the number of simultaneous connections allowed. They are used by the corresponding new FEATURE(ratecontrol) (FEATURE(conncontrol) on page 619) and FEATURE(conncontrol) (FEATURE(ratecontrol) on page 638), which perform the same functions via the access database.

This new ConnectionRateWindowSize option sets the size of the window of time that is used to measure these rates. It is declared like this:

O ConnectionRateWindowSize = secs                 ← configuration file (V8.13 and
later)
-O ConnectionRateWindowSize = secs                ← command line (V8.13 and later)
define(`confCONNECTION_RATE_WINDOW_SIZE', `secs') ← mc configuration (V8.13 and
later)

Here, secs is of type time. If this option is omitted, the default for the window of time is 60 seconds. If this option is defined, but the time units are omitted, the default units are seconds.

We recommend you change the default only if you have not already made connection-limiting entries in your access database. If you make those entries first, and then later change this setting, you will silently change the meaning of those access database entries.

The ConnectionRateWindowSize option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ConnectOnlyTo

Connect only to one specified host V8.10 and later

Sometimes it is necessary to test sendmail without allowing mail to be delivered or relayed offsite. In the ideal test situation, it is preferable that the recipient and sender addresses are not modified in the process. After all, one needs to be sure that all headers will be correct, and that all necessary rule sets will be exercised.

The ConnectOnlyTo option provides just such a service by allowing all mail to be relayed to a single machine, regardless of how the mail is addressed. It is declared like this:

O ConnectOnlyTo=ipaddrconfiguration file (V8.10 and
later)
-OConnectOnlyTo=ipaddrcommand line (V8.10 and later)
define(`confCONNECT_ONLY_TO',`ipaddr')        ← mc configuration (V8.10 and later)

Here, ipaddr is the IP addresses of the target machine to which all mail will be delivered. It must be given in the form of a dotted quad unless sendmail was compiled with NETINET6 (NET... on page 126) defined, in which case you can specify an IPv6 address.

The ConnectOnlyTo option can be used when testing, and commented out otherwise. The ConnectOnlyTo option should not be confused with the nullclient or msp features, which send all mail to a hostname that can use MX records, and thus is more versatile and does a superior job of forwarding mail to a dedicated mail server.

An easy way to create a target for the ConnectOnlyTo option’s setting that accepts all SMTP mail, but logs and discards each inbound piece, is to add the following to a new and separate mc configuration file (don’t change your main configuration file):

LOCAL_RULESETS
SLocal_check_rcpt
R$*             $#discard

This setup will cause all inbound SMTP mail to be discarded. Logs will include lines that look (in part) like this:

ruleset=check_rcpt, arg1=<recipient>, relay=host [addr], discard

If you set up a host this way, however, understand that you should probably use a setup that is fully separate from the normal one. That way, user outbound email will still work.

The ConnectOnlyTo option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ControlSocketName

Path to control socket V8.10 and later

Starting with V8.10, the sendmail daemon can accept a few control and status commands via a Unix-based named socket. This interface is primarily intended for use with the tools provided with the commercial version of sendmail, but it can be equally valuable for use with your own home-grown tools. The ControlSocketName option enables this type of controlling interface. It is declared like this:

O ControlSocketName=pathconfiguration file (V8.10 and
later)
-OControlSocketName=pathcommand line (V8.10 and later)
define(`confCONTROL_SOCKET_NAME', path)       ← mc configuration (V8.10 and later)

Here, the argument path, of type string, is the full pathname of the Unix named socket. The file named by path need not exist. If it exists, sendmail will remove it and create a new named socket. As a consequence, you should avoid accidently declaring path with an existing file. The file will be silently removed when sendmail starts.

The path needs to be secure. That is, every component of it should be owned by, and writable only by, root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). Because this interface can be used to shut down the sendmail daemon, the socket requires extra protection. On some operating systems (such as with Solaris and pre-4.4 BSD kernels), it is not enough to make the socket mode 0600. You should also place it in a directory that is root-owned and of mode 0700. On such operating systems, if you put it in a directory that is world-searchable, anyone on the same machine will be able to shut down the daemon.

If the path specification is one where some component does not exist, sendmail will log the following message and not use a controlling socket:

daemon could not open control socket /vqr/spool/mqueue/.control: No such file or
directory

Here, /vqr was mistyped, when /var is what was meant.

An example of code that shows one way to use the controlling socket is in contrib/smcontrol.pl, a perl(1) script that requires version 5 or higher perl to use. It gathers the name of the control socket from the hardcoded file named /etc/mail/sendmail.cf. To run it, you just invoke it with a single argument:

# cd contrib
# ./smcontrol.pl help
Help for smcontrol:
help            This message.
restart         Restart sendmail.
shutdown        Shut down sendmail.
status          Show sendmail status.
memdump         Dump allocated memory list (for debugging only).
End of HELP info

The contrib/smcontrol.pl program is a simple command-line interface to the controlling socket. It should be considered a prototype for developing your own, more sophisticated, tools. Consider, for example, the usefulness of the status output:

# ./smcontrol.pl status
Daemon Status: (process 13480) Accepting connections

Child Process 13560 Status: SMTP server child for 123.45.67.8
Child Process 13579 Status: SMTP server child for 123.45.67.9
Child Process 13584 Status: console socket child

This shows that the daemon is up, and that two sites are connected to yours for the transmission of mail.

The new control socket command mstat has been added beginning with V8.14. This new command causes sendmail to emit stats in a machine-friendly format:

# ./smcontrol.pl mstat
C:1
M:0
L:0
Q:NOTCONFIGURED:−1
D:0/./772127
P:2914 accepting connections
P:19204 SMTP server child for 12.34.56.78
P:19210 console socket child

The ControlSocketName option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

CRLFile

Location of Certificate Revocation file V8.13 and later

Beginning with V8.13, sendmail supports use of the certificate revocation lists available with OpenSSL[368] version 0.9.7 and above. The new CRLFile option allows you to declare the location and name of a certificate revocation list file.

When an inbound connection is received by sendmail, and when the connecting host requests a secure session by giving the STARTTLS command, the local sendmail (by way of the OpenSSL library) uses the information in CRLFile to determine whether the connecting host’s certificate should be accepted or rejected.

The file specified by the CRLFile option is created using the openssl(1) command. After the file has been created, you need to declare its location like this:

O CRLFile=/path/file                    ← configuration file (V8.13 and later)
-OCRLFile=/path/file                    ← command line (V8.13 and later)
define(`confCRL',`/path/file')          ← mc configuration (V8.13 and later)

Here, /path/file is of type string and specifies the full-path location of the certificate revocation list file. By default, the CRLFile option is not declared. But if the file is declared using this CRLFile option, and does not exist or is unreadable or has bad permissions, all STARTTLS commands are disallowed by sendmail. Note that the /path/file argument may contain sendmail macros, and those macros will be expanded as the configuration file is read.

If your version of OpenSSL is too old, the following warning will print when you try to declare the CRLFile option, and the option will be ignored:

Warning: Option: CRLFile requires at least Open SSL 0.9.7

The file referenced by the CRLFile option is created using the openssl(1) command. For example, if you are using your own CA, the following can be used to create a file named /etc/ssl/crl.pem:[369]

openssl ca -revoke certificate-file ← first revoke the certificate
openssl ca -gencrl -out crl.pem     ← then create the revocation list

If you need DER format in your revocation list file, you can substitute the following line for the second line in the preceding snippet:

openssl crl -in crl.pem -outform der -out crl.der

Note that these examples are an oversimplification for illustrative purposes only. See the OpenSSL documentation for more details.

The CRLFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DaemonPortOptions

Options for the daemon V8.1 and later

The sendmail program can run in two connection modes: as a daemon, accepting connections; or as a client, making connections. Each mode can connect to a port to do its work. The options for the client port are set by the ClientPortOptions option (ClientPortOptions on page 986). The options for the daemon are set by this DaemonPortOptions option.

This DaemonPortOptions option is used to customize the daemon’s SMTP service. The form for this option is as follows:

O DaemonPortOptions=pair,pair,pairconfiguration file (V8.7 and
later)
-ODaemonPortOptions=pair,pair,paircommand line (V8.7 and
later)
define(`confDAEMON_OPTIONS',``pair,pair,pair'')     ← mc configuration (V8.7 and
later)
DAEMON_OPTIONS(``pair,pair,pair'')                  ← mc configuration (V8.11 and
later)
OOpair,pair,pairconfiguration file
(deprecated)
-oOpair,pair,paircommand line (deprecated)

The DaemonPortOptions option is set to a comma-separated list of pairs,[370] where each pair is of the form:

key=value

As of V8.14.1, all keys are case-sensitive.[371] That is, Children differs from children. Prior to V8.7, an unknown key was silently ignored. With V8.8 and later, an unknown key is still ignored but now causes the following error to be printed:

DaemonPortOptions unknown parameter "key"

Beginning with V8.10, you can declare multiple DaemonPortOptions options, where each causes the single listening daemon to accept connections over multiple sockets.

The list of all currently defined keys is shown in Table 24-14.

Table 24-14. DaemonPortOptions option keywords

Key

§

Meaning

Addr

DaemonPortOptions=Addr= on page 994

The network to accept connection from

children

DaemonPortOptions=children= (8.14 and later) on page 994

The maximum number of children to fork for this daemon (V8.14 and later)

delayLA

DaemonPortOptions=delayLA= (8.14 and later) on page 995

The load average at which to delay accepting connections (V8.14.1 and later)

DeliveryMode

DaemonPortOptions=DeliveryMode= (8.14 and later) on page 995

The mode with which to perform delivery (V8.14 and later)

Family

DaemonPortOptions=Family= on page 995

The type of network we are connected to

InputFilter

DaemonPortOptions=InputFilter= on page 1178

List of Milters to call (V8.13 and later)

Listen

DaemonPortOptions=Listen= on page 995

The size of the listen(2) queue

Modify

DaemonPortOptions=Modify= on page 996

User-settable flags that modify daemon behavior (V8.10 and later)

Name

DaemonPortOptions=Name= on page 996

User-definable name for the daemon (V8.10 and later)

Port

DaemonPortOptions=Port= on page 997

The port number on which sendmail should listen

queueLA

DaemonPortOptions=queueLA= (8.14 and later) on page 997

The load average at which to begin queueing all inbound email (V8.14 and later)

ReceiveBufSize

DaemonPortOptions=ReceiveBufSize= on page 997

The size of the TCP/IP receive buffer

refuseLA

DaemonPortOptions=refuseLA= (8.14 and later) on page 997

The load average at which to begin refusing all inbound connections (V8.14.1 and later)

SendBufSize

DaemonPortOptions=SendBufSize= on page 998

The size of the TCP/IP send buffer

Only the first character in each key is recognized, so a succinct declaration such as the following can be used to change the port used by the daemon:

O DaemonPortOptions=P=26,A=our-addr  # Only listen for local mail on nonstandard port
26

The DaemonPortOptions option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DaemonPortOptions=Addr=

The Addr key specifies the address to use. The value is the name[372] or IP address of one of your network interfaces:

O DaemonPortOptions=Addr=128.32.204.25     # listen to our IP address only

If the Addr= and its value are omitted, the default address becomes INADDR_ANY, which allows connections to any address on the local machine. Note that this Addr is most useful on multihomed (or multialiased interface) machines, although it can also be useful on single interface machines (such as listening for connections on the localhost, 127.0.0.1).

Whenever sendmail calls rule sets to process a message, it puts the value of this DaemonPortOptions=Addr option into the ${daemon_addr} macro (${daemon_addr} on page 817). That macro is available for designing rule sets which make decisions based on the network address. (See also the ${client_addr) macro, ${client_addr} on page 810.)

DaemonPortOptions=children= (8.14 and later)

The children key is used to specify the maximum number of children to fork for the daemon in question. This setting overrides the value specified for the MaxDaemonChildren option (MaxDaemonChildren on page 1044).

One use for this key might be to limit the number of connections to the MSA daemon to just a few:

O DaemonPortOptions=Port=587, Name=MSA, M=E, children=4

Or you might want to limit the number of children on a special daemon, like one that listens on some internal port for special mail insertion by a program of your own design. Whatever your reason, the value for this key must be the ASCII representation of an unsigned integer suitable for interpretation by atoi().

DaemonPortOptions=delayLA= (8.14 and later)

The delayLA key is used to specify a load average at which sendmail will sleep briefly before accepting new connections. This setting overrides the setting for the DelayLA option (DelayLA on page 1002). See also the DaemonPortOptions option’s queueLA (DaemonPortOptions=queueLA= (8.14 and later)) and refuseLA (DaemonPortOptions=refuseLA= (8.14 and later) on page 997) keys.

DaemonPortOptions=DeliveryMode= (8.14 and later)

The DeliveryMode key is used to specify the manner in which to perform delivery. Only the first letter of the value is recognized, and it must be one of the four values shown in Table 24-16 on page 1005. This setting overrides the setting for the DeliveryMode option (DeliveryMode on page 1004). If an unknown delivery mode is specified, the following error is printed and this key is ignored:

554 5.3.5 Unknown delivery mode first character here

DaemonPortOptions=Family=

The Family key is used to specify the network family. The legal possible values are inet for AF_INET, inet6 for AF_INET6, iso for AF_ISO, ns for AF_NS, and x.25 for AF_CCITT:

O DaemonPortOptions=Family=iso

Note that only inet, inet6, and iso are currently supported. The default is inet. Also note that inet requires NETINET to be defined, inet6 requires NETINET6 to be defined, and iso requires NETISO to be defined when sendmail is compiled (see NET... on page 126).

Whenever sendmail calls rule sets to process a message, it puts the value of this DaemonPortOptions=Family option into the ${daemon_family} macro (${daemon_family} on page 818). That macro is available for designing rule sets which make decisions based on the address family.

DaemonPortOptions=Listen=

When sendmail begins to run in daemon mode, it executes a listen(2) system call as part of monitoring its SMTP port for incoming mail. The second argument to listen(2) defines the maximum length to which the incoming queue of pending connections can grow. If a connection request arrives with the queue full, the client will receive an error that indicates ECONNREFUSED. This Listen key is used to change the size of the incoming queue from its default of 10. If Listen is less than or equal to zero, listen(2) will silently set its own default. But note that some kernels might have built-in defaults of their own, so setting Listen might have no effect.

DaemonPortOptions=Modify=

Beginning with V8.10 sendmail, you can modify selected characteristics of the port. Modification is done by listing selected letters from Table 24-15 following the Modify=. Note that the letters are case-sensitive. Also note that of these letters, only h, S, and A are valid for the ClientPortOptions option.

Table 24-15. Modify= port option letters

Letter

Meaning

a

Require authentication with the AUTH ESMTP keyword before continuing with the connection. Do not use this setting on a public MTA that listens on port 25!

b

Only send mail out on the interface address through which mail has been received. This is most useful on a host that is known by many hostnames, such as an ISP supporting multiple company domains on a single server, although it is also useful on smaller machines that restrict inbound connections to particular addresses.

c

Always perform hostname canonification. Determined via the ${daemon_flags} macro (${daemon_flags} on page 818) and the ${client_flags} macro (${client_flags} on page 812).

f

Require fully qualified hostnames. Whether a hostname is fully qualified is determined via configuration file rules that employ the ${daemon_flags} macro (${daemon_flags} on page 818) and the ${client_flags} macro (${client_flags} on page 812). See also FEATURE(accept_unqualified_senders) (FEATURE(accept_unqualified_senders) on page 614).

h

Ignored by the daemon.

r

Request fully qualified recipient address. Uses ${daemon_flags} (${daemon_flags} on page 818) and ${client_flags} (${client_flags} on page 812).

s

Use SMTP over SSL (V8.13 and later).

u

Allow unqualified addresses. Determined via the ${daemon_flags} macro (${daemon_flags} on page 818), the ${client_flags} macro (${client_flags} on page 812), and configuration file rules. See also FEATURE(accept_unqualified_senders) (FEATURE(accept_unqualified_senders) on page 614).

A

Disable authentication—overrides the a modifier above. (V8.12 and later)

C

Don’t perform hostname canonification.

E

Disallow use of the ETRN command (Process the queue via ESMTP ETRN on page 433) as per RFC2476. Used for the MSA port 587.

O

If opening a socket fails, ignore the failure. (V8.12 and later)

S

Don’t offer STARTTLS at session beginning. (V8.12 and later)

In general, uppercase letters turn items on, and lowercase letters turn items off. Note that use of letters other than those shown will not yield an error. In fact, you can add your own letters and then use a ${daemon_flags} (${daemon_flags} on page 818) or ${client_flags} (${client_flags} on page 812) macro in your own custom rule sets to produce other interesting port-based decisions. One possibility might be to insist that any sender addresses arriving in the internal interface be fully qualified, and part of the local domain.

DaemonPortOptions=Name=

Because sendmail can listen on different ports simultaneously, and can bind to specific interfaces, it is desirable that each such instance be given a distinctive name. When listening on port 25 for inbound mail, sendmail is functioning as an MTA. When listening on port 587 for locally submitted mail, sendmail is functioning as an MSA.

This DaemonPortOptions=Name= is used to set the name that will be reported with the daemon= syslog equate (daemon= on page 522) and that is placed into a ${daemon_name} (${daemon_name} on page 819) or ${client_name} (${client_name} on page 812) macro. Many errors in connections now produce error messages that include the expression:

daemon name

to help clarify which port and role ran into a problem.

DaemonPortOptions=Port=

The Port key is used to specify the service port on which the daemon should listen. This is normally the port called smtp, as defined in the /etc/services file. The value can be either a services string (such as smtp) or a number (such as 25). This key is useful inside domains that are protected by a firewall. By specifying a nonstandard port, the firewall can communicate in a more secure manner with the internal network while still accepting mail on the normal port from the outside world:

O DaemonPortOptions=Port=26

If this pair is missing, the port defaults to smtp.

As of V8.10, sendmail now also obeys RFC2476 and (by default) listens on port 587 for the local submission of mail (see FEATURE(no_default_msa) on page 635).

The value of Port (port number) is placed into the ${daemon_port} macro (${daemon_port} on page 819) whenever rule sets are processed by that invocation of the daemon. For the ClientPortOptions option, the value of Port (port number) is placed into the ${client_port} macro whenever the client connects to another host.

Note that for the ClientPortOptions option, this Port probably should be set because it limits outbound connections to one per IP address (because ports cannot be shared).

DaemonPortOptions=queueLA= (8.14 and later)

The queueLA key is used to specify a load average at which sendmail will begin to queue all inbound email. This setting overrides the setting for the QueueLA option (QueueLA on page 1072). See also the DaemonPortOptions option’s delayLA (DaemonPortOptions=delayLA= (8.14 and later) on page 995) and refuseLA (DaemonPortOptions=refuseLA= (8.14 and later) on page 997) keys.

DaemonPortOptions=ReceiveBufSize=

The ReceiveBufSize key is used to specify the size of the TCP/IP receive buffer. The value is a size in bytes. This should not be set unless you are having performance problems. Slow links (such as 9.6K SL/IP lines) might profit from a setting of 256, for example:

O DaemonPortOptions=ReceiveBufSize=256

The default value is set by the system (see setsockopt(2)).

DaemonPortOptions=refuseLA= (8.14 and later)

The refuseLA key is used to specify a load average at which sendmail will begin to refuse acceptance of all inbound connections. This setting overrides the setting for the RefuseLA option (RefuseLA on page 1078). See also the DaemonPortOptions option’s delayLA (DaemonPortOptions=delayLA= (8.14 and later) on page 995) and queueLA (DaemonPortOptions=queueLA= (8.14 and later) on page 997) keys.

DaemonPortOptions=SendBufSize=

The SendBufSize key is used to specify the size of the TCP/IP send buffer. The value is a size in bytes. This should not be set unless you are having performance problems. Slow links (such as 9.6K SL/IP lines) might profit from a setting of 256, for example:

O DaemonPortOptions=SendBufSize=256

The default value is set by the system (see setsockopt(2)).

DataFileBufferSize

Buffered I/O df size V8.10 and later

It is possible to buffer df files in memory[373] and not flush those files to disk until they exceed a specified size, or until they are required to be placed on stable storage by the standards. That maximum buffered size is specified with this DataFileBufferSize option. It is declared like this:

O DataFileBufferSize=sizeconfiguration file (V8.10 and later)
-ODataFileBufferSize=sizecommand line (V8.10 and later)
define(`confDF_BUFFER_SIZE',size)          ← mc configuration (V8.10 and later)

Here, size is of type numeric. If size is less than or equal to zero, no buffering is performed (all df files are immediately placed on disk when opened). When size is greater than zero, all df files are held in memory (not placed on disk when opened) until closed, until the amount of data buffered exceeds size, or until they are required to be placed on stable storage by the standards. Only then is the file created and placed on disk.

Buffered file I/O is beneficial when high rates of outbound mail are desired because disk I/O is generally very expensive.

If the DataFileBufferSize option is not declared, the default for the mc configuration file is to omit this option. If the size is omitted, the default becomes 4,096 bytes.

See also the SuperSafe option (SuperSafe on page 1096) and the ${opMode} macro (${opMode} on page 839) as they can interact with this option.

The DataFileBufferSize option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DeadLetterDrop

Define dead.letter file location V8.10 and later

When handling bounced mail, sendmail first tries to deliver it to the envelope sender. If that fails, it next tries to deliver to the user defined by the DoubleBounceAddress option (DoubleBounceAddress on page 1025). If the message cannot be delivered to that user (perhaps because a valid user was not specified), sendmail attempts to save the message to the file defined by this DeadLetterDrop option, usually the file /var/tmp/dead.letter.

The DeadLetterDrop option is declared like this:

O DeadLetterDrop=pathconfiguration file (V8.10 and later)
-ODeadLetterDrop=pathcommand line (V8.10 and later)
define(`confDEAD_LETTER_DROP',`path')      ← mc configuration (V8.10 and later)

Here, path is the full path to the file for saving unsaveable bounce messages. If path is omitted, or if this entire option is omitted, no saving is performed, and instead sendmail will log a panic and leave the message in the queue, but renamed as a Qf file. The default configuration is to not define this option. The recommended value for path when defining this option is /var/tmp/dead.letter (but setting this option is not recommended).

The DeadLetterDrop option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DefaultAuthInfo

Source of AUTH information Deprecated

When sendmail is compiled with SASL (SASL on page 137) defined, authenticated connections can be supported. When negotiating an authenticated connection certain information is required, specifically and in this order:

  • The user id is the identifier sendmail uses to check allowable permissions. In general, this should never be root.

  • The authorization id is the identifier of the user allowed to set up the connection. In general, this should never be root.

  • The password is the clear text password used to authorize the mail connection. This should be a password dedicated to this use, not the plain text copy of the user’s password.

  • The realm is the administrative zone for authentication. In general, this should be your DNS domain. If no realm is specified (this item is blank), sendmail will substitute the value of the $j macro ($j on page 830).

  • The mechanism is the preferred mechanism for connection authentication. This should match one of the mechanisms listed in the AuthMechanisms option (AuthMechanisms on page 975).

This information can be stored either in a file where the items are listed one per line in the order shown, or in a program that is run and that prints these items to its standard output, one per line in the order shown. A program is a path specification prefixed with a vertical bar character. A file is a path specification not prefixed. The DefaultAuthInfo option is declared like this:

O DefaultAuthInfo=pathconfiguration file (V8.10 and later)
-ODefaultAuthInfo=pathcommand line (V8.10 and later)
define(`confDEF_AUTH_INFO',`path')         ← mc configuration (V8.10 and later)

The file or program specified by path must live in a secure directory (that is, one in which every component is writable only by root or the trusted user specified in the TrustedUser option), and must be readable or executable only by root or the user listed in the TrustedUser option (TrustedUser on page 1112). This option is not declared in the default configuration file generated by the mc configuration technique. The recommended path for the file form is /etc/mail/default-auth-info. No programs currently exist which can provide the information that is currently provided by the file.

Note that this DefaultAuthInfo option was introduced in V8.10 and declared deprecated in V8.12. Its functionality has been replaced by the access database and FEATURE(authinfo) (FEATURE(authinfo) on page 616).

The DefaultAuthInfo option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DefaultCharSet

Define Content-Type: character set V8.7 and later

When a mail message is converted from 8 to 7 bits (see the EightBitMode option in EightBitMode on page 1025), it is important that the result look like a MIME message. V8.7 and later sendmail first outputs the following header if one is not already present:

MIME-Version: 1.0

After that, sendmail looks for a Content-Type: header (Content-Type: on page 1154). If none is found, the following is inserted, where dfltchset is the value declared for this option:

Content-Type: text/plain; charset=dfltchset

The forms of the DefaultCharSet option are as follows:

O DefaultCharSet=dfltchsetconfiguration file (V8.7 and later)
-ODefaultCharSet=dfltchsetcommand line (V8.7 and later)
define(`confDEF_CHAR_SET',dfltchset)        ← mc configuration (V8.7 and later)

If the DefaultCharSet option is undefined, dfltchset defaults to the string unknown-8bit. The default for the mc technique is to omit this option.

Note that if the C= equate (C= on page 741) is present for the sender’s delivery agent, that character set supersedes this DefaultCharSet.

The DefaultCharSet option is safe. If specified from the command line, sendmail will not relinquish its special privileges.

DefaultUser

Default delivery agent identity All versions

The sendmail program can be run as a set-user-id root process (that is, with the permissions of root, regardless of who runs it, the default prior to V8.12). It can also be run as an ordinary process by an ordinary (nonprivileged) user (that is, with root privilege only if it is run by root). When sendmail is run so that it has root privilege, it must give up that privilege under certain circumstances to remain secure.[374]

When it can’t set its identity to that of a real user, or when it should not (as when writing to files or running programs specified in the aliases file), sendmail sets its gid to that specified by the g option and its uid to that specified by the u option. For V8.7 and later, the DefaultUser option sets both the user and group identities.[375]

When sendmail is running with root privilege and when the F=S delivery agent flag (F=S on page 780) is not specified, sendmail changes its owner and group identity to that of an ordinary user in the following circumstances:

  1. If the mail message is forwarded because of a user’s ~/.forward file, and if delivery is via a delivery agent that has the F=o flag set (F=o on page 777), sendmail changes its owner and group identity to that of the user whose ~/.forward file was read.

  2. Otherwise, if the mail message is being delivered through an aliases(5) file’s :include: mailing list expansion, and if delivery is via a delivery agent that has the F=o flag set (F=o on page 777) or to a file, sendmail changes its owner and group identity to that of the owner of the file that was specified by the :include: line.

  3. Otherwise, if the sender of the mail message is local and if delivery is via a delivery agent that does not have the F=o flag set (F=o on page 777) or to a file, sendmail changes its owner and group identity to that of the sender. If the sender is root, sendmail changes its owner and group identity to that specified by this DefaultUser option.

  4. Otherwise, sendmail changes its owner and group identity to that specified by this DefaultUser option.

These user and group defaults are ignored if the delivery agent’s F= equate includes the S flag (run as another specified user). Also, if the delivery agent’s U= equate is set, it will be used instead of DefaultUser.

The forms of the DefaultUser option are as follows:

O DefaultUser=uid:gidboth, configuration file (V8.7 and later)
-ODefaultUser=uid:gidboth, command line (V8.7 and later)
define(`confDEF_USER_ID',`uid')     ← user, mc configuration (V8.7 and later)
define(`confDEF_GROUP_ID',`gid')    ← group, mc configuration (obsolete as of
V8.7)

define(`confDEF_USER_ID',`uid:gid') ← both, mc configuration (V8.7 and later)
Ouuiduser, configuration file (deprecated)
-ouuiduser, command line (deprecated)
Oggidgroup, configuration file (deprecated)
-oggidgroup, command line (deprecated)
Ouuid:gidboth, configuration file (deprecated)
-ouuid:gidboth, command line (deprecated)

The arguments uid and gid are of type numeric. Beginning with V8 sendmail, user or group names can also be text (for example, nobody). Beginning with V8.7 sendmail, the user definition with DefaultUser can specify both user and group. For example:

O DefaultUser=daemon:nogroup

There can be arbitrary whitespace between the user (daemon), the colon, and the group (nogroup). If the group is missing, the value that is assigned to it varies depending on the nature of the uid specification. If the uid is a name, the group becomes the default group of that user as defined in the passwd(5) file. If the uid is numeric, the value in the group is not changed. For example, consider this passwd(5) file entry, where the group 12 corresponds to the group name bumgroup:

bogus:*:10:12::/:

Then all the following are equivalent:

O DefaultUser=bogus
O DefaultUser=bogus:12
O DefaultUser=bogus:bumgroup
O DefaultUser=10:12

Under pre-8.7 sendmail, a missing argument caused the value 0 to be used for the respective user or group identities. If an entire u or g option was missing, the default value became 1 (usually daemon). Under V8.7 and later sendmail, the default is to look up each of the following usernames, and to use the first one found to exist:

mailnull
sendmail
daemon

If none of these is found, the default becomes 1:1. In NFS-mounted environments, safe values for these options are often one or more less than those of the user nobody and the group nogroup.[376]

For maximum security, you should create a special pseudouser and assign that pseudouser to this option. (See The DefaultUser option on page 175 for a more detailed description of this approach.)

The g, u, and DefaultUser options are not safe. If specified from the command line, they can cause sendmail to relinquish its special privileges.

DelayLA

Add one second SMTP sleep on high load V8.12 and later

When the load average on a machine (the average number of processes in the run queue over the last minute) becomes too high, sendmail can compensate in three different ways:

  • The QueueLA option (QueueLA on page 1072) determines the load at which sendmail will begin to queue messages rather than delivering them, and at which it will skip any scheduled queue runs, and the load at which scheduled runs will be skipped.

  • The RefuseLA option (RefuseLA on page 1078) determines the load at which sendmail will begin to refuse connections rather than accepting them.

  • The DelayLA option determines the load at which sendmail will begin to delay replies to SMTP commands.

The forms of the DelayLA option are as follows:

O DelayLA=loadconfiguration file (V8.12 and later)
-ODelayLA=loadcommand line (V8.12 and later)
define(`confDELAY_LA',load)   ← mc configuration (V8.12 and later)

The optional argument load, of type numeric, defaults to zero if it is missing. If the entire DelayLA option is missing, the default value given to load is zero. The default for the mc technique is to omit this option.

This DelayLA option is effective only if your sendmail binary was compiled with load-average support (LA_TYPE on page 118), which is almost universal these days. You can use the -d3.1 debugging switch to discover whether your binary includes the necessary support.

Should the load on the machine reach or exceed the limit, sendmail will begin to impose a delay on each received SMTP command (commands received by a listening daemon). When an SMTP command arrives, sendmail will sleep one second before processing it:

RCPT To: <user@your.domain>
     ← sleep one second here

When the limit is first met or exceeded, the following message will be logged:

delaying connections on daemon name: load average=load
 >= limit

Here, name is the name given to the port that is handling the connection. That name is set with the DaemonPortOptions option (DaemonPortOptions on page 993) Name= equate.

The load is the current load average, and the limit is the limit set by this option. This message is logged only once, and then again every 90 seconds for as long as the high load condition persists.

The sleep of one second, and the logging interval of 90 seconds, are both hardcoded in the source and cannot be changed.

Beginning with V8.14, this load average cutoff can be tuned on an individual daemon basis using the DaemonPortOptions option’s keyword delayLA (DaemonPortOptions=delayLA= (8.14 and later) on page 995).

The DelayLA option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DeliverByMin

Set default DELIVERBY interval V8.12 and later

RFC2852 defines a way to ensure that a message is delivered or bounced within a defined maximum window of time. This method is known as the DELIVERBY SMTP extension and is used like the following (shown in bold):

220 your.host.domain ESMTP Sendmail 8.12.7/8.12.7; Fri, 13 Dec 2002 10:09:06 −0600
(MDT)
EHLO another.host.domain
250-your.host.domain Hello another.host.domain [123.45.67.8], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBYnote
250 HELP
MAIL From:<bob@another.host.domain> BY=600;Rnote
250 2.1.0 <bob@another.host.domain>... Sender ok

Here, your site tells the connecting site that it supports the DELIVERBY SMTP extension by displaying the 250-DELIVERBY line. Then the other site recognizes that support and says that it wants the message delivered within 600 seconds by including the BY=600;R as part of the envelope sender MAIL From: command.

The ;R tells your server to not relay this message to a site that does not support this extension. The only possibility, other than ;R, is a ;N, which means the message can be relayed to another site, regardless of whether that other site supports this extension.

It is possible to run software or a configuration at your site in such a way that mail cannot be immediately delivered. If you screen all messages for viruses, for example, or if you queue all inbound mail and deliver from the queue, you will likely not be able to guarantee immediate delivery. In such instances, you are required to advertise the size of that delay. You advertise such delays by adding an argument to the SMTP DELIVERBY command:

250-DELIVERBY 300

Here, you advertise that you cannot guarantee delivery in less than 300 seconds (5 minutes), perhaps because you queue all inbound mail and process the queue only once each 5 minutes. If a message arrives with a requirement that it be delivered within 250 seconds:

MAIL From: <bob@another.host.domain> BY=250;R

it would bounce because your site said it could not honor such a narrow window of delivery time.

The way your advertise your minimum delivery time is with the DeliverByMin option, which is declared like this:

O DeliverByMin=mintimeconfiguration file (V8.12 and later)
-ODeliverByMin=mintimecommand line (V8.12 and later)
define(`confDELIVER_BY_MIN',`mintime')      ← mc configuration (V8.12 and later)

Here, mintime is of type time. If mintime is negative, the DELIVERBY extension is not offered. If mintime is zero (the default), the DELIVERBY SMTP extension is offered, but no minimum is stated. If mintime is greater than zero, the DELIVERBY SMTP extension is offered and your minimum is stated. Note that no command-line switches are available to cause sendmail to include a BY= in the MAIL From: command.

Whenever mail is propagated with a BY=, the receiving site will subtract the time it takes to deliver or relay the message from the value specified by the BY=. If the difference is negative, the message is bounced. If the difference is positive, the new (smaller) value is passed to the next site using a new BY= showing that new value. The process continues until the message is delivered, or until a site in the chain requires more than the BY= interval to deliver or relay the message, at which point the message is bounced.

The DeliveryByMin option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DeliveryMode

Set delivery mode All versions

sendmail can use four modes for delivering mail. Three have always been a part of sendmail: background, interactive, and queue-only. The deferred mode has been added under V8.7 and later sendmail.

The mode is selected with the DeliveryMode option:

O DeliveryMode=modeconfiguration file (V8.7 and later)
-ODeliveryMode=modecommand line (V8.7 and later)
define(`confDELIVERY_MODE',mode)   ← mc configuration (V8.7 and later)
Odmodeconfiguration file (deprecated)
-odmodecommand line (deprecated)

The mode argument is of type character. It is case-sensitive (must be lowercase) and is selected from one of the keywords shown in Table 24-16. Only the first letter of each is recognized, but we recommend full words for improved clarity.

Table 24-16. DeliveryMode option keywords

Keyword

§

Description

background

DeliveryMode=background on page 1005

Background (asynchronous) delivery

deferred

DeliveryMode=deferred on page 1006

Deferred (held as is) delivery (V8.7 and later)

interactive

DeliveryMode=interactive on page 1006

Interactive (synchronous) delivery

queueonly

DeliveryMode=queueonly on page 1006

Queued (held but processed) delivery

If the mode argument is missing, this option defaults to the i or interactive mode. If the entire DeliveryMode option is missing, V8 sendmail defaults to background mode, but old sendmail behaves unpredictably; consequently, this option should be considered mandatory. The default for the mc configuration is also background.

If the mode character is anything other than the first lowercase letter of one of the keywords shown in Table 24-16, sendmail will print and log the following error and will immediately exit with an exit value of EX_USAGE as defined in <sysexits.h>:

Unknown delivery mode char

Prior to V8.12, queue-only and deferred modes were available only if QUEUE was defined when sendmail was compiled (QUEUE on page 135). If QUEUE was not defined and one of these two modes was selected, sendmail would print and log the following:

need QUEUE to set -odqueue or -oddefer

Beginning with V8.12, the QUEUE Build macro has been removed, and the various queue-related modes are always available.

The DeliveryMode option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

DeliveryMode=background

Background mode—intended primarily[377] for use in the configuration file—allows sendmail to run asynchronously. This means that once sendmail has gathered the entire message and verified that the recipient is deliverable, it will fork(3) a copy of itself and exit. The copy, running in the background (asynchronously), will then handle the delivery. From the user’s point of view, this mode allows the mail interface program to act as though it sent the message nearly instantaneously.

DeliveryMode=deferred

Deferred mode—for use in either the command line or the configuration file—is much like queue-only mode except that all database lookups, including DNS, are deferred until the actual queue run. Deferred mode (V8.7 and later) is preferred for dial-on-demand sites (typically, modem-based SL/IP or PPP connections). Just as in queue-only mode, all mail is queued for later delivery, but with deferred mode, code inside sendmail that would ordinarily interact with DNS is suppressed. This prevents the modem from being dialed and connections from being established every time mail is queued.

See also the -D database-map switch (-D on page 887) and the DialDelay option (DialDelay on page 1007).

DeliveryMode=interactive

Interactive mode—intended for use from the command line—causes sendmail to run synchronously. This mode is useful primarily for debugging mail problems. Instead of going into the background with fork(3), it runs in the foreground (synchronously). In this mode, error messages are printed back to the controlling terminal rather than being mailed to the user as bounced mail. The -v command-line switch (-v on page 249) automatically sets the mode to interactive.

DeliveryMode=queueonly

Queue-only mode—for use in either the command line or the configuration file—causes sendmail to synchronously queue mail. Queue-only mode is useful at sites that have huge amounts of UUCP mail or Usenet news batch feeds, or when delivering to low-priority addresses such as mailing lists. Queuing has the beneficial effect of serializing delivery through queue runs, and it reduces the load on a machine that many parallel backgrounded sendmail processes can cause. Queue-only mode is typically supplied as a command-line option to sendmail by the uuxqt(8) program. When queue-only mode is selected, all mail is queued for delivery, and none is actually delivered. A separate run of sendmail with its -q command-line switch (Periodically with -q on page 427) is needed to actually process the queue. Note that addresses can still be looked up with DNS as a part of the queueing process. Consequently, queue-only mode is probably not suitable for dial-on-demand sites.

DHParameters

Parameters for DSA/DH cipher suite V8.11 and later

For Ephemeral Diffie-Hellman encoding, the server first sends either an RSA or a DSA public key. The server then generates, signs, and sends the Diffie-Hellman (DH) parameters and the DH public value.

The DH parameters that are sent are generated or read from a file. The location of that file is defined with this DHParameters option:

O DHParameters=paramconfiguration file (V8.11 and later)
-ODHParameters=paramcommand line (V8.11 and later)
define(`confDH_PARAMETERS',`param')   ← mc configuration (V8.11 and later)

Here, param is one of the items shown in Table 24-17. Note that only the first character is examined, so 5 and 512 are equivalent. Also note that the default is 1024 for the server, and 512 for the client.

Table 24-17. DHParameters parameter items

Item

Meaning

None

No parameters, so don’t use DH.

512

Generate 512-bit fixed parameters.

1024

Generate 1024-bit fixed parameters.

/path/file

Read the parameters from a file.

If you list the /path/file item, the file referenced must live in a safe path, one that is writable only by root.

If you use an item that is not in the table, one of the following errors will print and be logged, depending on whether sendmail is in the role of a client or server:

STARTTLS=client, error: illegal value 'bad item' for DHParam
STARTTLS=server, error: illegal value 'bad item' for DHParam

This option should be defined only if a cipher suite containing DSA/DH is used. Otherwise, you should leave it undefined.

The DHParameters option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DialDelay

Connect failure retry time V8.7 and later

Many Internet providers allow small sites (such as home machines) to dial up when there is a demand for network traffic to flow. Such connections are usually of short duration and use the PPP or SL/IP protocol. A problem can arise when this dial-up-on-demand is instigated by sendmail.[378] The process of negotiating a dial-up connection can take so long that sendmail will have its attempt to connect(2) fail. (See also the connect keyword for the Timeout option in Timeout.connect (V8.6 and later) on page 1101.) To remedy this situation, V8.7 and later offer the DialDelay option. It is declared like this:

O DialDelay=delayconfiguration file (V8.7 and later)
-ODialDelay=delaycommand line (V8.7 and later)
define(`confDIAL_DELAY',delay) ← mc configuration (V8.7 and later)

The argument delay is of type time. If this option is entirely omitted or if delay is omitted, the default is then zero and no delay is enabled. The default for the mc configuration technique is also zero. If the unit of time is omitted from the time declaration, the default is seconds.

If delay is nonzero and sendmail has its initial connect(2) fail, it will sleep(3) for delay seconds and then try to connect(2) again. Note that sendmail tries to connect again only once, so the delay should be large enough to accommodate your anticipated worst-case delay. On the other hand, care should be taken to avoid excessively long delays that can make sendmail appear to hang. No check is made by sendmail for absurdly large values given to delay.

This option was more relevant in the days of dial-out modems. With ISDN lines this option shouldn’t be needed. You should need this option only if you are dialing out on an old-technology modem.

The DialDelay option is safe. If it is specified from the command line, sendmail will not relinquish its special privileges.

DirectSubmissionModifiers

Daemon direct submission flags V8.12 and later

Direct submission of email is accomplished by running sendmail on the command line:

% /usr/sbin/sendmail address
% /usr/sbin/sendmail -t < file
% /usr/sbin/sendmail -bs

The first form shows the recipient address being set as part of the command line. The second form shows the recipient address being parsed from the headers in the file. And the third form shows the recipient being taken from an SMTP session run via standard input and output.

Regardless of how you submit messages to sendmail, on the command line or with -bs, it is still considered direct submission. When a message is directly submitted it is of a different nature than a message received over a socket. When a message is directly submitted, the ${daemon_flags} sendmail macro (${daemon_flags} on page 818) is given one of two possible sets of values. If the -G command-line switch (-G on page 242), which specifies gateway submission mode, is specified, the values are CC f. If the -G command-line switch is omitted, the values are c u.

CC f

The CC means to not canonify hostnames. The f means to require that all hostnames be supplied fully canonified.

c u

The c means to canonify all hostnames. The u means that hostnames do not need to be supplied in canonified form.

But note that with the mc configuration, the default for the submit.cf file is to define the DaemonPortOptions Modify= with the character E, which means to disallow use of the ETRN command.

If you wish to specify different flags, you can use this DirectSubmissionModifiers option, which is declared like this:

O DirectSubmissionModifiers=charsconfiguration file (V8.12
and later)
-ODirectSubmissionModifiers=charscommand line (V8.12 and
later)
define(`confDIRECT_SUBMISSION_MODIFIERS',`chars')    ← mc configuration (V8.12 and
later)

Here, chars is of type string and consists of the characters that are used by the DaemonPortOptions option’s Modifier= equate’s flags (DaemonPortOptions=Modify= on page 996). There is no need to double the uppercase flags because sendmail will do that automatically.

The chars you list become the flags used for direct submission and replace the default flags.

Note that you cannot use the DirectSubmissionModifiers option on the command line. If you do, it will be accepted but the default flags will continue to be used:

-ODirectSubmissionModifiers=charscommand line does not work

The DirectSubmissionModifiers option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DontBlameSendmail

Relax file security checks V8.9 and later

Although sendmail is very security-conscious, there are times when a site might wish for a more relaxed security posture. We don’t recommend any relaxation of security, and in fact recommend beefing up your security whenever possible. But for sites that prefer to reduce sendmail’s security checks, V8.9 and later offer the DontBlameSendmail option. It is declared like this:

O DontBlameSendmail=for,for,...configuration file (V8.9
and later)
-ODontBlameSendmail=for,for,...command line (V8.9 and
later)
define(`confDONT_BLAME_SENDMAIL',``for,for,...'')     ← mc configuration (V8.9 and
later)

Here, for is one of the comma-separated items[379] listed in the lefthand column of Table 24-18 that are not case-sensitive. If the entire DontBlameSendmail is absent, or if nothing is listed after the equals sign, overall safety is unchanged. If an item is specified that is not listed in the table, sendmail prints the following error and ignores that option:

readcf: DontBlameSendmail option: bad item here unrecognized

The DontBlameSendmail option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Table 24-18. DontBlameSendmail change items

Item

§

Meaning

AssumeSafeChown

DontBlameSendmail=AssumeSafeChown on page 1011

Assume chown(2) is safe.

ClassFileInUnsafeDirPath

DontBlameSendmail=ClassFileInUnsafeDirPath on page 1011

Allow F class macro files in unsafe directory paths.

DontWarnForwardFileInUnsafeDirPath

DontBlameSendmail=DontWarnForwardFileInUnsafeDirPath (V8.10 and later) on page 1012

Omit warnings about forward files in unsafe directories.

ErrorHeaderInUnsafeDirPath

DontBlameSendmail=ErrorHeaderInUnsafeDirPath on page 1012

Allow ErrorHeader file in unsafe directory paths.

FileDeliveryToHardLink

DontBlameSendmail=FileDeliveryToHardLink on page 1012

Allow delivery to hard-linked files.

FileDeliveryToSymLink

DontBlameSendmail=FileDeliveryToSymLink on page 1012

Allow delivery to symbolic links.

ForwardFileInGroupWritableDirPath

DontBlameSendmail=ForwardFileInGroupWritableDirPath on page 1013

Allow forward files in group-writable directory paths.

ForwardFileInUnsafeDirPath

DontBlameSendmail=ForwardFileInUnsafeDirPath on page 1013

Allow forward files in unsafe directory paths.

ForwardFileInUnsafeDirPathSafe

DontBlameSendmail=ForwardFileInUnsafeDirPathSafe on page 1013

Unsafe forward files can forward to files and programs.

GroupReadableKeyFile

DontBlameSendmail=GroupReadableKeyFile (V8.12 and later) on page 1014

Accept a group-readable key file for STARTTLS.

GroupReadableSASLDBFile

DontBlameSendmail=GroupReadableSASLDBFile (V8.12 and later) on page 1014

Accept a group-readable Cyrus SASL password file.

GroupWritableAliasFile

DontBlameSendmail=GroupWritableAliasFile on page 1014

Allow alias files that are group-writable.

GroupWritableDirPathSafe

DontBlameSendmail=GroupWritableDirPathSafe on page 1014

Consider group-writable directory paths safe.

GroupWritableForwardFile

DontBlameSendmail=GroupWritableForwardFile (V8.12 and later) on page 1015

Allow forward files that are group-writable.

GroupWritableForwardFileSafe

DontBlameSendmail=GroupWritableForwardFileSafe on page 1015

Allow unsafe forward files to write to files and programs.

GroupWritableIncludeFile

DontBlameSendmail=GroupWritableIncludeFile (V8.11 and later) on page 1015

Allow:include: files that are group-writable.

GroupWritableIncludeFileSafe

DontBlameSendmail=GroupWritableIncludeFileSafe on page 1016

Allow unsafe :include: to write to files and programs.

GroupWritableSASLDBFile

DontBlameSendmail=GroupWritableSASLDBFile (V8.12 and later) on page 1016

Accept a group-writable Cyrus SASL password file.

HelpFileInUnsafeDirPath

DontBlameSendmail=HelpFileInUnsafeDirPath on page 1016

Allow the help file to live in an unsafe directory path.

IncludeFileInGroupWritableDirPath

DontBlameSendmail=IncludeFileInGroupWritableDirPath on page 1017

Allow:include: files to live in group-writable directory paths.

IncludeFileInUnsafeDirPath

DontBlameSendmail=IncludeFileInUnsafeDirPath on page 1017

Allow :include: files to live in unsafe (group- or world-writable) directory paths.

IncludeFileInUnsafeDirPathSafe

DontBlameSendmail=IncludeFileInUnsafeDirPathSafe on page 1017

Allow :include: files in unsafe directory paths to deliver to files or programs.

InsufficientEntropy

DontBlameSendmail=InsufficientEntropy (V8.11 and later) on page 1017

Use STARTTLS even if the PRNG for OpenSSL is not properly seeded.

LinkedAliasFileInWritableDir

DontBlameSendmail=LinkedAliasFileInWritableDir on page 1018

Allow a hard-linked aliases file to live in an unsafe directory.

LinkedClassFileInWritableDir

DontBlameSendmail=LinkedClassFileInWritableDir on page 1018

Allow a hard-linked F class macro file to live in an unsafe directory.

LinkedForwardFileInWritableDir

DontBlameSendmail=LinkedForwardFileInWritableDir on page 1018

Allow a hard-linked forward file to live in an unsafe directory.

LinkedIncludeFileInWritableDir

DontBlameSendmail=LinkedIncludeFileInWritableDir on page 1018

Allow a hard-linked :include: file to live in an unsafe directory.

LinkedMapInWritableDir

DontBlameSendmail=LinkedMapInWritableDir on page 1019

Allow a hard-linked database map file to live in an unsafe directory.

LinkedServiceSwitchFileInWritableDir

DontBlameSendmail=LinkedServiceSwitchFileInWritableDir on page 1019

Allow a hard-linked service switch file to live in an unsafe directory.

MapInUnsafeDirPath

DontBlameSendmail=MapInUnsafeDirPath on page 1019

Allow database-map files to live in unsafe directory paths.

NonRootSafeAddr

DontBlameSendmail=NonRootSafeAddr (V8.10 and later) on page 1019

When not running as root, allow delivery to files and programs.

RunProgramInUnsafeDirPath

DontBlameSendmail=RunProgramInUnsafeDirPath (V8.12 and later) on page 1019

Allow programs to run from inside unsafe directory paths.

RunWritableProgram

DontBlameSendmail=RunWritableProgram (V8.12 and later) on page 1020

Allow programs to run that are group- or world-writable.

Safe

DontBlameSendmail=Safe on page 1020

Like the default, completely safe.

TrustStickyBit

DontBlameSendmail=TrustStickyBit on page 1020

Writable directories are safe if the sticky bit is set.

WorldWritableAliasFile

DontBlameSendmail=WorldWritableAliasFile on page 1020

Allow the aliases file to be world-writable.

WorldWritableForwardFile

DontBlameSendmail=WorldWritableForwardFile (V8.12 and later) on page 1020

Allow forward files to be world-writable.

WorldWritableIncludeFile

DontBlameSendmail=WorldWritableIncludeFile (V8.12 and later) on page 1021

Allow :include: files to be world-writable.

WriteMapToHardLink

DontBlameSendmail=WriteMapToHardLink on page 1021

Write to database maps that are hard links.

WriteMapToSymLink

DontBlameSendmail=WriteMapToSymLink on page 1021

Write to database maps that are symbolic links.

WriteStatsToHardLink

DontBlameSendmail=WriteStatsToHardLink on page 1021

Write to the status file that is a hard link.

WriteStatsToSymLink

DontBlameSendmail=WriteStatsToSymLink on page 1021

Write to the status file that is a symbolic link.

Note that you can have a configuration file that you think might require one of these flags. But before you set it, think carefully about how setting it might affect other files that might also be involved. If you do set one of these flags, and then your machine is broken into, don’t blame sendmail!

In the sections that follow, we describe the purpose and use of each item. Note that not all items produce error messages that might indicate a risk to be corrected. Also note that these items are grouped alphabetically, not by related function.

DontBlameSendmail=AssumeSafeChown

Assume that the chown(2) system call is restricted to root. Some versions of Unix and some implementations of NFS permit regular users to give away their files to other users. On such systems, sendmail is unable to safely assume that a file was necessarily created by the owner of that file, particularly when that file is in a directory that is writable by anyone other than just root. You can enable this item if you know that file chown(2) is restricted to root on your system. If in doubt, see test/t_pathconf.c for a way to test this.

DontBlameSendmail=ClassFileInUnsafeDirPath

When reading a file using the F configuration command (The F Class Command on page 857), sendmail will disallow that reading when the file lives in an unsafe directory path. Should such a file be found, sendmail will print and log one of the following messages and skip reading that file:

configfile: line  num:  fileclass: cannot open  Ffile:  Group-writable directory
configfile: line  num:  fileclass: cannot open  Ffile:  World-writable directory

An unsafe directory path is one where any component is writable by a user other than root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If your site needs to place such F files in unsafe directory paths, and if you are not able to correct the situation, you can enable this item. With ClassFileInUnsafeDirPath enabled, you increase risk but allow sendmail to read F files that live in unsafe directory paths.

DontBlameSendmail=DontWarnForwardFileInUnsafeDirPath (V8.10 and later)

Before sendmail will read a user’s ~/.forward file (The User’s ~/.forward File on page 500), it will first check to see that the directory it is in is safe. A safe directory in this instance is one whose path components are writable only by root or by the owner. Beginning with V8.10, if the path is unsafe, sendmail will print and log one of the following warnings and skip reading that file:

user... forward:  /path:  Group-writable directory
user... forward:  /path:  World-writable directory

Here, user is the user whose login directory probably has bad permissions set on it, and path is the full path to the ~/.forward file. Note that many lines such as these will be logged because sendmail tries variations with + and host-based suffixes when looking for a ~/.forward file (see also the ForwardPath option, ForwardPath on page 1034). Also note that these warnings will be logged even if the ~/.forward file does not exist.

Some circumstances might require you to allow users to maintain group-writable directories. If you cannot avoid that risky situation, you can enable this item. With this DontWarnForwardFileInUnsafeDirPath item enabled, you turn off only the logging. Note that any unsafe forward files will still not be used.

DontBlameSendmail=ErrorHeaderInUnsafeDirPath

The ErrorHeader option (ErrorHeader on page 1027) is used to (optionally) declare the name of a file that contains the text of a message to include in bounced email messages. Ordinarily, sendmail requires a file to live in a safe directory path. A directory path is safe when all components are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If the ErrorHeader file is found in an unsafe directory path, sendmail will silently skip using that file.

Site policy might require you to maintain that file in an unsafe directory path (perhaps on a central disk served via NFS). If you cannot remedy this situation you can enable this item. By specifying the ErrorHeaderInUnsafeDirPath item, you increase risk but allow the ErrorHeader option’s file to live in an unsafe directory path.

DontBlameSendmail=FileDeliveryToHardLink

Ordinarily, sendmail will not append mail to files that have more than one link. Such files pose a problem because sendmail has no idea whether such links are to special files (such as /etc/passwd), and so cannot check to see whether those other links live in safe directory paths. If sendmail finds such a file when trying to deliver, it will bounce the message with an error such as this:

/path
      (reason: can't create (user) output file)

Here, path is the full pathname to the file that had more than one link. If you need to maintain hard links for administrative reasons, you can enable this item. When you enable the FileDeliveryToHardLink item you increase risk but allow sendmail to deliver to files that are hard links.

DontBlameSendmail=FileDeliveryToSymLink

Ordinarily, sendmail will not append mail to files that are symbolic links to other files. Although V8.10 correctly checks the path to the link and to the pointed-to file, it still will not append mail to such files. If sendmail attempts to deliver to a file that is a symbolic link, it will bounce the message with an error such as this:

/path
      (reason: can't create (user) output file)

Here, path is the full pathname to the file that is a symbolic link. If you need to maintain symbolic links for administrative reasons, you can enable this item. When you enable the FileDeliveryToSymLink item you increase risk but allow sendmail to deliver to files that are symbolic links.

DontBlameSendmail=ForwardFileInGroupWritableDirPath

In general, the path to a user’s home directory, and that home directory, should be writable only by root or that user. There are circumstances, however, when groups of users or pseudousers must share a single home directory. In such an instance, it might be desirable for them all to have writable permission to that directory. This can be done by enabling group write permissions. If you do, however, sendmail will begin to reject the common ~/.forward file found in that directory with the following warning:

user... forward:  /path:  Group-writable directory

To prevent this warning but allow sendmail to honor that ~/.forward file—but at increased risk to your system—you can enable this item. By enabling this ForwardFileInGroupWritableDirPath item, you increase risk but allow ~/.forward files (The User’s ~/.forward File on page 500) to reside in group-writable directory paths.

DontBlameSendmail=ForwardFileInUnsafeDirPath

Generally, ~/.forward files (The User’s ~/.forward File on page 500) must live in safe directory paths. A directory path is safe when all components are writable only by root, and when its last component is writable only by root or the owner. If some component of the path to a user’s home is unsafe, one of the following messages will be printed and logged when mail is sent to that user:

user... forward:  /path:  Group-writable directory
user... forward:  /path:  World-writable directory

When this message is printed, sendmail refuses to honor that user’s ~/.forward file.

If your site places user homes under directory paths that are unsafe, and if you are unable to correct this flaw, you might need to enable this item. By enabling this ForwardFileInUnsafeDirPath item, you increase risk but allow sendmail to honor ~/.forward files that live in unsafe directory paths. (Also see ForwardFileInUnsafeDirPathSafe in the next section.)

DontBlameSendmail=ForwardFileInUnsafeDirPathSafe

Even if you allow ~/.forward files (The User’s ~/.forward File on page 500) to live in unsafe directories, sendmail will still not honor lines in that file that forward mail to files or programs because it is felt that an insecure ~/.forward file poses a grave risk to the user. If you disagree, or have some reason to relax this rule, you can define this item. With it, you increase risk but allow any ~/.forward file that is in an unsafe directory path to forward mail to files and programs.

DontBlameSendmail=GroupReadableKeyFile (V8.12 and later)

The TLS key file used by STARTTLS should normally be readable only by the owner of the file. That owner should be root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112).

At some sites, for ease of administration, it is sometimes necessary to allow that file to be group-readable. At such sites, you will need to define this item. If you don’t, sendmail will refuse to honor that key file.

DontBlameSendmail=GroupReadableSASLDBFile (V8.12 and later)

The Cyrus SASL password file, as set up with the saslpasswd(8) program, must be readable only by the owner of the file. That owner should be root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112).

If, for possible administrative reasons (such as to share it with other SASL applications, such as Cyrus IMAP), you need that file to be group-readable, you will have to define this item. If you don’t, sendmail will refuse to honor the file.

DontBlameSendmail=GroupWritableAliasFile

The aliases file (The aliases(5) File on page 460) should generally be writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). By allowing it to be writable by others, you risk allowing bogus and dangerous entries to be placed into it. Some sites, however, allow system administrators to edit that file, without the need to become root. Permission to edit is granted by allowing group-writability. But if you do that, the following message will be printed and logged and you will be unable to rebuild the aliases database:

cannot open /etc/mail/aliases: Group-writable file

If you need to allow group-writable aliases files, you can enable this item. By enabling this GroupWritableAliasFile item, you increase risk but allow sendmail to rebuild the aliases database without complaint, even if it is group-writable.

DontBlameSendmail=GroupWritableDirPathSafe

An unsafe directory path is one in which any component is writable by a user other than root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). Normally, :include: and ~/.forward files can only contain lines that cause writes to files or writes through programs, if those :include: and ~/.forward files live in safe directory paths.

If you wish :include: files to live in directory paths in which one or more directories have the group-writable permissions set, and if you expect to retain the same ability to write to files or through programs, you must define this item, and one more:[380]

define(`confDONT_BLAME_SENDMAIL',``GroupWritableDirPathSafe,
IncludeFileInGroupWritableDirPath'')

If you wish ~/.forward files to live in directory paths in which one or more directories have the group-writable permissions set, and if you expect to retain the same ability to write to files or through programs, you must define this item, and one more:

define(`confDONT_BLAME_SENDMAIL',``GroupWritableDirPathSafe,
ForwardFileInGroupWritableDirPath'')

Note that if a group-writable directory is not the last directory in the path, all directories and files under it can be at risk. If you require a group-writable directory, we recommend you make it the last in the path.

DontBlameSendmail=GroupWritableForwardFile (V8.12 and later)

Generally, ~/.forward files (The User’s ~/.forward File on page 500) should be writable only by root or the owner. Such safe files allow sendmail to honor lines in them that deliver via file or program entries. If a ~/.forward file has group-write permission set, sendmail will refuse to open the file and will log the following error (if the LogLevel [LogLevel on page 1040] option’s value is 12 or higher):

/path: group-writable forward file, marked unsafe

Sometimes it can be unavoidably necessary for a user’s ~/.forward file to be group-writable. If so, you can define this item to allow ~/.forward files to be group-writable. Although this will allow sendmail to read such files, sendmail will still disallow delivery via file or program entries.

DontBlameSendmail=GroupWritableForwardFileSafe

Generally, ~/.forward files (The User’s ~/.forward File on page 500) should be writable only by root or the owner. Sometimes it can be unavoidably necessary for a user’s ~/.forward file to be group-writable. If group-writable ~/.forward files exist at your site, such files will be considered unsafe. And if the LogLevel (LogLevel on page 1040) option’s value is 12 or higher, you will see the following warning:

/path: group-writable forward file, marked unsafe

An unsafe ~/.forward file causes sendmail to disallow delivery via files or program entries. If you cannot avoid group-writable user ~/.forward files, you can enable this item. By enabling this GroupWritableForwardFileSafe item, you increase risk, allow sendmail to accept group-writable ~/.forward files, but allow those group-writable ~/.forward files to deliver to files and to programs. But note that this GroupWritableForwardFileSafe item will be ignored unless GroupWritableForwardFile is also set to allow the file to be read in the fist place (that is, before determining whether the contents are safe).

DontBlameSendmail=GroupWritableIncludeFile (V8.11 and later)

Generally, :include: files (:include: Mailing Lists on page 486) should be writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). Such safe permissions allow sendmail to honor lines in :include: files that write to files, or through programs. If a :include: file has group-write permission set, sendmail will refuse to open the file and will log the following error (if the LogLevel [LogLevel on page 1040] option’s value is 12 or higher):

/path: group-writable :include: file, marked unsafe

Sometimes it can be unavoidably necessary for a :include: file to be group-writable. You can define this item to allow :include: files to be group-writable. Although this will allow sendmail to read such files, sendmail will still disallow delivery via file or program entries.

DontBlameSendmail=GroupWritableIncludeFileSafe

Generally, files that are included with the :include: (:include: Mailing Lists on page 486) directive from inside an aliases file must be writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), but some sites find it easier to administer mailing lists when system administrators can edit those files using only group permissions on each file, instead of having to become root each time. If this is the situation at your site, you will see the following warning logged when the LogLevel (LogLevel on page 1040) option’s value is 12 or higher:

/path: group-writable :include: file, marked unsafe

An unsafe :include: file causes sendmail to disallow delivery via files or program entries. If you cannot avoid group-writable :include: files, you can enable this item. By enabling this GroupWritableIncludeFileSafe item, you increase risk but allow sendmail to accept group-writable :include: files. But note that this GroupWritableIncludeFileSafe item will be ignored unless GroupWritableIncludeFile is also set to allow the file to be read in the first place (that is, before determining whether the contents are safe).

DontBlameSendmail=GroupWritableSASLDBFile (V8.12 and later)

The Cyrus SASL password file, as set up with the saslpasswd(8) program, must be writable only by the owner of the file. That owner should be root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112).

Sometimes for administrative reasons you might need to have that file group-writable (for example, to share it with other SASL applications). If you do, you will need to define this item. If you don’t, sendmail will refuse to honor the file.

DontBlameSendmail=HelpFileInUnsafeDirPath

The HelpFile option (HelpFile on page 1035) specifies the location of the file from which sendmail gathers the help lines for its SMTP connections and for its -bt mode. That file must live in a safe directory path, or sendmail will not be able to offer help:

% /usr/sbin/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> ?
Sendmail 8.14.1 -- HELP not implemented

A safe directory path is one in which all components are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If your site is set up in such a way that this file must live in an unsafe directory path, and if you cannot fix the problem, you can enable this item. With this HelpFileInUnsafeDirPath item enabled, sendmail will run at greater risk, but will allow the help file to live in an unsafe directory.

DontBlameSendmail=IncludeFileInGroupWritableDirPath

Generally, files that are included with the :include: (:include: Mailing Lists on page 486) directive from inside an aliases file must live in a directory path, all components of which must be writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). But some sites find it easier to administer mailing lists when administrators can add files without the need to become root each time. By setting the group-writable permission on the directory in the directory path, you can enable anyone in that group to create new files. (Of course, he might still need to be root to add new references to the aliases file.) If you set group-write permission, however, sendmail will ignore the :include: files in that directory and will log this error:

:include:/path... Cannot open  /path:  Group-writable directory

If you need to maintain group-writable directory paths for :include: files, you can enable this item. By enabling this IncludeFileInGroupWritableDirPath item, you will increase risk, but allow :include: files to live in group-writable directory paths.

DontBlameSendmail=IncludeFileInUnsafeDirPath

Files that are included with the :include: (:include: Mailing Lists on page 486) directive from inside an aliases file must live in a safe directory path. A safe directory path is one in which all components are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). But sometimes such :include: files must live in a directory in which some component of its directory path is writable by root as well as others. When that is the case, sendmail will log one of the following errors and will ignore those :include: files:

:include:/path... Cannot open  /path:  Group-writable directory
:include:/path... Cannot open  /path:  World-writable directory

If yours is such a site, and if you cannot correct the permissions, you can specify this item. By enabling this IncludeFileInUnsafeDirPath item, you increase risk, but allow :include: files to live in unsafe directory paths.

DontBlameSendmail=IncludeFileInUnsafeDirPathSafe

Even if you allow :include: files (:include: Mailing Lists on page 486) to live in unsafe directories, sendmail will refuse to honor any references in them for delivery to files or programs. This behavior is benign when only lists of addresses exist in those :include: files. But if you need to further reference files and programs, you will also need to enable this item. With it enabled, sendmail will run at greater risk, and will allow a :include: file that is in an unsafe directory to include references to programs and files.

DontBlameSendmail=InsufficientEntropy (V8.11 and later)

The TLS library requires a strong pseudorandom number generator to operate at maximum security. Depending on the version of the library you have installed, you might be required to initialize that random number generator with random data. The OpenSSL library uses the /dev/urandom device to perform that initialization. On systems that lack /dev/urandom, a random file must be specified in its place. This is done with the RandFile option (RandFile on page 1076).

If the RandFile option’s file is not properly initialized with random data, or if that file is not updated in a timely fashion, sendmail will refuse to honor STARTTLS. Although you are strongly encouraged to either set up a good RandFile option’s file, or run the egd(8) daemon (EGD on page 204), you might be unable to do so. In such a circumstance, you can define this InsufficientEntropy item. When defined, it allows sendmail to use STARTTLS even though the pseudorandom number generator was not properly initialized, which silently weakens the cryptography used.

DontBlameSendmail=LinkedAliasFileInWritableDir

When a file lives in a directory that is writable by users other than root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), it should not be a link because other users can remove the link and replace it with a file or link of their own. The aliases file (The aliases(5) File on page 460) should generally be a file, not a link, but if it is a link, and if that link exists in an unsafe directory, sendmail will refuse to use it. If your aliases file is a link, and if that link must live in a writable directory, you can enable this item. By enabling this LinkedAliasFileInWritableDir item, you cause sendmail to run at increased risk, and to allow aliases files that are links to live in a writable directory.

DontBlameSendmail=LinkedClassFileInWritableDir

When a file lives in a directory that is writable by users other than root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), it should not be a link because other users can remove the link and replace it with a file or link of their own. When reading a file using the F configuration command (The F Class Command on page 857), sendmail will ordinarily not allow such files to be links that live in writable directories. When such files are links, and if that link lives in a directory that is unsafe, sendmail will run at increased risk and will allow F files that are links to live in writable directories.

DontBlameSendmail=LinkedForwardFileInWritableDir

When a ~/.forward file lives in a home directory that is writable by users other than the owner or root, it should not be a link. Those other users can remove the link and replace it with a file or link of their own. Generally, sendmail will not honor ~/.forward files that are links that live in writable directories. When such links are necessary, and when a writable directory cannot be avoided, you can enable this item. With this LinkedForwardFileInWritableDir item enabled, sendmail will run at increased risk, and will honor ~/.forward files that are links and that live in writable directories.

DontBlameSendmail=LinkedIncludeFileInWritableDir

When a file lives in a directory that is writable by users other than root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), it should not be a link. Those other users can remove the link and replace it with a file or link of their own. If you feel you can control this risk, you can enable this item. With this LinkedIncludeFileInWritableDir item enabled, sendmail will run at increased risk and will allow :include: files to be links that can live in writable directories.

DontBlameSendmail=LinkedMapInWritableDir

When a database-map file lives in a directory that is writable by users other than root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), it should not be a link. Those other users can remove the link and replace it with a file or link of their own. Database-map files (The K Configuration Command on page 882) that are links and live in writable directories will not be honored by sendmail. When such database-map files must be links, and when those links must unavoidably live in writable directories, you can enable this item. With this LinkedMapInWritableDir item enabled, sendmail will allow map (database) files that are links to live in writable directories.

DontBlameSendmail=LinkedServiceSwitchFileInWritableDir

When a service switch file lives in a directory that is writable by users other than root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112), it should not be a link. Those other users can remove the link and replace it with a file or link of their own. The ServiceSwitchFile option (ServiceSwitchFile on page 1088) specifies the file that defines how aliases and other services will be handled. It can, for example, define aliases to be first looked up with NIS, and if that fails to be looked up in the aliases database. Sometimes it might be desirable for this file to be a link. When such a link must unavoidably live in a writable directory, you can enable this item. With this LinkedServiceSwitchFileInWritableDir item enabled, sendmail will run at increased risk, and will allow the ServiceSwitchFile option’s file to be a link even if it lives in a writable directory.

DontBlameSendmail=MapInUnsafeDirPath

Map (database) files (The K Configuration Command on page 882) must live in safe directories. A safe directory is one in which all components of its path are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If your site stores maps (databases) in a directory, some component of which is writable by a user other than root, and if you cannot correct that situation, you can enable this item. With it enabled, sendmail allows map (database) files to live in unsafe directories.

DontBlameSendmail=NonRootSafeAddr (V8.10 and later)

The sendmail program usually runs as root because it is run by root. With the RunAsUser option (RunAsUser on page 1083), sendmail can run as a user other than root. When the RunAsUser option (RunAsUser on page 1083) specifies a non-root user, all file and program delivery will be banned, and such messages will be bounced. If you wish to allow file and program delivery to succeed, even though the RunAsUser option defines a non-root user, you can define this item. With this NonRootSafeAddr item enabled, sendmail will run at increased risk, but will honor file and program delivery when it is running as a non-root user.

DontBlameSendmail=RunProgramInUnsafeDirPath (V8.12 and later)

Generally, sendmail prefers to run a program for delivery that is in a safe directory path. A safe directory path is one in which all components are writable only by root, or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If a program lives in an unsafe directory, sendmail will execute it anyway, but will log this warning:

Warning: program program_name unsafe: reason

If, for some reason, you are unable to put all required programs in safe directories, you can enable this item. With this RunProgramInUnsafeDirPath item enabled, sendmail ceases logging such warnings.

DontBlameSendmail=RunWritableProgram (V8.12 and later)

For sendmail to trust a program, it prefers that the program be writable only by its owner and root. If sendmail is required to run a program that is group- or world-writable, it will do so, but will log the following warning:

Warning: program program_name unsafe: reason

If, for some reason, you are unable to prevent all required programs from having bad permissions, you can enable this item. With this RunWritableProgram item enabled, sendmail ceases logging such warnings.

DontBlameSendmail=Safe

When sendmail first starts, it clears (zeros) all the DontBlameSendmail items to establish a default condition of maximum safety (minimum risk). This Safe item does the same thing by clearing all the other items. As a side effect, if you list Safe last in a sequence of items, you cancel any preceding items. For example:[381]

define(`confDONT_BLAME_SENDMAIL',``TrustStickyBitSafe, Safe'')
define(`confDONT_BLAME_SENDMAIL',`Safe')

Here, both lines are equivalent. In the first line, the TrustStickyBitSafe item was canceled because it was followed by a Safe item—which cancels all items.

DontBlameSendmail=TrustStickyBit

If the sticky bit is set on a directory, a user other than root cannot delete or rename files of other users in that directory. If your operating system correctly honors the sticky bit on a directory, and if you wish to use that mechanism instead of safe directories, you can enable this item. With this TrustStickyBit item enabled, sendmail can run at increased risk and will honor group- and world-writable directories that have the sticky bit set.

DontBlameSendmail=WorldWritableAliasFile

At small sites, sometimes everyone is trusted to add and remove aliases from the aliases file. To allow this, some sites make the aliases file world-writable. Ordinarily, sendmail will refuse to use an aliases file that is so extremely unsafe. If you enable this WorldWritableAliasFile item, sendmail will run at extreme risk, and will go ahead and use an aliases file that is world-writable.

DontBlameSendmail=WorldWritableForwardFile (V8.12 and later)

Despite the security risks (Permissions for ~/.forward Files on page 166), some sites allow world-writable ~/.forward files. If your site is one of these, you can prevent sendmail from complaining and ignoring those world-writable ~/.forward files by defining this item.

Note, however, that we recommend you prohibit world-writable ~/.forward files and not use this item as a bandage.

DontBlameSendmail=WorldWritableIncludeFile (V8.12 and later)

Despite the security risks (Permissions for :include: on page 165), some sites allow world-writable :include: files. If your site is one of these, you can prevent sendmail from complaining and ignoring those world-writable :include: files by defining this item.

Note, however, that we recommend you prohibit world-writable :include: files and not use this item as a bandage.

DontBlameSendmail=WriteMapToHardLink

Ordinarily, sendmail will not update database-map files that have more than one link. Such files pose a problem because sendmail has no idea whether such links are to special files (such as /etc/passwd), and so cannot check to see whether those other links live in safe directory paths. A directory path is safe when all components are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112).

To allow updates to database-map files that are hard links, set this item.

DontBlameSendmail=WriteMapToSymLink

Ordinarily, sendmail will not update map (database) files that are symbolic links to other files. Although V8.10 correctly checks the path to the link, and to which the file points, it still will not update such files. To allow updates to map (database) files that are symbolic links, enable this item. With this WriteMapToSymLink item enabled, sendmail will run at increased risk and will update map (database) files that are symbolic links.

DontBlameSendmail=WriteStatsToHardLink

Ordinarily, sendmail will refuse to update the file indicated by the StatusFile option (StatusFile on page 1095) when that file has more than one link. Such a file poses a problem because sendmail has no idea whether links are to special files (such as /etc/passwd), and so cannot check to see whether that other link lives in a safe directory. A directory is safe when all components of its path are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112).

To allow updates to the status file, when that file has hard links, enable this item. With this WriteStatsToHardLink item enabled, sendmail will run at increased risk, and will update the status file even if it is a hard link.

DontBlameSendmail=WriteStatsToSymLink

Ordinarily, sendmail will not update the file indicated by the StatusFile option (StatusFile on page 1095) when that file is a symbolic link. V8.10 correctly checks the path of both the link and the file pointed to, but it still will not update the file. To allow updates to a status file that is a symbolic link, just define this item. With this WriteStatsToSymLink item enabled, sendmail will run at increased risk, and will update the status file even if it is a symbolic link.

DontExpandCnames

Prevent CNAME expansion V8.7 and later

Ordinarily, the $[ and $] operators (Canonicalize Hostname: $[ and $] on page 668) cause the enclosed hostname to be looked up with DNS[382] and replaced with the canonical address for that host. The canonical address is the A or AAAA DNS record. For example, consider these DNS records:

here.us.edu.    IN     A     123.45.67.89
ftp.us.edu.     IN     CNAME here.us.edu.

But if the address ftp.us.edu is fed to the $[ and $] operators in the RHS of a rule:

R $*      $[ $1 $]

the rewritten result of passing ftp.us.edu as $1 will be the name here.us.edu. This behavior was correct under RFC822 and RFC1123, and with the publication of RFC2821 and RFC2822 this change is now officially correct.

Sometimes it is important for the CNAME to appear in email headers as the canonical name. One example might be that of an FTP service moving from one machine to another during a transition phase. In that instance, outgoing mail should appear to be from ftp.us.edu because the records will change after the move, and the ability to reply to such mail must be maintained:

here.us.edu.    IN     A     123.45.67.89     ← retired and gone
ftp.us.edu.     IN     CNAME there.us.edu.
there.us.edu.   IN     A     123.45.67.90

Another possibility might be that of a mobile host (a workstation that plugs into different networks and thus has different A records over time):

mobile.us.edu.    IN     CNAME monday.dc.gov.
monday.dc.gov.    IN     A     12.34.56.78
tuesday.foo.com.  IN     A     23.45.67.89

Whenever this workstation is plugged in, its CNAME record is changed to point to the A record of the day: monday.dc.gov on Monday and tuesday.foo.com on Tuesday. But regardless of what its A record happens to be, outgoing mail should look as though it came from mobile.us.edu.

The DontExpandCnames option causes sendmail to accept CNAME records as canonical. It is declared like this:

O DontExpandCnames=boolconfiguration file (V8.7 and later)
-ODontExpandCnames=boolcommand line (V8.7 and later)
define(`confDONT_EXPAND_CNAMES',`bool')     ← mc configuration (V8.7 and later)

The argument bool is of type Boolean. If bool is missing, the default is true (use the CNAME). If the entire DontExpandCnames option is missing, the default is false (convert CNAMEs to hostnames which point to the real hostname). We recommend that you always declare this option as true. But note that other systems down the line might still expand the CNAME even if you do set this option to true.

The DontExpandCnames option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DontInitGroups

Don’t use initgroups(3) V8.7 and later

Just before executing any delivery agent (including the *include* delivery agent) and just before opening a ~/.forward file, sendmail sets its group and user identities as appropriate. To illustrate, consider the U= equate (U= on page 755). If the fax delivery agent has the U= equate set like this:

U=fax:fax

its A= program will be executed by the user fax who is in the group fax. In addition, sendmail calls the initgroups(3) system call to expand the list of groups to which the user belongs. In the case of fax, it might also belong to the groups faxadm and faxusers. The total result is that fax can execute, read, and write any files that have the appropriate group permissions set for any of the groups fax, faxadm, and faxusers.

This versatility, however, has a price. As group files get huge or as nis, nisplus, or hesiod services become slow (probably because they are also large), the initgroups(3) call can start to adversely affect sendmail’s performance.

When performance is a concern, the DontInitGroups option can be used to disable initgroups(3):

O DontInitGroups=boolconfiguration file (V8.7 and later)
-ODontInitGroups=boolcommand line (V8.7 and later)
define(`confDONT_INIT_GROUPS',bool)    ← mc configuration (V8.7 and later)

The argument bool is of type Boolean. If it is missing, the default value is true—don’t call initgroups(3). If the entire option is missing, the default value is false—do call initgroups(3). See NO_GROUP_SET on page 130 for a discussion of how NO_GROUP_SET determines whether this option also affects the getgrgid(3) system call.

The DontInitGroups option is not safe as of V8.8.4. Even if it is specified from the command line, it can cause sendmail to relinquish its special privileges.

DontProbeInterfaces

Don’t probe interfaces for $=w V8.9 and later

When sendmail first starts up, it probes all your network interfaces to see what hostname is assigned to each.[383] For all that it finds in the up state, it adds that hostname to the class $=w ($=w on page 876), meaning that class will be considered a valid name for the local machine.

Sometimes, however, especially when supporting virtual hosts, sendmail should not consider all the interface hosts as local. Because there is no way to remove a name from a class, it is better to not have sendmail probe the interfaces in the first place. Then, you will be able to manually add (or add via your /etc/mail/local-host-names file;[384] see FEATURE(use_cw_file) on page 643) just the names you want into the class $=w.

You can disable sendmail’s initial scanning of interfaces for hostnames by declaring this DontProbeInterfaces option:

O DontProbeInterfaces=boolconfiguration file (V8.10 through
V8.11)
-ODontProbeInterfaces=boolcommand line (V8.10 through
V8.11)
define(`confDONT_PROBE_INTERFACES',`bool')      ← mc configuration (V8.10 through
V8.11)
O DontProbeInterfaces=stringconfiguration file (V8.12 and
later)
-ODontProbeInterfaces=stringcommand line (V8.12 and later)
define(`confDONT_PROBE_INTERFACES',`string')    ← mc configuration (V8.12 and
later)

The argument bool is of type Boolean. If it is missing, the default value is true—don’t probe interfaces at startup for hostnames. The argument string is of type String (for V8.12 and above). If it is missing, the default value is true—don’t probe interfaces at startup for hostnames. If the entire option is missing, the default value is false—do probe interfaces.

Beginning with V8.12, a third alternative (to true or false) is available. If you specify a literal loopback, sendmail will probe interfaces at startup, but will not probe the loopback interface.

The DontProbeInterfaces option is not safe. Even if it is specified from the command line, it can cause sendmail to relinquish its special privileges.

DontPruneRoutes

Don’t prune route addresses V8.1 and later

One form of address is called a route address because it specifies a route (sequence of hosts) through which the message should be delivered. For example:

@hostA,@hostB:user@hostC

This address specifies that the message should first go to hostA, then from hostA to hostB, and finally from hostB to hostC for delivery to user.[385]

RFC1123, in Enable TLS with Build, specifies that delivery agents should always try to eliminate source routing when they are able. V8 sendmail takes an address such as this and checks to see whether it can connect to hostC directly. If it can, it rewrites the address like this:

user@hostC

This is called “pruning route addresses.” There might be times when such pruning is inappropriate. Internal networks, for example, might be set up to encourage manual specification of a route through a high-speed network. If left to its own, sendmail always tosses the route and tries to connect directly.

The DontPruneRoutes option causes sendmail to never prune route addresses. The forms of this option are as follows:

O DontPruneRoutes=boolconfiguration file (V8.7 and
later)
-ODontPruneRoutes=boolcommand line (V8.7 and later)
define(`confDONT_PRUNE_ROUTES',`bool')          ← mc configuration (V8.7 and
later)
ORboolconfiguration file (deprecated)
-oRboolcommand line (deprecated)

The argument bool is of type Boolean. If it is missing, the default value is true (nothing special is done with route addresses). If the entire R option is missing, the default becomes false (route addresses are pruned). With the mc configuration technique the default is false.

The DontPruneRoutes option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

DoubleBounceAddress

Errors when sending errors V8.8 and later

Ordinarily, when sendmail sends error notification mail, it expects that error notification to be successfully delivered. Upon occasion, error mail itself will bounce or fail too. This is called a “double-bounce” situation. Prior to V8.8, sendmail would notify postmaster if error notification failed. But this might not be the best solution in all cases. Consider, for example, a site that has a sitewide postmaster and several departmental postmasters. In such situations, double-bounce mail should probably go to the sitewide postmaster.

Beginning with V8.8 sendmail, the DoubleBounceAddress option can be used to define who gets double-bounce mail:

O DoubleBounceAddress=addrconfiguration file (V8.8 and
later)
-ODoubleBounceAddress=addrcommand line (V8.8 and later)
define(`confDOUBLE_BOUNCE_ADDRESS',`addr')      ← mc configuration (V8.7 and
later)

Here, addr is of type string and is a comma-separated list of one or more email addresses. If addr is missing, the following error is printed and the option is ignored:

readcf: option DoubleBounceAddress: value required

If the entire option is missing, the default becomes postmaster. If sendmail is unable to send double-bounce mail to addr, it logs the following error:

cannot parse addr

The DoubleBounceAddress option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

EightBitMode

How to convert 8-bit input V8.7 and later

The data portion of an email message is transmitted during the DATA phase of an SMTP transaction. Prior to V8.6, the data were presumed to be 7-bit. That is, the high (8th) bit of every byte of the message could be cleared (reset or made zero) with no change in the meaning of that data. With the advent of ESMTP and MIME, it became possible for sendmail to receive data for which the preservation of the 8th bit is important.

There are two kinds of 8-bit data. Data that arrives with the high bit set and for which no notification was given is called “unlabeled” 8-bit data. Data for which notification was given (using BITMIME in the ESMTP session or with the -B8BITMIME command-line switch, -B on page 232, or with a MIME-Version: header in the message, MIME-Version: on page 1160) is called “labeled.”

The EightBitMode option tells sendmail how to treat incoming unlabeled 8-bit data. The forms of this option are as follows:

O EightBitMode=keyconfiguration file (V8.7 and later)
-OEightBitMode=keycommand line (V8.7 and later)
define(`confEIGHT_BIT_HANDLING',key)   ← mc configuration (V8.7 and later)
O8keyconfiguration file (V8.6, deprecated)
-o8keycommand line (V8.6, deprecated)

The key is mandatory and must be selected from one of those shown in Table 24-19. If the key is missing or if key is not one of those listed, sendmail will print the following error and ignore the option:

Unknown 8-bit mode char

Only the first character of the key is recognized, but we still recommend that the full word be used for clarity.

Table 24-19. EightBitMode option characters

Key

§

Meaning

mimify

EightBitMode=mimefy on page 1027

Do any necessary conversion of BITMIME to 7-bit.

pass

EightBitMode=pass on page 1027

Pass unlabeled 8-bit input through as is.

strict

EightBitMode=strict on page 1027

Reject unlabeled 8-bit input.

If the entire EightBitMode option is missing, the default becomes p (pass 8-bit and convert MIME). If you configure with V8’s mc technique, the default is also p.

Depending on the key selected and the nature of incoming mail, any of several error messages can be generated:

Eight bit data not allowed
Cannot send 8-bit data to 7-bit destination
host does not support 8BITMIME

Conversion from 8 to 7 bits is complex. First, sendmail looks for a MIME Content-Type: header. If the header is found, sendmail looks for and, if found, uses a MIME boundary definition to delimit conversion.[386] If more than one-fourth of a section has the high bit set after reading at least 4 kilobytes of data, sendmail presumes Base64 encoding[387] and inserts the following MIME header into the data stream:

Content-Transfer-Encoding: base64

Base64 encoding converts 8-bit data into a stream of 6-bit bytes that contain universally readable text. Base64 is described in RFC1521.

If less than one-fourth of the data that was scanned has the high bit set or if the type in the Content-Type: header is listed in $=q ($=q on page 874), the data is converted from 8 to 7 bits by using quoted-printable encoding, and the following MIME header is inserted into the stream:

Content-Transfer-Encoding: quoted-printable

Under quoted-printable encoding, ASCII control characters (in the range 0x00 through 0x20), the tab character, the = character, and all characters with the high bit set are converted. First an = character is output, then the character is converted to an ASCII representation of its hexadecimal value, and that value is output. For example:

0xb9      becomes →   =B9

Under this scheme, the = character is considered binary and is encoded as =3D. If the F=3 flag (F=3 on page 763) is set for a selected delivery agent, the characters:

! " # $ @ \ [ ] ^ ` { | } ~

are also converted. If F=3 is not set, those characters are output as is.

Lines longer than 72 characters (bytes) are broken with the insertion of an = character and the E= end-of-line characters defined for the current delivery agent. Any lines that end in a whitespace character have that whitespace character converted to quoted-printable, even if the line has fewer than 72 characters. Quoted-printable encoding is described in RFC1521.

Where m (mimefy) might not be appropriate for a given delivery agent, the F=8 flag (F=8 on page 764) can be specified to force p (pass8bit) behavior.

The EightBitMode option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

EightBitMode=mimefy

Convert unlabeled 8-bit input to BITMIME, and do any necessary conversion of BITMIME to 7 bits. When running as a daemon receiving mail via SMTP, advertise the BITMIME ESMTP keyword as valid. This key specifies that your site will be a MIME installation.

EightBitMode=pass

Pass unlabeled 8-bit input through as is. Convert labeled BITMIME input to 7 bits as required by any delivery agent with the F=7 flag set (F=7 on page 764), or any SMTP server that does not advertise BITMIME.

EightBitMode=strict

Reject unlabeled 8-bit input. Convert BITMIME to 7 bits as required by any delivery agent with the F=7 flag set (F=7 on page 764), or any SMTP server that does not advertise BITMIME.

ErrorHeader

Set error message header V8 and later

When a notification of a mail error is sent to the sender, the details of the error are taken from the text saved in the xf file (The Transcript File: xf on page 401). The ErrorHeader option allows you to prepend custom text ahead of that error text.

Custom error text is useful for sites that wish to offer help as part of the error message. For example, one common kind of error message is notification of an unknown user:

----- Transcript of session follows -----
 550 5.7.1 smith@wash.dc.gov... User unknown
----- Unsent message follows -----

Here, the user smith is one that is unknown. A useful error help message for your site to produce might be:

Common problems:
     User unknown: the user or login name is wrong.
     Host unknown: you mistyped the host part of the address.
----- Transcript of session follows -----
 550 5.7.1 smith@wash.dc.gov... User unknown
----- Unsent message follows -----

The forms for the ErrorHeader option are as follows:

O ErrorHeader=textconfiguration file (V8.7 and later)
-OErrorHeader=textcommand line (V8.7 and later)
define(`confERROR_MESSAGE',`text')   ← mc configuration (V8.7 and later)
OEtextconfiguration file (V8.6 deprecated)
-oEtextcommand line (V8.6 deprecated)

The argument text is mandatory. If it is missing, this option is ignored. The text is either the actual error text that is printed or the name of a file containing that text. If text begins with the / character, it is taken as the absolute pathname of the file (a relative name is not possible). If the specified file cannot be opened for reading, this option is silently ignored.

Macros can be used in the error text, and they are expanded as they are printed. For example, the text might contain:

For help with $u, try "finger $u"

which might produce this error message:

For help with smith@wash.dc.gov, try "finger smith@wash.dc.gov"
   ----- Transcript of session follows -----
550 5.7.1 smith@wash.dc.gov... User unknown
   ----- Unsent message follows -----

If you specify a file, that file must live in a directory that is safe. A directory is safe when all components of its path are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser on page 1112). If the directory is unsafe, sendmail will ignore the file. If you must put that file in an unsafe directory, you can still enable sendmail to use it by setting the appropriate DontBlameSendmail option (DontBlameSendmail=ErrorHeaderInUnsafeDirPath on page 1012). Note that the file itself must be writable only by root or the trusted user specified in the TrustedUser option, regardless of the directory permissions.

The ErrorHeader option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ErrorMode

Specify mode of error handling All versions

The sendmail program is flexible in its handling of delivery errors. By selecting from five possible modes with the ErrorMode option, you can tailor notification of delivery errors to suit many needs.

This option is intended primarily for use from the command line. If included in the configuration file, it should be given only a p or m argument, for print mode (the default) or mail-error mode.

The forms of the ErrorMode option are as follows:

O ErrorMode=modeconfiguration file (V8.7 and later)
-OErrorMode=modecommand line (V8.7 and later)
define(`confERROR_MODE',mode)   ← mc configuration (V8.7 and later)
-emodecommand-line shorthand (not recommended)
Oemodeconfiguration file (deprecated)
-oemodecommand line (deprecated)

The type of mode is a character. If mode is missing, the default value is p (for print normally). If this ErrorMode option is entirely missing, the default value is p.

The possible characters for the mode argument are listed in Table 24-20.

Table 24-20. ErrorMode option modes

Mode

§

Meaning

e

ErrorMode=e on page 1029

Like m, but always exit with a zero exit status.

m

ErrorMode=m on page 1029

Mail error notification to the sender no matter what.

p

ErrorMode=p on page 1030

Print error messages (the default).

q

ErrorMode=q on page 1030

Remain silent about all delivery errors.

w

ErrorMode=w on page 1030

Write errors to the sender’s terminal screen (deprecated and removed as of V8.13).

Note that the error-handling mode is automatically set to m (for mail errors) in three special circumstances. First, if a mailing list is being processed and if an owner is found for that list (Defining a Mailing List Owner on page 490), the mode is set to m to force mail notification to that owner. Second, if SMTP delivery is to multiple recipients, the mode is set to m to force mail notification to the sender on the assumption that multiple recipients qualify as a mailing list. And third, if the sender address is not that of a local sender, the notification must be mailed to the offsite address.

Also note that V8 sendmail sets the error-handling mode to q (for quiet) when sendmail is given the -bv (address verification) command-line switch. This prevents spurious error messages from being mailed to root when testing addresses.

The ErrorMode option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

ErrorMode=e

Like m, but always exit with a zero exit status. This mode is intended for use from the command line under very limited circumstances. This e mode is used by the rmail(8) program when it invokes sendmail. On some systems, if sendmail exits with a nonzero value (fails), the uuxqt(8) program sends its own error message. This results in two error messages being sent, whereas only one should ever be sent. Worse still, the error message from uuxqt might contain a bad address, one that can itself bounce.

ErrorMode=m

Mail error notification to the sender, no matter what. This mode tries to find the most rational way to return mail. All aliasing is disabled to prevent loops. Nothing is ever saved to ~/dead.letter. This mode is intended for use from the command line. The m mode is appropriate for mail generated by an application that arises from a login but for which no human is present to monitor messages. One example might be a data-acquisition system that is manually logged in but is then left to fend for itself. Similarly, when the user news sends articles by mail, error messages should not be placed in ~news/dead.letter, where they might be overlooked; rather, this mode should be used so that errors are placed in a mail spool file, where they can be periodically monitored.

ErrorMode=p

Print error messages (the default). The sendmail program simply tries to save a copy of the failed mail in ~/dead.letter and prints an error message to its standard output. If the sender is remote, it sends notification of the problem back to that sender via email. If ~/dead.letter is not writable, a copy is saved to /usr/tmp/dead.letter. Note that this default path was hard-coded into pre-V8 versions of sendmail as a string constant. The only way to change it was by editing savemail.c. But beginning with V8 and prior to V8.10 sendmail, the path component was defined by the _PATH_VARTMP definition, and that could be tuned in your Makefile. Beginning with V8.10 sendmail, this path is defined with the DeadLetterDrop option (DeadLetterDrop on page 998).

ErrorMode=q

Quiet; remain silent about all delivery errors. If the sender is local, this mode assumes that the program or person that ran sendmail will give notification of the error. Mail is not sent, and ~/dead.letter is not saved. Error information is provided only in the sendmail program’s exit(2) status (sendmail’s exit( ) Status on page 228). This mode is intended for use in shell scripts. One possible use might be exploding a junk-mail mailing list with a program that could correctly interpret the exit status.

ErrorMode=w

Write errors to the sender’s terminal screen if logged in (similar to write(1)); otherwise, send mail to that user. First tries to write to stdout. If that fails, it reverts to mail notification. This mode is intended for use from the command line. The reason for this mode has been lost to history,[388] and it should be considered obsolete.

As of V8.13, the w setting has been deprecated and removed. If you have used this mode in the past and still need to use it, you may still do so under V8.13 and later by building sendmail with -DUSE_TTYPATH=1 defined in your Build configuration file.

FallbackMXhost

Fallback MX host V8.4 and later

At sites with poor (connect-on-demand) or unreliable network connections, SMTP connections can often fail. In such situations, it might not be desirable for each workstation to queue the mail locally for a later attempt. Under V8 sendmail, it is possible to specify a fallback host to which the mail should instead be forwarded. One such host might be a central mail hub machine.

The FallbackMXhost option specifies the name of a mail exchanger machine (MX record) of last resort. It is given an artificially low priority (high preference number) so that sendmail tries to connect to it only if all other connection attempts for the target host have failed.

Beginning with V8.12, the host specified for this option has its MX records looked up, and those records are added (with artificially high preference numbers) in place of the host. This can be prevented (and the old behavior emulated) by surrounding the hostname with square brackets.

Note that this fallback MX host is used only for connection failures. Prior to V8.10, it is not used if the name server lookup fails. Beginning with V8.10, this fallback MX host is also used if the name server lookup fails. This option is available only for the [IPC] delivery agent (The use of $h in A=TCP on page 739). Note that MX lookups are available only if sendmail is compiled with NAMED_BIND defined (NAMED_BIND on page 124). Also note that, beginning with V8.13, a FallBackSmartHost option has been added (FallBackSmartHost on page 1031).

The forms of the FallbackMXhost option are as follows:

O FallbackMXhost=hostconfiguration file (V8.7 and later)
-OFallbackMXhost=hostcommand line (V8.7 and later)
define(`confFALLBACK_MX',`host')   ← mc configuration (V8.7 and later)
OVhostconfiguration file (V8.6 deprecated)
-oVhostcommand line (V8.6 deprecated)

Here, host is of type string and is the fully qualified domain name of the fallback host. If host or the entire option is missing, no fallback MX record is used. The effect of this option can be seen by using the /mx rule-testing command (Look Up MX Records with /mx on page 309).

The FallbackMXhost option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

FallBackSmartHost

Fallback SmartHost V8.13 and later

At sites with poor (connect-on-demand) or unreliable network connections, SMTP connections can often fail. In such situations, it might not be desirable for each workstation to queue mail locally for later delivery attempts. Prior to V8.13 sendmail, the FallbackMXhost option (FallbackMXhost on page 1030) was used to provide a final, alternative method for getting a message out the door by specifying the name of a mail exchanger machine (MX record) of last resort.

The trouble with this strategy is that the FallbackMXhost option works only if the recipient’s hostname can be looked up in the first place. If the hostname cannot be found, not even the FallbackMXhost is tried.

For most well-managed sites, this is not a problem. Machines can still look up hosts on the Internet, even if they are on an internal business LAN or behind a firewall. But not all sites are well managed, and some sites disallow external lookups as a matter of policy. For such sites, the FallbackMXhost option will not do.

Beginning with V8.13, the FallBackSmartHost option has been added to solve this particular problem. Even if the recipient’s host cannot be found, the fallback host specified with this new option will still be tried.

The FallBackSmartHost option is declared like this:

O FallBackSmartHost=host.domain                 ← config file (V8.13 and later)
-OFallBackSmartHost=host.domain                 ← command line (V8.13 and later)
define(`confFALLBACK_SMARTHOST', `host.domain') ← mc config (V8.13 and later)

Here, host.domain is the canonical name of the host to fall back to. If this option is entirely omitted (the default), no fallback smart host is defined. If the hostname is an empty string or is the name of a nonexistent host, mail forwarded to that host will fail. The host.domain may contain sendmail macros and, if it does, those macros will be expanded just before the attempt is made to connect to the host.

Note that the hostname specified for this FallBackSmartHost option must not exist in the class $=w ($=w on page 876). If it does, it will be silently ignored.

Another use for this new FallBackSmartHost option presents itself at sites that have unreliable FallbackMXhost servers. When that FallbackMXhost goes down, this FallBackSmartHost will be tried, thus allowing outbound mail to continue to flow.

The FallBackSmartHost option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

FastSplit

Suppress MX lookups on initial submission V8.12 and later

When sendmail expands an alias (The aliases(5) File on page 460), as when using aliases to send to a mailing list, sendmail sorts the list of new recipients by host. Normally, that list of hosts is then sorted by MX record rather than hostname. After sorting, the new MX-sorted list is split by sendmail into multiple envelopes.

Envelope splitting (also called cloning) creates multiple envelopes when there was originally only one. Each new envelope contains fewer envelope recipients. Normally, all these envelopes are delivered in parallel for delivery efficiency.

This process is intended to create delivery efficiencies, but on high-traffic machines, it can actually create slowdowns because:

  • Converting hostnames to MX records requires a DNS lookup for each hostname.

  • Large lists can lead to far too many parallel deliveries.

Although the FastSplit option can be used to both eliminate MX lookups and limit the number of parallel deliveries, these two functions cannot be decoupled. The FastSplit option is used like this:

O FastSplit=numconfiguration file (V8.12 and later)
-OFastSplit=numcommand line (V8.12 and later)
define(`confFAST_SPLIT',`num')     ← mc configuration (V8.12 and later)

Here, num is of type numeric. If it is negative, non-numeric, or zero, the normal behavior of sendmail is allowed (hosts are sorted by MX record, and there is no limit on parallel delivery). The default is one.

If num is greater than zero, it prevents sendmail from looking up MX records prior to the sort and split. At sites with possibly sluggish DNS lookups, suppressing the MX lookup can significantly speed up envelope splitting.

Also, if num is greater than zero, that value specifies the limit that will be imposed on the number of parallel deliveries. If there are more envelopes (after splitting) than this value, sendmail will deliver in parallel only that number, and will queue the remainder for delivery during a later queue run.

As mentioned earlier, there is no way to decouple these two functions of the FastSplit option. By making num sufficiently large you can suppress MX lookups, yet still allow relatively large parallel sends. But you cannot limit the number of parallel sends without also suppressing the MX lookups.

The one exception to all this is that parallel sends are limited only when the message is submitted via the command line (as by mailx(1) and the like). Mail that is submitted via SMTP (as with mh(1), the MSP to the MTA, and the like) does not honor the limit on parallel sends.

The FastSplit option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ForkEachJob

Process queue files individually All versions

On machines with a small amount of memory (such as 3B1s and old Sun 3s), it is best to limit the size of running processes. One way to do this is to have the sendmail program fork(2) a copy of itself to handle each individual queued message. The ForkEachJob option can be used to allow those fork(2)s.

The forms of the ForkEachJob option are as follows:

O ForkEachJob=boolconfiguration file (V8.7 and later)
-OForkEachJob=boolcommand line (V8.7 and later)
define(`confSEPARATE_PROC',bool)   ← mc configuration (V8.7 and later)
OYboolconfiguration file (deprecated)
-oYboolcommand line (deprecated)

The argument bool is of type Boolean. If bool is missing, the default is true (fork). The default for the mc technique is false (don’t fork). If the entire ForkEachJob option is missing, the default is also false (don’t fork).

If the ForkEachJob option is set (true), there is a fork(2) to start processing of the queue, and then another fork(2) to process each message in the queue. If the ForkEachJob option is not set (false), only the initial fork(2) takes place, greatly improving the efficiency of a queue run. For example, a single process (as with ForkEachJob false) retains information about down hosts and so does not waste time trying to connect again for subsequent mail to the same host during the current queue run. For all modern machines, the ForkEachJob option should be false.

Note that V8.12 has further reduced the need to set this option because V8.12 sendmail has greatly improved memory management.

The ForkEachJob option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ForwardPath

Set forward file search path V8 and later

When mail is being delivered to a local user, sendmail normally attempts to open and read a file in the user’s home directory called .forward. If that file exists and is readable, the addresses in that file replace the local user name for delivery.[389]

Under V8 sendmail the ForwardPath option is used to define alternative names and locations for the user’s ~/.forward file.

The forms of the ForwardPath option are as follows:

O ForwardPath=pathconfiguration file (V8.7 and later)
-OForwardPath=pathcommand line (V8.7 and later)
define(`confFORWARD_PATH',path)   ← mc configuration (V8.7 and later)
OJpathconfiguration file (V8.6 deprecated)
-oJpathcommand line (V8.6 deprecated)

The path is a colon-separated list of files. An attempt is made to open and read each in turn, from left to right, until one is successfully read:

define(`confFORWARD_PATH',`/var/forward/$u:$z/.forward')

Macros can, and should, be used in the path file locations. In this example, sendmail first looks in the file /var/forward/$u (where the macro $u contains the user’s login name, $u on page 848). If that file can’t be opened for reading, sendmail tries reading; see $z/.forward (where the $z macro contains the user’s home directory; see $z on page 852). Other macros of interest are $w (the local hostname, $w on page 850), $f (the user’s full name, $f on page 824), $h (the user’s +detail, Plussed Detail Addressing on page 476), $r (the sending protocol, $r on page 842), and $s (the sending host, $s on page 844). The recommended declaration is to use the name of the local host. Thus:

define(`confFORWARD_PATH',`$z/.forward.$w:$z/.forward')

If the path or the entire option is omitted, the default is $z/.forward. Therefore, omitting the ForwardPath option causes V8 sendmail to emulate older versions by looking only in the ~/.forward file for user-forwarding information.

Beginning with V8.7 sendmail, the F=w delivery agent flag (F=w on page 781) must be set for the recipient’s delivery agent, or all forwarding is skipped. Previously, this was tied to the delivery agent named local.

The ForwardPath option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

HeloName

Set the name for the HELO/EHLO commands V8.14 and later

When sendmail connects to a listening MTA server, it waits for the 220 greeting and then sends its HELO or EHLO command:

220 foo.example.com ESMTP Sendmail 8.14.0/8.14.0; Fri, 14 Dec 2007 11:53:38 −0800
(PST)
EHLO your.host.domain

Normally, the hostname following the HELO or EHLO is the value of the $j macro ($j on page 830). There may be instances, however, when the value of $j is not correct. For example, when the value assigned to $j is one that is not known to the outside world (such as host.inside.example.com), this would mean that the hostname following HELO or EHLO could not be looked up, potentially causing some sites to reject that HELO or EHLO command. In such a circumstance the HeloName option can be used to set a new value.

The forms of the HeloName option are as follows:

O HeloName=domainconfiguration file (V8.14 and later)
-OHeloName=domaincommand line (V8.14 and later)
define(`confHELO_NAME',domain)   ← mc configuration (V8.14 and later)

The value of domain must be a canonical hostname that can be looked up using DNS. The string you specify is used as is. Do not include macros in the declaration because they will be used literally, not expanded.

The HeloName option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

HelpFile

Specify location of the help file All versions

The sendmail program implements the SMTP (and ESMTP) HELP command by looking up help messages in a text file. Beginning with V8.7 sendmail, help messages for the -bt rule-testing mode are also looked up in that file. The location and name of that text file are specified by using the HelpFile option. If the name is the C-language value NULL, or if sendmail cannot open that file for reading, sendmail issues the following message and continues:[390]

502 5.0.0 HELP not implemented

The help file is composed of lines of text, separated by tab characters into two fields per line. The leftmost field is an item for which help is offered. The rightmost field (the rest of the line) is the help text to be printed. A few lines in a typical help file might look like this:

help    HELP [ <topic> ]
help            The HELP command gives help info.
helo    HELO <hostname>
helo            Introduce yourself.
ehlo    EHLO <hostname>
ehlo            Introduce yourself, and request extended SMTP mode.
ehlo    Possible replies include:
ehlo            SEND            Send as mail                    [RFC821]

For an SMTP request of help vrfy, sendmail might produce:

214-VRFY <recipient>
214-     Verify an address.  If you want to see what it aliases
214-     to, use EXPN instead.
214 End of HELP info

The forms of the HelpFile option are as follows:

O HelpFile=fileconfiguration file (V8.7 and later)
-OHelpFile=filecommand line (V8.7 and later)
define(`HELP_FILE',`file')   ← mc configuration (V8.7 and later)
OHfileconfiguration file (deprecated)
-oHfilecommand line (deprecated)

The argument file is of type string and can be a full or relative pathname. Relative names are always relative to the queue directory. If file is omitted, the name of the help file defaults to helpfile. If the entire option is omitted, the name of the help file is undefined. The default for the mc configuration technique is /etc/mail/helpfile. SMTP is described in RFC2821, and ESMTP is described in RFC1869.

The HelpFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

HoldExpensive

Queue for expensive mailers All versions

An expensive mailer is a delivery agent that contains an e flag in its F= equate (F=e on page 770). Typically, such delivery agents are associated with slow network connections such as SL/IP, or with costly networks such as those with high per-connect or connection startup rates. Whatever the reason, the HoldExpensive option allows you to queue all such mail for later delivery rather than connecting on demand. (Queuing is described in Chapter 11 on page 394.)

Note that this option affects only the initial delivery attempt, not later attempts when the queue is processed. Essentially, all this option does is to defer delivery until the next time the queue is processed.

The forms of the HoldExpensive option are as follows:

O HoldExpensive=boolconfiguration file (V8.7 and later)
-OHoldExpensive=boolcommand line (V8.7 and later)
define(`confCON_EXPENSIVE',bool)   ← mc configuration (V8.7 and later)
-c                                 ← command-line shorthand (not recommended)
Ocboolconfiguration file (deprecated)
-ocboolcommand line (deprecated)

The argument bool is of type Boolean. If the bool argument is missing, the default is true (expensive mail is queued). If the entire HoldExpensive option is missing, the default value is false (expensive mail is delivered immediately).

The -v (verbose) command-line switch automatically sets the HoldExpensive option to false. The HoldExpensive option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

HostsFile

Specify alternative /etc/hosts file V8.7 and later

When canonifying a host’s name, sendmail will use the method described under the ServiceSwitchFile option (ServiceSwitchFile on page 1088). When that method is files, sendmail parses the /etc/hosts file to find the canonical name. If a different file should be used on your system, you can specify it with this HostsFile option:

O HostsFile=pathconfiguration file (V8.7 and later)
-OHostsFile=pathcommand line (V8.7 and later)
define(`confHOSTS_FILE',path)  ← mc configuration (V8.7 and later)

Here, path is of type string. If path is missing, the name of the /etc/hosts file becomes an empty string. If the entire option is missing, the default is the value that was given to _PATH_HOSTS when sendmail was compiled (_PATH... on page 131). If the path cannot be opened for reading (for any reason at all), host canonification by this method is silently skipped.

One example of a use for the HostsFile option would be to use a switched-service file to cause all host lookups to use DNS first, and then files:

hosts:    dns files

In that case, you would use a special file to hold information about internal hosts which are not known to DNS. Such a file might look like this:

123.45.67.89    secret.internal.host.domain

This special file would be defined with the HostsFile option.

The HostsFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

HostStatusDirectory

Location of persistent host status V8.8 and later

The process of delivering network mail requires that sendmail fork(2) so that the child process can handle the queue. Then, if the ForkEachJob option (ForkEachJob on page 1033) is true, each job in the queue has to fork(2) again so that each child of a child can perform each task. Internally, sendmail maintains tables of status information about network hosts (such as whether the host is up or down, or refusing connections). A problem can arise when multiple queue-processing children are running. Because they are separate processes, their separate children lack access to the common pool of host information that is stored internally by each parent.[391]

One solution is to store host status information externally so that all children can access it. Inspired by KJS sendmail, V8.8 has introduced the HostStatusDirectory option. This option both tells sendmail that it should save host status information externally, and defines where that information will be stored on disk.

The form for the HostStatusDirectory option looks like this:

O HostStatusDirectory=pathconfiguration file (V8.8 and
later)
-OHostStatusDirectory=pathcommand line (V8.8 and later)
define(`confHOST_STATUS_DIRECTORY', `path')    ← mc configuration (V8.8 and later)

Here, path is of type string and, if present, specifies the base directory under which the host status will be stored. This can be a full or relative path specification. If it is a relative path, it is interpreted as relative to the queue directory. If path is omitted or if the entire option is omitted, the default is that no persistent host information will be saved. If path does not exist or if it exists and is not a directory, sendmail will then print the following error and will store no persistent host information:

Cannot use HostStatusDirectory = path: reason here

Note that the status information in this directory can be printed with the hoststat(1) command (hoststat (V8.8 and Later) on page 221). Also note that the HostStatusDirectory option will not work if the ConnectionCacheSize option (ConnectionCacheSize on page 987) is set to zero:

Warning: HostStatusDirectory disabled with ConnectionCacheSize = 0

Note that on machines that send out a great deal of mail, you should probably compare performance with and without this option enabled and base your decision to use it on the result. Also note that this option is required if you wish to also use the SingleThreadDelivery option (SingleThreadDelivery on page 1092).

Avoid using a directory that is on a tmpfs filesystem (prior to Sun Solaris 2.5) because file locking is not supported. Avoid using a directory that is on an NFS filesystem because record locking is unreliable, is single-threaded, and can add extra RPC traffic.

The HostStatusDirectory option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

IgnoreDots

Ignore leading dots in messages All versions

There are two ways that sendmail can detect the end of a mail message: by noting an end-of-file (EOF) condition or by finding a line composed of a single dot. According to the SMTP and ESMTP protocols (RFC821), the end of the mail data is indicated by sending a line containing only a period. The IgnoreDots option tells sendmail to treat any line that contains only a single period as ordinary text, not as an EOF indicator.

This option is generally used from the command line when reading a message that might have a line in it that contains only a single dot. This option can safely be used in the configuration file because sendmail always turns it off (sets it to false) when reading a message using SMTP.

The forms of the i option are as follows:

O IgnoreDots=boolconfiguration file (V8.7 and later)
-OIgnoreDots=boolcommand line (V8.7 and later)
define(`confIGNORE_DOTS',bool)   ← mc configuration (V8.7 and later)
-i                               ← command-line shorthand (deprecated)
Oiboolconfiguration file (deprecated)
-oiboolcommand line (deprecated)

The argument bool is of type Boolean. If bool is missing, the default value is true (ignore leading dots). If the IgnoreDots option is entirely omitted, the default is false (recognize leading dots as special).

The IgnoreDots option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

InputMailFilters

Set the order of input filters V8.12 and later

Input mail filters and the X configuration command are described in The X Configuration Command on page 1173. In the configuration file, each filter defined with an X configuration command must also be listed with this InputMailFilters option for it to be used. With the mc configuration, the INPUT_MAIL_FILTER macro defines a filter with the X configuration command and automatically lists the filter with this InputMailFilters option. But the MAIL_FILTER mc macro only defines the filter with the X configuration command, and does not list it with this InputMailFilters option. When using the MAIL_FILTER mc macro, you need to also list your filters with this option for them to be used.

The InputMailFilters option is declared like this:

O InputMailFilters=listconfiguration file (V8.12 and later)
-OInputMailFilters=listcommand line (V8.12 and later)
define(`confINPUT_MAIL_FILTERS',`list')     ← mc configuration (V8.12 and later)

Here, list is of type string. It is a comma-separated list of the names defined by the INPUT_MAIL_FILTER( ) or MAIL_FILTER( ) mc configuration command (see The InputMailFilters Option on page 1177 for a complete description of this option, including possible error messages).

The InputMailFilters option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

LDAPDefaultSpec

Default LDAP switches V8.10 and later

Beginning with V8.10 sendmail, you can specify the default switches for use with ldap database maps (ldap (was ldapx) on page 912) before you use the K configuration command to declare them. This LDAPDefaultSpec option, for example, is a handy way to specify the LDAP server host:

O LDAPDefaultSpec=-h ldap.our.domain

Later K configuration commands would then omit this switch.

The LDAPDefaultSpec option is declared like this:

O LDAPDefaultSpec=specconfiguration file (V8.10 and later)
-OLDAPDefaultSpec=speccommand line (V8.10 and later)
define(`confLDAP_DEFAULT_SPEC',spec)     ← mc configuration (V8.10 and later)

Here, spec is of type string and is an ldap database-map sequence of switches, just as you would use with the K configuration command. If this option is missing, no default is set. If the spec is missing, no default switches are set.

The -N, -O, -S, -a, and -T switches must not be used. If they are, the following error will be logged and printed and sendmail will exit:

readcf: option LDAPDefaultSpec: Do not set non-LDAP specific flags

Nor can you use the -k switch to specify a default LDAP query with this option. If you do, you will see the following error logged and printed, and sendmail will exit:

readcf: option LDAPDefaultSpec: Do not set the LDAP search filter

Finally, you cannot use the -v switch to specify a default for the LDAP attributes. If you do, you will see the following error logged and printed, and sendmail will exit:

readcf: option LDAPDefaultSpec: Do not set the requested LDAP attributes

The LDAPDefaultSpec option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

LogLevel

Set (increase) the logging level All versions

The sendmail program is able to log a wide variety of information about what it is doing. There is no default file for recording information. Instead, sendmail sends all such information via the Unix syslog(3) mechanism. The disposition of messages by syslog is determined by information in the file /etc/syslog.conf (see Tuning syslog.conf on page 515). One common scheme places noncritical messages in /var/log/syslog but routes important messages to /dev/console or /var/adm/messages.

The meaningful values for the logging level, and their syslog priorities, are outlined here.[392] Higher logging levels include the lower logging levels. For example, logging level 2 also causes level 1 messages to be logged.

0

Minimal logging. See What is logged at LogLevel=0 on page 1041 for examples of what is logged at this setting.

1

Serious system failures and security problems logged at LOG_CRIT or LOG_ALERT.

2

Communication failures (e.g., lost connections or protocol failures) logged at LOG_CRIT.

3

Malformed addresses logged at LOG_NOTICE. Transient forward/include errors logged at LOG_ERROR. Connect timeouts logged at LOG_NOTICE.

4

Malformed qf filenames and minor errors logged at LOG_NOTICE. Out-of-date alias databases logged at LOG_INFO. Connection rejections (via libwrap.a or one of the check_ rule sets) logged at LOG_NOTICE.

5

A record of each message received logged at LOG_INFO. Envelope cloning logged at LOG_INFO.

6

SMTP VRFY attempts and messages returned to the original sender logged at LOG_INFO. The ETRN and EXPN ESMTP commands logged at LOG_INFO.

7

Delivery failures, excluding mail deferred because of the lack of a resource, logged at LOG_INFO.

8

Successful deliveries logged at LOG_INFO. Alias database rebuilds logged at LOG_NOTICE.

9

Mail deferred because of a lack of a resource logged at LOG_INFO.

10

SMTP inbound connects logged at LOG_INFO. Each key as looked up in a database, and the result of each lookup, logged at LOG_INFO. TLS errors logged at LOG_WARNING. AUTH= and STARTTLS errors logged at LOG_INFO. Milter connects and replies logged at LOG_INFO.

11

All nis errors logged at LOG_INFO. The end of processing (job deletion) logged at LOG_INFO.

12

SMTP outbound connects logged at LOG_INFO.

13

Log bad user shells, world-writable files, and other questionable situations.

14

Connection refusals logged at LOG_INFO. More STARTTLS information logged at LOG_INFO.

15

All incoming and outgoing SMTP commands and their arguments logged at LOG_INFO.

16–98

Debugging information. You’ll need the source to understand this logging. You can grep(1) LogLevel in all the .c files to find interesting things to look for. These are logged at LOG_DEBUG.

The forms of the LogLevel option are as follows:

O LogLevel=levconfiguration file (V8.7 and later)
-OLogLevel=levcommand line (V8.7 and later)
define(`confLOG_LEVEL',lev)   ← mc configuration (V8.7 and later)
OLlevconfiguration file (deprecated)
-oLlevcommand line (deprecated)

The type for lev is numeric and defaults to 9. For the mc technique, the default is also 9. Negative values are equivalent to a logging level of 0.

Logging is effective only if sendmail is compiled with LOG defined (LOG on page 120). The -d0.1 debugging switch (see -d0.1 on page 542) can be used to see whether LOG was defined for your system.

The LogLevel option is safe.[393] Even if it is specified from the command line, sendmail retains its root privilege. For security reasons, the logging level of V8.6 and later sendmail can be increased from the command line but not decreased.

What is logged at LogLevel=0

Because of their severe nature, some errors and problems are logged even though the LogLevel option is set to zero. Specifically:

  • Problems with $j and $=w that are checked if sendmail was compiled with XDEBUG defined:

    daemon process doesn't have $j in $=w; see syslog
    daemon process $j lost dot; see syslog
  • Failure to find your unqualified hostname or qualified domain:

    My unqualified hostname (my hostname) unknown
    unable to qualify my own domain name (my hostname) -- using short name
  • If the daemon was invoked without a full pathname:

    daemon invoked without full pathname; kill −1 won't work
  • Normal startup of the daemon:

    starting daemon (version): how
  • File descriptor failure if sendmail was compiled with XDEBUG defined:

    subroutine: fd number not open
  • Possible attacks based on a newline in a string:

    POSSIBLE ATTACK from address: newline in string "string here"

Also, the states dumped as a result of a SIGUSR1 (SIGUSR1 on page 510) are logged, as is the output caused by the -d91.100 switch.

MailboxDatabase

Choose a mailbox database V8.12 and later

To perform delivery, sendmail needs to find information about any recipient or sender that is local. The items of interest are:

Numeric IDs

The uid and gid of the user are important because they determine what files can be read or written and which programs can be run.

Full name

The full name is for use in headers and in the $x sendmail macro ($x on page 851).

Home directory

The home directory for the user is needed to locate the user’s ~/.forward file, to locate the place to write the ~/dead.letter file, or to set the correct directory for starting programs.

Shell

The user’s shell is needed to determine whether the user is permitted to run programs (The /etc/shells File on page 180).

In the past, all of this information was gathered using getpwent(3). Beginning with V8.12 sendmail, it is possible to specify this or a different method using an API designed to allow you to write your own method.

The MailboxDatabase option is used to specify how user information is acquired:

O MailboxDatabase=methodconfiguration file (V8.12 and later)
-OMailboxDatabase=methodcommand line (V8.12 and later)
define(`confMAILBOX_DATABASE',method)   ← mc configuration (V8.12 and later)

Here, the method is of type string. The default (and, as of V8.12, the only) method is the literal string pw, which means to use getpwent(3). An LDAP implementation of a method is included in the source as an example. If you wish to write your own method, see the code in libsm/mbdb.c.

The MailboxDatabase option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

MatchGECOS

Match recipient in GECOS field V8.1 and later

The GECOS field is the portion of a passwd(5) file line that contains a user’s full name. Typical passwd file lines are illustrated here with the GECOS field of each highlighted in bold type:

george:Vnn9x34sEVbCN:101:29:George Washington:/usr/george:/bin/csh
bcx:/a88.97eGSx1l:102:5:Bill Xavier,,,:/usr/bcx:/bin/csh
tim:Fss9UdQl55cde:103:45:& Plenty (Jr):/usr/tim:/bin/csh

When sendmail attempts to deliver through a delivery agent that has the F=w flag set (F=w on page 781), it looks up the recipient’s name in the passwd file so that it can locate the user’s home directory. That lookup tries to match the login name, the leftmost field in the passwd file. If that lookup fails, and sendmail has been compiled with MATCHGECOS defined (MATCHGECOS on page 120) and this MatchGECOS option is true, sendmail also tries to match the recipient name to the GECOS field.

First, sendmail converts any underscore characters in the address into spaces and, if the BlankSub option is set (BlankSub on page 980), any characters that match that space substitution character into spaces. This makes the recipient name look like a normal full name.

Second, sendmail normalizes each GECOS entry by throwing away everything following and including the first comma, semicolon, and percent characters. It also converts the & to the login name wherever one is found.

After each GECOS name is normalized, it’s compared in a case-insensitive manner to the recipient. If they match, the passwd entry for that user is used.

This feature allows users to receive mail addressed to their full name as given in the GECOS field of the passwd file. The usual form is to replace spaces in the full name with dots or underscores, so email addresses could be:

George_Washington
Bill.Xavier
"Tim_Plenty_(Jr)"

Full names in GECOS fields that contain characters with special meaning to sendmail, such as the last one in the preceding example, must be quoted when used as addresses.

You should not enable this option if your site lets users edit their own GECOS fields with the chfn(1) program. For one thing, they change their name in a way that can cause mail to start failing. Worse, they can change their name to match another user’s and begin to capture that other user’s mail. Even if the GECOS field is secure, you should avoid this option if your passwd file is large. The sendmail program performs a sequential read of the passwd file, which could be very slow.

The forms of the MatchGECOS option are as follows:

O MatchGECOS=boolconfiguration file (V8.7 and later)
-OMatchGECOS=boolcommand line (V8.7 and later)
define(`confMATCH_GECOS',bool)   ← mc configuration (V8.7 and later)
OGboolconfiguration file (deprecated)
-oGboolcommand line (deprecated)

If you are running DEC OSF/1 V3.2 or earlier, you will need to compile sendmail with the DEC_OSF_BROKEN_GETPWENT compile-time macro defined (see ...IS_BROKEN on page 117).

The MatchGECOS option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

MaxAliasRecursion

Maximum recursion of aliases V8.10 and later

When sendmail processes an alias, it essentially translates one address into new addresses. It must then look up each new address to see whether it, too, is aliased. Clearly, there is a risk that this process might become recursive or excessively deep. Prior to V8.10 sendmail, the MAXRCRSN compile-time macro set the limit on how far this recursion could go. Beginning with V8.10, the limit is set with this MaxAliasRecursion option.

The MaxAliasRecursion option is declared like this:

O MaxAliasRecursion=numconfiguration file (V8.10 and later)
-OMaxAliasRecursion=numcommand line (V8.10 and later)
define(`confMAX_ALIAS_RECURSION',`num')     ← mc configuration (V8.10 and later)

The num is of type numeric and, if omitted, becomes zero. If the entire MaxAliasRecursion option is omitted, the default becomes 10. The default for the mc configuration technique is also 10. If num is zero or negative, all aliases will be limited to one transformation, and every one will cause an error. Whatever the value of num, when recursion becomes greater than that number, the following error is logged and returned as an error in the SMTP dialog, thus bouncing that address:

554 5.0.0 aliasing/forwarding loop broken (actual aliases deep; num max)

In general, a value of 10 should be considered the minimum.

The MaxAliasRecursion option is not safe. If it is specified from the command line, it can cause sendmail to give up any special privileges.

MaxDaemonChildren

Maximum forked daemon children V8.8 and later

The sendmail program fork(3)s often. It forks to process each incoming connection, and it forks to process its queue.

You can limit the number of forked children that the listening sendmail daemon produces by defining the MaxDaemonChildren option, the forms of which are as follows:

O MaxDaemonChildren=numconfiguration file (V8.8 and later)
-OMaxDaemonChildren=numcommand line (V8.8 and later)
define(`confMAX_DAEMON_CHILDREN',`num')     ← mc configuration (V8.8 and later)

The num is of type numeric and specifies the maximum number of forked children that are allowed to exist at any one time. If num is less than or equal to zero, if it is missing, or if this entire option is missing, no limit is imposed. If num is greater than zero, connections that cause more than that number of forked children to be created will be rejected. While rejecting more connections, sendmail will change its process title to read:

rejecting connections: maximum children: num

If num is greater than zero, sendmail will also limit the number of forked daemon children it creates to handle queue runs.

If the daemon handling incoming mail has this option set, a denial-of-service attack can easily be launched against your machine. Beginning with V8.8, the ConnectionRateThrottle option (ConnectionRateThrottle on page 988) can be used to slow rapid incoming connections and can be used with the incoming daemon.

The MaxDaemonChildren option is appropriate for use in certain queue-processing situations. For example, consider a special queue that exclusively holds mail for a popular host (say, /var/spool/bigqueue). To handle the outgoing mail, you could run sendmail in queue-processing mode like this:

/usr/sbin/sendmail -q5m -OMaxDaemonChildren=2 -OQueueDirectory=/var/spool/bigqueue

Here, the queue is processed once every five minutes. If the number of children were not limited and if the queue were large or the destination host slow, too many parallel invocations of sendmail could be spawned, thus causing excessive connections to the destination host. By limiting the number of children with the MaxDaemonChildren option, you allow a small, polite amount of parallelism. (See also the MaxQueueRunSize option, MaxQueueRunSize on page 1050.)

Beginning with V8.14, the DaemonPortOptions option’s keyword children (DaemonPortOptions=children= (8.14 and later) on page 994) can be used to override this setting on an individual daemon basis.

The MaxDaemonChildren option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxHeadersLength

Set maximum header length V8.10 and later

One form of a denial-of-service attack is to send email with many or huge header lines—so huge that memory becomes filled. Prior to V8.10, sendmail limited the maximum total bytes for all headers to the value of the MAXHDRSLEN compile-time macro (MAX... on page 120). That macro defaults to 32,768 bytes if you don’t define it yourself. Beginning with V8.10 sendmail, the MaxHeadersLength option has been added as a way to reduce that limit. The forms of the MaxHeadersLength option are as follows:

O MaxHeadersLength=numconfiguration file (V8.10 and later)
-OMaxHeadersLength=numcommand line (V8.10 and later)
define(`confMAX_HEADERS_LENGTH',num)    ← mc configuration (V8.10 and later)

The num is the maximum total number of bytes you want to allow for all headers combined. If num is missing, it defaults to zero. If the entire MaxHeadersLength option is missing, the default is the value of the MAXHDRSLEN compile-time macro. The default for the mc configuration technique is 32768. If num is less than half of MAXHDRSLEN, the following error is printed, but the limit set by num is still used:

Warning: MaxHeadersLength: headers length limit set lower than (MAXHDRSLEN/2)

During message processing, sendmail reads all headers into memory. When they become larger than the limit imposed by this MaxHeadersLength option (or by the MAXHDRSLEN compile-time macro), the following message is logged:

headers too large (bytes max)
headers too large (bytes max) from sending host during message collect ← V8.12
and later

The offending message will also be bounced with this error:

552 5.0.0 Headers too large (bytes max)

The MaxHeadersLength option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxHopCount

Set maximum hop count All versions

A hop is the transmittal of a mail message from one machine to another.[394] Many hops might be required to deliver a message. The number of hops is determined by counting the Received:, Via:, X400-Received, and Mail-From: lines in the header of an email message.[395]

The MaxHopCount option tells sendmail the maximum number of times a message can be forwarded. When sendmail receives a message via email, it calculates the hop count. If that count is above the maximum allowed, it bounces the message back to the sender with the error:

sendmail: too many hops (17 max)

In this case, 17 is the maximum. Detecting too many hops is useful in stopping mail loops—messages being forwarded back and forth between two machines.

The forms of the MaxHopCount option are as follows:

O MaxHopCount=hopsconfiguration file (V8.7 and later)
-OMaxHopCount=hopscommand line (V8.7 and later)
define(`confMAX_HOP',hops)   ← mc configuration (V8.7 and later)
Ohhopsconfiguration file (deprecated)
-ohhopscommand line (deprecated)

The hops argument is of type numeric. If hops is missing, the value becomes zero and causes all mail to fail with the error:

sendmail: too many hops (0 max)

If the entire MaxHopCount option is missing, hops defaults to 25. A good value is 50 or more (RFC2821, Command-Line Switches, suggests 100). This allows mail to follow a fairly long route through many machines (as it could with UUCP) but still catches and bounces mail caught in a loop between two machines.

The MaxHopCount option should not be confused with the -h command-line switch (-h on page 242). The MaxHopCount option specifies the maximum number of hops allowed, whereas the -h command-line switch presets the (beginning) hop count for a given email message.

The MaxHopCount option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxMessageSize

Maximum incoming ESMTP message size V8.7 and later

The SIZE keyword to the MAIL From: command states how big an incoming message is in bytes.[396] If the SIZE keyword is not specified, sendmail makes no assumptions about the incoming message’s size. V8 sendmail can reject a message at this point if it is larger than a definable maximum message size:

Message size exceeds fixed maximum message size (max)

Here, max is the maximum acceptable size in bytes. Ordinarily, there is no maximum. If you want to define one, you can do so with the MaxMessageSize option:

O MaxMessageSize=maxsizeconfiguration file (V8.7 and later)
-OMaxMessageSize=maxsizecommand line (V8.7 and later)
define(`confMAX_MESSAGE_SIZE',maxsize)   ← mc configuration (V8.7 and later)
Obminblocks/maxsizeconfiguration file (deprecated)
-obminblocks/maxsizecommand line (deprecated)

If maxsize is omitted or if this entire option is omitted, the default is 0 (for unlimited message sizes). For the mc configuration the default is 0 (unlimited). Note that the old b option could also set the minimum blocks free (see MinFreeBlocks on page 1057).

This limit on message size is enforced during the SMTP dialog. Later, after a delivery agent has been selected, further limitations can be imposed by using the M= delivery agent equate (see M= on page 746).

The size of the message is also checked after the message is received (after receipt of the SMTP final DATA-dot) and will be rejected if it is too large at that time.

The MaxMessageSize option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxMimeHeaderLength

Maximum MIME header length V8.10 and later

MIME headers are special, in that they can appear both in the header portion of a message and in the body of the message. Such headers include MIME-Version: (which can appear only in the header portion), Content-Type: (which can appear in both), and Content-Disposition: (which appears in both). All such headers have a name (the part to the left of the colon) and a field (the part to the right of the colon). The length of a MIME header is the combined length of these two parts.

In addition, some MIME headers can also have parameters following the value. For example:

Content-Type: image/gif; name="filename.gif"

Here, the value is everything up to and including the first semicolon. Each semicolon-delimited item that follows that value is a parameter. The following, for example, has one value and two parameters:

Content-Type: multipart/mixed;
        charset="Windows-1252";
        boundary="----=_NextPart_000_00DC_01BEAC82.35D91E20"

Certain kinds of MUA attacks can be based on overly long MIME headers. To prevent the success of such attacks, V8.10 sendmail has introduced the MaxMimeHeaderLength option. It sets the maximum length for both MIME headers and MIME header parameters. The forms of the MaxMimeHeaderLength option are as follows:

O MaxMimeHeaderLength=hdr/paramconfiguration file (V8.10 and
later)
-OMaxMimeHeaderLength=hdr/paramcommand line (V8.10 and later)
define(`confMAX_MIME_HEADER_LENGTH',hdr/param)   ← mc configuration (V8.10 and
later)

Here, hdr is the maximum length for the MIME headers, and param is the maximum length for each parameter. If param is missing, that maximum defaults to zero. If the slash and param are missing, that maximum defaults to one-half the value of hdr. If hdr is missing, that maximum defaults to zero. If either is zero, no checking is done for maximums.

If hdr is positive and nonzero, but less than 128, the following error is printed:

Warning: MaxMimeHeaderLength: header length limit set lower than 128

If param is positive and nonzero, but less than 40, the following error is printed:

Warning: MaxMimeHeaderLength: field length limit set lower than 40

When processing messages, if sendmail finds a MIME header that is listed as belonging to the class $={checkMIMETextHeaders} ($={checkMIMETextHeaders} on page 871) or the class $={checkMIMEHeaders} ($={checkMIMEHeaders} on page 871), it will compare that header length to the maximum set by hdr. If it is too long, sendmail will print and log the following error, and truncate that header line to hdr bytes:

Truncated long MIME header name:value header (possible attack)

Headers in the class $={checkMIMETextHeaders} include the default Content-Description: header. Such headers are simply truncated.

Headers in the class $={checkMIMEHeaders} include the defaults Content-Disposition:, Content-Id:, Content-Transfer-Encoding:, Content-Type:, and MIME-Version:. Such headers are more intelligently truncated in a manner that ensures they will remain legal.

When processing messages, if sendmail finds a MIME header that is listed in the class $={checkMIMEFieldHeaders} ($={checkMIMEFieldHeaders} on page 870), it will check each parameter to insure that it is not larger than param bytes. For any that are too large, sendmail prints and logs the following error, and truncates that parameter to param bytes:

Truncated MIME parameter header due to field size (possible attack)

The MaxMimeHeaderLength option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxNOOPCommands

Number of useless commands before a slowdown V8.14 and later

Prior to V8.14, sendmail set 20 as the limit on the number of useless commands received from a client before it would slow down its responses to that client. The idea is that too many such commands may indicate that an attack is in progress. The useless commands are NOOP and VERB (but not HELP). If sendmail detects too many useless commands, it logs the following warning and sleeps at least one second before replying:

envelope id : client: possible SMTP attack: command=useless command here, count=
how many

Prior to V8.14, the only way to change the limit on useless commands was to change the setting for the MAXNOOPCOMMANDS compile-time macro in sendmail/srvrsmtp.c. Beginning with V8.14, however, you may override that default with your own limit by setting this MaxNOOPCommands option, which is declared like this:

O MaxNOOPCommands=numconfiguration file (V8.14 and later)
-OMaxNOOPCommands=numcommand line (V8.14 and later)
define(`confMAX_NOOP_COMMANDS',`num')   ← mc configuration (V8.14 and later)

Here, num is of type numeric. If num is negative, non-numeric, or zero, no limit is placed on the number of useless commands that the client may send. If this option is entirely omitted, the default is the original value of 20.

The MaxNOOPCommands option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxQueueChildren

Limit total concurrent queue processors V8.12 and later

It is possible to get into situations where too many sendmail processes are processing queues. These queue processors are children of the main sendmail process. Should too many queue-processing children become a problem at your site, you can use this MaxQueueChildren option to limit them.

The MaxQueueChildren option is declared like this:

O MaxQueueChildren=numconfiguration file (V8.12 and later)
-OMaxQueueChildren=numcommand line (V8.12 and later)
define(`confMAX_QUEUE_CHILDREN',`num')   ← mc configuration (V8.12 and later)

Here, num is of type numeric. If num is negative, non-numeric, or zero (the default), no limit is placed on the number of queue-processing children that can simultaneously run. If num is greater than zero, each time sendmail is about to fork(3) to create another queue-processing child, it checks to make sure that there are not too many running. If the number running is equal to or greater than the limit imposed by num, sendmail skips launching another one.

When you define queue groups (Queue Groups (V8.12 and Later) on page 408), you can set up processors for each group with the Runners= equate (The Runners= (R=) queue-group equate on page 414). When this MaxQueueChildren option is defined, it establishes a limit on the total queue processors across all queue groups—that is, for example, if you have two queue groups[397] and you define Runners=2 for each group. If this MaxQueueChildren option is three, the process shown in Table 24-21 will occur during each queue run (where - means to skip the run, and “run” means to perform the run).

Table 24-21. Queue processing example

Queue group

1st run

2nd run

3rd run

4th run

group1

run

-

run

-

group2

-

run

-

run

The MaxQueueChildren option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MaxQueueRunSize

Maximum queue messages processed V8.7 and later

Ordinarily (beginning with V8.6 sendmail), there is no limit to the number of queued messages that can be processed during a single queue run. If there are more messages than sendmail has allocated memory for, sendmail will calmly allocate more memory. (Previously, a fixed limit was imposed at compile time.)

Some systems process so much mail that a single queue run can become unmanageably large—so huge, in fact, that system resources are strained to the limit with an adverse effect on system performance. If your site suffers from this problem, beginning with V8.7 you can set an upper limit on the number of queued messages to be processed by using the MaxQueueRunSize option:

O MaxQueueRunSize=limitconfiguration file (V8.7 and later)
-OMaxQueueRunSize=limitcommand line (V8.7 and later)
define(`confMAX_QUEUE_RUN_SIZE',limit)      ← mc configuration (V8.7 and later)

Here, limit is of type numeric and defines the upper limit on how many queued messages can be processed during a single queue run. If limit is less than or equal to zero, if it is missing, or if the entire option is missing, no limit is imposed. The default is to impose no limit.

If MaxQueueRunSize is defined and if that limit is reached while processing the queue, sendmail will log the following message at LOG_ALERT:

WorkList for queuedir maxed out at  limit

Processing of the queue is described in How the Queue Is Processed on page 426.

The MaxQueueRunSize option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

MaxRecipientsPerMessage

Maximum recipients per envelope V8.10 and later

When sendmail receives email via SMTP, it gathers its list of envelope recipients from the RCPT To: command. In that command, two envelope recipients might be specified (and acknowledged) like this:

RCPT To:<userA@your.host.domain>
250 2.1.5 <userA@your.host.domain>... Recipient OK
RCPT To:<userB@your.host.domain>
250 2.1.5 <userB@your.host.domain>... Recipient OK

Here, each RCPT To: line tells sendmail to deliver a copy of the message to each recipient specified in that line. Each shows the local sendmail acknowledging each recipient.

One method of spamming is to list thousands of recipients for each message—that is, to specify thousands of RCPT To: commands, causing sendmail to deliver a copy of the message to thousands of recipients. As an antispam measure, V8.10 sendmail introduced an option to limit the number of recipients that can be specified for a given envelope. Called MaxRecipientsPerMessage, that option is used like this:

O MaxRecipientsPerMessage=limitconfiguration file (V8.10 and
later)
-OMaxRecipientsPerMessage=limitcommand line (V8.10 and later)
define(`confMAX_RCPTS_PER_MESSAGE', `limit')    ← mc configuration (V8.10 and
later)

The limit tells sendmail the maximum number of recipients it will accept for the current envelope. Any that are specified beyond this limit cause sendmail to acknowledge with this message:

452 4.5.3 Too many recipients

A 452 SMTP acknowledgment tells the sending machine to defer delivery to this recipient until later. This won’t hurt legitimate sites because it delays delivery only until the next queue run. Spam sites, however, will be discouraged because they count on having thousands of recipients accepted at once.

The default for limit is zero. If specified as zero or as a negative value, no limit is imposed.

The MaxRecipientsPerMessage option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

MaxRunnersPerQueue

Limit concurrent queue processors per queue group V8.12 and later

This MaxRunnersPerQueue option defines the maximum number of queue processors that can run in parallel in any given queue group. Note that this differs from the MaxQueueChildren option (MaxQueueChildren on page 1049), which sets the total limit for all queue processors.

The MaxRunnersPerQueue option is declared like this:

O MaxRunnersPerQueue=numconfiguration file (V8.12 and
later)
-OMaxRunnersPerQueue=numcommand line (V8.12 and later)
define(`confMAX_RUNNERS_PER_QUEUE', `num')     ← mc configuration (V8.12 and
later)

Here, num is of type numeric. If num is negative, non-numeric, or zero, no limit is set. If num is positive (the default is 1), that limit is applied to each queue group.

Note that this limit is overridden by the Runners= equate, of the Q configuration file lines (The Q Configuration Command on page 409), and that a Runners=0 disables all queue processing for a queue group. If a Runners= is not specified for a queue group, this MaxRunnersPerQueue option sets the default. Also note that this MaxRunnersPerQueue option is effective only if the MaxQueueChildren option is also given a positive value.

The MaxRunnersPerQueue option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MeToo

Send to me too Deprecated

When you send mail to a mailing list that includes your name as a part of that list, V8.10 and later sendmail normally include you in the mailing, whereas V8.9 and earlier normally exclude you. This change in the default behavior was caused by a change in the standards.

The MeToo option overrides the default. The forms of the MeToo option are as follows:

-m                          ← command-line shorthand
O MeToo=boolconfiguration file (V8.7 and later)
-OMeToo=boolcommand line (V8.7 and later)
define(`confME_TOO',bool)   ← mc configuration (V8.7 and later)
Omboolconfiguration file (deprecated)
-omboolcommand line (deprecated)

The optional argument bool, when missing, defaults to true (include the sender). If this option is entirely missing, V8.10 and later default to true (include the sender), but V8.9 and earlier default to false (exclude the sender).

The MeToo option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

Milter

Tune interactions with the Milter program V8.12 and later

If you set up your mc configuration file to filter mail through external mail filter programs (The InputMailFilters Option on page 1177), you might want to send more information to those programs than is provided by default. This Milter option allows you to do just that, and is declared like this:

O Milter.LogLevel=levelconfiguration file (V8.12 and
later)
O Milter.macros.connect=listconfiguration file (V8.12 and
later)
O Milter.macros.helo=listconfiguration file (V8.12 and
later)
O Milter.macros.envfrom=listconfiguration file (V8.12 and
later)
O Milter.macros.envrcpt=listconfiguration file (V8.12 and
later)
O Milter.macros.data=listconfiguration file (V8.14 and
later)
O Milter.macros.eoh=listconfiguration file (V8.14 and
later)
O Milter.macros.eom=listconfiguration file (V8.13 and
later)
-OMilter.LogLevel=levelcommand line (V8.12 and later)
-OMilter.macros.connect=listcommand line (V8.12 and later)
-OMilter.macros.helo=listcommand line (V8.12 and later)
-OMilter.macros.envfrom=listcommand line (V8.12 and later)
-OMilter.macros.envrcpt=listcommand line (V8.12 and later)
-OMilter.macros.data=listcommand line (V8.14 and later)
-OMilter.macros.eoh=listcommand line (V8.14 and later)
-OMilter.macros.eom=listcommand line (V8.13 and later)
define(`confMILTER_LOG_LEVEL',`level')        ← mc configuration (V8.12 and later)
define(`confMILTER_MACROS_CONNECT',`list')    ← mc configuration (V8.12 and later)
define(`confMILTER_MACROS_HELO',`list')       ← mc configuration (V8.12 and later)
define(`confMILTER_MACROS_ENVFROM',`list')    ← mc configuration (V8.12 and later)
define(`confMILTER_MACROS_ENVRCPT',`list')    ← mc configuration (V8.12 and later)
define(`confMILTER_MACROS_DATA',`list')       ← mc configuration (V8.14.1 and
later)
define(`confMILTER_MACROS_EOH',`list')        ← mc configuration (V8.14.1 and
later)
define(`confMILTER_MACROS_EOM',`list')        ← mc configuration (V8.13 and later)

If any of these commands are set without MILTER support (Pre-V8.13 Enable with -DMILTER on page 1170), the following error is printed and logged when sendmail starts, and the command is ignored:

Warning: Option: bad option requires Milter support (-DMILTER)

The bare Milter option is meaningless, and if set (say, to foo) in your sendmail.cf file like the following:

O Milter foo

the following error will be produced:

configfile: line number: readcf: unknown option name Milter foo

Also, following a bare Milter option with an equals sign, as, for example:

O Milter=foo

will produce the following error:[398]

configfile: line number: milter_set_option: invalid Milter option, must specify
suboption

A bare Milter.macros is also meaningless. If set (say, to {foo}) in your sendmail.cf file like the following:

O Milter.macros={foo}

the following error will be produced:

configfile: line number: milter_set_option: invalid Milter option macros {foo}

Because the nature of each suboption varies, we discuss their defaults in the sections to follow.

Milter.LogLevel

The Milter.LogLevel option is of type number. If it is set with a negative number (other than a −1), a non-numeric expression, or the value zero, no Milter logging will be done. If the Milter.LogLevel option is entirely missing (or set to a −1), it defaults to the same value as that specified for the LogLevel option (LogLevel on page 1040). Otherwise, this option sets the log level used by sendmail to report on external Milter programs:

define(`confMILTER_LOG_LEVEL',`9')

Here, the Milter log level is set to 9, which will report everything logged at level 9 and below. As of this writing, all Milter levels less than 10 are logged at LOG_ERR, and those greater than 10 are logged at LOG_INFO. Also as of this writing, only a few Milter log levels are available:

1

Bad reply codes from the external program, socket errors, timeouts waiting for the external program to reply, polling errors with select(3) while waiting for the external program to reply, bad read/write length from/to the external program, and general reply and state errors

9

A header was added, added or deleted a RCPT To: response, replaced message body, and no active filter

10

Connect to filters, connect ending, and lies about adding or changing that were honored anyway

11

Empty or missing socket information, unknown socket type, local socket name too long, local socket unsafe, bad address format, bad port number, unknown port name, invalid domain specification, unknown hostname, error creating socket, open failure, unknown protocol, status, and aborts

14

Reply code, rejects, discards, and deferrals

1

Milter senders, and Milter recipients

18

Headers sent, and body sent

22

Time to complete a command

Milter.macros.connect

The Milter.macros.connect option is of type string. If set, it lists the sendmail macros whose names and values should be passed to the external program after a connection has been accepted. Only the macro names should be listed here (omit the leading $ from each), separated by commas.[399] For example:

define(`confMILTER_MACROS_CONNECT',``j, {daemon_name}'')

At most, 40 macros can be listed. If you list too many, the following error will be printed and logged:

milter_set_option: too many macros in Milter.macros.connect num (max 40)

There is no built-in default. The default for the mc configuration technique includes the macros $j ($j on page 830), $_ ($_ on page 801), ${daemon_name} (${daemon_name} on page 819), ${if_name} (${if_name} on page 828), and ${if_addr} (${if_addr} on page 827). If you replace the default list with no macros, none will be sent to the external program.

Milter.macros.helo

The Milter.macros.helo option is of type string. If set, it lists the sendmail macros whose names and values should be passed to the external program after the HELO or EHLO command has been received. Only the macro names should be listed here (omit the leading $ from each), separated by commas.[400] For example:

define(`confMILTER_MACROS_HELO',``{client_addr}, {client_name}'')

At most, 40 macros can be listed. If you list too many, the following error will be printed and logged:

milter_set_option: too many macros in Milter.macros.helo num (max 40)

There is no built-in default. The default for the mc configuration technique includes the macros ${tls_version} (${tls_version} on page 847), ${cipher} (${cipher} on page 809), ${cipher_bits} (${cipher_bits} on page 810), ${cert_subject} (${cert_subject} on page 809), and ${cert_issuer} (${cert_issuer} on page 809). If you replace the default list with no macros, none will be sent to the external program.

Milter.macros.envfrom

The Milter.macros.envfrom option is of type string. If set, it lists the sendmail macros whose names and values should be passed to the external program after the MAIL From: command has been received. Only the macro names should be listed here (omit the leading $ from each), separated by commas.[401] For example:

define(`confMILTER_MACROS_ENVFROM',``{mail_addr}, {mail_mailer}'')

At most, 40 macros can be listed. If you list too many, the following error will be printed and logged:

milter_set_option: too many macros in Milter.macros.envfrom num (max 40)

There is no built-in default. The default for the mc configuration technique includes the macros $i ($i on page 826), ${auth_type} (${auth_type} on page 806), ${auth_authen} (${auth_authen} on page 804), ${auth_ssf} (${auth_ssf} on page 806), ${auth_author} (${auth_author} on page 805), ${mail_mailer} (${mail_mailer} on page 834), ${mail_host} (${mail_host} on page 833), and ${mail_addr} (${mail_addr} on page 833). If you replace the default list with no macros, none will be sent to the external program.

Milter.macros.envrcpt

The Milter.macros.envrcpt option is of type string. If set, it lists the sendmail macros whose names and values should be passed to the external program after each RCPT To: command has been received. Only the macro names should be listed here (omit the leading $ from each), separated by commas.[402] For example:

define(`confMILTER_MACROS_ENVRCPT',``{rcpt_addr}, {rcpt_mailer}'')

At most, 40 macros can be listed. If you list too many, the following error will be printed and logged:

milter_set_option: too many macros in Milter.macros.envrcpt num (max 40)

There is no built-in default. The default for the mc configuration technique includes the macros ${rcpt_mailer} (${rcpt_mailer} on page 843), ${rcpt_host} (${rcpt_host} on page 843), and ${rcpt_addr} (${rcpt_addr} on page 842). If you replace the default list with no macros, none will be sent to the external program.

None of these Milter options is safe. If specified from the command line, any can cause sendmail to relinquish its special privileges.

Milter.macros.data

Beginning with V8.14, the new Milter.macros.data option defines a list of macros to be passed to a Milter’s DATA command-handling routine. It is declared like this:

O Milter.macros.data=listconfiguration file (V8.14 and
later)
-OMilter.macros.data=listcommand line (V8.14 and later)
define(`confMILTER_MACROS_DATA',`list')      ← mc configuration (V8.14.1 and
later)

The Milter.macros.data option is of type string. The list is a sequence of macro names, each separated from the next using a comma, and each stripped of its leading “$” prefix (that is, {nbadrcpts}, not ${nbadrcpts}).

There is no default macro passed to the Milter’s DATA handling routine. If you wish to add macros you may do so using your mc configuration file like this:

define(`confMILTER_MACROS_EOM', `{nbadrcpts}')

Here, we added the ${nbadrcpts} macro (${nbadrcpts} on page 837) to the list of macros.

The Milter.macros.data option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Milter.macros.eoh

Beginning with V8.14, the Milter.macros.eoh option defines a list of macros to be passed to a Milter’s end-of-message handling routine. It is declared like this:

O Milter.macros.eoh=listconfiguration file (V8.14 and later)
-OMilter.macros.eoh=listcommand line (V8.14 and later)
define(`confMILTER_MACROS_EOH',`list')      ← mc configuration (V8.14.1 and later)

The Milter.macros.eoh option is of type string. The list is a sequence of macro names, each separated from the next with a comma, and each stripped of its leading “$” prefix (that is, {mail_addr}, not ${mail_addr}).

There are no default macros passed to the Milter’s end-of-headers routine. If you wish to add macros you may do so using your mc configuration file like this:

define(`confMILTER_MACROS_EOM', ``{mail_host},{mail_addr}'')

Here, we tell the Milter library to send the ${mail_host} macro (${mail_host} on page 833) and the ${mail_addr} macro (${mail_addr} on page 833) to your end-of-headers function. Note the use of two single quotes. They are needed because the macro list contains a comma (recall that the list of macros must be delimited with commas).

The Milter.macros.eoh option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Milter.macros.eom

Beginning with V8.13, the Milter.macros.eom option defines a list of macros to be passed to a Milter’s end-of-message handling routine. It is declared like this:

O Milter.macros.eom=listconfiguration file (V8.13 and later)
-OMilter.macros.eom=listcommand line (V8.13 and later)
define(`confMILTER_MACROS_EOM',`list')      ← mc configuration (V8.13 and later)

The Milter.macros.eom option is of type string. The list is a sequence of macro names, each separated from the next using a comma, and each stripped of its leading “$” prefix (that is, {nbadrcpts}, not ${nbadrcpts}).

The default macro passed to the Milter’s end-of-message routine is the ${msg_id} macro (${msg_id} on page 834). If you wish to add other macros to the default list you may do so using your mc configuration file like this:

define(`confMILTER_MACROS_EOM', confMILTER_MACROS_EOM``,{nbadrcpts}'')

Here, we added the ${nbadrcpts} macro (${nbadrcpts} on page 837) to the default list of macros. Note the use of two single quotes. They are needed because the added macro contains a comma (recall that the list of macros must be delimited with commas).

The Milter.macros.eom option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

MinFreeBlocks

Define minimum free disk blocks V8.1 and later

The ESMTP SIZE keyword to the MAIL From: command tells V8 sendmail how big an incoming message is in bytes. If the SIZE keyword is not specified, sendmail assumes that the incoming message is zero bytes in size. In either case, it calls an internal routine to see whether enough space is available in the queue to accept the message. Unless sendmail is told otherwise, it assumes it can use 100% of the disk space in the queue. If SIZE bytes will overfill the queue disk, sendmail prints the following error and rejects the mail message:

Insufficient disk space; try again later

Note that the SIZE keyword (if received) is just an estimate that allows oversized mail to be rejected early in the ESMTP dialog. V8 sendmail still properly diagnoses out-of-space conditions when it actually reads the message.

If using 100% of the disk space is unacceptable, you can use the MinFreeBlocks option, the forms of which follow, to reserve space for other kinds of files:

O MinFreeBlocks=minblocksconfiguration file (V8.7 and
later)
-OMinFreeBlocks=minblockscommand line (V8.7 and later)
define(`confMIN_FREE_BLOCKS',minblocks)         ← mc configuration (V8.7 and
later)
Obminblocks/maxsizeconfiguration file (deprecated)
-obminblocks/maxsizecommand line (deprecated)

Here, minblocks is of type numeric and is the number of disk blocks you wish to reserve. If minblocks is missing or negative, or if the entire option is omitted, no blocks are reserved. For the V8.6 form of the b option, a slash is required to separate minblocks from maxsize (maxsize is described under the MaxMessageSize option, MaxMessageSize on page 1047). The default when configuring with the mc method is 100.

Note that minblocks minimum blocks are reserved only for the ESMTP SIZE keyword to the MAIL From: command. No check is made for any other kind of queuing to reserve space. Consequently, you should reserve a sufficient number of blocks to satisfy your normal queuing needs.

The MinFreeBlocks option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

MinQueueAge

Skip queue file if too young V8.7 and later

When the queues are processed normally, sendmail will attempt to deliver all messages (except those that have a recipient address that resolves to a delivery agent with the F=% flag set, (F=% on page 761). No distinction is made between recently queued messages and messages that have been in the queue for a long time.

Some sites might prefer to process the queue often—say, once every five minutes. This ensures that all important mail will be delivered promptly but can exact a price in degraded performance. Every time the queue is processed, sendmail tries to deliver every mail message in the queue, but many sites have queued messages that should not be retried every five minutes. One way to handle this problem is to set the MinQueueAge option. If it is set to 1h (one hour), every queued message is forced to remain in the queue for a minimum of one hour, even if the queue is processed more frequently. The forms of this option are as follows:

O MinQueueAge=waitconfiguration file (V8.7 and later)
-OMinQueueAge=waitcommand line (V8.7 and later)
define(`confMIN_QUEUE_AGE''`wait')         ← mc configuration (V8.7 and later)

The argument wait is of type time. If wait is less than or equal to zero, or if it is missing, this feature is disabled. If the units in the time expression are omitted, the default is minutes. There is no default for the mc configuration method.

Note that the decision to process is not based on the time the message was placed into the queue. It is instead based on the time the message was last processed from the queue. This time is stored in the K line of the qf file (K line on page 452). This minimum is enforced only if the number of times delivery has been attempted is greater than zero (the qf file’s N line, N line on page 452). This ensures that the first delivery attempt will be made immediately.

The MinQueueAge option is safe. If specified from the command line, sendmail will not relinquish its special privileges.

MustQuoteChars

Quote nonaddress characters V8.8 and later

All addresses are composed of address information and nonaddress information. The two most common forms of addresses look like this:

address (nonaddress)
nonaddress <address>

Usually, the nonaddress information is a user’s full name or something similar. RFC2822 requires that certain characters be quoted if they appear in the nonaddress part of an address:

@ , ; : \ ( ) [ ] . ' < >

Note that here we show angle brackets, although they will not be part of this option’s setting (they are set internally by sendmail).

Nonaddress information inside parentheses is already quoted by those parentheses. But nonaddress information that is outside parentheses and contains any of these characters needs to be quoted with full quotation marks. To illustrate, consider this address:

From: Bob@home <bob@here.uofa.edu>

Because the nonaddress part Bob@home contains an @ character, sendmail is required to quote the entire phrase, thus forming:

From: "Bob@home" <bob@here.uofa.edu>

Note that the address part contains angle brackets that are not quoted. They are unquoted because they surround the address part, and are not considered part of the nonaddress part.

If you wish to add characters to the mandatory list of characters that will be quoted, you can do so with the MustQuoteChars option, the forms of which are as follows:

O MustQuoteChars=moreconfiguration file (V8.8 and later)
-OMustQuoteChars=morecommand line (V8.8 and later)
define(`confMUST_QUOTE_CHARS', `more')    ← mc configuration (V8.8 and later)

Here, more is of type string and is the list of additional characters that you wish to see quoted in the nonaddress part of addresses. Note that the more characters replace the . and ' characters, so if you wish to retain those latter two characters, you must include them in your declaration. If more is missing, the . and ' characters are dropped from the default:

@ , ; : \ ( ) [ ]

The default for the mc configuration technique is to not define this option, in which case the default is:

@ , ; : \ ( ) [ ] . '

The MustQuoteChars option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

NiceQueueRun

Default nice(3) setting for queue processors V8.12 and later

The nice(3) value of a process is one of the factors used by the kernel to determine a process’ scheduling priority. Scheduling priorities typically range from −20 to +20. The higher (more positive) the value, the lower the processes’ scheduling priority, and the lower (more negative) the value, the higher the command’s scheduling priority. Most processes (such as sendmail) run with a nice(3) value of zero.

At busy mail-handling sites, it can be desirable to process the queues at a higher (less favorable) or lower (more favorable) nice(3) priority than normal. If you run many queue processors over many queues, you might wish to increase the nice(3) value so that queue processing has less impact on other processes. At mail-sending sites, where outbound email has the priority, you might wish to decrease the nice(3) value so that queue processing gets more CPU time than other processes.

The nice(3) value for queue processors is set with this NiceQueueRun option like this:

O NiceQueueRun=valueconfiguration file (V8.12 and later)
-ONiceQueueRun=valuecommand line (V8.12 and later)
define(`confNICE_QUEUE_RUN',`value')       ← mc configuration (V8.12 and later)

Here, value is the value passed to the nice(3) function. It is of type numeric. A positive value will decrease the queue runner’s priorities. A negative value will be silently accepted, then ignored at runtime. A non-numeric or zero value (the default) will leave the priority unchanged.

If your system lacks nice(3) support, the following warning will be printed and logged and this NiceQueueRun option will be ignored:

Warning: NiceQueueRun set on system that doesn't support nice(  )

Note that the call to nice(3) does not check for errors. If sendmail cannot set a new nice(3) value, the queue processors will silently not be given a new priority.

The NiceQueueRun option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

NoRecipientAction

How to handle no recipients in header V8.7 and later

The header portion of a mail message must contain at least one recipient header. Problems can arise when an MUA produces a message with no recipients or when the only recipients are listed in a Bcc: header line. In the past, sendmail inserted an Apparently-To: header (Apparently-To: on page 1151) into any message that lacked header recipients. The addresses in the Apparently-To: were gleaned from the envelope.

Beginning with V8.7 sendmail, it is possible to choose how messages without recipients will be handled. This is done with the NoRecipientAction option, which is used like this:

O NoRecipientAction=whatconfiguration file (V8.7 and later)
-ONoRecipientAction=whatcommand line (V8.7 and later)
define(`confNO_RCPT_ACTION',what)     ← mc configuration (V8.7 and later)

The argument what is of type string and must be selected from those shown in Table 24-22. If the what is omitted or if it is other than one of the possibilities shown, the following error is printed, and the option is ignored:

Invalid NoRecipientAction: bad what

If the entire option is omitted, the default becomes none. The default for the mc technique is to omit this option.

The what is case-insensitive (meaning that none and nOnE are both identical).

Table 24-22. NoRecipientAction option keywords

What

§

Meaning

add-apparently-to

NoRecipientAction=add-apparently-to on page 1060

Add an Apparently-To: header.

add-bcc

NoRecipientAction=add-bcc on page 1060

Add an empty Bcc: header.

add-to

NoRecipientAction=add-to on page 1061

Add a To: header.

add-to-undisclosed

NoRecipientAction=add-to-undisclosed on page 1061

Add To: undisclosed-recipients:;.

none

NoRecipientAction=none on page 1061

Pass the message unchanged.

The NoRecipientAction option is safe. If it is specified from the command line, sendmail will not relinquish its special privileges.

NoRecipientAction=add-apparently-to

Add an Apparently-To: header. That is, act like pre-V8.7 sendmail. But note that this choice has been deprecated and should not be used.

NoRecipientAction=add-bcc

Add an empty Bcc: header. This makes the header portion of the mail message legal under RFC2822 but implies that all recipients originally appeared in Bcc: header lines. But be aware that old versions of sendmail will strip all Bcc: headers, so the next site might add an Apparently-To: header and wrongly expose the address.

NoRecipientAction=add-to

Add a To: header and fill it out with all the recipients from the envelope. This can be misleading because it can give a false picture of the intended recipients. It can also cause Bcc: header addresses to be mistakenly revealed. This choice might be appropriate in the command line when sendmail is run from an MUA that routinely omits recipient headers.

NoRecipientAction=add-to-undisclosed

Add a To: header, but list in it only the address of an empty, but descriptive, mailing list:

To: undisclosed-recipients:;

This is the recommended setting for use in configuration files.

NoRecipientAction=none

Pass the message unchanged. Currently, this is technically illegal because RFC2822 requires at least one recipient header in every mail message. This choice might be appropriate for naïve sites that kick all mail to a smart host for processing. Note that RFC822 makes this legal.

OldStyleHeaders

Allow spaces in recipient lists All versions

In pre-RFC821 days, lists of recipients were commonly space-delimited; that is, the list:

hans christian andersen

was considered a list of three mail recipients, rather than a single, three-part name. Currently, individual recipient names must be delimited with commas, and internal spaces must be quoted. That is:

hans,christian,andersen       ← three recipients
"hans christian andersen"     ← a single three-part name
hans christian andersen       ← illegal

Because some users and some old programs still delimit recipient lists with spaces, the OldStyleHeaders option can be used to tell sendmail to internally convert those spaces to commas.

The forms of the OldStyleHeaders option are as follows:

O OldStyleHeaders=boolconfiguration file (V8.7 and later)
-OOldStyleHeaders=boolcommand line (V8.7 and later)
define(`confOLD_STYLE_HEADERS',bool)   ← mc configuration (V8.7 and later)
Ooboolconfiguration file (deprecated)
-ooboolcommand line (deprecated)

The argument bool is of type Boolean. If that argument is missing, the default value is true, and unquoted spaces in an address are converted to commas. The default when configuring with the mc technique is true. If the entire OldStyleHeaders option is missing, it defaults to false, and unquoted spaces are converted to the character defined by the BlankSub option (BlankSub on page 980).

The sendmail program is somewhat adaptive about commas. When first examining a list of addresses, it looks to see whether one of the following four characters appears in that list:

, ; < (

If it finds any of these characters in an address list, it turns off the OldStyleHeaders option for the remainder of the list. You always want to enable this option in your configuration file. The only exception might be the unusual situation in which all addresses are normally comma-separated but some legal addresses contain spaces.

Note that comma delimiting allows spaces around recipient names for clarity. That is, both of the following are equivalent:

hans,christian,andersen
hans, christian, andersen

The OldStyleHeaders option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

OperatorChars

Set token separation operators V8.7 and later

The OperatorChars option stores as its value a sequence of characters, any one of which can be used to separate the components of an address into tokens (Tokenizing Rules on page 655). Prior to V8.7, the $o macro fulfilled this role. Beginning with V8.7, the OperatorChars option has taken over:

O OperatorChars=.:%@!^=/[  ]            ← beginning with V8.7
Do.:%@!^=/[  ]                          ← prior to V8.7

The list of separation operators declared with this option is joined by sendmail to an internal list of hardcoded separation operators:

(  )<>,;\r\n

The combined list is used in tokenizing the workspace for rule-set processing. The order in which the characters appear in the OperatorChars option declaration is arbitrary. The space and tab characters need not be included in that list because they are always used to separate tokens.

Care should be taken in eliminating any given character from this list. Before doing so, the entire configuration file should be examined in detail to be sure that no rule requires that character. The use of the individual characters in addresses is beyond the scope of this book. The book !%@:: A Directory of Electronic Mail Addressing and Networks, by Donnalyn Frey and Rick Adams (O’Reilly), contains the many forms of addressing in great detail.

The OperatorChars option is used like this:

O OperatorChars=textconfiguration file (V8.7 and later)
-OOperatorChars=textcommand line (V8.7 and later)
define(`confOPERATORS',`text')     ← mc configuration (V8.7 and later)
Dotextprior to V8.7

The text is of type string. If it is missing and if the configuration file version is less than 7, sendmail tries to use the value of the $o macro. If that macro is also undefined, a default of .:@[ ] is used. If text is longer than 39 characters, it is truncated to 39 characters. In using the mc technique, a default of .:%@!^/[ ]+ is used.

Note that this option must be defined before any rule sets are declared. If you mistakenly declare a rule set first, you will see the following warning:

Warning: OperatorChars is being redefined.
  It should only be set before ruleset definitions.

The OperatorChars option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

PidFile

Location of the sendmail pid file V8.10 and later

Prior to V8.10 sendmail, the location and name of the sendmail.pid file (Daemon mode (-bd) on page 20) hardcoded. But having only one file could lead to problems at sites that ran multiple daemons (possibly bound to different interfaces) because that file could contain the information about only one daemon.

Beginning with V8.10, sendmail allows you to set both the location and the name of the sendmail.pid file with an option. This allows each daemon to have its own private file, thus eliminating the former contention for a single file.

The location and name of the sendmail.pid file are set with the PidFile option:

O PidFile=pathconfiguration file (V8.10 and later)
-OPidFile=pathcommand line (V8.10 and later)
define(`confPID_FILE',`path')   ← mc configuration (V8.10 and later)

The path is the full pathname of the file. If path is missing, the pathname becomes that of an empty string. If the entire option is missing, the default varies depending on the operating system (see conf.h). The default with the mc configuration technique is to not define this option.

If the file specified cannot be written—because it is not safe, it is in a directory that does not exist, or it is an empty string—sendmail will log the following error and skip writing to the file:

unable to write path

Note that the path may contain macros as part of its declaration. The values in the macros will become part of the path just before the file is created and written.[403] One convenient declaration, for example, might look like this:

define(`confPID_FILE',`/etc/mail/sendmail.pid.${daemon_name}')

Here, the path will have a suffix that is the name you give to the daemon with the ${daemon_name} macro (${daemon_name} on page 819).

Prior to V8.13, sendmail would leave the PID file in place when it exited. Beginning with V8.13, however, sendmail removes its PID file when it exits. Also prior to V8.13, sendmail would not lock the file, meaning that if two daemons shared a file, the second might overwrite the information of the first. Beginning with V8.13, sendmail now locks its PID file while it is running.

Prior to V8.13, only a listening daemon could have a PID file. Beginning with V8.13, sendmail allows all persistent daemons (such as queue runners) to create PID files.

The PidFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

PostmasterCopy

Extra copies of bounce messages All versions

RFC2821 requires that all sites be set up so that mail addressed to the special name Postmaster[404] always be successfully delivered. This requirement ensures that notification of mail problems can always be sent and successfully delivered to the offending site.[405] At most sites, the name Postmaster is an alias to a real person’s name in the aliases file. Mail to Postmaster should never be ignored.

Ordinarily, notification of locally bounced mail and other mail problems is sent back (bounced) to the sender of the message. The local person in the role of Postmaster does not get a copy of local failed mail.

The PostmasterCopy option tells sendmail to send a copy of all failed mail to another person, often Postmaster. Under V8 and SunOS, that copy contains only the failed message’s header. Under very old versions of sendmail, that copy includes both the header and the body.

The forms of the PostmasterCopy option are as follows:

O PostmasterCopy=userconfiguration file (V8.7 and later)
-OPostmasterCopy=usercommand line (V8.7 and later)
define(`confCOPY_ERRORS_TO',user)   ← mc configuration (V8.7 and later)
OPuserconfiguration file (deprecated)
-oPusercommand line (deprecated)

The argument user is of type string. If the argument is missing or if the PostmasterCopy option is entirely missing, no extra copy is sent. The default for the mc configuration technique is to not send an extra copy.

While debugging a new sendmail.cf file, it is wise to define the PostmasterCopy option so that you receive a copy of all failed mail. Once the configuration file is stable, either the PostmasterCopy option can be removed or the name can be replaced with an alias to a program. Such a program could filter the copies of error mail so that only serious problems would be seen.

Macros used in the user argument will be correctly expanded before use. For example:

D{NOTIFYHOST}mailhost                     ← beginning with V8.7
O PostmasterCopy=Postmaster@${NOTIFYHOST} ← beginning with V8.7
DAmailhost                                ← deprecated
OPPostmaster@$A                           ← deprecated

The PostmasterCopy option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

PrivacyOptions

Increase privacy of the daemon V8.1 and later

The PrivacyOptions option is used primarily as a way to force other sites to adhere to SMTP conventions, but can also be used to improve security.

The forms of the PrivacyOptions option are as follows:

O PrivacyOptions=what,...configuration file (V8.7 and later)
-OPrivacyOptions=what,...command line (V8.7 and later)
define(`confPRIVACY_FLAGS',``what,...'')   ← mc configuration (V8.7 and later)
Opwhat,...configuration file (deprecated)
-opwhat,...command line (deprecated)

Multiple what arguments are allowed but they must be separated from one another by commas[406] (there can be arbitrary spaces around the commas). For example:

define(`confPRIVACY_FLAGS',``authwarnings, needmailhelo'')

If this option is entirely omitted or if no what arguments are listed, the option defaults to public. The default for the mc configuration technique is authwarnings. The possible what arguments are listed in Table 24-23, and are described in more details in the sections that follow.

Table 24-23. PrivacyOptions option keywords

Keyword

§

Meaning

authwarnings

PrivacyOptions=authwarnings on page 1066

Enable X-Authentication-Warning: headers.

goaway

PrivacyOptions=goaway on page 1066

Much checking for privacy and security.

needexpnhelo

PrivacyOptions=needexpnhelo on page 1067

Require HELO before EXPN.

needmailhelo

PrivacyOptions=needmailhelo on page 1067

Require HELO before MAIL From:.

needvrfyhelo

PrivacyOptions=needvrfyhelo on page 1067

Require HELO before VRFY.

noactualrecipient

PrivacyOptions=noactualrecipient on page 1067

Suppress X-Actual-Recipient DSN lines for privacy (V8.14 and later).

nobodyreturn

PrivacyOptions=nobodyreturn on page 1066

Prevent RETURN=FULL from returning the body (V8.10 and later).

noetrn

PrivacyOptions=noetrn on page 1066

Disallow all SMTP ETRN commands.

noexpn

PrivacyOptions=noexpn on page 1067

Disallow all SMTP EXPN commands.

noreceipts

PrivacyOptions=noreceipts on page 1068

Prevent SUCCESS return receipts.

noverb

PrivacyOptions=noverb on page 1068

Disallow all SMTP VERB commands.

novrfy

PrivacyOptions=novrfy on page 1068

Disallow all SMTP VRFY commands.

public

PrivacyOptions=public on page 1068

No extra checking for privacy or security.

restrictexpand

PrivacyOptions=restrictexpand (V8.12 and later) on page 1069

Restrict who can use -bv (V8.12 and later).

restrictmailq

PrivacyOptions=restrictmailq on page 1069

Restrict who can run mailq(1).

restrictqrun

PrivacyOptions=restrictqrun on page 1069

Restrict who can process the queues.

If what is other than one of the keywords listed in the table, sendmail prints the following message and ignores the unknown word:

readcf: Op line: unknown_word unrecognized

Note that sendmail checks for non-root use of the -C (-C on page 238) and -oQ (QueueDirectory on page 1070) command-line switches and dangerous uses of the -f (-f on page 241) command-line switch when the command line is read but does not issue warnings until after the configuration file is read. That way, the configuration file determines how X-Authentication-Warning: headers will be issued.

The PrivacyOptions option is safe. If specified from the command line, it does not cause sendmail to relinquish its special privileges. Because it is really a mask, specifications in the configuration file or on the command line can only make it more restrictive.

PrivacyOptions=authwarnings

Setting authwarnings causes sendmail to insert special headers into the mail message that advise the recipient of reasons to suspect that the message might not be authentic. The general form of this special header is shown here. The possible reasons are listed in Chapter 25 on page 1120.

X-Authentication-Warning: ourhost:  reason

PrivacyOptions=goaway

This is a shorthand way to set authwarnings, noexpn, novrfy, noverb, needmailhelo, needexpnhelo, needvrfyhelo, and nobodyreturn.

PrivacyOptions=nobodyreturn

Ordinarily, the body of the original message in a bounced message will be returned with the bounce. Also, if the DSN extension RET (-R on page 247) indicates that the original body should be returned, it will. For example:

MAIL From:<address> RET=FULL

Beginning with V8.10, you set this privacy flag to make it your policy to never return the original body in a bounce, and to suppress the honoring of RET=FULL.

PrivacyOptions=noetrn

The ETRN (Process the queue via ESMTP ETRN on page 433) ESMTP extension allows sites that connect to your sendmail daemon to force the daemon to process the queue on demand. For sites that support dial-up hosts’ mail, this is a useful and valuable feature. For sites that prefer to process the queue only when they want to, this feature might not be desirable. To disable the ETRN feature, just define this privacy flag. By disabling it, you cause the following ESMTP reply to be sent when the ETRN command is attempted:

502 5.7.0 Sorry, we do not allow this operation

Note that you can use the check_etrn rule set (check_etrn on page 706) to allow some sites to use ETRN, while disallowing other sites.[407]

PrivacyOptions=needexpnhelo

The SMTP EXPN command causes sendmail to “expand” a local address and print the result. If the address is an alias, it shows all the addresses that result from the alias expansion. If the address is local, it shows the result of aliasing through a user’s ~/.forward file. If needexpnhelo is specified, sendmail requires that the requesting site first introduce itself with an SMTP HELO or EHLO command. If the requesting site has not done so, sendmail responds with the following message rather than providing the requested expansion information:

503 5.0.0 I demand that you introduce yourself first

PrivacyOptions=needmailhelo

The SMTP protocol specifies that the sending site should issue the HELO or EHLO command to identify itself before specifying the name of the sender with the MAIL From: command. By listing needmailhelo with the PrivacyOptions option, you cause the following error to be returned to the sending site in this situation:

503 5.0.0 Polite people say HELO first

If needmailhelo is not specified but authwarnings is specified, the following header is added to the message describing the problem:

X-Authentication-Warning: ourself: Host they didn't use HELO protocol

PrivacyOptions=needvrfyhelo

The SMTP VRFY command causes sendmail to verify that an address is that of a local user or local alias. Unlike EXPN, VRFY does not cause mailing-list contents, the result of aliasing, or the contents of ~/.forward files to be displayed. If needvrfyhelo is specified, sendmail requires that the requesting site first introduce itself with an SMTP HELO or EHLO command. If the requesting site has not done so, sendmail responds with the same message as for needexpnhelo, rather than providing the requested verification information.

PrivacyOptions=noactualrecipient

DSN bounce messages generally display the intended recipient’s name on the X-Actual-Recipient line. For privacy reasons, you may prefer to protect the identity of your recipients, and if so, you should set this PrivacyOptions setting to noactualrecipient.

PrivacyOptions=noexpn

Setting noexpn causes sendmail to disallow all SMTP EXPN commands. In place of information, sendmail sends the following reply to the requesting host:

502 That's none of your business            ← prior to V8.7
502 Sorry, we do not allow this operation   ← beginning with V8.7

Setting noexpn also causes sendmail to reject all SMTP VERB commands:

502 5.0.0 Verbose unavailable

Other sendmail programs might send VERB if the delivery agent making the connection has the F=I flag set (see F=I (uppercase i) on page 773).

Note that you can use the check_expn rule set (check_vrfy and check_expn on page 707) to allow some sites to use EXPN, while disallowing other sites.[408]

PrivacyOptions=noreceipts

Setting noreceipts causes pre-V8.7 sendmail to silently skip the processing of all Return-Receipt-To: headers (see Return-Receipt-To: on page 1165). Beginning with V8.7 sendmail, notification of successful delivery is governed by the NOTIFY keyword (see RFC1891) to the ESMTP RCPT To: command:

RCPT To:<address> NOTIFY=SUCCESS

Setting noreceipts causes V8.7 and later sendmail to silently skip all such requests for notification of successful delivery.

Note that this also causes the ESMTP DSN feature to not be advertised in the EHLO response. But because that feature is very valuable, we recommend you not specify noreceipts.

PrivacyOptions=noverb

The VERB (F=I (uppercase i) on page 773) ESMTP command places sendmail into verbose mode when processing an inbound session. This can be useful for debugging a connection, but it also opens the possibility that unwanted information will be disclosed to outsiders. If you see this as a risk, you can disable VERB by defining this privacy option. With it defined, an attempt to use the VERB command will result in the following rejection:

502 5.7.0 Verbose unavailable

PrivacyOptions=novrfy

Setting novrfy causes sendmail to disallow all SMTP VRFY commands. In place of verification, sendmail sends the following reply to the requesting host:

252 Who's to say?                                                  ← V8.6
252 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ← V8.7 and later

Note that you can use the check_vrfy rule set (check_vrfy and check_expn on page 707) to allow some sites to use VRFY, while disallowing other sites.[409]

PrivacyOptions=public

The default for the non-mc version of the PrivacyOptions option is public. This means that there is no extra checking for valid SMTP syntax and no checking for the security matters.

PrivacyOptions=restrictexpand (V8.12 and later)

The -bv command-line switch causes sendmail to verify the list of recipients. For security reasons, you might want to prevent users from using this command-line switch because it could allow them to read ~/.forward files, :include: files, and aliases that can contain privileged information.

Beginning with V8.12, this restrictexpand keyword causes sendmail to drop special privileges when the -bv switch is specified by a user who is neither root, nor the trusted user specified in the TrustedUser option. This protects information by denying them from reading ~/.forward files, :include: files, and private aliases (aliases found in aliases files that are not ordinarily readable). This restrictexpand keyword also prevents the -v command-line switch from being used. See -bv on page 237 for additional information.

PrivacyOptions=restrictmailq

Ordinarily, only a subset of users can examine the mail queue’s contents by using the mailq(1) command (see Printing the Queue on page 422). To further limit who can examine a queue’s contents, specify restrictmailq. If restricted, sendmail allows only users who are in the same group as the group ownership of the queue directory to examine the queue’s contents. This allows the queue directory to be protected (e.g., mode 0750), yet selected users will be able to see its contents. Alternatively, if sendmail is run as set-user-id root (not the default), this allows the queue directory to be fully protected with mode 0700, yet still allow selected users to see its contents.

PrivacyOptions=restrictqrun

Ordinarily, anyone can process the queue with the -q switch (see Periodically with -q on page 427). To limit queue processing to root, or to the owner of the queue directory, specify restrictqrun. If queue processing is restricted, any nonprivileged user who attempts to process the queue will get this message:

You do not have permission to process the queue

ProcessTitlePrefix

Process listing prefix V8.10 and later

When sendmail is running, you can find it in process listings under the name sendmail, regardless of how you ran it (e.g., as mailq). This is proper at the majority of sites that run only a single daemon. Some sites, however, run multiple daemons. For example, on a firewall machine one daemon might be listening to the outside interface, and another might be listening only on the internal interface. A process listing would show both, but give no clue as to which is which:

root     14384  IW   Dec 18  1:30 sendmail: accepting connections
root     15567  IW   Dec 18  4:34 sendmail: accepting connections

In such situations, it can be useful to be able to differentiate between the two listing items. The ProcessTitlePrefix option allows you to do just that:

O ProcessTitlePrefix=prefixconfiguration file (V8.10 and
later)
-OProcessTitlePrefix=prefixcommand line (V8.10 and later)
define(`confPROCESS_TITLE_PREFIX',`prefix')   ← mc configuration (V8.10 and later)

Here, prefix is of type string. If it is absent, the prefix becomes an empty string. If the entire option is absent, no prefix is used. The default for the mc configuration technique is to leave this option undefined.

If the previous example of two sendmail daemons had been started at boot time using an rc file with lines such as these:

/usr/sbin/sendmail -OProcessTitlePrefix=inside -C/etc/mail/inside.cf -bd
/usr/sbin/sendmail -OProcessTitlePrefix=outside -C/etc/mail/outside.cf -bd

the previous process listing might look like this:

root     14384  IW   Dec 18  1:30 sendmail: outside: accepting connections
root     15567  IW   Dec 18  4:34 sendmail: inside: accepting connections

Note that this difference is evident only in the process listing, and that the prefix set by this option is not reflected in log lines.

The ProcessTitlePrefix option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

QueueDirectory

Location of queue directory All versions

Mail messages that have not yet been delivered are stored in the sendmail program’s queue directory. The location of that directory is defined by the QueueDirectory option. That location can be a relative pathname (for testing) or an absolute pathname. If the specified location does not exist, sendmail prints something such as the following:

cannot chdir(/var/spool/mqueue): No such file or directory

If the location exists but is not a directory, sendmail prints something such as the following:

cannot chdir(/var/spool/mqueue): Not a directory

In both cases, sendmail also logs an error message via syslog(8) if the logging level of the LogLevel option (LogLevel on page 1040) permits. In both cases, sendmail aborts immediately.

The forms of the QueueDirectory option are as follows:

O QueueDirectory=pathconfiguration file (V8.7 and later)
-OQueueDirectory=pathcommand line (V8.7 and later)
define(`QUEUE_DIR',`path')   ← mc configuration (V8.7 and later)
OQpathconfiguration file (deprecated)
-oQpathcommand line (deprecated)

The path argument is of type string. If it is missing, the value for path defaults to mqueue. Relative names for the queue are always relative to the directory in which sendmail was invoked. If the entire QueueDirectory option is missing, the value for path defaults to a null string, and sendmail complains with:

QueueDirectory (Q) option must be set

The default in configuring with the mc technique varies depending on your operating system.

The QueueDirectory option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

QueueFactor

Factor for high-load queuing All versions

When the load average on a machine (the average number of processes in the run queue over the past minute) becomes too high, sendmail can try to compensate by queuing all mail rather than delivering it. The QueueFactor option is used in combination with the QueueLA option (QueueLA on page 1072) to calculate the point at which sendmail stops delivering. If the current load average is greater than or equal to the value given to the QueueLA option, the following formula is evaluated:

msgpri > q / (la − x + 1)

Here, q is the value set by this option, la is the current load average, and x is the cutoff load specified by the QueueLA option. If the value yielded by this calculation is less than or equal to the priority of the current mail message (msgpri in this example), the message is queued rather than delivered. Priorities are initialized with the P sendmail.cf command (Precedence on page 1148) and tuned with the RecipientFactor and ClassFactor options (RecipientFactor on page 1077). As the load average (la) grows, the value to the right of the > becomes smaller, increasing the chance that msgpri will exceed that threshold (so that the mail will be queued).

The forms of the QueueFactor option are as follows:

O QueueFactor=factconfiguration file (V8.7 and later)
-OQueueFactor=factcommand line (V8.7 and later)
define(`confQUEUE_FACTOR',fact)   ← mc configuration (V8.7 and later)
Oqfactconfiguration file (deprecated)
-oqfactcommand line (deprecated)

The argument fact is of type numeric. It can be positive, negative, or zero. If fact is missing, the value defaults to zero. If the entire QueueFactor option is missing, the default value given to fact is 600000 (six hundred thousand). The default for the mc technique is to omit this option.

Note that the load average is effective only if your sendmail binary was compiled with load-average support (LA_TYPE on page 118), which is highly probable. Use the -d3.1 debugging switch to discover whether your binary includes that support.

The QueueFactor option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

QueueFileMode

Default permissions for queue files V8.12 and later

The files that populate a queue directory are the qf, df, and xf files. The qf file (The qf File Internals on page 445) contains envelope information and the message’s headers. The df file (The Data (Message Body) File: df on page 398) contains the body of the message. The xf file (The Transcript File: xf on page 401), when present, contains a copy of failed SMTP replies and other error messages generated during a delivery attempt.

If the SuperSafe option (SuperSafe on page 1096) is set to true, all messages are placed in the queue prior to delivery. If that option is false (or interactive beginning with V8.12), only messages that fail to be delivered on the first attempt are placed into the queue. When a message is placed into the queue, the qf and df files are created. The permissions that the files get are determined by this QueueFileMode option.

The QueueFileMode option is declared like this:

O QueueFileMode=permsconfiguration file (V8.12 and later)
-OQueueFileMode=permscommand line (V8.12 and later)
define(`confQUEUE_FILE_MODE',`perms')   ← mc configuration (V8.12 and later)

Here, perms is the permissions that will be given to the created files. Those permissions are of type octal. The default is 0600 (if the real-user-id is the same as the effective-user-id), and 0644 otherwise. If the mode has the group-writable bit set (as in 0664), the umask(2) is set to 0002 (disallow world-writable permissions) just prior to the open(2) or creat(2), and restored to its prior value just after.

Be careful to supply only an octal value to this option. If you mistakenly give it a string (such as QueueFileMode=o+rwx), you will find your queue files being created with a mode of 000, and sendmail will be unable to read them.

In general, it is recommended that queue files be created with the narrowest permission possible. Unless you have a compelling reason to change the defaults, you should leave them as is.

The QueueFileMode option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

QueueLA

On high load, queue only All versions

When the load average on a machine (the average number of processes in the queue run over the past minute) becomes too high, sendmail can compensate in three different ways:

  • This QueueLA option determines the load at which sendmail will begin to queue messages rather than delivering them, and the load at which scheduled runs will be skipped.

  • The RefuseLA option (RefuseLA on page 1078) determines the load at which sendmail will begin to refuse connections rather than accepting them.

  • The DelayLA option (DelayLA on page 1002) determines the load at which sendmail will begin to delay replies to SMTP commands.

The QueueLA option specifies the load above which sendmail queues messages rather than delivering them. The QueueLA and QueueFactor options interact to determine this cutoff; they are both covered under the QueueFactor option (QueueFactor on page 1071).

The forms of the QueueLA option are as follows:

O QueueLA=loadconfiguration file (V8.7 and later)
-OQueueLA=loadcommand line (V8.7 and later)
define(`confQUEUE_LA',load)   ← mc configuration (V8.7 and later)
Oxloadconfiguration file (deprecated)
-oxloadcommand line (deprecated)

The optional argument load, of type numeric, defaults to zero if it is missing. If the entire QueueLA option is missing, the default value given to load is eight times the number of CPU processors. The default for the mc technique is to omit this option. On newer, faster machines a higher setting might be more appropriate.

This QueueLA option is effective only if your sendmail binary was compiled with load-average support (LA_TYPE on page 118). You can use the -d3.1 debugging switch to discover whether your binary includes the necessary support.

Beginning with V8.14, this load average cutoff can be tuned on an individual daemon basis using the DaemonPortOptions option’s keyword queueLA (DaemonPortOptions=queueLA= (8.14 and later) on page 997).

The QueueLA option is not safe. If specified from the command line, it can cause sendmail to relinquish its root privilege.

QueueSortOrder

How to presort the queue V8.7 and later

Prior to V8.7 sendmail, mail messages in the queue were sorted by priority when the queue was processed. Under V8.7, an enhanced sort can be implemented with the QueueSortOrder option, the forms of which are as follows:

O QueueSortOrder=howconfiguration file (V8.7 and later)
-OQueueSortOrder=howcommand line (V8.7 and later)
define(`confQUEUE_SORT_ORDER',how)    ← mc configuration (V8.7 and later)

The argument how is of type character.[410] It can be P or p (for priority), which causes sendmail to emulate its old (sort by priority) behavior. It can be H or h (for host), which causes sendmail to perform an enhanced sort. Beginning with V8.8 sendmail, it can be T or t (for time), which sorts by submission time. Beginning with V8.10 sendmail, it can be F or f (for file), which sorts by filename. Beginning with V8.12 sendmail, it can be R or r (for random), which randomizes the list of hosts, or M or m, which sorts based on file modification time. Beginning with V8.13 sendmail, it can be N or n (for none), to not sort at all. If any other character is specified or if how is omitted, the following message is printed and the option is skipped:

Invalid queue sort order "badchar"

If this option is omitted entirely, the default is to sort by priority. The default in configuring with the mc technique is also priority.

The QueueSortOrder option is safe. If specified from the command line, sendmail will not relinquish its special privileges.

QueueSortOrder=host

If what is host, the messages in the queue are first sorted by recipient host,[411] lock status, and priority. If any message for a host is locked (currently being delivered), all the messages for that host are also marked as locked. Then the queue is sorted again, this time by lock status (unlocked first), recipient host, and priority. Delivery attempts after this sort tend to group SMTP connections to the same host together sequentially.

Be careful in sorting by host. If you have a large backlog of low-priority (batch) mail on a low-speed link to some host (for example, news), you might end up delaying higher-priority mail intended for other hosts. The host sort is recommended for high-speed links but is less desirable on low-speed links.

QueueSortOrder=priority

The method to order a queue run that has been used by sendmail for many years is a simple sort of the message priorities. A message’s priority is found in the qf file’s P line (P line on page 453). The sort is based on cost. That is, low (less-positive) priorities are sorted ahead of high (more-positive) values.

QueueSortOrder=time (V8.8 and later)

Beginning with V8.8, sendmail recognizes the time keyword, which causes it to sort based on submission time. This setting is not intended for use in the configuration file. Instead, it should be used only from the command line and in combination with the -qR command-line switch (Process by identifier/recipient/sender: -q[ISR] on page 431).

If you wrongly set time in the configuration file, large and old jobs will be sorted in with small, new jobs. This can delay important mail.

QueueSortOrder=filename (V8.10 and later)

Beginning with V8.10, sendmail recognizes the filename keyword, which causes it to sort based on filenames in the queue directory. This setting is not intended for use in the configuration file. Instead, it should be used when queues are unusually deep, as a fast way to process the queue.

The preceding sort modes open and read every qf file, dramatically slowing down the sort. Because the sort must happen before sendmail will begin processing the queue, such a slowdown on a very deep directory can lead to serious bottlenecks. This filename sorts on filename only, and does not open qf files to read them. See Handle Deep Queues on page 404 for a description of how to handle deep queues.

QueueSortOrder=random (V8.12 and later)

Beginning with V8.12, sendmail recognizes the random keyword, which causes it to sort using a pseudorandomizer so that the list of envelopes ends up in a pseudorandom order. This setting is not intended for use in the configuration file. Instead, it should be used when queues are unusually deep, as a fast way to process the queue. Like the filename keyword, this mode avoids the cost of opening and reading every qf file. Unlike filename, however, parallel queue runners will have different lists to process. This avoids lock and other contentions that could somewhat slow a queue run.

QueueSortOrder=modtime (V8.12 and later)

Beginning with V8.12, sendmail recognizes the modtime keyword, which causes it to sort based on the modification time of each qf file. The list is ordered in reverse, so the oldest qf files are processed first. Although you can set modtime in the configuration file, it has the potential to unacceptably delay important new mail. In general, this setting is better used as part of a command-line invocation of sendmail.

QueueSortOrder=none (V8.13 and later)

Beginning with V8.13, sendmail recognizes the none keyword, which causes it to not sort the list at all. That is, it will process the queued envelopes in the order they were originally put into the queue directory. This can be among the fastest ways to drain a full queue.

QueueTimeout

Limit life of a message in the queue Deprecated

When mail cannot be delivered promptly, it is left in the queue. At intervals specified by sendmail’s -q command-line switch, or by a queue group’s Interval= setting, periodic re-delivery of that queued mail is attempted. The maximum total time a mail message can remain in the queue before being bounced as undeliverable is defined by this QueueTimeout option. (Note that the QueueTimeout option has been deprecated in favor of the Timeout option of V8.7 sendmail.)

The forms of the QueueTimeout option are as follows:

O QueueTimeout=qtimeconfiguration file (deprecated)
-OQueueTimeout=qtimecommand line (deprecated)
define(`confMESSAGE_TIMEOUT',`qtime')   ← mc configuration (deprecated)
OTqtimeconfiguration file (deprecated)
-oTqtimecommand line (deprecated)

The argument qtime is of type time. If this argument is missing or if the entire QueueTimeout option is missing, the value given to qtime is zero, and no mail is ever queued.[412] The qtime is generally specified as a number of days—5d, for example. (Incidentally, RFC1123 recommends five days as a minimum.)

All queued mail is timed out on the basis of its creation time compared to the timeout period specified by the QueueTimeout option. Each queued message has its creation time stored in its qf file’s T line (T line on page 456). When sendmail is run (either as a daemon or by hand) to process the queue, it gets its timeout period from the value of the QueueTimeout option. As the queue is processed, each message’s creation time is checked to see whether it has timed out on the basis of the current value of the QueueTimeout option. Because the configuration file is read only once (when sendmail first starts), the timeout period cannot be subsequently changed. There are only two ways to lengthen the timeout period: first, by modifying the configuration file’s QueueTimeout option, and killing and restarting sendmail; and second, by running sendmail by hand with the -q command-line switch (Periodically with -q on page 427) and setting a new timeout using an appropriate command-line switch.

Although qf files should never be hand-edited, messages can theoretically be rejuvenated (made to appear young again) by modifying the creation time that is stored in a queued file’s qf file. The details of the qf queue file are presented in The qf File Internals on page 445.

Under V8 sendmail, the sender can be notified when a message is delayed. This feature is enabled by the inclusion of a second argument following the qtime argument in the QueueTimeout option declaration:

O QueueTimeout=qtime/ notifyconfiguration file (deprecated)
-OQueueTimeout=qtime/ notifyconfiguration file (deprecated)
define(`confMESSAGE_TIMEOUT',`qtime/ notify')    ← mc configuration (deprecated)
OTqtime/ notifyconfiguration file (deprecated)
-oTqtime/ notifycommand line (deprecated)

If the second argument is present, it must be separated from the first by a /. The notify specifies the amount of time sendmail should wait, after the message is first queued, before sending notification to the sender that it was delayed. If notify is missing or longer than qtime, no warning messages are sent. If notify is longer than qtime, no notification is ever sent.

Note that this is a crude method compared to the one described under the Timeout option in Timeout on page 1097. Beginning with V8.7 sendmail and using the queuereturn and queuewarn keywords of that option, the qtime and notify values can be tuned on the basis of individual mail message priorities.

The QueueTimeout option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RandFile

Source for random numbers V8.11 and later

STARTTLS requires that it have some source for randomized data. It uses /dev/urandom on systems that support that device. On systems that don’t, you must specify an alternative.

The RandFile option is used to specify an alternative source like this:

O RandFile=whereconfiguration file (V8.11 and later)
-ORandFile=wherecommand line (V8.11 and later)
define(`confRAND_FILE',`where')   ← mc configuration (V8.11 and later)

Here, where is of type string, and specifies the source for the randomized data. That source can be either a Unix-domain socket used by the egd(8) daemon (EGD on page 204), or a file you update with randomized data yourself (Roll your own on page 204). You tell sendmail which you are using by prefixing where with either a literal egd: or file: expression:

define(`confRAND_FILE',`egd:/var/run/entropy')   ← socket for the egd daemon
define(`confRAND_FILE',`file:/etc/randfile')     ← a file of random data

See Roll your own on page 204 for a full discussion of how this option and those file types fit into the STARTTLS scheme.

The RandFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RecipientFactor

Penalize large recipient lists All versions

Not all messages need to be treated equally. When sendmail processes the messages in its queue, it sorts them by priority.[413] The priority that is given to a message is calculated once, when it is first created, and adjusted (incremented or decremented) each time it is processed in the queue. You can think of priority as a cost, where mail with the lowest priority number (lowest cost) is handled first. The formula for the initial calculation is:

priority = nbytes - (class * z) + (recipients * y)

The items in this calculation are as follows:

priority

Priority of the message when it was first created.

nbytes

Number of bytes in the total message, including the header and body of the message.

class

Value given to a message by the Precedence: line in the header of the message. The string following the Precedence: is usually either first-class, special-delivery, junk, bulk, or list. That string is converted to a numeric value determined by the P command (Precedence on page 1148) in the sendmail.cf file.

z

Value given the ClassFactor option (ClassFactor on page 984) and a weighting factor to adjust the relative importance of the class.

recipients

Number of recipients to whom the message is addressed. This number is counted after all alias expansion.

y

Value given this RecipientFactor option and weighting factor to adjust the relative importance of the number of recipients.

The forms of the RecipientFactor option are as follows:

O RecipientFactor=factorconfiguration file (V8.7 and later)
-ORecipientFactor=factorcommand line (V8.7 and later)
define(`confWORK_RECIPIENT_FACTOR',factor)   ← mc configuration (V8.7 and later)
Oyfactorconfiguration file (deprecated)
-oyfactorcommand line (deprecated)

The argument factor is of type numeric. If that argument is missing, the default value is zero. If the entire RecipientFactor option is missing, the default value is 30000 (thirty thousand). The default for the mc technique is to omit this option.

The RecipientFactor option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RefuseLA

Refuse connections on high load All versions

When the load average on a machine (the average number of processes in the run queue over the past minute) becomes too high, sendmail can compensate in three different ways:

  • The QueueLA option (QueueLA on page 1072) determines the load at which sendmail will begin to queue messages rather than delivering them, and the load at which scheduled queue runs will be skipped.

  • This RefuseLA option determines the load at which sendmail will begin to refuse connections[414] rather than accepting them.

  • The DelayLA option (DelayLA on page 1002) determines the load at which sendmail will begin to delay replies to SMTP commands.

Some experts consider refusing connections with the RefuseLA option a more serious problem than the queuing caused by the QueueLA option (QueueLA on page 1072), so prior to the introduction of V8.7 sendmail, they generally recommended that the load specified for this RefuseLA option should be the higher of the two. Others take the opposite stand. Paul Vixie, for one, believes that the RefuseLA option should be lower than the QueueLA option so that you stop accepting mail before you stop processing it. Under V8.7, the two options have been decoupled, and you can now tune them according to your personal philosophy.

The forms of the RefuseLA option are as follows:

O RefuseLA=limitconfiguration file (V8.7 and later)
-ORefuseLA=limitcommand line (V8.7 and later)
define(`confREFUSE_LA',limit)   ← mc configuration (V8.7 and later)
OXlimitconfiguration file (deprecated)
-oXlimitcommand line (deprecated)

The argument limit is of type numeric. If limit is missing, the value becomes zero (meaning no check is performed). If the entire RefuseLA option is missing, the value for the load cutoff defaults to 12 times the number of CPU processors. The default for the mc technique is to omit this option.

When running an MTA and an MSA in parallel, as with the V8.12 security model, consider setting the value for this RefuseLA option lower for the MTA and higher for the MSA. That way, locally submitted mail will tend to still be accepted, despite a high load average that causes the MTA to refuse outside SMTP mail.

This RefuseLA option is effective only if your sendmail binary was compiled with load-average support included (LA_TYPE on page 118). You can use the -d3.1 debugging switch to discover whether your binary includes the necessary support.

When the limit is first met or exceeded, the following message will be logged:

rejecting connections on daemon name: load average=load

Here, name is the name given to the port that is handling the connection. That name is set with the DaemonPortOptions option’s (DaemonPortOptions=Name= on page 996) Name= equate. The load is the current load average.

Beginning with V8.13, the RejectLogInterval (RejectLogInterval on page 1079) can be used to limit how often this warning message is logged.

Beginning with V8.14, this load average cutoff can be tuned on an individual daemon basis using the DaemonPortOptions option’s keyword refuseLA (DaemonPortOptions=refuseLA= (8.14 and later) on page 997).

The RefuseLA option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RejectLogInterval

Limit how often high load-average warnings should be logged V8.13 and later

Prior to V8.13, whenever the load level on a machine became greater than the setting for the RefuseLA option (RefuseLA on page 1078), further inbound connections would be refused, and the following warning message would be logged:

rejecting connections on daemon name: load average=load

Beginning with V8.13 sendmail, you may now specify how often additional warnings should be logged. Note that the same message is logged when refusing begins, but if connections continue to be refused, you will be notified with a different message, to aid you in taking corrective actions.

The RejectLogInterval option tells sendmail how often (at what intervals) it should log a message saying that connections are still being refused. The RejectLogInterval option is declared like this:

O RejectLogInterval=interval                      ← configuration file (V8.13 and
later)
-ORejectLogInterval=interval                      ← command-line (V8.13 and later)
define(`confREJECT_LOG_INTERVAL', `interval')     ← mc configuration (V8.13 and
later)

Here, interval is of type time. The default (if this option is omitted) is three hours. The default units are hours. For example, both of following set the periodic logging interval to one hour:

define(`confREJECT_LOG_INTERVAL', `60m')
define(`confREJECT_LOG_INTERVAL', `1')

When connections are first refused because the load level is too high, the following warning is logged, as before:

rejecting connections on daemon name: load average=load

Thereafter, for as long as the load continues to be too high, the following warning message is logged once per RejectLogInterval interval:

have been rejecting connections on daemon name for duration

Here, name is the name of the listening daemon (e.g., MTA-v4), and duration is the total amount of time that has elapsed since connections were first refused.

The RejectLogInterval option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ResolverOptions

Tune DNS lookups All versions

The ResolverOptions option allows you to tune the way DNS lookups are performed. The forms of this option are as follows:

O ResolverOptions=arg ...configuration file (V8.7 and later)
-OResolverOptions="arg ..."command line (V8.7 and later)
define(`confBIND_OPTS',`arg ...')   ← mc configuration (V8.7 and later)
-oI"arg ..."command line (V8.6 and later)
OIarg ...configuration file (V8.6 and later)
OIboolconfiguration file (deprecated)
-oIboolcommand line (deprecated)

The arg is one or more arguments that allow you to tune the behavior of the name server. The arg arguments are identical to the flags listed in resolver(3), but you omit the RES_ prefix. For example, RES_DNSRCH is expressed as DNSRCH. A flag can be preceded by a plus or minus sign to enable or disable the corresponding name server option. If no pluses or minuses appear, the name server option is enabled just as though a plus were present. Consider the following:

O ResolverOptions=+AAONLY -DNSRCH

These turn on the AAONLY name server option (Authoritative Answers Only) and turn off the DNSRCH name server option (search the domain path). If the ResolverOptions option is omitted entirely, the default is for the DNSRCH, DEFNAMES, and RECURSE name server options to be enabled and all others to be disabled. Thus, for example, DNSRCH is always enabled unless you specifically turn it off.

Beginning with V8.7 sendmail, the special string HasWildcardMX can be listed along with the other resolver options:

O ResolverOptions=+AAONLY -DNSRCH HasWildcardMX

This string causes MX lookups to be done with res_query(3) set (provided that the level of the configuration is 6 or above, The V Configuration Command on page 580); otherwise, those lookups are done with res_search(3). This string also inhibits MX lookups when getting the canonical name of the local host. It should always be used if you have a wildcard MX record that matches your local domain.

Beginning with V8.12 sendmail, the special string WorkAroundBrokenAAAA (Broken IPv6 Name Servers on page 331) can be listed along with the other resolver options:

O ResolverOptions=+AAONLY -DNSRCH WorkAroundBrokenAAAA

When attempting to canonify a hostname, some broken name servers will return SERVFAIL (a temporary failure) on T_AAAA IPv6 lookups. If you want to excuse this behavior, include WorkAroundBrokenAAAA with the ResolverOptions option. We recommend, however, that you note the problem and report it to the administrator of that broken name server.

The complete list of resolver options available as of V8.12 is shown in Table 24-24.

Table 24-24. ResolverOption settings for resolver options

Setting

Meaning

AAONLY

Return authoritative answers only.

DEBUG

Print debug messages.

DEFNAMES

Use the default domain name.

DNSRCH

Search the local domain’s tree.

HasWildcardMX

Use res_query(3) for MX lookups.

IGNTC

Ignore truncation errors.

PRIMARY

Query the primary server only.

RECURSE

Use recursive lookups.

STAYOPEN

Keep the TCP socket open.

USEVC

Use a virtual circuit.

USE_INET6

Use IPv6 lookups (not available on all systems).

WorkAroundBrokenAAAA

Ignore bad returns of a T_AAAA lookup.

Note that omitting the ResolverOptions option altogether does not disable DNS lookups. To disable DNS under V8.6 and earlier sendmail, you must compile a version of sendmail with NAMED_BIND support omitted (NAMED_BIND on page 124). Beginning with V8.7 sendmail, you can disable use of DNS via your service-switch file (ServiceSwitchFile on page 1088).

Under V8 sendmail, any Boolean argument following the ResolverOptions is silently ignored. Therefore, an initial True might be included for compatibility with previous versions of sendmail. Note that under V8 sendmail, a False produces an error and cannot be used to disable this option.

V1 configuration files (The V Configuration Command on page 580) cause sendmail to disable DNSRCH and DEFNAMES when doing delivery lookups but to leave them on at all other times. V2 and later configuration files cause sendmail to use the resolver options defined by the ResolverOptions option, except that it always enables DNSRCH when doing lookups with the $[ and $] operators. Starting with V8, sendmail defers the decision of whether to use DNS lookups to the ServiceSwitchFile option (ServiceSwitchFile on page 1088). DNS is now considered canonical only if the dns service is listed for hosts in the ServiceSwitchFile.

Finally, note that an attempt to use this option with a version of sendmail that does not support DNS lookups (NAMED_BIND on page 124) will result in this error message:

name server (I option) specified but BIND not compiled in

The ResolverOptions option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RetryFactor

Increment per job priority All versions

When sendmail processes the messages in its queue, it sorts them by priority and handles those with the lowest priority first.

The priority of a message is calculated once, using the RecipientFactor (RecipientFactor on page 1077) and ClassFactor (ClassFactor on page 984) options, when the message is first created, and it is adjusted, using this RetryFactor option, each time the message is processed in the queue.

Each time a message from the queue fails to be delivered and needs to be requeued, its priority is adjusted. That adjustment is made by adding the value of this RetryFactor option.

The forms of the RetryFactor option are as follows:

O RetryFactor=incconfiguration file (V8.7 and later)
-ORetryFactor=inccommand line (V8.7 and later)
define(`confWORK_TIME_FACTOR',inc)   ← mc configuration (V8.7 and later)
OZincconfiguration file (deprecated)
-oZinccommand line (deprecated)

The argument inc is of type numeric. If inc is missing, the default value is zero. If the entire RetryFactor option is missing, the value for inc defaults to 90000 (ninety thousand). The default for the mc technique is to omit this option. The increment is performed by adding the value of inc to the previously stored message priority each time that message is queued.

The RetryFactor option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RequiresDirFsync

Turn off directory fsync(2) during runtime V8.13 and later

Some versions of Unix (or implementations of disk I/O) do not support immediate updates of directories when the data in them changes. For these Unix versions, the REQUIRES_DIR_FSYNC compile-time macro (REQUIRES_DIR_FSYNC on page 136) must set to true, causing sendmail to fsync(2) the directory every time it is updated.

If your operating system is one of these, and if you need to avoid the overhead of this forced directory updating,[415] you may do so by defining the RequiresDirfsync option. It is declared like this:

O RequiresDirfsync=bool                       ← configuration file (V8.13 and later)
-O RequiresDirfsync=bool                      ← command-line (V8.13 and later)
define(`confREQUIRES_DIR_FSYNC',  `bool')     ← mc configuration (V8.13 and later)

Here, bool is of type Boolean. If this option is omitted, the default is true (that is, directory fsync(2) is required if REQUIRES_DIR_FSYNC was defined at compile time). If this option is defined as false, however, directory fsync(2) is disabled even if REQUIRES_DIR_FSYNC was defined at compile-time.

The RequiresDirfsync option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RrtImpliesDsn

Return-Receipt-To: is DSN request V8.10 and later

Prior to V8.7, sendmail recognized the Return-Receipt-To: as valid, and would return notification of delivery success to the address indicated in that header. This proved a bad idea (see Return-Receipt-To: on page 1165) for a variety of reasons. Beginning with V8.7 sendmail, the Return-Receipt-To: header was no longer recognized and, instead, the DSN command of NOTIFY=SUCCESS replaced it.

Demand, however, has caused the Return-Receipt-To: header to return to limited use. Beginning with V8.10, if the RrtImpliesDsn option is true, if a Return-Receipt-To: header is found, and if this is the final delivery, sendmail will act as though a NOTIFY=SUCCESS was requested, and will strip the Return-Receipt-To: header and return a DSN success notification to the envelope-sender address (unless noreceipts [PrivacyOptions=noreceipts on page 1068] is declared for the PrivacyOptions option). If this is not the final delivery, sendmail will relay the message onward to the next MTA with the Return-Receipt-To: header deleted, and with the request for success notification carried in the envelope’s NOTIFY=SUCCESS.

The Return-Receipt-To: option is declared like this:

O RrtImpliesDsn=boolconfiguration file (V8.10 and later)
-ORrtImpliesDsn=boolcommand line (V8.10 and later)
define(`confRRT_IMPLIES_DSN',bool)      ← mc configuration (V8.10 and later)

The optional argument bool is of type Boolean. If bool is missing, this option becomes true (Return-Receipt-To: headers are returned as DSN). If the entire option is missing (the default), it becomes false (Return-Receipt-To: headers are ignored). The default for the mc configuration technique is to omit this option.

The RrtImpliesDsn option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

RunAsUser

Run as non-root (on a firewall) V8.8 and later

On firewalls, for reasons of additional security, it is often desirable to run sendmail as a user other than root. Beginning with V8.8 sendmail, you can accomplish this by using the RunAsUser option:

O RunAsUser=user: groupconfiguration file (V8.8 and
later)
-ORunAsUser=user: groupcommand line (V8.8 and later)
define(`confRUN_AS_USER', `user: group')      ← mc configuration (V8.8 and later)

Here, user is either the uid number of the identity you want sendmail to run under, or a symbolic name for that identity. If a symbolic name is specified and if that name cannot be looked up in the passwd(5) file, sendmail prints the following error:

readcf: option RunAsUser: unknown user bad symbolic name here

If the symbolic name is found in the passwd(5) file, the uid and gid that sendmail will run under are set from that file.

The :, if it is present, signals to sendmail that you also intend to specify a group identity.

The group is either the numeric gid that you want sendmail to run as, or a symbolic name for a group. If it is a symbolic name, that name is looked up in the group(5) file. If it is not found in that file, the following error is printed:

readcf: option RunAsUser: unknown group bad group name here

If the symbolic name is in that file, sendmail will run under the gid found there.

The sendmail program assumes the identity specified just after the configuration file is read for all but the daemon mode. As a daemon, sendmail remains root to listen for incoming SMTP connections. Each time it receives a connection, it validates that connection (Local_check_relay and check_relay on page 252), and then fork(2)s. The child then processes the incoming message. Immediately after the fork (and before any data is read from or written to the connection), the child assumes the identity specified by this RunAsUser option.

Note that running as non-root can lead to problems, especially on machines that do more than simply relay mail between networks. As non-root, sendmail might not be able to read some :include: files, will certainly not be able to read protected ~/.forward files, and won’t be able to save messages to the queue, unless permissions are relaxed to allow the non-root user such access. This option is intended to be used on a firewall machine. It should definitely not be used on nonfirewall machines.[416]

The RunAsUser option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SafeFileEnvironment

Directory for safe file writes V8.7 and later

For security, it is desirable to control the manner and circumstances under which messages are delivered to files. Beginning with V8.7 sendmail, you can enhance the security of writing to files with the SafeFileEnvironment option. It is used like this:

O SafeFileEnvironment=pathconfiguration file (V8.7 and later)
-OSafeFileEnvironment=pathcommand line (V8.7 and later)
define(`confSAFE_FILE_ENV',path)        ← mc configuration (V8.7 and later)

The path is of type string and, if present, must be the full pathname of a directory. The default, if either path or the entire option is missing, is NULL, causing this feature to be ignored.

When preparing to save a message to a file, sendmail first obtains the permissions of that file, if the file exists, and saves them (Delivery to Files on page 466). The sendmail program uses lstat(2) to obtain those permissions if it was compiled with HASLSTAT defined (HAS... on page 114). Otherwise, it uses stat(2).

If the path for this option is non-NULL and nonempty, sendmail then precedes that chroot(2) with a:

chroot(path)

If the chroot(2) fails, sendmail prints the following error and bounces the mail message:

mailfile: Cannot chroot(path)

If the name of the file begins with path, that prefix is stripped after the chroot(2) and before the fopen(3).

For example, consider the need to safely store all mail archive files on the mail hub in a directory called /archives. You would first create this configuration declaration:

O SafeFileEnvironment=/archives

Then every file archive notation in the aliases database should be changed to reference this base directory:[417]

adminlist:   :include:/usr/local/maillists/admin.list,
             /archives/admin/log

For safety, sendmail will henceforth chroot(2) into the /archives directory before delivering to any files. Note that this SafeFileEnvironment option affects all writes to files, so a user’s ~/.forward entry (such as the following) will become relative to /archives and so might fail depending on your specific setup:

/u/bill/tmp/incoming     ← written as /archives/u/bill/tmp/incoming

The SafeFileEnvironment option also causes sendmail to verify that the file that is being written to is a plain file. If it is anything else, sendmail prints the following error and bounces the messages:

/dev/tty... Can't create output: Error 0

Here, an attempt to dump the message to /dev/tty failed because sendmail discovered it was a device rather than an ordinary file. But note that beginning with V8.8, it is always legal to write to the special device named /dev/null.

The SafeFileEnvironment option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SaveFromLine

Save Unix-style From lines All versions

Many Unix MUAs, as well as some transmittal systems such as UUCP, require that a mail-message header begin with a line that begins with the five-character sequence "From“. All other header lines must adhere to the RFC2822 standard and be delimited with a colon:

From jqp@Washington.DC.gov Mon Jan 01 12:35:25 2001
Return-Path: <jqp@Washington.DC.gov>
Date: Mon, 01 Jan 2001 12:35:15 PDT
From: jqp@Washington.DC.gov (John Q Public)

If you don’t set the SaveFromLine option, the first line in the preceding example is stripped out by sendmail. The SaveFromLine option prevents this because it tells sendmail to keep header lines that begin with the five characters "From“. But note that it also causes this header to no longer be recognized as a header.

The forms of the SaveFromLine option are as follows:

O SaveFromLine=boolconfiguration file (V8.7 and later)
-OSaveFromLine=boolcommand line (V8.7 and later)
define(`confSAVE_FROM_LINES',bool)   ← mc configuration (V8.7 and later)
-s                                   ← command-line shorthand (not recommended)
Ofboolconfiguration file (deprecated)
-ofboolcommand line (deprecated)

The optional argument bool is of type Boolean. If bool is missing, this option becomes true (the "From" line is saved). If the entire option is missing, it defaults to false (neither save the "From" line nor recognize it as a header).

The SaveFromLine option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SendMimeErrors

Return MIME-format errors V8.1 and later

MIME is documented in RFC2045 through RFC2049.[418] MIME is a method of incorporating non-ASCII text (such as images and sounds) in mail messages.

When sendmail composes an error notification of failed (bounced) mail, this SendMimeErrors option tells sendmail to include MIME-format headers in that error notification. MIME format is required for DSN notification to work (the two go hand in hand). This option affects only returned (bounced) mail.

If the SendMimeErrors option is true and if sendmail is composing a returned mail message, the following two headers are added to the header portion of that message:

MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
        boundary=magic

The 1.0 version of the MIME-Version: header (MIME-Version: on page 1160) is hardcoded into V8 sendmail, so it cannot be changed. The Content-Type: is instead multipart/mixed if sendmail was compiled without DSN support (DSN on page 111). The magic of Content-Type: is a string that is used to separate the various parts of the message body. The string is formed from the queue ID, the time, and the hostname. For example:

Content-Type: multipart/report; report-type=delivery-status;
        boundary="dBPEYdx00413.946132480/your.host.domain"

Then sendmail prefixes the body of the returned message (if there is one), a line of notification, and this boundary:

This is a MIME-encapsulated message

--dBPEYdx00413.946132480/your.host.domain
           ← message body begins here

Newer MUAs are aware of MIME and can send and receive MIME messages. Such MUAs understand the MIME-Version: header in a mail message. Older (non-MIME-aware) MUAs ignore that header.

Unless you bounce mail to a site that cannot handle MIME, you should always set this SendMimeErrors option to true.

The forms of the SendMimeErrors option are as follows:

O SendMimeErrors=boolconfiguration file (V8.7 and later)
-OSendMimeErrors=boolcommand line (V8.7 and later)
define(`confMIME_FORMAT_ERRORS',`bool')   ← mc configuration (V8.7 and later)
Ojboolconfiguration file (V8.6 and later)
-ojboolcommand line (V8.6 and later)

The optional argument bool is of type Boolean. If bool is missing, this option becomes true (errors are sent in MIME format). If the entire option is missing, it defaults to false (errors are sent just as they were before this option was introduced). The default with the mc configuration technique is to set it to true.

The SendMimeErrors option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

ServerCertFile

File containing the server’s certificate V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you might need to create, or purchase, to set up stream encryption is a certificate for your server. A server certificate is the certificate used by sendmail when it is acting in the role of a server (receiving inbound email). The server certificate is contained in a file whose location is set with this ServerCertFile option, with declarations that look like this:

O ServerCertFile=pathconfiguration file (V8.11 and later)
-OServerCertFile=pathcommand line (V8.11 and later)
define(`confSERVER_CERT',`path')   ← mc configuration (V8.11 and later

Here, path is a full path specification of the file containing the certificate. The path might contain sendmail macros, and if so, those macros will be expanded (their values used) when the configuration file, or command line, is read:

define(`confSERVER_CERT', `${MyCERTPath}/SrvrCert.pem')

The path must be a full pathname (must begin with a slash), or the file will be rejected and the following error logged:

STARTTLS: ServerCertFile missing

The path must also live in a directory that is safe (every component of which is writable only by root or the trusted user specified in the TrustedUser option) and must itself be safe (owned by and writable only by root or the trusted user specified in the TrustedUser option). If it is not, it will be rejected and the following error logged:

STARTTLS=server: file path unsafe: reason

Even if all goes well, there is still a chance that the SSL software will reject the certificate. If it does, the following will be logged:

STARTTLS=server, error: SSL_CTX_use_certificate_file(path) failed

The ServerCertFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ServerKeyFile

File with the server certificate’s private key V8.11 and later

STARTTLS and stream encryption are discussed in detail in STARTTLS on page 202. Among the items you might need to set up to employ them is a key file that corresponds to a certificate file. That is the key used by sendmail when it is acting in the role of a server (receiving inbound email). A server key is contained in a file, the location of which is set with this ServerKeyFile option:

O ServerKeyFile=pathconfiguration file (V8.11 and later)
-OServerKeyFile=pathcommand line (V8.11 and later)
define(`confSERVER_KEY',`path')   ← mc configuration (V8.11 and later

Here, path is a full path specification of the file containing the key. The path might contain sendmail macros, which will be expanded (their values used) when the configuration file, or command line, is read:

define(`confSERVER_KEY', `${MyCERTPath}/SrvrKey.pem')

The path must be a full pathname (must begin with a slash), and must live in a directory that is safe (every component of which is writable only by root or the trusted user specified in the TrustedUser option), and must itself be safe (mode 0600, owned by, readable, and writable only by root or the trusted user specified in the TrustedUser option). If it is not, it will be rejected and the following error logged:

STARTTLS=server: file path unsafe: reason

But even if all goes well, there is still a chance that the SSL software will reject the certificate. If it does, the following will be logged:

STARTTLS=server, error: SSL_CTX_use_PrivateKey_file(path=) failed

The ServerKeyFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

ServiceSwitchFile

Specify file for switched services V8.7 and later

Some implementations of Unix recognize that system information can be found in a variety of places. On Solaris 8, for example, hostnames can be obtained from the /etc/hosts file, from nis, from nisplus, or from DNS. Solaris allows the system administrator to choose the order in which these services are searched with a “service-switch” file. Other systems, such as Ultrix and DEC OSF/1, have a similar concept, but some (such as SunOS 4) use built-in rules that cannot be changed without the source code.

Beginning with V8.7, sendmail uses a system-service switch on Solaris, DEC OSF/1, and Ultrix.[419] Otherwise, sendmail uses the service switch defined by this ServiceSwitchFile option.

The form for redefining the switched-services file is as follows:

O ServiceSwitchFile=pathconfiguration file (V8.7 and later)
-OServiceSwitchFile=pathcommand line (V8.7 and later)
define(`confSERVICE_SWITCH_FILE',path)   ← mc configuration (V8.7 and later)

If this option is defined on Solaris, DEC OSF/1, or Ultrix, it is ignored. Otherwise, path is used as the full pathname of the file that is to be used as the service switch. If path is omitted, the default is NULL. If the entire option is omitted, the default is /etc/mail/service.switch. The default for the mc technique is to omit this option.

The service-switch file must live in a safe directory and must itself have safe permissions, or sendmail will refuse to use the information in it. If your site unavoidably must make the service-switch file unsafe, you might be able to overcome that problem with the DontBlameSendmail option (DontBlameSendmail on page 1009).

The form of each line in the file defined by path is:

service  how how

Here, service is either hosts (which states how hostnames are looked up), aliases (which states how aliases are looked up), or passwd (which states how passwd(5) information is looked up). For each service, there might be one or more how methods (not all of which make sense with all services). The service and the hows must be separated from each other by whitespace. The possible methods (values for each how) are files (the information is in a file or database, such as /etc/hosts), netinfo (for information on NeXT machines), nis (the information is in an nis map), nisplus (the information is in an nisplus map), dns (the host information is looked up with DNS), or hesiod (the information is listed with a Hesiod service).[420]

For example, consider the contents of the following /etc/service.switch file:

aliases nis
passwd nis files
hosts dns

Here, sendmail will look up aliases in the nis map mail.aliases. Password information, such as local user login names and full name information from the GECOS field, will first be looked up in the nis map passwd.byname. If not found there, they will then be looked up in the file /etc/passwd. The last line tells sendmail to look up A, AAAA, CNAME, PTR, and MX records using the DNS services.

The hosts line can also determine how MX records are treated (Look Up Addresses for Delivery on page 328). If “dns” does not appear in that line, sendmail disables lookups of MX records. If sendmail is configured to look up hosts with nis first, then DNS, it will do the MX lookup in DNS before the nis lookup.

For Solaris, hosts is looked up with the nsswitch.conf(4) service. For DEC OSF/1 and Ultrix, hosts is looked up with the svc.conf(5) service. For all others, the file defined by the ServiceSwitchFile is examined for a line that begins with the word hosts. If that line is missing or if the file doesn’t exist, dns is returned by default. But if NAMED_BIND was not defined (NAMED_BIND on page 124) when sendmail was compiled, the default returned is nis for Solaris and SunOS, and on other systems it is files.

Note that on systems such as SunOS, a version of gethostbyname(3) is still called that ignores the sendmail program’s service-switch file. On such systems, you might need to download the source, recompile, and install a version that works correctly.

The ServiceSwitchFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SevenBitInput

Force 7-bit input V8.1 and later

By default, V8 sendmail leaves as is all bytes of every mail message body it reads (headers still have some 7-bit limitations). This differs from other releases of sendmail that always clear (zero) the high (most-significant) bit. To make V8 sendmail behave like older versions and always clear the high bit on input, the SevenBitInput option is available, the forms of which are as follows:

O SevenBitInput=boolconfiguration file (V8.7 and later)
-OSevenBitInput=boolcommand line (V8.7 and later)
define(`confSEVEN_BIT_INPUT',bool)   ← mc configuration (V8.7 and later)
O7boolconfiguration file (V8.6 and later)
-o7boolcommand line (V8.6 and later)

The argument bool is of type Boolean. If bool is missing, the default value is true (clear the 8th bit). If this option is omitted entirely, the default is false (the 8th bit is unmodified). If you configure with the mc technique, the default for confSEVEN_BIT_INPUT is false.

Note that this option is temporarily set to false for a single message if the ESMTP BODY=8BITMIME parameter is given, and is set to true if the BODY=7BIT parameter is given.

Also note that the SevenBitInput option affects input only. The F=7 delivery agent flag (F=7 on page 764) can be used to set 7-bit output on an individual delivery-agent basis.

The SevenBitInput option is safe. If specified from the command line, sendmail will not relinquish its special privileges.

SharedMemoryKey

The key to enable shared memory V8.12 and later

Shared memory is used by sendmail to store the amount of available disk space of the queue disks and the total number of messages queued across all queues (Print the Number of Messages in the Queue on page 425). For sendmail to do these two tasks, the binary must have been compiled with shared memory support (SM_CONF_SHM on page 142), and this SharedMemoryKey option must be declared.

You declare the SharedMemoryKey option like this:

O SharedMemoryKey=keyconfiguration file (V8.12 and later)
-OSharedMemoryKey=keycommand line (V8.12 and later)
define(`confSHARED_MEMORY_KEY',key)   ← mc configuration (V8.12 and later)

Here, key is of type numeric and can be positive, negative, or zero. A non-numeric key evaluates to zero. A key of zero causes use of shared memory to be disabled. Otherwise, the value specified becomes the key used by shmget(2).

If you specify the SharedMemoryKey option, and shared memory support was not included in sendmail, the following error is printed and logged:

Option: SharedMemoryKey requires shared memory support (-DSM_CONF_SHM)

If shared memory is used, only the initial daemon will create and destroy it. If you run multiple initial daemons, you must be careful not to specify the same key for each. For example, two lines in a boot-time rc file might look like this:

/usr/sbin/sendmail -OSharedMemoryKey=1001 -C /etc/mail/fast.cf -q10m
/usr/sbin/sendmail -OSharedMemoryKey=1002 -C /etc/mail/slow.cf -q1h

The SharedMemoryKey option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SharedMemoryKeyFile

Allow sendmail to set the shared memory key V8.14 and later

The sendmail program uses shared memory to store the amount of available disk space of the queue disks and the total number of messages queued across all queues (Print the Number of Messages in the Queue on page 425) if the binary was compiled with shared memory support (SM_CONF_SHM on page 142), and if the SharedMemoryKey option (SharedMemoryKey on page 1090) or this SharedMemoryKeyFile option was declared.

The SharedMemoryKeyFile option tells sendmail to set its own shared memory key, and store that selected key into a file you specify. But note that for this to work, the SharedMemoryKey option must also be declared and given a value of −1.

You declare the SharedMemoryKeyFile option like this:

O SharedMemoryKeyFile=fnameconfiguration file (V8.14 and
later)
-OSharedMemoryKeyFile=fnamecommand line (V8.14 and later)
define(`confSHARED_MEMORY_KEY_FILE',fname)   ← mc configuration (V8.14 and later)

The fname is the full pathname of the file. If fname is missing, the pathname becomes that of an empty string. If the entire option is missing, the default varies depending on the operating system (see conf.h). The default with the mc configuration technique is to not define this option.

If the file specified cannot be written—because it is not safe, because it is in a directory that does not exist, or because it is an empty string—sendmail will log the following error and skip writing to the file:

unable to write fname

Note that the fname may contain macros as part of its declaration. The values in the macros will become part of the fname when the configuration file is read. One convenient declaration, for example, might look like this:

define(`confSHARED_MEMORY_KEY_FILE',`/etc/mail/shmkey.${daemon_name}')

Here, the fname will have a suffix that is the name you give to the daemon with the ${daemon_name} macro (${daemon_name} on page 819).

If you specify the SharedMemoryKey option, and shared memory support was not included in sendmail, the following error is printed and logged:

Option: SharedMemoryKeyFile requires shared memory support (-DSM_CONF_SHM)

If shared memory is used, only the initial daemon will create and destroy it. If you run multiple initial daemons, you must be careful not to specify the same key file for each. For example, two lines in a boot-time rc file might look like this:

/usr/sbin/sendmail -OSharedMemoryKeyFile=/etc/mail/skA -C /etc/mail/fast.cf -q10m
/usr/sbin/sendmail -OSharedMemoryKeyFile=/etc/mail/skB -C /etc/mail/slow.cf -q1h

The SharedMemoryKeyFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SingleLineFromHeader

Strip newlines from From: headers V8.8 and later

Lotus Notes’ SMTP mail gateway can generate From: headers that contain newlines and that contain the address on the second line:

From: Full Name
        <address>

Although this is legal per RFC822, many MUAs mishandle such headers and are unable to find the address. If your site suffers from this problem, you can define the SingleLineFromHeader option using one of these forms:

O SingleLineFromHeader=boolconfiguration file (V8.8 and
later)
-OSingleLineFromHeader=boolcommand line (V8.8 and later)
define(`confSINGLE_LINE_FROM_HEADER', `bool')  ← mc configuration technique (V8.8
and later)

The bool is of type Boolean. If it is true, sendmail will convert all newlines found in a From: header into space characters. If it is false, sendmail will leave all From: headers as is. The default for the mc configuration technique is false.

The SingleLineFromHeader option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

SingleThreadDelivery

Set single-threaded delivery V8.8 and later

Ordinarily, when sendmail processes the queue, it pays relatively little attention to other sendmail processes that might be processing the same queue at the same time. It locks a single qf file during delivery so that no other sendmail will attempt delivery of that message at the same time, but that is all. When sending many messages to a single other host, it is possible for multiple, parallel sendmail processes to try to deliver different messages from that queue to that single host all at once.

When parallelism is not desirable, you might wish to set up sendmail to be single-threaded. This ensures that only a single sendmail will ever be delivering to a given host at a given time. Single-threaded delivery is enabled with the SingleThreadDelivery option, the forms of which are as follows:

O SingleThreadDelivery=boolconfiguration file (V8.8 and
later)
-OSingleThreadDelivery=boolcommand line (V8.8 and later)
define(`confSINGLE_THREAD_DELIVERY',`bool')    ← mc configuration (V8.8 and later)

The argument bool is of type Boolean. If it is missing, the default value is true (deliver single-threaded). If the entire SingleThreadDelivery option is missing, the default becomes false (deliver in parallel). The default for the mc configuration technique is false.

Note that the SingleThreadDelivery option will work only if the HostStatusDirectory option is also declared (HostStatusDirectory on page 1037). If it is not, sendmail will print the following error and reset the SingleThreadDelivery option to false:

Warning: HostStatusDirectory required for SingleThreadDelivery

Be careful setting the SingleThreadDelivery option to true because it can slow down mail delivery by a substantial degree. To understand why, consider an ongoing queue run to a host that is receiving many messages. If interactive user mail arrives during that run, the sendmail process executed by the user’s MUA might find that it cannot send the message because it is single-threaded and the other sendmail has that host locked. In that case the user’s message will be queued and will wait in the queue until the next queue is run. Even if your site is on the Internet, one large message to a slow site can cause interactive mail for that site to be wrongly queued.

An appropriate use for the SingleThreadDelivery option is on the command line when processing the queue. In daemon mode, for example, these startup commands might be appropriate:

/usr/sbin/sendmail -bd
/usr/sbin/sendmail -OSingleThreadDelivery -q30m

Note that two sendmail programs are started: one to act as a daemon and the other to periodically process the queue. Don’t combine them when using the SingleThreadDelivery option because incoming (relayed) mail can wrongly affect outgoing mail.

The SingleThreadDelivery option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SmtpGreetingMessage

The SMTP greeting message All versions

When sendmail accepts an incoming SMTP connection it sends a greeting message to the other host. This message identifies the local machine and is the first thing it sends to say it is ready.

Prior to V8.7 sendmail, this message was declared with the $e macro. Beginning with V8.7 sendmail, it is declared with the SmtpGreetingMessage option. In both cases, the message must begin with the fully qualified name of the local host. Usually, that name is stored in $j. The minimal definition for both is:

O SmtpGreetingMessage=$j   ← beginning with V8.7
De$j                       ← V8.6 and earlier

Additional information can follow the local hostname. Any additional information must be separated from the hostname by at least one space:

De$j additional informationat least one space

Traditionally, that additional information is the name of the listening program (in our case, always sendmail), the version of that program, and a statement that the program is ready. For example:

O SmtpGreetingMessage=$j Sendmail $v ready at $b  ← beginning with V8.7
De$j Sendmail $v ready at $b                      ← V8.6 and earlier

Note that it is not uncommon to see imaginative (and legal) variations in the additional information:

De$j Sun's sendmail.mx is set to go (at $b), let 'er rip!

Under versions V8.6 and earlier, there was no default for this greeting message. You had to define $e in every configuration file. Beginning with V8.7, sendmail checks to see whether the SmtpGreetingMessage option was defined and uses that value if it was. Otherwise, it checks to see whether the level of the configuration file is 6 or less. If it is, and if the $e macro was defined, it uses that value. Otherwise, it uses the following default:

$j Sendmail $v ready at $b

The forms for the $e and SmtpGreetingMessage are as follows:

O SmtpGreetingMessage=messageconfiguration file (V8.7 and later)
-OSmtpGreetingMessage=messagecommand line (V8.7 and later)
define(`confSMTP_LOGIN_MSG',`message')     ← mc configuration (V8.7 and later)
Demessageconfiguration file (V8.6 and earlier)

The message is of type string and must be present. It must contain, at minimum, the fully qualified name of the local host.

Note that in V8.1 through V8.6, sendmail always added the extra line:

ESMTP spoken here

to its initial greeting message. Beginning with V8.7, sendmail instead inserts the word “ESMTP” into the greeting message itself just after the fully qualified hostname.

The SmtpGreetingMessage option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SoftBounce

Bounce with temporary, not permanent, errors V8.14 and later

Normally, sendmail permanently rejects email using a 5yz SMTP reply code:

RCPT To:<alex@example.com>
553 5.3.0 <alex@example.com>... Spam blocked see: http://spamcop.net/bl.shtml?76.23
.25.147

But because mail rejected with a 5yz code will not be retried, such rejections may not be desirable when testing a new setup. Consider the need to create a new rule set that rejects certain Subject: headers, or the need to develop and install a new Milter. Until such a new setup is validated as working, you might want to fail mail only temporarily instead of permanently.

Email is temporarily failed with a 4yz code and delivery will be retried at a later time (unless the mail is spam).

For testing, you can change all 5yz bounces into 4yz bounces using the SoftBounce option:

O SoftBounce=boolconfiguration file (V8.14 and later)
-OSoftBounce=boolcommand line (V8.14 and later)
define(`confSOFT_BOUNCE',`bool')     ← mc configuration (V8.14.1 and later)

The argument bool is of type Boolean. If it is missing, the default value is true (deliver single-threaded). If the entire SoftBounce option is missing, the default becomes false (deliver in parallel). The default for the mc configuration technique is false.

With the SoftBounce option set to true, all SMTP replies that would normally begin with a 5 will have that 5 converted into a 4 just before the reply is issued. Note that only the leading 5 is changed, not the entire SMTP value.

The SoftBounce option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

StatusFile

Specify statistics file All versions

At busy and complex mail sites, many different delivery agents are active. For example, one kind of mail might be routed over the Internet using the TCP delivery agent, while another might be routed via the UUCP suite of programs, and yet another might be routed over a DS3 link to a group of research machines. Under such circumstances, it is useful to gather statistical information about the total use to date of each delivery agent.

The StatusFile option tells sendmail the name of the file into which it should save those statistics. This option does not cause statistics to be gathered. It merely specifies the name of the file where they might be saved. When sendmail runs, it checks for the existence of such a file. If the file exists, it opens and updates the statistics in the file. If the file doesn’t exist, sendmail quietly ignores statistics. The statistics can be viewed by using the mailstats(8)[421] program (The statistics File on page 365).

The forms of the StatusFile option are as follows:

O StatusFile=pathconfiguration file (V8.7 and later)
-OStatusFile=pathcommand line (V8.7 and later)
define(`STATUS_FILE',`path')   ← mc configuration (V8.7 and later)
OSpathconfiguration file (deprecated)
-oSpathcommand line (deprecated)
undefine(`STATUS_FILE')        ← mc configuration (V8.14 and later)

The optional argument path is of type string. It can be a relative or a full pathname. The default value for path is statistics. Relative names are always relative to the queue directory. If the entire option is missing, the value for path becomes the null string. The default in configuring with the mc technique varies depending on your operating system.

The statistics file must live in a safe directory and must itself have safe permissions. If your site is unable to ensure the safety of this file, you might be able to overcome that limitation (at increased risk) with one of the DontBlameSendmail (DontBlameSendmail on page 1009) option’s items.

Beginning with V8.14, it is possible to undefine the STATUS_FILE and thereby prevent sendmail from attempting to open and write to a statistics file for each delivery. This can slightly increase performance.

The StatusFile option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

SuperSafe

Queue everything just in case All versions

At times, such as when calling /bin/mail to deliver local mail, sendmail holds an entire message internally while waiting for that delivery to complete. Clearly, this runs the risk that the message will be lost if the system crashes at the wrong time.

As a safeguard against such rare catastrophes, the SuperSafe option can be used to force sendmail to queue every message and to sync(2) the queued files to disk for maximum safety. The queued copy is left in place until sendmail is sure that delivery was successful. We strongly recommend that this option always be declared as true.

The forms of the SuperSafe option are as follows:

O SuperSafe=characterconfiguration file (V8.12 and later)
-OSuperSafe=charactercommand line (V8.12 and later)
define(`confSAFE_QUEUE',`character')    ← mc configuration (V8.12 and later)
O SuperSafe=boolconfiguration file (V8.7 and later)
-OSuperSafe=boolcommand line (V8.7 and later)
define(`confSAFE_QUEUE',`bool')         ← mc configuration (V8.7 and later)
Osboolconfiguration file (deprecated)
-osboolcommand line (deprecated)

The argument, prior to V8.12, was of type Boolean. The argument, with V8.12 and later, is of type Character. If the argument is missing, the default value is true (everything is queued). The default for the mc configuration technique is also true. If the entire SuperSafe option is missing, the default for V8.11 and earlier becomes false (no special queuing behavior), but for V8.12 and later it becomes true (everything is queued).

Beginning with V8.12, a third alternative to true or false was introduced that is useful with sendmail’s interactive delivery mode, and is called i for interactive. For example:

define(`confDELIVERY_MODE',`interactive')
define(`confSAFE_QUEUE',   `interactive')    ← V8.12 and later

This interactive setting for the SuperSafe option causes sendmail to skip unneeded secondary synchronization calls.

Beginning with V8.13, a forth alternative was introduced that is useful when Milters reject a great deal of mail. The SuperSafe option now accepts a PostMilter setting which delays fsync()ing the df file until after all Milters have reviewed the message.

define(`confSAFE_QUEUE',   `PostMilter')    ← V8.13 and later

At high-volume sites that perhaps send subscription email, there can be benefit (and increased risk) to turning off this SuperSafe option:

define(`confSAFE_QUEUE',   `false')    ← strongly discouraged

The SuperSafe option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

TempFileMode

Permissions for temporary files All versions

The TempFileMode option tells sendmail what mode (file permissions) to give its temporary files and its freeze file.[422] This TempFileMode option also sets the file permissions for delivery to files that do not already exist (and must therefore be created). Prior to V8.12, this option also set permission for queued files (see the QueueFileMode option, QueueFileMode on page 1071).

The forms of the TempFileMode option are as follows:

O TempFileMode=modeconfiguration file (V8.7 and later)
-OTempFileMode=modecommand line (V8.7 and later)
define(`confTEMP_FILE_MODE',`mode')   ← mc configuration (V8.7 and later)
OFmodeconfiguration file (old mode)
-oFmodecommand line (old mode)

The mode is of type octal. The default is 0600 (if the real-user-id is the same as the effective-user-id), and 0644 otherwise. If the mode has the group-writable bit set (as in 0664), the umask(2) is set to 0002 (disallow world-writable permissions) just prior to the open(2) or creat(2), and restored to its prior value just after. Be careful to not omit just the mode argument—if you do, the permissions become 0000, and sendmail might not be able to read or write its own files.

The TempFileMode option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Timeout

Set timeouts All versions

Many events can take a long time to complete—so long, in fact, that they can cause sendmail to appear to hang if they don’t time out. For example, when reading commands or data from a remote SMTP connection, the other side can be so slow that it becomes necessary for the local sendmail to time out and break the connection. Similarly, when reading from its standard input, sendmail might find that the program feeding it information is taking so long that a timeout becomes necessary.

The V8 version of the sendmail program has introduced defaults for the amount of time it waits under various circumstances. The forms of the Timeout option are as follows:

O Timeout.keyword=valueconfiguration file (V8.7 and
later)
-OTimeout.keyword=valuecommand line (V8.7 and
later)
define(`confTO_keyword',` value')                   ← mc configuration (V8.7 and
later)
O Timeout=keyword=value,...configuration file (V8.6)
-OTimeout=keyword=value,...command line (V8.6)
define(`confREAD_TIMEOUT',``keyword=value,...'')    ← mc configuration (V8.6)
Orkeyword=value,...configuration file (V8.1
through V8.5)
-orkeyword=value,...command line (V8.1 through
V8.5)
Ortimeconfiguration file
(deprecated)
-ortimecommand line (deprecated)

Prior to V8 sendmail, only a single time could be specified that set the timeout for all SMTP transactions. Beginning with V8 sendmail, a list of keyword and value pairs can be specified that set a wide assortment of timeouts.[423] In this section, we focus on the current syntax. The recognized keyword words are listed in Table 24-25. The default and minimum value for each is described in the individual section. The minimums discussed in the subsections that follow are those recommended by RFC1123, Digital Certificate Acronyms, but they are not enforced.[424]

Table 24-25. Timeout option keywords

Keyword

§

Meaning

aconnect

Timeout.aconnect (V8.12 and later) on page 1099

Wait for all connects (V8.12 and later).

auth

Timeout.auth (V8.12 and later) on page 1100

Wait for a reply in an SMTP AUTH dialog (V8.12 and later).

command

Timeout.command (V8.6 and later) on page 1100

Wait for the next command.

connect

Timeout.connect (V8.6 and later) on page 1101

Wait for connect(2) to return.

control

Timeout.control (V8.10 and later) on page 1101

Wait for control socket commands to finish (V8.10 and later).

datablock

Timeout.datablock (V8.6 and later) on page 1101

Wait for each DATA block read.

datafinal

Timeout.datafinal (V8.6 and later) on page 1102

Wait for acknowledgment of final dot.

datainit

Timeout.datainit (V8.6 and later) on page 1102

Wait for DATA acknowledgment.

fileopen

Timeout.fileopen (V8.7 and later) on page 1102

Wait for an NFS file to open (V8.7 and later).

helo

Timeout.helo (V8.6 and later) on page 1102

Wait for HELO or EHLO.

hoststatus

Timeout.hoststatus (V8.8 and later) on page 1103

Duration of host status (V8.8 and later)

iconnect

Timeout.iconnect (V8.8 and later) on page 1103

Wait for connect(2) on first delivery attempt (V8.8 and later).

ident

Timeout.ident (V8.6 and later) on page 1104

Wait for RFC1413 identification protocol.

initial

Timeout.initial (V8.6 and later) on page 1104

Wait for initial greeting message.

lhlo

Timeout.lhlo (V8.12 and later) on page 1105

Wait for LHLO acknowledgment (V8.12 and later).

mail

Timeout.mail (V8.6 and later) on page 1105

Wait for MAIL From: acknowledgment.

misc

Timeout.misc (V8.6 and later) on page 1105

Wait for other SMTP commands.

queuereturn

Timeout.queuereturn (V8.7 and later) on page 1106

Bounce if still undelivered (V8.7 and later).

queuewarn

Timeout.queuewarn (V8.7 and later) on page 1107

Warn if still undelivered (V8.7 and later).

quit

Timeout.quit (V8.6 and later) on page 1108

Wait for QUIT acknowledgment.

rcpt

Timeout.rcpt (V8.6 and later) on page 1108

Wait for RCPT To: acknowledgment.

resolver

Timeout.resolver (V8.10 and later) on page 1108

Limits for DNS lookups (V8.10 and later).

rset

Timeout.rset (V8.6 and later) on page 1109

Wait for RSET acknowledgment.

starttls

Timeout.starttls (V8.12 and later) on page 1110

Wait for STARTTLS acknowledgment (V8.12 and later).

The value for each keyword is of type time (except for resolver.retry, which is numeric). The default, if a unit character is omitted, is minutes (except for resolver.retrans, which is seconds). For the queuewarn and queuereturn keywords, however, the defaults are hours and days, respectively. Note that some of the default values can seem overly long. This is intentional because some events can legitimately take a very long time. Consider, for example, a misconfigured DNS server. If you time out too soon, your performance will actually decrease because the timeouts will cause retransmits.

For the V8.7 and later mc technique, each keyword is declared with its corresponding confTO_ expression. For example, the keyword initial is declared like this:

define(`confTO_INITIAL',`5m')                  ← mc configuration (V8.7 and later)

The particular confTO_ expression and its corresponding default value are listed with each keyword.

For compatibility with old configuration files, if no keyword = is specified, timeouts for the mail, rcpt, datainit, datablock, datafinal, and command keywords are set to the indicated value:

Or2h              ← set them to two hours

An example of the r option with keyword = pairs looks like this:

Orrcpt=25m,datablock=3h

With the V8.7 and later forms of the Timeout option (where the earlier forms are all deprecated), individual timeouts can be listed more attractively like this:

O Timeout.rcpt      = 25m
O Timeout.datablock =  3h

For the previous two examples, the timeout for acknowledgment of the RCPT To: command (list a recipient) is 25 minutes and the timeout for acknowledgment of receipt of each line of the mail message is 3 hours. All the others that are not specified assume the default values.

The Timeout option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Timeout.aconnect (V8.12 and later)

When sendmail attempts to establish a network connection to another host, it uses the connect(2) system call. If the connection is going to fail, either that system call will time out (after an amount of time that varies with the operating system), or the connection will be immediately rejected. If there are additional hosts in the list of hosts to connect to, sendmail will proceed to the next host in the list and try to connect again.

If you wish to limit the total amount of time all these connection attempts will take, you can do so with this aconnect keyword to the Timeout option:

O Timeout.aconnect=timeoutconfiguration file (V8.12 and later)
-OTimeout.aconnect=timeoutcommand line (V8.12 and later)
define(`confTO_ACONNECT', `timeout')     ← mc technique (V8.12 and later)

Here, timeout is of type time. If the time is specified as zero (the default), no timeout is imposed.

Note that if the aconnect time limit is exceeded, delivery of the message will be deferred until the next queue run.

Also note that if the aconnect time limit is exceeded, and if the FallbackMXhost (FallbackMXhost on page 1030) option was defined, a connection will be made to the host defined by the FallbackMXhost option.

Timeout.auth (V8.12 and later)

When sendmail connects to another site, it greets that site with an EHLO command. In return, the other site replies with a list of SMTP extensions it supports:

250-host.domain Hello some.domain, pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSn
250-ETRn
250-AUTH DIGEST-MD5 CRAM-MD5             ← note this line
250-DELIVERBY
250 HELP

The local sendmail notes that the other site supports AUTH, so the local sendmail uses the AUTH command. The local sendmail then waits for the other side to begin its negotiating. The amount of time the local sendmail waits can be limited with this auth keyword, the forms of which are as follows:

O Timeout.auth=timeoutconfiguration file (V8.12 and later)
-OTimeout.auth=timeoutcommand line (V8.12 and later)
define(`confTO_AUTH', `timeout')     ← mc configuration (V8.12 and later)

The timeout is set to 10m (10 minutes) by default. There is no recommended timeout. There is no default for the mc technique.

If authentication times out, the connection is closed.

Timeout.command (V8.6 and later)

When local sendmail is running as an SMTP server, it acknowledges any SMTP command sent to it by the other host and then waits for the next command. The amount of time the local sendmail waits for each command is defined with the command keyword, the forms of which are as follows:

O Timeout.command=timeoutconfiguration file (V8.6 and later)
-OTimeout.command=timeoutcommand line (V8.6 and later)
define(`confTO_COMMAND', `timeout')    ← mc configuration (V8.6 and later)

The default for timeout is one hour, and the minimum is specified as five minutes. The mc technique uses the confTO_COMMAND for which no default is defined. If a command is not received in time, the local sendmail assumes that the connection has hung and shuts it down.

Timeout.connect (V8.6 and later)

When sendmail attempts to establish a network connection to another host, it uses the connect(2) system call. If the connection is going to fail, that system call will time out after an amount of time that varies with the operating system. With some buggy versions of Linux, for example, the timeout is 90 minutes, whereas for other versions of Unix it is typically one to five minutes, and for newer versions of Unix it is 75 seconds.

When the amount of time to wait for a connection to fail is of concern, you can override the system value with the connect keyword to the Timeout option:[425]

O Timeout.connect=timeoutconfiguration file (V8.6 and later)
-OTimeout.connect=timeoutcommand line (V8.6 and later)
define(`confTO_CONNECT', `timeout')     ← mc configuration (V8.6 and later)

If no timeout is specified, the default is to use the system-imposed timeout. No default is defined for the mc technique.

Note that if the connect(2) call times out, delivery will be deferred until the next queue run. If you wish the connect(2) to be tried again (as you might for a dial-on-demand machine), you should investigate the DialDelay option (DialDelay on page 1007).

Timeout.control (V8.10 and later)

Beginning with V8.10, sendmail can now be controlled in a limited fashion via a Unix domain socket (see ControlSocketName on page 990). When it first detects that a command is ready on that socket, it sets a timeout before reading the command. That prevents sendmail from hanging if the controlling command is slow.

The timeout for the controlling socket is set like this:

O Timeout.control=timeoutconfiguration file (V8.10 and later)
-OTimeout.control=timeoutcommand line (V8.10 and later)
define(`confTO_CONTROL', `timeout')    ← mc configuration (V8.10 and later)

The default if this option is omitted is two minutes. The default for the mc configuration technique is to leave this timeout undefined.

Timeout.datablock (V8.6 and later)

The local sendmail buffers a mail message and sends it to the receiving site one line at a time. The amount of time that the receiving sendmail waits for a read to complete is set with the datablock keyword, the forms of which are as follows:[426]

O Timeout.datablock=timeoutconfiguration file (V8.6 and later)
-OTimeout.datablock=timeoutcommand line (V8.6 and later)
define(`confTO_DATABLOCK', `timeout')    ← mc configuration (V8.6 and later)

The default timeout is one hour, and the specified minimum is three minutes. The mc technique uses confTO_DATABLOCK, which has no default.

Timeout.datafinal (V8.6 and later)

After the entire mail message has been transmitted, the local sendmail sends a lone dot to say that it is done, and then waits for the receiving sendmail to acknowledge acceptance of that dot:

250 Mail accepted

The amount of time that the local sendmail waits for acknowledgment that the mail message was received is set with the datafinal keyword, the forms of which are as follows:

O Timeout.datafinal=timeoutconfiguration file (V8.6 and later)
-OTimeout.datafinal=timeoutcommand line (V8.6 and later)
define(`confTO_DATAFINAL', `timeout')    ← mc configuration (V8.6 and later)

The default timeout is one hour, and the specified minimum is 10 minutes. The mc technique uses confTO_DATAFINAL, which has no default. If the value is shorter than the time actually needed for the receiving site to deliver the message, the local sendmail times out before seeing the “Mail accepted” message when, in fact, the mail was accepted. This can lead to the local sendmail wrongly attempting to deliver the message later for a second time.

Timeout.datainit (V8.6 and later)

After all the recipients have been specified, the local sendmail declares that it is ready to send the mail message itself. It issues the SMTP DATA command to the other site:

DATA

The local sendmail then waits for acknowledgment, which looks like this:

354 Enter mail, end with "." on a line by itself

The amount of time that the local sendmail waits for acknowledgment of its DATA command is set with the datainit keyword, the forms of which are as follows:

O Timeout.datainit=timeoutconfiguration file (V8.6 and later)
-OTimeout.datainit=timeoutcommand line (V8.6 and later)
define(`confTO_DATAINIT', `timeout')    ← mc configuration (V8.6 and later)

The default timeout is five minutes, and the specified minimum is two minutes. The mc technique should use confTO_DATAINIT, which has no default.

Timeout.fileopen (V8.7 and later)

If a directory is remotely mounted and the server is down or not responding, an attempt to open a file in that directory can hang. Beginning with V8.7, the fileopen keyword sets the amount of time to wait for an open to complete.[427] The forms of this keyword are as follows:

O Timeout.fileopen=timeoutconfiguration file (V8.7 and later)
-OTimeout.fileopen=timeoutcommand line (V8.7 and later)
define(`confTO_FILEOPEN', `timeout')    ← mc configuration (V8.7 and later)

The default is 60 seconds. The mc technique uses confTO_FILEOPEN, which has no default.

Timeout.helo (V8.6 and later)

After the greeting, the local sendmail sends a HELO (or EHLO to get ESMTP) message to identify itself. That message looks something like this:

HELO here.us.edu

The other site then replies with acknowledgment of the local HELO or EHLO:

250 there.dc.gov  Hello here.us.edu, pleased to meet you

The amount of time the local sendmail waits for the other site to acknowledge the local HELO or EHLO is set with the helo keyword, the forms of which are as follows:

O Timeout.helo=timeoutconfiguration file (V8.6 and later)
-OTimeout.helo=timeoutcommand line (V8.6 and later)
define(`confTO_HELO', `timeout')     ← mc configuration (V8.6 and later)

The default value is five minutes. There is no specified minimum, but we recommend no less than five minutes (because some sites use DNS to validate the hostname). The mc technique uses confTO_HELO, which has no default.

Timeout.hoststatus (V8.8 and later)

When processing the queue, sendmail saves the connection status of each host to which it connects and each host to which it fails to connect. It does this because an unsuccessful host should not be tried again during the same queue run. This makes sense when you consider that failures tend to remain failures for a while.

At sites that process huge queues, on the other hand, such behavior might not be appropriate. If it takes hours (rather than minutes) to process the queue, the likelihood increases that a previously failed connection might succeed. For such sites, V8.8 sendmail has introduced the Timeout.hoststatus option, the forms of which are as follows:

O Timeout.hoststatus=timeoutconfiguration file (V8.8 and later)
-OTimeout.hoststatus=timeoutcommand line (V8.8 and later)
define(`confTO_HOSTSTATUS', `timeout')    ← mc configuration (V8.8 and later)

Here, timeout is of type time. If timeout is present, it specifies the length of time that information about a host will be considered valid. If a queue run finishes faster than this interval, it has no effect. But when queue runs take longer than this interval, a previously down host will be given a second try if it appears in the queue again.

If timeout is missing, it is interpreted as zero, and no host information is ever saved. If the entire option is missing, the default is 30 minutes. The mc technique uses confTO_HOSTSTATUS, which has no default.

Note that this timeout is also used to time out persistent host status files when the purgestat(1) command is used (purgestat (V8.8 or Later) on page 223).

Timeout.iconnect (V8.8 and later)

When sendmail attempts to establish a network connection to another host, it uses the connect(2) system call. If the connection is going to fail, that system call will time out after an amount of time that varies with the operating system. You can override the system timeout with the connect keyword (Timeout.connect (V8.6 and later) on page 1101) to the Timeout option.

When outgoing mail is first processed, mail to responsive hosts should precede mail to sluggish hosts. To understand why, consider that all mail is processed serially during each queue run. If a sluggish host precedes all the other hosts in the queue, those other hosts will not even be tried until the sluggish host finishes or times out. With this in mind, the very first time sendmail attempts to deliver a message, it should enforce a shorter connect(2) timeout than it should for latter attempts.

Beginning with V8.8 sendmail, you can set an initial connect(2) timeout with the iconnect keyword to the Timeout option. Here are the forms:

O Timeout.iconnect=timeoutconfiguration file (V8.8 and later)
-OTimeout.iconnect=timeoutcommand line (V8.8 and later)
define(`confTO_ICONNECT', `timeout')    ← mc configuration (V8.8 and later)

If no timeout is specified or if the entire Timeout.iconnect option is omitted, the default is to time out the first connection the same as the timeout for all connections (i.e., it defaults to the setting for Timeout.connect). The mc technique uses confTO_ICONNECT, for which there is no default. The N line in the qf file (N line on page 452) determines whether this is the first attempt. If the value in that line is zero, this is the first delivery attempt.

Timeout.ident (V8.6 and later)

The sendmail daemon queries every outside connecting host with the RFC1413 identification protocol to record the identity of the user at the other end who made the connection and to verify the true name of the remote connecting host. The default timeout is to wait five seconds for a response. The ident keyword is used to change this timeout. If your site accepts mail from PCs running SMTP software, you might need to disable this feature. Some PCs get stuck when queried with the RFC1413 identification protocol. The forms of this keyword are as follows:

O Timeout.ident=timeoutconfiguration file (V8.6 and later)
-OTimeout.ident=timeoutcommand line (V8.6 and later)
define(`confTO_IDENT', `timeout')     ← mc configuration (V8.6 and later)

If the timeout is zero, the ident protocol is disabled. The mc technique uses confTO_IDENT, for which there is no default.

Timeout.initial (V8.6 and later)

When sendmail first connects to a remote site, that site sends an initial greeting message. The greeting message always starts with 220 and might look something like one of these sample greetings:

220 host.domain ESMTP Sendmail 8.12.6/8.12.6; Fri, 13 Dec 2002 13:19:01 −0700 (PDT)
220 some.server.net - Maillennium ESMTP/MULTIBOX in2 #46
220 another.server.com ESMTP CommuniGate Pro 3.5.9
220 another.host.domain ESMTP mail_relay_in-xg3.9; Fri, 13 Dec 2002 16:22:35 −0400
220 organization.domain ESMTP Exim 3.34 #1 Fri, 13 Dec 2002 13:25:56 −0700

You can set an initial timeout with the initial keyword to the Timeout option, using one of these forms:

O Timeout.initial=timeoutconfiguration file (V8.6 and later)
-OTimeout.initial=timeoutcommand line (V8.6 and later)
define(`confTO_INITIAL', `timeout')    ← mc configuration (V8.6 and later)

The default for the greeting wait and the recommended minimum is five minutes.[428] The mc technique uses confTO_INITIAL, for which there is no default.

Timeout.lhlo (V8.12 and later)

The sendmail program can use LMTP to deliver mail to a local delivery program. One such program is mail.local (The mail.local Delivery Agent on page 359). When sendmail first starts an LMTP connection, it sends the LHLO command. It then waits for the program to reply. The amount of time that sendmail waits for that reply is set with the lhlo keyword, the forms of which are as follows:

O Timeout.lhlo=timeoutconfiguration file (V8.12 and later)
-OTimeout.lhlo=timeoutcommand line (V8.12 and later)
define(`confTO_LHLO', `timeout')    ← mc configuration (V8.12 and later)

The default timeout is 2m (two minutes). There is no recommended wait interval. There is no default for the mc configuration technique.

Timeout.mail (V8.6 and later)

After sending HELO, EHLO, or LHLO, the local sendmail next sends the address of the sender (the envelope-sender address) with the MAIL From: command:

MAIL From:<you@here.us.edu>

The local sendmail then waits for acknowledgment, which can look like this:

250 2.1.0 <you@here.us.edu>... Sender ok

The amount of time that the local sendmail waits for acknowledgment of its MAIL From: command is set with the mail keyword. Here are the forms:

O Timeout.mail=timeoutconfiguration file (V8.6 and later)
-OTimeout.mail=timeoutcommand line (V8.6 and later)
define(`confTO_MAIL', `timeout')     ← mc configuration (V8.6 and later)

The default timeout is 10 minutes, and the specified minimum is 5 minutes. The mc technique uses confTO_MAIL, for which there is no default.

Timeout.misc (V8.6 and later)

During the course of mail transfer, the local sendmail can issue short miscellaneous commands. Examples are NOOP (which stands for no operation) and VERB (which tells the other side to enter verbose mode). The time that the local sendmail waits for acknowledgment of these miscellaneous commands is defined with the misc keyword. Here are the forms:

O Timeout.misc=timeoutconfiguration file (V8.6 and later)
-OTimeout.misc=timeoutcommand line (V8.6 and later)
define(`confTO_MISC', `timeout')     ← mc configuration (V8.6 and later)

The default timeout is two minutes, and no minimum is specified. The mc technique uses confTO_MISC, for which there is no default.

Timeout.queuereturn (V8.7 and later)

This keyword determines a mail message’s lifetime in the queue. Beginning with V8.7, this queuereturn keyword is used to set the amount of time a message must wait in the queue before it is bounced as nondeliverable. It uses these forms:

O Timeout.queuereturn=timeoutconfiguration file (V8.7 and later)
-OTimeout.queuereturn=timeoutcommand line (V8.7 and later)
define(`confTO_QUEUERETURN', `timeout')    ← mc configuration (V8.7 and later)

The queuereturn keyword can be further tuned on the basis of three possible levels of priority that a mail message can have. That is, the preceding forms set all three levels, whereas the following tune each level independently:

O Timeout.queuereturn.urgent=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuereturn.normal=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuereturn.non-urgent=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuereturn.dsn=timeoutconfiguration file (V8.13 and
later)
OTimeout.queuereturn.urgent=timeoutcommand line (V8.7 and later)
-OTimeout.queuereturn.normal=timeoutcommand line (V8.7 and later)
-OTimeout.queuereturn.non-urgent=timeoutcommand line (V8.7 and later)
-OTimeout.queuereturn.dsn=timeoutconfiguration file (V8.13 and
later)
define(`confTO_QUEUERETURN_URGENT',`timeout')     ← mc configuration (V8.7 and
later)
define(`confTO_QUEUERETURN_NORMAL',`timeout')     ← mc configuration (V8.7 and
later)
define(`confTO_QUEUERETURN_NONURGENT',`timeout')  ← mc configuration (V8.7 and
later)
define(`confTO_QUEUERETURN_DSN',`timeout')        ← configuration file (V8.13 and
later)

The default for the mc configuration technique is to bounce all messages that remain in the queue for more than five days.

The keywords urgent, normal, and non-urgent correspond to the Precedence: header from the mail message. When the numeric equivalent of the Precedence: header as translated from the P line of the configuration file (see Precedence on page 1148) is negative, the message is classified as nonurgent. When it is greater than zero, the message is classified as urgent. Otherwise, it is normal.

As of V8.7, a Priority: header is also available (see Priority: on page 1161) to directly specify the message priority and thereby bypass the need to set the value using the Precedence: header.

Priority: urgent
Priority: normal
Priority: non-urgent

There is currently no way to specify a Priority: header’s value from the sendmail command line.

Beginning with V8.10, in addition to an interval specification, you can use the literal term now to force an immediate bounce. This term is best used from the command line in conjunction with an appropriate queue specifier (see Process by identifier/recipient/sender: -q[ISR] on page 431 and Process by queue group with -qG (V8.12 and later) on page 432). For example:

% /usr/sbin/sendmail -qGbadqueue -OTimeout.queuereturn=now

Here, the messages in the queue group badqueue will all be bounced.

Beginning with V8.13, a new priority keyword, dsn, has been added to the previous three (urgent, normal, and non-urgent). If the precedence of a message is normal (zero), and if the message is a return DSN message, the timeout defined by this new keyword is used. One handy use for this new keyword is to return DSN messages sooner than normal mail. But note that when you return a bounce message, you create a double-bounce which is sent to the address specified by the DoubleBounceAddress option (DoubleBounceAddress on page 1025).

Timeout.queuewarn (V8.7 and later)

When a message is queued for longer than a predetermined time, sendmail sends a message to the sender explaining that the original message could not be delivered right away and that sendmail will keep trying. Beginning with V8.7, this queuewarn keyword is used to set the amount of time a message must wait in the queue before that explanation is mailed. Here are the forms:

O Timeout.queuewarn=timeoutconfiguration file (V8.7 and later)
-OTimeout.queuewarn=timeoutcommand line (V8.7 and later)
define(`confTO_QUEUEWARN', `timeout')     ← mc configuration (V8.7 and later)

The queuewarn keyword can be further tuned on the basis of three possible levels of priority that a mail message can have. That is, the preceding forms set all three levels, whereas the following tune each level independently:

O Timeout.queuewarn.urgent=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuewarn.normal=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuewarn.non-urgent=timeoutconfiguration file (V8.7 and
later)
O Timeout.queuewarn.dsn=timeoutconfiguration file (V8.13 and
later)
-OTimeout.queuewarn.urgent=timeoutcommand line (V8.7 and later)
-OTimeout.queuewarn.normal=timeoutcommand line (V8.7 and later)
-OTimeout.queuewarn.non-urgent=timeoutcommand line (V8.7 and later)
-OTimeout.queuewarn.dsn=timeoutcommand line (V8.13 and later)
define(`confTO_QUEUEWARN_URGENT',`timeout')     ← mc configuration (V8.7 and
later)
define(`confTO_QUEUEWARN_NORMAL',`timeout')     ← mc configuration (V8.7 and
later)
define(`confTO_QUEUEWARN_NONURGENT',`timeout')  ← mc configuration (V8.7 and
later)
define(`confTO_QUEUEWARN_DSN',`timeout')        ← mc configuration (V8.13 and
later)

The defaults for the mc configuration technique are to send a warning for normal mail after four hours.

The keywords urgent, normal, and non-urgent correspond to the Precedence: header from the mail message. When the numeric equivalent of the Precedence: header as translated from the P line of the configuration file (see Precedence on page 1148) is negative, the message is classified as non-urgent. When it is greater than zero, the message is classified as urgent. Otherwise, it is normal.

As of V8.7, a Priority: header is also available (see Priority: on page 1161) to specify the message priority and thereby bypass the need to set the value using the Precedence: header:

Priority: urgent
Priority: normal
Priority: non-urgent

There is currently no way to specify a Priority: header’s value from the sendmail command line.

Beginning with V8.13, it is possible to set a separate wait for DSN (bounce) messages using the dsn keyword. One handy use for this would be to prevent warnings from being sent for DSN mail. You can do this by setting the warning timeout to be greater than the return timeout for regular mail:

define(`confTO_QUEUERETURN',  `5d')
define(`confTO_QUEUEWARN_DSN', `7d')

Here, normal mail will be returned (bounced) after five days, but because DSN mail won’t issue a warning until after seven days, no warnings will be sent.

Timeout.quit (V8.6 and later)

When the local sendmail is finished and wishes to break the connection, it sends the SMTP QUIT command:

QUIT

The other side acknowledges, and the connection is terminated:

221 2.0.0 there.dc.gov delivering mail

The time the local sendmail waits for acknowledgment of the QUIT command is defined with the quit keyword, the forms of which are as follows:

O Timeout.quit=timeoutconfiguration file (V8.6 and later)
-OTimeout.quit=timeoutcommand line (V8.6 and later)
define(`confTO_QUIT', `timeout')    ← mc configuration (V8.6 and later)

The default timeout is two minutes, and no minimum is specified. The mc technique uses confTO_QUIT, for which there is no default.

Timeout.rcpt (V8.6 and later)

After sending the MAIL From: command, the local sendmail issues one RCPT To: command for each envelope recipient. One such RCPT To: line might look like this:

RCPT To:<them@there.dc.gov>

The local sendmail then waits for acknowledgment, which looks like this:

250 2.1.5 <them@there.dc.gov>... Recipient ok

The amount of time that the local sendmail waits for acknowledgment of each RCPT To: command is set with the rcpt keyword. Here are the forms:

O Timeout.rcpt=timeoutconfiguration file (V8.6 and later)
-OTimeout.rcpt=timeoutcommand line (V8.6 and later)
define(`confTO_RCPT', `timeout')      ← mc configuration (V8.6 and later)

The default timeout value is one hour,[429] and the specified minimum is five minutes. The mc technique uses confTO_RCPT, for which there is no default.

Timeout.resolver (V8.10 and later)

The resolver library contains the routines for looking up hostnames and addresses with DNS. Those lookups can sometimes take a long time to complete, either because a host’s name server is slow or down, or because of routing problems. Two timeout-type variables are available to limit how long these DNS lookups can take. One variable specifies the amount of time those routines wait between attempts to get the information. The other specifies the number of times those routines will retry to get the information. Beginning with V8.10 sendmail, the Timeout.resolver option allows you to alter one or the other, or both of these variables.

The Timeout.resolver option is used like this:

O Timeout.resolver.retrans=timeoutconfiguration file (V8.10 and
later)
O Timeout.resolver.retry=numconfiguration file (V8.10 and
later)
-OTimeout.resolver.retrans=timeoutcommand line (V8.10 and later)
-OTimeout.resolver.retry=numcommand line (V8.10 and later)
define(`confTO_RESOLVER_RETRANS', `timeout')   ← mc configuration (V8.10 and
later)
define(`confTO_RESOLVER_RETRY', `num')         ← mc configuration (V8.10 and
later)

Here, timeout sets the amount of time to wait between retries before a retransmission. The default is defined by your system’s resolver library. A good recommended value is 5s (for five seconds).

The num is the number of retries allowed before giving up. The default is defined by your system’s resolver library. A good recommended value is 4.

In addition to these gross adjustments, you can also differentiate between a first DNS lookup and subsequent DNS lookups. The first time a message is tried for delivery, you might want to set the retransmission and retry limits very low to screen out hard-to-deliver sites. Then for all the following (normal) tries, you can set those limits high so that all subsequent tries will likely succeed. You differentiate between the two by appending either a .first or a .normal suffix to retrans or retry:

O Timeout.resolver.retrans.first=timeoutconfiguration file (V8.10
and later)
O Timeout.resolver.retrans.normal=timeoutconfiguration file (V8.10
and later)
O Timeout.resolver.retry.first=numconfiguration file (V8.10
and later)
O Timeout.resolver.retry.normal=numconfiguration file (V8.10
and later)
-OTimeout.resolver.retrans.first=timeoutcommand line (V8.10 and
later)
-OTimeout.resolver.retrans.normal=timeoutcommand line (V8.10 and
later)
-OTimeout.resolver.retry.first=numcommand line (V8.10 and
later)
-OTimeout.resolver.retry.normal=numcommand line (V8.10 and
later)
define(`confTO_RESOLVER_RETRANS_FIRST', `timeout')    ← mc configuration (V8.10 and
later)
define(`confTO_RESOLVER_RETRANS_NORMAL', `timeout')   ← mc configuration (V8.10 and
later)
define(`confTO_RESOLVER_RETRY_FIRST', `num')          ← mc configuration (V8.10 and
later)
define(`confTO_RESOLVER_RETRY_NORMAL', `num')         ← mc configuration (V8.10 and
later)

Here, timeout could be short—say, 2s for the first try, and a more relaxed 10s for all subsequent delivery attempts. The num could similarly be fewer—say, 2 for the first try, and a more relaxed 5 for all subsequent delivery attempts.

Note that these retry and retrans timeouts can also be set for the dns (dns on page 905) and host (host on page 910) database-map types by using the corresponding -d and -r database-map K configuration command switches.

Timeout.rset (V8.6 and later)

If connection caching is enabled (see the ConnectionCacheSize option, ConnectionCacheSize on page 987), the local sendmail sends an SMTP RSET command to reset the other side. The time the local sendmail waits for acknowledgment of the RSET command is defined with the rset keyword. It looks like this:

O Timeout.rset=timeoutconfiguration file (V8.6 and later)
-OTimeout.rset=timeoutcommand line (V8.6 and later)
define(`confTO_RSET', `timeout')     ← mc configuration (V8.6 and later)

The default timeout is five minutes, and no minimum is specified. The mc technique uses confTO_RSET, for which there is no default.

Timeout.starttls (V8.12 and later)

When sendmail connects to another site, it greets that site with an EHLO command. In return, the other site replies with a list of SMTP extensions it supports:

220 some.other.domain ESMTP service ready
EHLO host.your.domain
250-some.other.domain Pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-STARTTLS                            ← note
250-DSn
250-ETRn
250-DELIVERBY
250 HELP
STARTTLS
220 2.0.0 Ready to start TLS            ← noteTLS negotiation begins here

The local sendmail notes that the other site supports STARTTLS, so the local sendmail uses the STARTTLS command. The local sendmail then waits for the other side to begin the TLS negotiating. The amount of time the local sendmail waits can be limited with this starttls keyword:

O Timeout.starttls=timeoutconfiguration file (V8.12 and later)
-OTimeout.starttls=timeoutcommand line (V8.12 and later)
define(`confTO_STARTTLS', `timeout')    ← mc configuration (V8.12 and later)

The default timeout is one hour, and no minimum is specified. The mc technique uses confTO_STARTTLS, for which there is no default.

TimeZoneSpec

Set time zone All versions

Under System V, Unix processes must look for the local time zone in the environment variable TZ. Because V8.12 and earlier sendmail were often run as a set-user-id root program, it cannot (and should not) trust its environment variables. Consequently, on System V machines it is necessary to use the TimeZoneSpec option to give sendmail the correct time zone information.

The forms for the TimeZoneSpec option are as follows:

O TimeZoneSpec=zoneconfiguration file (V8.7 and later)
-OTimeZoneSpec=zonecommand line (V8.7 and later)
define(`confTIME_ZONE',`zone')   ← mc configuration (V8.7 and later)
Otzoneconfiguration file (deprecated)
-otzonecommand line (deprecated)

Here, the zone is of type string and is usually three arguments in one:[430] the local abbreviation for standard time, the number of hours the local time differs from GMT, and the local abbreviation for daylight-saving time. For example, on the West Coast of the United States, you might declare:

O TimeZoneSpec=PST8PDT

If the entire TimeZoneSpec option is missing, the default is to unset (clear) the TZ environment variable (use the system default). If zone is missing, the default is to import the TZ variable from the environment. If zone is present, the time zone is set to that specified.

The system default varies depending on the operating system. For BSD Unix, it is the value returned by the gettimeofday(3) call. For SysV Unix, it is whatever was compiled into the C library (usually New Jersey time).

For the mc declaration, zone should be either a literal USE_SYSTEM, which causes the entire option to be omitted, or a literal USE_TZ, which causes the option to be declared but the zone to be omitted (thus importing the TZ variable from the calling environment). Otherwise, a time zone declaration is as described earlier:

define(`confTIME_ZONE',`USE_SYSTEM')  ← use system default
#O TimeZoneSpec=                      ← the same

define(`confTIME_ZONE',`USE_TZ')      ← use environment TZ
O TimeZoneSpec=                       ← the same

define(`confTIME_ZONE',`EST5EDT')     ← use EST5EDT
O TimeZoneSpec=EST5EDT                ← the same

The TimeZoneSpec(t) option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

TLSSrvOptions

Tune the server TLS settings V8.12 and later

The behavior of STARTTLS authentication and stream encryption (STARTTLS on page 202) can be tuned with this TLSSrvOptions option. It is used like this:

O TLSSrvOptions=lettersconfiguration file (V8.12 and
later)
-OTLSSrvOptions=letterscommand line (V8.12 and later)
define(`confTLS_SRV_OPTIONS', `letters')      ← mc configuration (V8.12 and later)

Here, letters is a list of one or more key letters, each separated from the next by a comma. The default is to omit this option. As of V8.12, only one key letter is available. It is shown in Table 24-26.

Table 24-26. TLSSrvOptions key letters

Letter

Meaning

V

Turn off the request for a client certificate (V8.12 and later).

The TLSSrvOptions option is not safe. If it is specified from the command line, it can cause sendmail to relinquish its special privileges.

TrustedUser

Alternative to root administration V8.10 and later

Beginning with V8.10, sendmail has two different types of trusted users. There are the traditional trusted users defined by the T configuration command (and the class $=t), who can set the sender address using the -f command-line switch (-f on page 241) without generating warnings, and run newaliases.

A separate TrustedUser option sets the identity of the user who can administer sendmail. If it is set, this user will own database-map files (such as aliases) and the control socket (ControlSocketName on page 990).

The TrustedUser option is set like this:

O TrustedUser=userconfiguration file (V8.10 and later)
-OTrustedUser=usercommand line (V8.10 and later)
define(`confTRUSTED_USER',`user')      ← mc configuration (V8.10 and later)

The user is either a user login name (in which case it will be looked up with the appropriate passwd technique), or an integer (in which case it will be used as is as the uid for this user). If the user is an unknown or is omitted, an error will result:

readcf: option TrustedUser: unknown user bad name

There is no default for this option, and the mc configuration technique leaves it undefined by default. See The TrustedUser option (V8.10 and above) on page 176 for a more complete discussion of this option.

The TrustedUser option is not safe. If it is specified from the command line, it can cause sendmail to relinquish its special privileges.

TryNullMXList

If no best MX record, use A or AAAA V8.1 and later

RFC974 says that when mail is being sent from a host that is an MX record for the receiving host, all MX records of a preference equal to or greater than the sending host must be discarded. In some circumstances, this can leave no usable MX records, and if that is the case, V8 sendmail bases its action on the setting of its TryNullMXList option.

The forms of the TryNullMXList option are as follows:

O TryNullMXList=boolconfiguration file (V8.7 and later)
-OTryNullMXList=boolcommand line (V8.7 and later)
define(`confTRY_NULL_MX_LIST',bool)   ← mc configuration (V8.7 and later)
Owboolconfiguration file (deprecated)
-owboolcommand line (deprecated)

The bool is of type Boolean. If it is false, sendmail bounces the mail message with the following error message:

MX list for otherhost points back to thishost

If bool is true, sendmail looks to see whether the receiving host has an A or AAAA record. If it does, sendmail tries to deliver the mail message directly to that host’s A or AAAA record address. If the host doesn’t have an A or AAAA record, sendmail bounces the message. See Ambiguous MX Records on page 337 for a full discussion of why one setting might be preferable over another. Note that RFC2821 requires that this option be set to false to prevent it from creating unpredictable mail routing. The default with the mc configuration technique is false.

The TryNullMXList option is not safe as of V8.8.4. If it is specified from the command line, it can cause sendmail to relinquish its special privileges.

UnixFromLine

Define the From format All versions

The UnixFromLine option replaces the pre-V8.7 $l macro. It has two functions:

  • It defines the look of the five-character "From" header line needed by UUCP software.

  • It defines the format of the line that is used to separate one message from another in a file of many mail messages.

The forms of the UnixFromLine option and $l macro are as follows:

Dlformatconfiguration file (V8.6 and earlier)
O UnixFromLine=formatconfiguration file (V8.7 and later)
-OUnixFromLine=formatcommand line (V8.7 and later)
define(`confFROM_LINE',`format')   ← mc configuration (V8.7 and later)

The format is of type string. Under V8.6 and earlier, there was no default for format, so the $l macro always had to be defined. Beginning with V8.7, sendmail first checks to see whether the UnixFromLine option was defined and uses that value if it was. Otherwise, it checks to see whether the level of the configuration file is 6 or less. If it is and if the $l macro was defined, it uses that value. Otherwise, it uses the default:

From $g  $d

Here, $g ($g on page 824) holds the sender’s address relative to the recipient, and $d ($d on page 817) holds as its value the current date in Unix ctime(3) format.

The UnixFromLine option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

UnixFromLine in UUCP software

UUCP software requires all messages to begin with a header line that looks like this:

From sender   date  remote from <host>

The sendmail program prefixes such a line to a mail message’s headers if the F=U flag (F=U on page 781) is set for the delivery agent.[431] Prior to V8.7, if the local machine supports UUCP, the $l macro must be supplied with "From“, sender, and date:

DlFrom $g $d

The rest of the information (the remote from <host >) is supplied by sendmail.

UnixFromLine with mail files

Under Unix, in a file of many mail messages, such as a mailbox, lines that begin with the five characters "From" are used to separate one message from another. This is a convention that is not shared by all MUAs. The sendmail program appends mail messages to files under only two circumstances: when saving failed mail to the user’s dead-letter file, and when delivering to a local address that begins with the / character. In appending messages to files, it uses the UnixFromLine ($l) option to define the form of the message separator lines.

For sites that use the Rand MUA (and that do not also use UUCP), the UnixFromLine ($l) option can be defined to be four Ctrl-A characters:

Dl^A^A^A^A
O UnixFromLine=^A^A^A^A

UnsafeGroupWrites

Check unsafe group permissions Deprecated

In processing a ~/.forward file or a :include: file, a question arises when group- or world-write permission is enabled. Should sendmail trust the addresses found in such files? Clearly the answer is “no” when world-write permission is enabled. But what of group-write permission?

Beginning with V8.8 sendmail, the decision of whether to trust group-write permission is left to the UnsafeGroupWrites option, which looks like this:

O UnsafeGroupWrites=boolconfiguration file (V8.8 and later)
-OUnsafeGroupWrites=boolcommand line (V8.8 and later)
define(`confUNSAFE_GROUP_WRITES',bool)   ← mc configuration (V8.7 and later)

The optional argument bool, when missing, defaults to true (check for unsafe group-write permission). If this option is missing entirely, it defaults to false (don’t check for unsafe group-write permission).

With this option set to true, a ~/.forward file or a :include: file with group or world writability will result in one of these four errors being logged:

filename: group writable forward file, marked unsafe
filename: world writable forward file, marked unsafe
filename: group writable include file, marked unsafe
filename: world writable include file, marked unsafe

Any address in the file that is a file or a program will result in a bounce and this message:

Address address is unsafe for mailing to programs
Address address is unsafe for mailing to files

Beginning with V8.10, sendmail uses this option only to set the GroupWritableForwardFileSafe (DontBlameSendmail=GroupWritableForwardFileSafe on page 1015) and GroupWritableIncludeFileSafe (DontBlameSendmail=GroupWritableIncludeFileSafe on page 1016) items in conjunction with the DontBlameSendmail option, and so has been deprecated.

The UnsafeGroupWrites option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

UseErrorsTo

Use Errors-To: for errors V8.1 and later

Ordinarily, V8 sendmail sends notification of failed mail to the envelope sender. It specifically does not send notification to the addresses listed in the Errors-To: header. It does this because the Errors-To: header violates RFC1123. For additional information about the Errors-To: header, see Errors-To: on page 1156.

The UseErrorsTo option is available to prevent older versions of mail-reading software from failing. When set, it allows error notification to be sent to the address listed in the Errors-To: header in addition to that sent to the envelope sender.

The forms of the UseErrorsTo option are as follows:

O UseErrorsTo=boolconfiguration file (V8.7 and later)
-OUseErrorsTo=boolcommand line (V8.7 and later)
define(`confUSE_ERRORS_TO',bool)   ← mc configuration (V8.7 and later)
Olboolconfiguration file (deprecated)
-olboolcommand line (deprecated)

The optional argument bool, when missing, defaults to true (errors are sent to the Errors-To: header). If this option is missing entirely, it defaults to false (the Errors-To: header is ignored).

The UseErrorsTo option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

UseMSP

Run as a mail submission program V8.12 and later

Beginning with V8.12, sendmail distinguishes between running as a listening daemon (or queue processor), and running as a mail submission program (The submit.cf File on page 66). This UseMSP option tells sendmail whether to run as a mail submission program. It looks like this:

O UseMSP=boolconfiguration file (V8.12 and later)
-OUseMSP=boolcommand line (V8.12 and later)
define(`confUSE_MSP',`bool')    ← mc configuration (V8.12 and later)

The bool is of type Boolean. If it is true, sendmail runs as a mail submission program. If it is false, or if the entire option is omitted, sendmail does not run as a mail submission program. In the default setup, the sendmail.cf file has this option undefined, and the submit.cf file has it defined. This option should never be defined in the sendmail.cf file.

When sendmail is run as a mail submission program, it runs under the uid of the user that ran it. If that user is root, and if the RunAsUser option (RunAsUser on page 1083) was defined in the submit.cf file, sendmail becomes that user. Otherwise, it remains root.

One effect of defining this option to true is to allow group-writable queue files, but only if the group of the queue directory is the same as that of a set-group-id sendmail binary.

The UseMSP option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

UserDatabaseSpec

Specify user database V8.1 and later

V8 sendmail, if compiled with USERDB defined (USERDB on page 150), can use a special, internally understood database called the User Database. Addresses that are defined in the User Database can be looked up and modified after aliasing but before the processing of the user’s ~/.forward file.

The workings of this database are described in userdb on page 942. The UserDatabaseSpec option defines the name and location of the file containing this User Database information.

The forms of the UserDatabaseSpec option are as follows:

O UserDatabaseSpec=path,...configuration file (V8.7 and later)
-OUserDatabaseSpec=path,...command line (V8.7 and later)
define(`confUSERDB_SPEC',``path,...'')   ← mc configuration (V8.7 and later)
OUpath,...configuration file (deprecated)
-oUpath,...command line (deprecated)

The argument path, . . . is of type string and is a comma-[432] or space-separated list of elements. Those elements can be database pathnames, or other information as described next. If path, . . . is missing or if the entire option is missing, the User Database is not used. Otherwise, the User Database is used, and each database is accessed in turn, leftmost to rightmost, in the list of paths. There is no default for the mc technique.

The elements of path, . . . can be either pathnames of files or other methods of lookup, depending on the first character of each:

/

A leading slash causes the element to be interpreted as a pathname; for example, /etc/mail/userdb.

@

A leading @ causes a copy of the message for each user to be forwarded to a specified host. The assumption is that the other host is in a better position to perform user database lookups. Such a declaration looks like @dbhost.our.domain. Note that this form of declaration must be last in the list that constitutes path, . . . because it always succeeds.

h

Beginning with V8.7, a leading h or H causes sendmail to perform a case-insensitive comparison of the path to the string hesiod. If they match, user database inquiries are looked up via Hesiod services.

For example, the following declares two user databases. The /etc/mail/userdb database is used first. If the entry is not found in that database, it will be forwarded to the host mail.here.us for handling there:

O UserDatabaseSpec=/etc/mail/userdb,@mail.here.us

Any leading character other than those shown here causes an error message to be printed and that particular path, . . . element to be ignored:

Unknown UDB spec badpath

If UDB_DEFAULT_SPEC is defined when sendmail is compiled (UDB_DEFAULT_SPEC on page 149), that value becomes the default if the UserDatabaseSpec option is missing. If UDB_DEFAULT_SPEC is undefined, the default becomes NULL and no User Database lookups are performed.

The UserDatabaseSpec option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

Verbose

Run in verbose mode All versions

The sendmail program offers a verbose mode of operation. In this “blow-by-blow” mode, a description of all the sendmail program’s actions is printed to the standard output. This mode is valuable in running sendmail interactively but must not be used when running in daemon mode. Consequently, you should never set this option in the sendmail.cf file. Instead, you should set it from the command line using the -v command-line switch.

After the sendmail.cf file is parsed and the command-line arguments have been processed, sendmail checks to see whether it is in verbose mode. If it is, it sets the HoldExpensive option (don’t connect to expensive mailers, HoldExpensive on page 1036) to false and sets the DeliveryMode option (DeliveryMode on page 1004) to interactive.

The forms of the Verbose option are as follows:

-v                ← command-line shorthand
O Verbose=boolconfiguration file (V8.7 and later)
-OVerbose=boolcommand line (V8.7 and later)
Ovboolconfiguration file (deprecated)
-ovboolcommand line (deprecated)

The argument bool is of type Boolean. If it is missing, the default value is true (be verbose). If the entire option is missing, the default value is false (be quiet).

Note that setting restrictexpand (PrivacyOptions=restrictexpand (V8.12 and later) on page 1069), with the PrivacyOptions option, disables this Verbose option.

The Verbose option is safe. When it is specified from the command line, sendmail retains its special privileges. Note that the Verbose option should never be set in the configuration file.

XscriptFileBufferSize

Set xf file buffered I/O limit V8.10 and later

It is possible to buffer xf files in memory,[433] and to not flush those files to disk until they exceed a specified size limit. That maximum buffered size limit is specified with this XscriptFileBufferSize option:

O XscriptFileBufferSize=limitconfiguration file (V8.10 and later)
-OXscriptFileBufferSize=limitcommand line (V8.10 and later)
define(`confXF_BUFFER_SIZE',limit)        ← mc configuration (V8.10 and later)

Here, limit is of type numeric. If limit is less than or equal to zero, no buffering is performed (all xf files are immediately placed on disk when opened). When limit is greater than zero, all xf files are held in memory (not placed on disk when opened), until the amount of data buffered exceeds limit. Only then is the file created and placed on disk.

Buffered file I/O is beneficial for use with the xf files. They are usually empty (because most mail succeeds), and creating and removing them from disk can impede performance. At risk is only the loss of some bounced-mail error information.

The default if the XscriptFileBufferSize option is not declared, or if the limit is omitted, is 4,096 bytes. The default for the mc configuration file is to not declare this option.

The XscriptFileBufferSize option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

M

Define a macro Obsolete as of V8.7

The M option is used to set or change a defined macro’s value. Although this option is allowed in the sendmail.cf file, it is intended exclusively for use from the command line. Macros that are defined in the command line will not override the values of those same macros defined in the configuration file.

The forms of the M option are as follows:

OMXvalueconfiguration file (old obsolete form)
-oMXvaluecommand line (old obsolete form)
-MXvaluecommand line (V8.7 and later)
DXvalueboth are equivalent to this in the configuration and mc files

In all four cases, the argument value is of type string. The value is assigned to the macro named X. Pre-V8.7 macro names are always a single character. Multicharacter macro names that are available with V8.7 are described in Chapter 21 on page 784.

One example of the usefulness of this option concerns the rmail(8) program. Suppose a machine is used for networked mail. Ordinarily, the $r macro is given the value “ESMTP” to signify that mail is received over the network. But for UUCP mail, the $r macro should be given the value “UUCP.” One way to effect such a change is to arrange for rmail(8) to invoke sendmail with a command-line argument of:

-oMrUUCP

In this command line, the -o switch tells sendmail to define a macro (the M) whose name is r to have the text UUCP as its new value.[434] This new value overrides whatever value $r might have been given in the configuration file. The M option should be approached with caution. If you later upgrade your sendmail program and install a new configuration file, you might find that the names of macros aren’t what you expect. Previous command-line assumptions about macro names can suddenly break.

The M option is safe in assigning values only to the $r and $s macros. For all other macros it is unsafe and, if specified from the command line, can cause sendmail to relinquish its special privileges. Pre-V8 SunOS sendmail was an exception in that it considered this option safe for all macros. Note that the M option should never be used in the configuration file (instead use the D configuration command).



[357] * These comments do not mean that you should change options by editing your configuration file directly. Never edit your sendmail.cf file!

[358] * If the short option name is a space, sendmail presumes that the option name will be a multicharacter one.

[359] * With any of the modern utilities such as tcsh(1), ksh(1), or emacs(1), repetition might not require this shorthand.

[360] * Some mc macros use the define m4 directive, whereas others don’t require that directive. Those that don’t are suffixed with parentheses in the table.

[361] * Beginning with V8.6 sendmail, it also knows the location of its default pid file.

[362] * Beginning with V8.7, a switched-services file (ServiceSwitchFile on page 1088) can cause aliases to be found in NIS or other services and can completely ignore alias files altogether.

[363] * Also see Duplicate Entries and Automation on page 477, which illustrates the -A option switch for appending keys.

[364] * Or simplified, depending on whom you talk to.

[365] * Actually, the error reflects what was entered. If you entered “EhlO” the error would be “EhlO requires a domain name.”

[366] * On your system, the command might be ssl instead.

[367] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[368] * Secure Sockets Layer (SSLv2/v3) available from http://www.openssl.org.

[369] The directory that contains certificate revocation lists is found in your openssl.cnf configuration file and is generally defined as <ssl-base-dir>/crl/.

[370] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[371] If you depended on the old behavior where Family and family both worked, rebuild sendmail with the Build-time macro _FFR_DPO_CS defined. Note that beginning with V8.15, Addr, Family, Listen, Modifier, Name, and SendBufferSize will become case-insensitive, all the others will remain case-sensitive.

[372] * Names did not work prior to V8.8 sendmail.

[373] * With V8.10 and V8.11, this option could be used only on systems that defined the confSTDIOTYPE build macro (confSTDIOTYPE on page 98) as torek.

[374] * V8 is more security-conscious than earlier versions, and presumes that it is still root even if it has given up that privilege.

[375] * In essence, the g and u options have been deprecated in favor of a single DefaultUser option, which sets both.

[376] * Naturally you should check first to see whether any other software is using the identity you chose. Many software packages, for example, presume that one less than nobody is available for use.

[377] * A sending program (MUA) might need to use background mode on the command line if the message is urgent and if the default in sendmail’s configuration file is to queue all messages (with q mode).

[378] * Or by any other network-oriented program, such as FTP or a web browser.

[379] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[380] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[381] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[382] * If name services are enabled by defining NAMED_BIND (NAMED_BIND on page 124) when sendmail is built.

[383] * This DontProbeInterfaces option was originally added for performance reasons. Sites that had a huge number of interface aliases found that the cost of reading them all (and then doing reverse lookups on each) became excessively time-consuming.

[384] This file used to be called /etc/sendmail.cw.

[385] * Also see how route addresses are handled in rules in Handling Routing Addresses on page 693 and the F=d delivery agent flag in F=d on page 769.

[386] * A boundary is used only for multipart messages.

[387] Also see the $=q class ($=q on page 874) for a way to require quoted-printable encoding.

[388] * According to Eric Allman, “Dubious, someone bugged me for it; I forget why.”

[389] * That is, if it is in an unsafe directory, or if the file itself is unsafe or doesn’t exist. See the discussions under the DontBlameSendmail option, specifically DontBlameSendmail=DontWarnForwardFileInUnsafeDirPath (V8.10 and later) on page 1012, DontBlameSendmail=ForwardFileInGroupWritableDirPath on page 1013, and DontBlameSendmail=GroupWritableForwardFileSafe on page 1015.

[390] * That is, if it is in a safe directory, and if the file itself is safe. See the discussions under the DontBlameSendmail option, specifically DontBlameSendmail=HelpFileInUnsafeDirPath on page 1016.

[391] * Also, status information from previous queue runs is lost.

[392] * Note that the pre-V8 organization differs and is not covered in this book.

[393] * V8.7.3 sendmail was released with the LogLevel (L) option set as not safe.

[394] * The IP transport protocol also has the concept of hops. A message going from one machine to another has only one mail hop but can have many IP hops.

[395] Actually, any header that is marked with an H_TRACE flag (H_TRACE Header Flag (V5 and Later) on page 1142) is counted.

[396] * There is no guarantee that the size specified is accurate.

[397] * For the sake of simplicity, we presume in this example that the two queue groups have been internally assigned by sendmail to be two workgroups. We also presume that the Interval= for each is the same.

[398] * Prior to V8.12.5, this command produced a core dump.

[399] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[400] When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[401] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[402] When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[403] * Note that the PID file is written after the -d0.10 output, so prior to V8.12.7, the macro will not be displayed as expanded in that output.

[404] * The name Postmaster is case-insensitive. That is, POSTMASTER, Postmaster, postmaster, and even PoStMaStEr are all equivalent.

[405] Note that adoption of RFC1648, titled Postmaster Convention for X.400 Operations, has extended this concept to include hosts addressed as user@host.domain that are really X.400 sites masquerading as Internet sites.

[406] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[407] * The check_etrn rule set can do much more than this too.

[408] * The check_expn rule set can do much more than this too.

[409] The check_vrfy rule set can do much more than this too.

[410] * Of course, we recommend using full words for clarity.

[411] When there are multiple recipients, the host is taken from the first recipient in the list. If that recipient is successfully delivered but others are deferred, a different recipient will be first in the next queue run. That new first recipient can result in a new host for the sort.

[412] * That is, each message is instantly bounced if it cannot be delivered on the first try.

[413] * See the QueueSortOrder option (QueueSortOrder on page 1073) for alternative ways to sort.

[414] * The sendmail program refuses just SMTP connections. Mail sent with other means, such as UUCP or via standard input, will still be accepted despite a high load. This means that some locally submitted mail will succeed, and other locally submitted mail will fail. That success versus failure is determined by whether that mail is submitted via SMTP.

[415] * You risk lost mail should the machine crash without this updating.

[416] * Through careful tuning and attention to details, you might be able to get a serviceable sendmail system to run non-root. Others have done this, but details are not available as of this writing.

[417] * This is not strictly necessary. Both /archives/admin/log and /admin/log will work equally well. The former, however, is preferred for clarity.

[418] * With additional details in RFC2184, RFC2231, RFC2646, and RFC3033.

[419] * Other operating systems might have service-switch files, but sendmail has not yet been ported to those systems.

[420] * Currently, the list is limited to those shown. Future versions of sendmail might offer others.

[421] * Whenever you upgrade to a new release of sendmail, be certain to also install the corresponding mailstats program. If you don’t, the old mailstats might not be able to read the new statistics file.

[422] * V8 sendmail no longer supports freeze files.

[423] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[424] Note that the defaults are intentionally higher than the recommended minimums. Setting timeouts too low can cause mail to fail unnecessarily.

[425] * Note that you can decrease the system-defined timeout, but you cannot increase it.

[426] Writes by the sending sendmail are timed out on the basis of the DATA_PROGRESS_TIMEOUT macro (DATA_PROGRESS_TIMEOUT on page 110).

[427] * Note that this works only if the remote filesystem is mounted with the intr mount option.

[428] * Because DNS name resolution can time out and retry and can actually take up to five minutes!

[429] * This timeout should be generously long because a recipient might be the name of a mailing list and the other side might take a long time to expand all the names in that list before replying.

[430] * This is actually a convention that is not used by all versions of Unix. Consult your online documentation to find the correct form for your system.

[431] * Prior to V8.7, this behavior was supported only if UGLYUUCP was defined in conf.h when sendmail was compiled.

[432] * When the argument to an m4 define command contains one or more commas, that argument should be enclosed in two single quotes.

[433] * With V8.10 and V8.11, this option could be used only on systems that defined the confSTDIOTYPE build macro (confSTDIOTYPE on page 98) as torek.

[434] * Under V8 sendmail, the $s and $r macros should be assigned values with the -p command-line switch (-p on page 246). Also note that -oM has been deprecated in favor of the new -M command-line switch.