#[non_exhaustive]pub enum SmtpOp {
Greeting,
Ehlo,
StartTls,
AuthPlain,
AuthLogin,
AuthXOAuth2,
AuthOAuthBearer,
AuthScramSha256,
MailFrom,
RcptTo,
Data,
Quit,
}Expand description
The SMTP operation that was in progress when an error was observed.
This is the granularity an operator looks for in a log message: “MAIL FROM was rejected” is more useful than “the server returned 550”. Each variant corresponds to one user-visible step of the SMTP state machine.
The enum is non_exhaustive so that future SMTP extensions (e.g.
AUTH XOAUTH2) can add a variant without forcing a major version
bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Greeting
Reading the server’s initial greeting (a 2xx line, typically
220).
Ehlo
EHLO and the capability negotiation that follows.
StartTls
STARTTLS command and the 220 reply that precedes the TLS
handshake (RFC 3207).
AuthPlain
AUTH PLAIN (RFC 4616) initial-response exchange.
AuthLogin
AUTH LOGIN exchange (any of its three round-trips).
AuthXOAuth2
AUTH XOAUTH2 exchange (Google / Microsoft OAuth 2.0 SASL
profile).
AuthOAuthBearer
AUTH OAUTHBEARER exchange (RFC 7628, IETF-standard OAuth 2.0
SASL mechanism).
AuthScramSha256
AUTH SCRAM-SHA-256 exchange (RFC 5802 / RFC 7677). Available
only with the scram-sha-256 cargo feature; the variant
itself is always present for source-compatibility stability.
MailFrom
MAIL FROM:<...> envelope-sender announcement.
RcptTo
RCPT TO:<...> recipient announcement (any of several when the
message has multiple recipients).
Data
The DATA command and the body that follows it.
Quit
QUIT shutdown handshake.