Envelopes vs. Headers

 < Free Open Study > 



When you send a letter by "snail mail"—the old-fashioned physical delivery method—you write a letter that looks something like this:

 To: Jane Doe     123 Main Street     Springfield, Anystate 99999 Dear Jane, Blah blah blah. . . Your friend, John Q. Public 

You then place the letter in an envelope with Jane's address, and your address—so the postal service can return your letter to you if can't it deliver it for some reason.

Internet mail works much the same. When you send a letter by e-mail you construct a message that looks like this:

 From: "John Q. Public" <jqpublic@isp.example.net> To: "Jane Doe" <jane@doe.example.com> Subject: Blah Blah blah blah. . . -John 

When you hit the Send button on your MUA, either the MUA or the MTA that receives the message constructs an envelope for it. As with snail mail, the envelope contains the recipient's address—which is required for delivering the message, of course—and the sender's address, which might be necessary for notifying the sender that the letter was undeliverable. Unlike snail mail, the Internet mail envelope does not require a stamp.

Because the envelope is constructed automatically for the user, many users don't even realize it exists. They mistakenly believe that the header of the message is the envelope. This belief works fine for simple person-to-person messages such as the one in the previous example, where the envelope is constructed from the header. It fails miserably when that's not the case, such as most spam, messages received from mailing lists, and messages received via Bcc (blind carbon copy).

For example, let's look at message sent with a Bcc header field. The most common implementation of Bcc is for the sending MUA/MTA to strip the Bcc field from the message after adding the addresses listed to the envelope. So, a message that looks like this:

 From: "John Q. Public" <jqpublic@isp.example.net> To: "Jane Doe" <jane@doe.example.com> Bcc: "John Doe" <john@doe.example.com> Subject: Blah Blah blah blah... -John 

when it's submitted by the sender, arrives in both recipients' mailboxes without the Bcc field. This is accomplished by creating an envelope that looks like this:

 Sender:jqpublic@isp.example.net Recipients:jane@doe.example.com, john@doe.example.com 

MTAs have different ways of storing the envelopes of messages in their queues. With qmail, envelope senders are stored under /var/qmail/queue/info, local recipients are stored under /var/qmail/queue/local, and remote recipients are stored under /var/qmail/queue/remote. Messages (header plus body) are stored under /var/qmail/queue/mess.

When messages are sent via SMTP, the MAIL command is used to send the envelope sender, and the RCPT command is used to send envelope recipients. Messages are sent using the DATA command, which must be preceded by the MAIL and RCPT commands.



 < Free Open Study > 



The Qmail Handbook
The qmail Handbook
ISBN: 1893115402
EAN: 2147483647
Year: 2001
Pages: 186
Authors: Dave Sill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net