What the message looks like
535 5.7.8 Error: authentication failed: authentication failureCommon causes
- Wrong password, or the password changed and the client still uses the old one.
- Username in the wrong format: full address instead of local part or the other way round (
auth_username_format). - Gmail/Google Workspace with 2FA: regular password instead of an app password.
- Microsoft 365: SMTP AUTH disabled for the mailbox (there usually shown as 535 5.7.139).
- Dovecot auth socket for Postfix missing or with wrong permissions.
Check
- Show SASL errors from Postfix and Dovecot
- Test the login directly against Dovecot (prompts for the password)
doveadm auth test -x service=smtp info@example.com - Check how Postfix hands auth to SASL
postconf smtpd_sasl_type smtpd_sasl_path smtpd_sasl_auth_enable - Show auth mechanisms and socket in Dovecot
doveconf -n | grep -E 'auth_mechanisms|auth_username_format|unix_listener'
Fix
- Re-enter the password in the client and verify it with
doveadm auth test. - Use the username exactly as the passdb expects it – usually the full address.
- For Google create an app password; for Microsoft 365 enable SMTP AUTH per mailbox or move to OAuth.
- For Postfix set
auth_mechanisms = plain loginand create the socket/var/spool/postfix/private/authwithuser = postfix. - Many 535s from one IP are brute force: enable fail2ban for Postfix SASL.
Typical scenario
After a password change on the mail server, Thunderbird reports '535 5.7.8 authentication failed' on every send, yet IMAP retrieval works. The Postfix log says 'SASL LOGIN authentication failed'. First run doveadm auth test anna@example.com to see whether the new password is valid in the backend. If it is, the fault lies with the client or the SASL link between Postfix and Dovecot, not with the password itself.
FAQ
What is the difference between 535 5.7.8 and 535 5.7.3?
Both report a failed login. 5.7.8 means invalid credentials, 5.7.3 is used by Exchange when authentication is not allowed. The checks are the same.
Why does IMAP work but SMTP fails?
IMAP talks to Dovecot directly, SMTP goes through Postfix and the SASL socket. If the socket is missing or the mechanism differs, only sending breaks.
Why does IMAP work but SMTP does not?
IMAP is checked by Dovecot directly, whereas SMTP AUTH goes through Postfix, which hands the check to Dovecot. If the socket (smtpd_sasl_path) is missing there or the username does not match the login format, only SMTP fails. Clients can also store passwords separately for each protocol.
Why does CRAM-MD5 fail although the password is right?
CRAM-MD5 and similar mechanisms need the password in plain text, or in a matching hash, on the server. If it is stored only as SHA512-CRYPT, the server cannot verify the challenge. PLAIN or LOGIN over TLS avoids the problem.
Can a wrong password on one device lock me out?
Yes. A phone with an old password retries the login regularly. Fail2ban counts that as an attack and eventually bans the IP, even for correct credentials. If everything suddenly hangs, check the ban list first.