SASL separates the protocol from the way a user is verified. SMTP, IMAP, LDAP and other protocols only describe how to exchange sign-in data, while the mechanisms (PLAIN, SCRAM-SHA-256, OAUTHBEARER) are attached as interchangeable modules.
Mechanisms
| Mechanism | What it does | TLS required |
|---|---|---|
PLAIN | sends the username and password in clear text (RFC 4616) | yes |
LOGIN | a non-standard variant of PLAIN, needed by some clients, for example Outlook | yes |
SCRAM-SHA-256 | exchanges verification data without sending the password (RFC 7677) | not required |
OAUTHBEARER | sign-in with an OAuth token (RFC 7628) | yes |
RFC 4616 advises not offering PLAIN by default and not using it without a reliably protected channel, usually TLS. In practice, almost everyone therefore uses PLAIN over TLS, and Dovecot enables only that by default and refuses unencrypted clear text.
How it works in SMTP
The client sends AUTH PLAIN with its credentials, and the server replies 235 if the sign-in succeeded or 535 if not. Postfix does not need to check passwords itself: it asks Dovecot through a socket.
smtpd_sasl_type = dovecotsmtpd_sasl_path = private/authsmtpd_sasl_auth_enable = yessmtpd_tls_auth_only = yesA user who has signed in with SASL may send mail to other domains, while the server refuses strangers, otherwise it would be an open relay. The framework is described in RFC 4422 (2006), and the SMTP sign-in extension in RFC 4954.
Sources
the term is written from these pages- RFC 4422 — Simple Authentication and Security Layer (SASL)rfc-editor.org/rfc/rfc4422(opens in a new tab)
- RFC 4616 — The PLAIN Simple Authentication and Security Layer (SASL) Mechanismrfc-editor.org/rfc/rfc4616(opens in a new tab)
- Dovecot — механизмы аутентификации SASLdoc.dovecot.org/main/core/config/auth/mechanisms/overview.html(opens in a new tab)
Verified 9 Nov