When sendmail reads the configuration file, macros that are declared
in that file are assigned values. The configuration-file command that declares
macros begins with the letter
D. There may only
be a single macro command per line.
The form of the
D macro configuration command is:
The symbolic name of the macro (here,
X) is a single-character
or a multicharacter name (see Section 31.4, "Macro Names"):
textsingle-character name X D
textmulticharacter name XXX
This must immediately follow the
D with no intervening
space. The value that is given to the macro is the
consisting of all characters beginning with the first character following
the name and including all characters up to the end of the line.
Any indented lines that follow the definition are joined to
that definition. When joined, the newline and indentation characters
are retained. Consider the following three configuration lines:
DXsometext moretext moretext tabs
These are read and joined by sendmail to form the following
text value for the macro named
\n represents a newline character, and the
\t represents a tab character.
text is missing, the value assigned to the
macro is that of an empty string; that is, a single
byte that has a value of zero.
If both the name and the
text are missing,
the following error is printed, and that
line is ignored:
 Prior to V8 sendmail, a macro whose name was missing was given arbitrary garbage as a value. This caused the sendmail program to crash.
Name required for macro/class
Table 31.2 shows the macro names that must (prior to V8.6) be given values in the configuration file.
|Macro||Description||As of V8.7|
|Section 34.8.65, SmtpGreetingMessage or $e||The SMTP greeting message||The |
|Section 31.10.20||Official canonical hostname||Automatically defined all V8|
|Section 34.8.72, UnixFromLine or $l||UNIX From format||The |
|Section 31.10.26||Name used for error messages||Automatically defined|
|Section 34.8.45, OperatorChars or $o||Delimiter operator characters||The |
|Section 31.10.30, $q||Format of the sender's address||No longer used|
Each of these macros is described at the end of this chapter in Section 31.10. Prior to V8.7, failure to define a required macro could have resulted in unpredictable problems. Beginning with V8.7 sendmail, no macros are required. Some are predefined  for you by sendmail, and others have become options.
 But you still may need to declare an occasional macro in your configuration file to solve unusual problems.
text of a macro's value in the configuration
file may contain escaped control codes.
Control codes are embedded
by using a backslash escape notation. The backslash escape
notations understood by sendmail are listed in
|Notation||Placed in Text|
All other escaped characters are taken as is.
For example, the notation
\X becomes a
\b is converted to a backspace
character (usually a CTRL-H).
DXO\bc May\, 1996 becomes O^Hc May, 1996
\b is translated into a backspace (
character, and the
\, is translated into a lone comma
Note that prior to V8.8, the first comma and all characters following it were stripped from the text unless the comma was quoted or escaped. For example,
DXMay, 1996 becomes May
Beginning with V8.8 sendmail, the comma is no longer special in defined macros.
Leading space characters are retained in
text whether they are quoted
or not. Spaces are harmless provided that the macro
is used only in rules (because spaces are token separators); but
if the macro is used to define other macros, problems can arise.
Dw ourhost DH nlm.nih.gov Dj $w.$H
text of the
$H macros is
used to define the
$j macro. The
$j macro is used in
the HELO SMTP command and in the
line. The value given to
$j by the above is
ourhost. nlm.nih.gov two a space spaces