Header Field Contents

The field of the H configuration command can contain any ASCII characters, including whitespace and newlines that result from joining.[2] For most headers, however, those characters must obey the following rules for grouping:[3]

Atom

In the header field, space characters separate one item from another. Each space-delimited item is further subdivided by specials (described next), into atoms:

smtp       an atom
foo@host   atom special atom
Babe Ruth atom atom

An atom is the smallest unit in a header and cannot contain any control characters. When the field is an address, an atom is the same thing as a token (see Chapter 18).

Specials

The special characters are those used to separate one component of an address from another. They are internally defined as:

( ) < > @ , ; : \ " . [ ]

A special character can be made nonspecial by preceding it with a backslash character. For example:

foo;fum    atom special atom
foo\;fum one atom

The space and tab characters (also called linear-whitespace characters) are also used to separate atoms and can be thought of as specials.

Quoted text

Quotation marks can be used to force multiple items to be treated as a single atom. For example:

Babe Ruth    atom atom
"Babe Ruth" a single atom

Quoted text can contain any characters except for the quotation mark (") and the backslash character (\).

Any text

Some headers, such as Subject: (Subject:), impose minimal rules on the text in the header field. For such headers, atoms, specials, and quotes ...

Get Sendmail, 3rd 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.