sendmail

sendmailSearch this book
Previous: 33.8 Alphabetized ReferenceChapter 34Next: 34.2 Configuration-File Options
 

34. Options

Contents:
Command-Line Options
Configuration-File Options
Configuring with V8 m4 Options
Alphabetical Table of All Options
Option Argument Types
Interrelating Options
Pitfalls
Alphabetized Reference

Options affect the operation of the sendmail program. [1] Options can be specified in the command line, in the sendmail.cf file, and in a V8 m4 configuration. Among the many behavioral characteristics that can be tuned with options are the following examples:

[1] See Chapter 13, Setting Options, for a tutorial introduction to options.

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. 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.

34.1 Command-Line Options

Beginning with version 8.7 sendmail, command-line options may use multicharacter option names. Prior to version 8.7, only single characters were allowed. We describe the old form first, then the new.

34.1.1 Pre-V8.7 Command-Line Option Declarations

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

-oXargument    <- prior 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). Depending on the option selected, an argument may be required. If that argument is present, it must immediately follow the option name with no intervening space. Only one option may be specified for each -o switch.

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

34.1.2 V8.7 Multicharacter Options in the Command Line

Beginning with version 8.7, option names may be single-character or multicharacter. Single-character options are declared with the -o (lower case) switch as described above. Multicharacter options are declared with a -O (uppercase) switch:

-OLongName=argument       <- beginning with V8.7
 -^
 uppercase

Space may optionally exist between the -O and the LongName. Space may not exist between the LongName, the =, and the argument unless they are quoted:

-O "LongName = argument"

Only one option may 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/tmp
-Oqueuedirectory=/var/tmp
-OQuEuEdIrEcToRy=/var/tmp

34.1.2.1 Multicharacter name shorthand

Beginning with 8.7, multicharacter names in the command line may 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/lib/sendmail -OQueueDirectory=/var/tmp

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

[2] With any of the modern utilities such as tcsh(1), ksh(1), or emacs(1), repetition may not require this shorthand.

% /usr/lib/sendmail -OQueueDir=/var/tmp
Option QueueDir used as abbreviation for QueueDirectory

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

% /usr/lib/sendmail -OQueue=/var/tmp
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/lib/sendmail -OQueDirectory=/var/tmp
readcf: unknown option name QueDirectory

Although these abbreviations can be handy on command lines, it is vital that you alway 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.

34.1.3 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 34.1.

Table 34.1: Options Inappropriate to the Configuration File
Option NameDescription
ErrorMode(e)Section 34.8.24, ErrorMode (e)

Set error mode. But note that in unusual circumstances it may be useful in a configuration file.

IgnoreDots(i)Section 34.8.32, IgnoreDots (i)

Ignore dots. Use the -OIgnoreDots command line switch (see Section 34.8.32) to set this option.

(M)Section 34.8.77, (M)

Define a macro. Use the D configuration command instead (see Section 31.3, "Configuration File Definitions").

MaxDaemonChildrenSection 34.8.35, MaxDaemonChildren

Set maximum forked children. Although appropriate on the command-line when processing a queue, it should seldom be used in the configuration file.

SingleThreadDeliverySection 34.8.64, SingleThreadDelivery

Set single-threaded delivery. Although appropriate on the command-line when processing a queue, it should seldom be used in the configuration file.

Verbose(v)Section 34.8.76, Verbose

Run in verbose mode. Use the -v command line switch (see Section 36.7.41, -v).

34.1.4 Options that Are Safe

It is common practice to install sendmail so that it runs with root privilege. Security considerations normally require that sendmail give up that privilege 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 root privilege. Those options are called "safe" and are shown in Table 34.2.

Table 34.2: Options That Are Safe
Option NameDescription
AllowBogusHELOSection 34.8.3, AllowBogusHELO

Allow no host with HELO or EHLO

CheckpointInterval(C)Section 34.8.7, CheckpointInterval (C)

Checkpoint the queue

ColonOkInAddrSection 34.8.9, ColonOkInAddr

Allow colons in addresses

DefaultCharSetSection 34.8.14, DefaultCharSet

Define Content-Type: character set

DeliveryMode(d)Section 34.8.16, DeliveryMode (d)

Set delivery mode

EightBitMode(8)Section 34.8.22, EightBitMode (8)

How to convert MIME input

ErrorMode(e)Section 34.8.24

Specify mode for error handling

IgnoreDots(i)Section 34.8.32

Ignore leading dots in messages

LogLevel(L)Section 34.8.33, LogLevel (L)

Set (increase) logging levela

MaxQueueRunSizeSection 34.8.38, MaxQueueRunSize

Maximum queue messages processed

MeToo(m)Section 34.8.39, MeToo (m)

Send to me too

MinFreeBlocks(b)Section 34.8.40, MinFreeBlocks (b)

Define minimum free disk blocks

MinQueueAgeSection 34.8.41, MinQueueAge

Skip queue file if too young

NoRecipientActionSection 34.8.43, NoRecipientAction

Handle no recipients in header

OldStyleHeaders(o)Section 34.8.44, OldStyleHeaders (o)

Allow spaces in recipient lists

PrivacyOptions(p)Section 34.8.47, PrivacyOptions (p)

Increase privacy of the daemon

QueueSortOrderSection 34.8.51, QueueSortOrder

How to pre-sort queue

SendMimeErrors(j)Section 34.8.60, SendMimeErrors (j)

Return MIME format errors

SevenBitInput(7)Section 34.8.62, SevenBitInput (7)

Force 7-bit input

SingleLineFromHeaderSection 34.8.63, SingleLineFromHeader

Strip newlines from From:

SuperSafe(s)Section 34.8.67, SuperSafe (s)

Queue everything just in case

UseErrorsTo(l)Section 34.8.74, UseErrorsTo (l)

Use Errors-To: for errors

Verbose(v)Section 34.8.76

Run in verbose mode

V8.7.3 was accidentally released with the LogLevel (L) option marked as not safe. For example, the AliasFile (A) option (location of the aliases file) is unsafe (and is not in Table 34.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.


Previous: 33.8 Alphabetized ReferencesendmailNext: 34.2 Configuration-File Options
33.8 Alphabetized ReferenceBook Index34.2 Configuration-File Options