Syntax of the Configuration-File Macro’s Text

The text of a macro’s value in the configuration file can contain escaped control codes. Control codes are embedded by using a backslash escape notation. The backslash escape notations understood by sendmail are listed in Table 21-2.

Table 21-2. Special characters allowed in macro text

Notation

Placed in text

\b

Backspace character

\f

Formfeed character

\n

Newline character

\r

Carriage-return character

\\

Backslash character

All other escaped characters are taken as is. For example, the notation \X becomes an X, whereas the notation \b is converted to a backspace character (usually a Ctrl-H). For example:

DXO\bc May\, 2003    becomes →  O^Hc May, 2003

Here, the \b is translated into a backspace character (Ctrl-H is shown as ^H) and the \, is translated into a literal comma character.

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, 2003    became →  May

Beginning with V8.8 sendmail, the comma is no longer special in defined sendmail macros.

Quoted text will have the quotation marks stripped. Only double quotation marks are recognized. Multiple parts of text can be quoted, or text can be quoted entirely.

Trailing spaces are automatically stripped. If you need to keep trailing spaces you need to quote them:

DX"2003 "

Leading space characters are retained in text regardless of whether they are quoted. Spaces are harmless, provided that ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.