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, then the new.
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.
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=argumentbeginning with V8.7
uppercase
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
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,[3] you might find it handy to use an abbreviation:
[3] With any of the modern utilities such as tcsh(1), ksh(1), or emacs(1), repetition might not require this shorthand.
% /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 previous 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.
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.
Option name |
§ |
Description |
|
---|---|---|---|
IgnoreDots |
(i) |
IgnoreDots |
Ignore dots. If you need to use this option, use the -i command-line switch (see IgnoreDots) to set it. |
(no long name) |
(M) |
M |
Define a macro. Use the D configuration command instead (see Section 21.3). |
Verbose |
(v) |
Verbose |
Run in verbose mode. Instead use the -v command-line switch (see -v). |
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.
Option name |
§ |
Description |
|
---|---|---|---|
AllowBogusHELO |
AllowBogusHELO |
Allow no-host with HELO or EHLO |
|
BadRcptThrottle |
BadRcptThrottle |
Slow excess bad RCPT TO: commands |
|
CheckpointInterval |
(C) |
CheckpointInterval |
Checkpoint the queue |
ColonOkInAddr |
ColonOkInAddr |
Allow colons in addresses |
|
DefaultCharSet |
DefaultCharSet |
Define Content-Type: character set |
|
DeliveryMode |
(d) |
DeliveryMode |
Set delivery mode |
DialDelay |
DialDelay |
Delay after connect failure |
|
EightBitMode |
(8) |
EightBitMode |
How to convert MIME input |
ErrorMode |
(e) |
ErrorMode |
Specify mode of error handling |
IgnoreDots |
(i) |
IgnoreDots |
Ignore leading dots in messages |
LogLevel |
(L) |
LogLevel |
Set (increase) logging level[4] |
MaxQueueRunSize |
MaxQueueRunSize |
Maximum queue messages processed |
|
MaxRecipientsPerMessage |
MaxRecipientsPerMessage |
Maximum recipients per envelope |
|
MeToo |
(m) |
MeToo |
Send to me too |
MinFreeBlocks |
(b) |
MinFreeBlocks |
Define minimum free disk blocks |
MinQueueAge |
MinQueueAge |
Skip queue file if too young |
|
NoRecipientAction |
NoRecipientAction |
How to handle no recipients in header |
|
OldStyleHeaders |
(o) |
OldStyleHeaders |
Allow spaces in recipient lists |
PrivacyOptions |
(p) |
PrivacyOptions |
Increase privacy of the daemon |
QueueSortOrder |
QueueSortOrder |
How to presort queue |
|
SendMimeErrors |
(j) |
SendMimeErrors |
Return MIME format errors |
SevenBitInput |
(7) |
SevenBitInput |
Force 7-bit input |
SingleLineFromHeader |
SingleLineFromHeader |
Strip newlines from From: headers |
|
SuperSafe |
(s) |
SuperSafe |
Queue everything just in case |
Verbose |
(v) |
Verbose |
Run in verbose mode |
[4] 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.