#[non_exhaustive]pub enum SmtpOp {
Greeting,
Ehlo,
StartTls,
AuthPlain,
AuthLogin,
AuthXOAuth2,
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).
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.