Your questions have been answered well, and you seem to have a good
handle on the situation, but here's a message I sent to the
majordomo-users list last year that explains the relationship between
message headers, bodies, and envelopes.

----

This is a long explanation, but if you're not an SMTP guru it's
probably worth reading.

SMTP is kind of like snail mail in that you have a letter (message)
inside an envelope. The letter has the addresses of the sender and
recipient(s) (e.g., the To/From/CC header fields) but the envelope has
the true sender/recipient addresses used to deliver the letter. In the
case of SMTP, the envelope addresses are conveyed by the SMTP MAIL
(sender or return path) and RCPT (recipient) commands.

Just like the post office uses the envelope addresses to control
delivery or return undeliverable letters, so SMTP uses its envelope
addresses. If a message can't be delivered to one of the recipients, a 
bounce message is sent to the sender (return path).

Let's look at some typical scenarios.

Case 1: User-to-user

User A sends a message to user B. The From header field is A, the To
header field is B, the envelope return path is A, and the envelope
recipient is B. E.g.:

    (Envelope)
        Sender: A
        Recipient: B

    (Message)
        From: A
        To: B

        body of message

Case 2: User-to-user with BCC

User A sends a message to user B and BCC's user C. The From field is
A, the To field is B, the envelope return path is A, and the envelope
recipients are B and C:

    (Envelope)
        Sender: A
        Recipients: B, C

    (Message)
        From: A
        To: B

        body of message

Case 3: User-to-list

User A sends a message to list LIST. List mail is a little tricky
because the message is first delivered to the mailing list resender,
then forwarded by the resender to the subscribers. The first hop is
like Case 1 except the Recipient/To is the list submission address:

    (Envelope)
        Sender: A
        Recipients: LIST

    (Message)
        From: A
        To: LIST

        body of message

The second hop is like Case 2 except the Recipients are the
subscribers and the Sender is the list owner alias:

    (Envelope)
        Sender: LIST owner
        Recipients: LIST subscribers

    (Message)
        From: A
        To: LIST

        body of message

Note that by setting the Sender on the second hop to the list owner
address, bounces to undeliverable recipients are directed to the list
owner rather than the originator of the message. Of course, some MTA's 
aren't fully SMTP-compliant, and they grab a return address from the
headers.

-Dave

Reply via email to