#[non_exhaustive]pub enum SmtpMessage {
Command {
verb: SmtpCommand,
args: String,
},
Reply {
code: u16,
text: String,
},
Banner {
banner: String,
},
Helo {
domain: String,
esmtp: bool,
},
MailFrom {
address: String,
},
RcptTo {
address: String,
},
Credentials {
mechanism: String,
user: String,
pass: String,
},
TlsUpgrade,
DataBegin,
DataEnd {
bytes: u64,
},
}smtp only.Expand description
One parsed SMTP control-channel message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Command
Command from the client.
Reply
Reply from the server (final-line only for multi-line).
Banner
Server banner — first 220 reply on the responder.
Fields
Helo
EHLO / HELO domain advertised by the client.
MailFrom
MAIL FROM:<addr>. address is the envelope-from
with <> stripped; empty for the null-sender <>.
RcptTo
RCPT TO:<addr>. address is the envelope-recipient
with <> stripped.
Credentials
AUTH credentials. mechanism is "PLAIN" or
"LOGIN". user / pass are base64-decoded; either
may be empty on a malformed exchange.
TlsUpgrade
STARTTLS was accepted (220 reply). After this
event the parser stops draining — pair with
flowscope::tls for the encrypted handshake.
DataBegin
Client sent DATA and got 354 Start mail input.
Following bytes are message body terminated by
\r\n.\r\n.
DataEnd
Message body finished (\r\n.\r\n observed). bytes
is the body length including headers but excluding the
terminator dot line.
Trait Implementations§
Source§impl Clone for SmtpMessage
impl Clone for SmtpMessage
Source§impl Debug for SmtpMessage
impl Debug for SmtpMessage
Source§impl<'de> Deserialize<'de> for SmtpMessage
Available on crate feature serde only.
impl<'de> Deserialize<'de> for SmtpMessage
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SmtpMessage
Source§impl PartialEq for SmtpMessage
impl PartialEq for SmtpMessage
Source§impl Serialize for SmtpMessage
Available on crate feature serde only.
impl Serialize for SmtpMessage
serde only.