mailbourne_core/envelope.rs
1//! # envelope — what the servers read
2//!
3//! During an SMTP conversation, the sender announces `MAIL FROM:<…>` (where
4//! bounces go) and `RCPT TO:<…>` (where to deliver). That pair is the
5//! **envelope**. It is *not* the `From:`/`To:` your mail client shows — those
6//! live inside the [message](crate::message) and may legitimately differ
7//! (that difference is how BCC and mailing lists work).
8
9use crate::address::EmailAddress;
10
11/// The SMTP envelope: return path plus recipients.
12#[derive(Debug, Clone)]
13pub struct Envelope {
14 /// Where failure notices (bounces) should be sent — the `MAIL FROM`.
15 /// SPF is checked against *this* domain, not the visible `From:` header.
16 pub mail_from: EmailAddress,
17 /// Where the message is actually delivered — the `RCPT TO` list.
18 pub rcpt_to: Vec<EmailAddress>,
19}