Dave Kitabjian <[EMAIL PROTECTED]> wrote:
> 
> It's time for me to understand this stuff clearly once and for all,
> partly so that I can handle spam intelligently and properly.
> 
> I'm unclear on the exact relationships between the following:
> 
> -------------------
> 1) MUA: "From", "To", "Bcc", "Reply Address" fields
> 
> 2) SMTP: "MAIL FROM:" and "RCPT TO:"
> 
> 3) Delivered Message: "To:", "From:", "Reply-To:", "Return-Path:"
> headers. Also, the terms "envelope sender" and "envelope recipient".

SMTP "MAIL FROM:" is the envelope sender, and "RCPT TO:" is the 
envelope recipient.  These are the only things that matter to an MTA;
it doesn't care what addresses are listed in the From: and To: headers in
the message itself.

> From what I currently understand, the MUA fields are (obviously)
> completed by the sender. (Let's assume a common client like Eudora or
> Outlook Express rather than qmail-inject for this discussion).

They are all effectively completed by the sender.  MS-Windows mail clients
may automatically use the contents of the From: header as the envelope
sender, but with many mail programs the user can set the envelope addresses
to whatever he likes.
 
> When connecting to the SMTP server to send the message, the "From" and
> "To" fields are copied by the MUA to become the "From:" and "To:"
> headers of the message. The "From" field is also used in the SMTP
> conversation as the "MAIL FROM:".

Not necessarily.  For example, if the user has QMAILUSER/QMAILHOST set in
their environment, qmail will construct the envelope sender address from those
if injected locally.

> The "Reply-To" header is created by the MUA from either the "Reply
> Address" field, if present, or else the "From" field. The "Return-Path:"
> header is added by the SMTP server based on the "Reply-To" or "From"
> header (?)

Reply-To: is not necessarily, unless you want replies to go to an address
different from the From: address.
 
> -> Question: So, now what do we look at to determine the "envelope
> sender" and "envelope recipient"? Secondly, which of these terms/headers
> is used to determine whom qmail delivers the message to?

With qmail, the envelope sender is preserved in the Return-path: header.
The envelope recipient is preserved in the Delivered-To: header.
 
> Okay, now the message bounces because because it's an evil spam message.
> 
> -> Question: Where does MAILER-DAEMON send the bounce message? To the
> "From:" person? "Reply-To:"?

The Return-Path: header, which is a copy of the envelope sender address.
But since it's spam, it will be one of:

-Empty <>
-Fake/nonexistent <[EMAIL PROTECTED]>
-Real, but an innocent bystander's address <[EMAIL PROTECTED]>

And the bounce will either bounce or be delivered to the innocent bystander.
 
> If I could understand THIS much, I'd be very happy. 

Happy?

Charles 
-- 
-----------------------------------------------------------------------
Charles Cazabon                            <[EMAIL PROTECTED]>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
-----------------------------------------------------------------------

Reply via email to