O'Reilly logo

Sendmail, 3rd Edition by Bryan Costales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Command-Line Definitions

Defined sendmail macros can also be declared when sendmail processes its command line, by using either the -M command-line switch or the M option (M). The forms for these command-line declarations are:

-oMXtext              no longer recommended 
-MXtext               preferred as of V8.7

For both forms, the X is the sendmail macro name, which can be single-character or multicharacter (we discuss this soon). The text follows the name and is the value assigned to the macro.

In the first form, the -o switch tells sendmail that this is an option. The M is the name of the option. The M option causes sendmail to use the characters that follow the M as a macro definition. This form still works but might be eliminated in a future version of sendmail.

In the second form, the -M command-line switch causes sendmail to use the characters that follow the M as a macro definition. Beginning with V8.7 sendmail, this is now the preferred form.

Because these forms of definition are a part of the command line, all special characters are interpreted by the shell. Any text that contains shell wildcard or history characters should have each of those special characters prefixed with a backslash:

-MXsurprise!me   /! is special for the C shell

Command-line macros are defined before the configuration file is read and parsed by sendmail. Note that configuration-file macros always override command-line macros. Despite this, command-line definitions can still be useful. Preassigned macros can be given new values, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required