Dan's Mail Format Site:
[<== Previous] | [Up] | [Next ==>]
Before getting into specific header lines, here's some general information on the structure of an e-mail message header. I'll also discuss how you go about seeing the headers in their complete, unmodified form; this can be difficult in some programs that go out of their way to hide their users from technical details.
How To See the Headers of a Message
I'll start by describing how to go about viewing e-mail headers; this will be helpful to you in following the
subsequent discussion of header format, by looking at headers of your own messages and seeing what their headers say.
The normal display you see while reading a message shows some headers (usually
Some of the better mail programs make it easy to see a message in its raw form, headers and all. Pegasus Mail, for instance, has a "Raw View" tab in the message viewer:
Mozilla's mail and news reader makes it almost as easy; there's a "Message Source" option in the "View" menu, very similar to the "View Source" feature for Web pages.
In some other programs, though, you've got to work hard to get to the headers. In Microsoft's Outlook, for instance, there's no way to view the complete message in its raw form as you can in Pegasus or Mozilla, but the headers are viewable, hidden at the bottom of the box you get when you right-click on a message in the inbox or a message folder and select "Options...", or when you select "Options..." from the "View" menu while a message is open. Not the most obvious place to put it, and the headers are then stuck in a small, non-resizeable scrolling text field.
Outlook Express, which is actually a totally different program from Outlook despite its name, uses a very different system; there, you need to select "Properties" from the right-click menu (when clicking on a message in a folder) or the "File" menu (when reading a message). There, you select the "Details" tab, and the headers are right there (in a somewhat bigger box than in Outlook), and there's even a button labeled "Message Source..." that lets you see the entire raw message.
In other programs, just look for a "View Source" or "View Headers" or "Full Headers" button, menu item, or configuration mode setting... there's no standardization in what this is named or where it can be found. This site gives instructions for many different programs.
Now that you've (hopefully) figured out how to view headers, or the full raw message source, in your mail reader, here is the structure of a message. This structure was defined in RFC 822, later revised in RFC 2822. (Newsgroup messages follow similar, but slightly different, standards in RFC 1036.)
Header1: Value1 Header2: Value2 Header3: Value3 Body
The headers and the body are separated by a blank line. Line breaks, in the standards for mail transmission, consist of a carriage return followed by a linefeed (CR+LF, or ASCII characters 13 and 10), though they may be converted to the local platform's line break representation (CR alone for MacOS, LF alone for Unix) when the message is displayed or stored.
The header portion consists of a series of fields, one per line, with the field name followed by a colon and the value of the field. In cases where a field is too long to fit on one line, it's possible to "fold" it into multiple lines by adding leading spaces to succeeding lines:
Header4: This is a long value, which wraps into the next line.
The first blank line marks the end of the headers and the beginning of the body, so it's important that no program add a blank line in the middle of the headers. This is a common error by novice programmers trying to write a program or script to generate e-mail messages.
That's basically it (though there are some more complex rules headers need to follow, documented in the above-referenced RFC documents). There are more complexities introduced by multi-part messages (each part of which has its own set of headers), but that will be discussed in the article on MIME headers. The rest of the articles in this section will discuss various specific header fields and their meanings.
Next: The most important headers are the ones that indicate who sent the message, and who it's going to. Those are the ones that are covered in the next article.
[<== Previous] | [Up] | [Next ==>]
This page was first created 22 Jun 2003, and was last modified 16 Apr 2012.