RFC 4954: SMTP Service Extension for Authentication

Defines the SMTP AUTH command and the SASL framework used to authenticate SMTP clients to submission servers.
Alaa
By Alaa
SMTPedia documents email infrastructure end to end: SMTP standards from the RFC archive, delivera...
8 min read Updated Jul 22, 2026 80 views
RFC 4954
SMTP Service Extension for Authentication
Current standard
Domain
SMTP
Published
July 2007
Obsoletes
RFC 2554
SMTP relevance
foundational
↗ Read on rfc-editor.org

What this RFC defines

RFC 4954 defines the SMTP AUTH extension, which allows SMTP clients to authenticate to a submission server before sending mail. It specifies the AUTH command, the list of SASL authentication mechanisms (PLAIN, LOGIN, CRAM-MD5, etc.), and how the authentication exchange proceeds.

Where you see it in practice

When you configure your email client with your email account credentials to send mail, those credentials are verified via SMTP AUTH as defined by RFC 4954. The AUTH PLAIN or AUTH LOGIN exchange your client performs before the MAIL FROM command is the mechanism this RFC defines. ESPs that issue API credentials for SMTP submission (username + password or API key as password) are using the RFC 4954 AUTH extension.

How it connects to other RFCs

RFC 4954 obsoletes RFC 2554 (the original SMTP AUTH specification). It works with RFC 5321 (SMTP base protocol) and RFC 3207 (STARTTLS), since credentials should only be sent over an encrypted connection. RFC 6409 (submission port 587) requires SMTP AUTH for client connections.

Current status

RFC 4954 is the current SMTP AUTH standard, published July 2007. It is implemented by all major MTAs and mail submission servers. The PLAIN and LOGIN mechanisms it supports should only be used over TLS-encrypted connections per RFC 8314.

SMTP authentication mechanisms

RFC 4954 obsoleted RFC 2554 and formalized SMTP AUTH as an ESMTP extension. Clients negotiate authentication by including AUTH in the EHLO exchange; the server advertises supported SASL mechanisms (PLAIN, LOGIN, CRAM-MD5, DIGEST-MD5, XOAUTH2, SCRAM-SHA-256). The client chooses one, sends credentials in the appropriate encoding, and the server accepts or rejects. Once authenticated, the session can send mail even from senders that would normally be blocked (open-relay protection), because the sender has proven identity via password or token.

Which mechanisms to use

PLAIN and LOGIN both transmit the password in Base64, which is trivially decoded; they only provide security when the session is wrapped in TLS via STARTTLS or a dedicated TLS port. CRAM-MD5 and DIGEST-MD5 provide challenge-response with better resistance to interception but are considered legacy. XOAUTH2 is the modern choice for Gmail and Microsoft 365, using OAuth 2.0 tokens instead of passwords. SCRAM-SHA-256 is the current recommendation for password-based authentication, providing salted mutual authentication. Any new implementation should target XOAUTH2 or SCRAM, not the older mechanisms.

Where you see AUTH in practice

SMTP AUTH is what makes port 587 (message submission) work. Every email client that sends mail on your behalf, from Thunderbird to Apple Mail to the Gmail app, authenticates via SMTP AUTH before transmitting. On the server side, Postfix uses Dovecot SASL or Cyrus SASL to authenticate against a user database; Exim has its own authenticator framework. If SMTP AUTH fails or is misconfigured, users see “550 authentication required” or “535 authentication failed” errors, both of which trace back to RFC 4954 semantics.

Quick Reference

RFC 4954 (July 2007) defines the SMTP AUTH service extension: how clients authenticate to servers during SMTP submission. Advertised as AUTH in EHLO response with a space-separated list of supported SASL mechanisms (PLAIN, LOGIN, CRAM-MD5, SCRAM-SHA-1, XOAUTH2, and others). Almost always combined with STARTTLS or implicit TLS to prevent credential interception. Obsoletes RFC 2554. Essential for message submission per RFC 4409 on port 587 and its successor RFC 6409.

RFC 4954 at a glance

AspectDetail
PurposeAuthenticate SMTP clients to servers during submission
AdvertisedAUTH LOGIN PLAIN CRAM-MD5 XOAUTH2 in EHLO response
FrameworkSASL (RFC 4422); RFC 4954 profiles SASL for SMTP
CommandAUTH mechanism [initial-response]
Typical ports587 (submission with STARTTLS), 465 (implicit TLS submission)
Security requirementMust be used over TLS in modern deployments per RFC 8314
PublishedJuly 2007 (obsoletes RFC 2554)

Common SASL mechanisms in SMTP AUTH

MechanismHow it worksSecurityWhere used
PLAINSends base64(NUL + username + NUL + password)Credentials sent in cleartext (base64 is trivially decoded); requires TLSMost common for user-to-server submission
LOGINServer prompts for base64 username, then base64 passwordSame as PLAIN; requires TLSLegacy; widely supported
CRAM-MD5Challenge-response with MD5 HMAC of passwordPassword not sent; MD5 brokenLegacy; use SCRAM instead
SCRAM-SHA-1, SCRAM-SHA-256Salted challenge-response with SHA hashPassword not sent; mutual auth; strongModern replacement for CRAM-MD5
XOAUTH2OAuth 2.0 bearer token instead of passwordStrong; delegated auth via OAuthGmail, Microsoft 365, modern IMAP+SMTP clients
GSSAPIKerberos-based authenticationStrong; ticket-basedEnterprise Kerberos environments
EXTERNALUses TLS client certificate identityStrong; certificate-basedRare; specialized deployments

AUTH PLAIN over TLS: complete dialogue

SMTP submission on port 587 with STARTTLS + AUTH PLAIN S: 220 mail.example.com ESMTP C: EHLO client.example.net S: 250-mail.example.com S: 250-STARTTLS S: 250 SIZE 52428800 C: STARTTLS S: 220 Ready to start TLS <<< TLS handshake >>> C: EHLO client.example.net S: 250-mail.example.com S: 250-SIZE 52428800 S: 250-AUTH LOGIN PLAIN S: 250 8BITMIME C: AUTH PLAIN AGFsaWNlAHNlY3JldFBhc3N3b3JkMTIz S: 235 2.7.0 Authentication successful C: MAIL FROM:<alice@example.com> S: 250 2.1.0 Ok …The base64 blob is: NUL + “alice” + NUL + “secretPassword123” Sent over TLS-encrypted channel, safe from eavesdropping.

Response codes specific to SMTP AUTH

CodeMeaningTypical cause
235 2.7.0Authentication successfulCredentials verified
334Server challenge (in mechanism exchange)Multi-step mechanism awaiting client response
432 4.7.12Password transition neededServer requires password change before continuing
454 4.7.0Temporary authentication failureAuth backend unavailable; retry
500 5.5.6Authentication exchange line too longMalformed AUTH exchange
530 5.7.0Authentication requiredServer requires AUTH before MAIL FROM; client didn’t authenticate
534 5.7.9Authentication mechanism too weakServer refuses PLAIN or LOGIN without TLS
535 5.7.8Authentication credentials invalidWrong username or password
538 5.7.11Encryption required for requested mechanismClient tried AUTH before STARTTLS

Common SMTP AUTH deployment mistakes

Advertising PLAIN or LOGIN without TLS. Both mechanisms transmit credentials in effectively cleartext (base64 is trivially reversed). Advertising them over an unencrypted connection lets any network observer capture credentials. RFC 4954 section 4 says SHOULD NOT offer these mechanisms without a security layer. Fix: only advertise cleartext-equivalent mechanisms after STARTTLS or when implicit TLS is in use.
Allowing AUTH on port 25 for relay. Historically port 25 was cleartext; enabling AUTH there is dangerous. Modern practice is: port 25 is server-to-server only, no AUTH offered. Client submission goes to port 587 (with STARTTLS) or 465 (implicit TLS) per RFC 8314. Postfix, Exchange, and other MTAs support this split via distinct configuration for the two channels.
Confusing MAIL FROM address with AUTH identity. The authenticated user (from AUTH) and the envelope sender (MAIL FROM) can differ. RFC 4954 supports this via the AUTH= parameter on MAIL FROM (trusted third-party submission). Restricting MAIL FROM to match the authenticated user is a policy decision, not a protocol requirement. However, allowing arbitrary MAIL FROM after AUTH enables authenticated spam if credentials are compromised; most operators enforce alignment.
Not moving to OAuth for modern clients. Password-based AUTH is increasingly deprecated for consumer mail. Gmail requires OAuth for third-party clients; Microsoft 365 is progressively disabling basic auth. XOAUTH2 replaces the password with a short-lived OAuth bearer token, drastically reducing credential theft impact. New client integrations should target XOAUTH2, not password auth.
Enabling weak mechanisms alongside strong ones. If a server advertises SCRAM-SHA-256 and PLAIN together, most clients will pick PLAIN (simpler, universal). Fix: disable weak mechanisms server-side. If you must support PLAIN for compatibility, only advertise it over TLS; consider client-specific policies (allow PLAIN for legacy clients, require SCRAM or OAuth for modern).
Authentication and submission RFCs
  • RFC 4422: SASL framework
  • RFC 4409: Message Submission (obsolete, replaced by RFC 6409)
  • RFC 6409: Message Submission (current)
  • RFC 8314: Cleartext considered obsolete for submission
  • RFC 3207: STARTTLS (paired with AUTH almost always)
  • RFC 5321: SMTP base protocol
  • RFC 6749: OAuth 2.0 (basis for XOAUTH2)
SMTPedia companion guides

Frequently asked questions

Why do I see “530 5.7.0 authentication required” when trying to send?

The server requires AUTH before accepting MAIL FROM but the client did not authenticate. Common causes: client is sending to port 25 (which typically requires no AUTH but rejects relay) or the client’s authentication step failed silently. Fix: verify the client is configured to submit on port 587 or 465 with valid credentials, and that STARTTLS or implicit TLS is enabled before AUTH.

What is the difference between “535 authentication failed” and “530 authentication required”?

530 means the server demands AUTH but the client did not attempt to authenticate. 535 means the client attempted AUTH but the credentials were rejected (wrong password, disabled account, unknown username). Fix for 530: enable AUTH in the client configuration. Fix for 535: verify username, password, and account state at the server.

Should I still use AUTH PLAIN in 2026?

Yes if paired with TLS; the combination is secure. PLAIN over TLS is functionally equivalent to a POST with a password over HTTPS. The concern is PLAIN without TLS, which leaks credentials to any network observer. If your infrastructure enforces STARTTLS or uses implicit TLS on port 465, PLAIN is fine. That said, moving to OAuth (XOAUTH2) or SCRAM-SHA-256 for new deployments provides additional defense against credential replay and phishing.

Can I use OAuth for SMTP AUTH?

Yes via XOAUTH2. Instead of a password, the client sends an OAuth 2.0 bearer token in the AUTH exchange. Gmail and Microsoft 365 support this and increasingly require it for third-party clients. The token has a short lifetime (typically 1 hour) and can be revoked; even if stolen, its impact is limited compared to a static password. XOAUTH2 is the modern default for consumer mail integrations.

Can the authenticated identity differ from MAIL FROM?

Per RFC 4954, yes. The AUTH= parameter on MAIL FROM lets a trusted submitter identify a different origin identity. Policy usually restricts this: most operators require the authenticated user to own or be permitted to send as the MAIL FROM address. Allowing arbitrary MAIL FROM after AUTH enables authenticated spam if credentials leak; enforcing alignment is a standard hardening step.


About the Author

Alaa - SMTPedia author

Alaa · LinkedIn

Email infrastructure specialist with 8+ years of hands-on experience in SMTP, deliverability, and email verification. I’ve configured and troubleshot mail systems across Postfix, Exchange, and cloud relays, managed IP reputation and warmup campaigns, and built verification pipelines processing millions of addresses. My work spans DNS authentication (SPF, DKIM, DMARC, BIMI), bounce handling, blocklist monitoring, and compliance frameworks including CAN-SPAM and GDPR. I write every article on SMTPedia to give email professionals, developers, and marketers the accurate, RFC-grounded reference they need.


About SMTPedia

SMTPedia is an independent email industry reference covering SMTP, IMAP, POP3, email deliverability, marketing platforms, DNS authentication, and email verification. Every article is researched from official provider documentation, IETF RFCs, and industry best practices. Settings and configurations are verified quarterly.

We are cited as a source by ChatGPT, Microsoft Copilot, and thousands of email professionals worldwide. Learn more about our editorial process.