Chapter 12 ■ Building and parsing e-Mail
224
• E-mail is represented as plain ASCII text, using character codes 1 through 127.
• The end-of-line marker is the two-character sequence carriage-return-plus-linefeed (CRLF),
which is the same pair of codes used to advance to the next line on an old teletype machine
and that is still the standard line-ending sequence in Internet protocols today.
• An e-mail consists of headers, a blank line, and then the body.
• Each header is formatted as a case-insensitive name, a colon, and a value, which can stretch to
several lines if the second and subsequent lines of the header are indented with whitespace.
• Because neither Unicode characters nor binary payloads are allowed in plain text, other
standards, which I will explain later in this chapter, provide encodings by which richer
information can be mixed down to plain ASCII text for transmission and storage.
You can read an actual e-mail message, as it arrived in my in box, in Listing 12-1.
Listing 12-1. Real-World E-Mail Message After Delivery Is Complete
X-From-Line: [email protected] Fri Dec 3 04:00:59 1999
Return-Path: [email protected]
Delivered-To: [email protected]
Received: from pele.santafe.edu (pele.santafe.edu [192.12.12.119])
by europa.gtri.gatech.edu (Postfix) with ESMTP id 6C4774809
for [email protected]; Fri, 3 Dec 1999 04:00:58 -0500 (EST)
Received: from aztec.santafe.edu (aztec [192.12.12.49])
by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id CAA27250
for [email protected]; Fri, 3 Dec 1999 02:00:57 -0700 (MST)
Received: (from rms@localhost)
by aztec.santafe.edu (8.9.1b+Sun/8.9.1) id CAA29939;
Fri, 3 Dec 1999 02:00:56 -0700 (MST)
Date: Fri, 3 Dec 1999 02:00:56 -0700 (MST)
Message-Id: [email protected]
X-Authentication-Warning: aztec.santafe.edu: rms set sender to [email protected] using -f
From: Richard Stallman [email protected]
To: [email protected]
In-reply-to: [email protected] (message from Brandon
Craig Rhodes on 02 Dec 1999 00:04:55 -0500)
Subject: Re: Please proofread this license
Reply-To: [email protected]
References: [email protected] [email protected]
Xref: 38-74.clients.speedfactory.net scrapbook:11
Lines: 1
Thanks.
Even though only one line of text body was actually delivered with this message, you can see that it accumulated
quite a bit of additional information during its transmission over the Internet.
Although all of the headers from the From line down might well have been present when the e-mail was
composed, many of the headers above it were probably added at various stages in its transmission history. Each client
and server that handles an e-mail message reserves the right to add additional headers. This means that each e-mail
message accumulates a personal history as it wings its way across the network, which can typically be read by starting
with the last headers and reading upward until you get to the first.
In this case, the e-mail seems to have originated in Santa Fe on a machine named aztec, where its author was
connected directly over the local host internal interface. The aztec machine then used SMTP to forward the message