Comments in the Header Field

Comments consist of text inside a header field that is intended to give users additional information. Comments are saved internally by sendmail when processing headers, then are restored, but otherwise are not used. Beginning with V8.7 sendmail, the F=c delivery agent flag (F=c on page 768) can be used to prevent restoration of the saved comments.

A comment begins with a left parenthesis and ends with a right parenthesis. Comments can nest. The following lines illustrate a non-nested comment and a comment nested inside another:

(this is a comment)
(text(this is a comment nested inside another)text)

Comments can be split over multiple lines by indenting:

(this is a comment
       split into two lines)
   ↑
   whitespace

A comment (even if nested) separates one atom from another just like a space or a tab does. Therefore, the following produces two atoms rather than one:

Bill(postmaster)Johnson

However, comments inside quoted strings are not special, so the following produces a single atom:

"Bill(postmaster)Johnson"

Parentheses can exist inside of comments only if they are escaped with a backslash:

<root@host.domain> (The happy administrator ;-\))
                                              ↑
                                              note

Balancing special characters

Many of the special characters that are used in the header field and in addresses need to appear in balanced pairs. Table 25-2 shows these characters and the characters needed to balance them. Failure to maintain balance can lead to failed mail. Note that only parentheses can be nested. None of the ...

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.