← Blog/Authentication

SMTP AUTH mechanisms: which one to use and why

October 15, 2026·6 min read·By MailPilot

SMTP AUTH is the extension that lets a client prove who it is before submitting mail. A server advertises the mechanisms it accepts in its EHLO response, and clients pick one. The choice matters less for secrecy — TLS handles that — and more for what kind of credential you are forced to store.

What the server offers

$ openssl s_client -starttls smtp -connect smtp.example.com:587 -crlf
EHLO test.example
250-AUTH PLAIN LOGIN XOAUTH2
250-STARTTLS

Everything in that AUTH list is available to you. Anything not in it will be refused, which is why "my client only supports CRAM-MD5" is a dead end on a modern provider.

The mechanisms, honestly compared

MechanismHow it worksVerdict
PLAINSends username and password base64-encoded in one stepFine inside TLS. Base64 is encoding, not encryption
LOGINSame credentials, two prompts instead of oneFunctionally identical to PLAIN; no security difference
CRAM-MD5Challenge-response; the password is never transmittedObsolete in practice. Requires the server to store a recoverable password, and MD5-based
XOAUTH2 / OAUTHBEARERSends a short-lived OAuth access tokenBest available. Scoped, revocable, expiring

Two conclusions people find surprising:

PLAIN and LOGIN are the same thing. Choosing LOGIN because it sounds more secure buys nothing. Both are safe inside a TLS session and both are catastrophic outside one.

CRAM-MD5 is not an upgrade. Its single advantage — not transmitting the password — is already provided by TLS, and it imposes a real cost: the server must be able to compute the challenge response, which means storing passwords in a recoverable form rather than as salted hashes. That is a worse security posture overall.

Why OAuth is the answer where it is offered

XOAUTH2 presents an access token obtained through an OAuth consent flow. The properties that matter operationally:

  • Scoped. A token can permit sending without permitting a full mailbox export.
  • Revocable per application. Removing one integration does not change a password that five other systems use.
  • Expiring. A leaked access token has a short useful life; a leaked password does not.
  • Governable. On Google Workspace and Microsoft 365, an admin can see and control which applications hold access.

Microsoft has been phasing out basic authentication across Exchange Online, SMTP AUTH included, so for Microsoft 365 the practical answer is increasingly "OAuth or nothing" — check the current state for your tenant rather than assuming password authentication will keep working. On Google, an app password is still possible but requires two-step verification on the account and is a long-lived secret doing a job OAuth does better.

Where app passwords still make sense

A generated app password is the right tool when a client speaks only SMTP and IMAP and has no OAuth support. Rules that keep it from becoming a liability:

  1. One per integration, named after it, so revocation is surgical.
  2. Never in a shared document or a repository. It is mailbox access with no second factor in front of it.
  3. Rotate it when anyone with access leaves.
  4. Prefer OAuth the moment the tool supports it.

Reading an authentication failure

The codes tell you which half is wrong:

ResponseMeaning
530 5.7.0 Authentication requiredYou tried to send before authenticating, or before STARTTLS
535 5.7.8 Authentication credentials invalidWrong username or password, or an account password used where an app password is required
534 5.7.9 Application-specific password requiredThe provider wants a generated credential, not the account password
454 4.7.0 Temporary authentication failureTransient — retry with backoff rather than reconfiguring
504 5.5.4 Unrecognized authentication typeYou offered a mechanism the server does not accept

A 5xx here is permanent: retrying the same credentials in a loop achieves nothing and, on some providers, triggers account protections that make the real problem harder to diagnose.

Authentication is not deliverability

SMTP AUTH proves you may use a server. It says nothing about whether receivers trust your mail. Those are different mechanisms with confusingly similar names:

  • SMTP AUTH — client to server, at submission time.
  • SPF, DKIM, DMARC — domain-level assertions that receivers evaluate after the fact.

A perfectly authenticated session can still deliver mail that fails DMARC alignment and lands in spam. Check both: the session with openssl s_client, and the domain by reading Authentication-Results on a message you actually received elsewhere.

What not to do

  • Do not pick LOGIN over PLAIN for security reasons. There are none.
  • Do not seek out CRAM-MD5. It forces weaker password storage on the server.
  • Do not authenticate over an unencrypted session, whatever the mechanism.
  • Do not reuse one app password across tools.
  • Do not retry a `535` automatically. Fix the credential; loops can lock accounts.
  • Do not assume SMTP AUTH affects placement. It does not; domain authentication does.

How MailPilot helps

MailPilot authenticates over OAuth for Gmail, Google Workspace, Outlook and Microsoft 365, and over SMTP/IMAP for SendGrid, Amazon SES, Mailgun, Postmark and custom hosts where OAuth is unavailable. Connection problems are surfaced at setup rather than mid-warm-up, and the domain-level half — SPF, DKIM and DMARC alignment — is checked separately, alongside per-provider placement measurement and daily reputation tracking.

MailPilot

Ready to reach the inbox every time?

Automated email warmup across real peer mailboxes. Live inbox placement monitoring. Free 7-day trial - no credit card required.

Start free trial
Reach the Inbox, Every Time
Connect unlimited inboxes for warmup. Free 7-day trial, no credit card.
Try for Free
WORKS WITH
OZOHO
inbox placement99.2%
free trial7-day
companies trust us340+

Start for free - no credit card required.

Get started freeBook a demo