Headers

Information on message routing is held in message headers. RFC 822 specifies many such headers and does not prohibit new ones being defined. Here, we look at which headers are required, which headers are good ideas, and how to create your own custom headers for use with email parsers.

When you look at an email message, it might seem that the header information is obvious. There are some subtle rules, however. Some headers can only appear in combination with others. Some have rules as to which part of the mail system creates them. As an email programmer, you should have an understanding of how to apply the various rules relating to headers when you are creating your mail-enabled applications.

This section discusses headers in detail. It details the creation of headers, the way in which they must be formed to be legal. Later, it discusses mandatory and optional headers. Dynamic headers (those that should be created only by MTAs) and userdefined headers are also described. The section ends by detailing email address formats, which are given in the address headers To, Reply-To, From, CC, BCC).

Get Programming Internet Email 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.