Skip to content

SMTP envelope vs message

In the SMTP protocol, a critical distinction exists between the Envelope and the Message content. The envelope contains the routing information used for mail transmission and delivery, while the message contains the actual data payload, including headers and body, intended for the recipient^[600-developer__smtp.md].

SMTP Envelope

The Envelope functions as the routing instruction set for the Mail Transfer Agent (MTA). It is defined by specific SMTP Commands exchanged during the transaction^[600-developer__smtp.md].

  • MAIL FROM: Specifies the envelope sender. This address indicates who is sending the mail and is used by the server for routing and bounce handling^[600-developer__smtp.md].
  • RCPT TO: Specifies the envelope recipient. This command tells the server where to deliver the message and can be executed multiple times to handle multiple recipients^[600-developer__smtp.md].

Crucially, the envelope sender and recipient defined by these commands can be different from the sender and recipient addresses listed inside the message headers^[600-developer__smtp.md].

Message Content

The Message is the actual data payload transmitted after the DATA command is issued^[600-developer__smtp.md]. It consists of: 1. Headers: Metadata such as Subject, Date, Content-Type, and From/To. 2. Body: The primary text or HTML content of the email^[600-developer__smtp.md].

The To and From addresses visible in an email client are part of this message content, not the envelope^[600-developer__smtp.md]. They are primarily for display purposes and do not necessarily dictate the actual transmission path.

Key Differences

The primary functional difference is that the Envelope controls where the email is sent (routing), while the Message controls what the email looks like (display)^[600-developer__smtp.md].

  • Discrepancy: Because MAIL FROM and RCPT TO (Envelope) can differ from the From and To headers (Message), it is possible for an email to display one recipient but be delivered to another, or to display a sender address that differs from the actual return path^[600-developer__smtp.md].
  • Bounces: If delivery fails, the MTA uses the envelope sender (MAIL FROM) to send a Non-Delivery Report (NDR) back to the sender, ignoring the From header in the message body^[600-developer__smtp.md].
  • [[SMTP]]
  • [[Mail Transfer Agent]]
  • [[Bounce address]]

Sources

^[600-developer__smtp.md]