What the message looks like
postfix/smtp[2314]: warning: SASL authentication failure: No worthy mechs found
postfix/smtp[2314]: 4F1A2B3C4D: SASL authentication failed; cannot authenticate to server smtp.example.com[203.0.113.10]: no mechanism availableCommon causes
- The package with the SASL mechanisms is missing:
libsasl2-modules. That gives “no mechanism available”. - The user name or password in
/etc/postfix/sasl_passwdis wrong, or the file was changed butpostmapwas not run. - The key in
sasl_passwddoes not matchrelayhostexactly, for example the square brackets or the port. - The provider offers login only over TLS, but
smtp_tls_security_levelis not set. smtp_sasl_security_optionsforbids the mechanism the provider offers.
Check
- Is the SASL module package installed?
dpkg -l | grep libsasl2-modules - Relay, SASL and TLS settings
postconf -n | grep -E 'relayhost|smtp_sasl|smtp_tls' - Does the stored key match the relay host?
sudo postmap -q '[smtp.example.com]:587' /etc/postfix/sasl_passwd - What does the log say?
Fix
- Install the modules:
apt install libsasl2-modules. - Set the relay with brackets and the port:
relayhost = [smtp.example.com]:587. - Enable login and TLS:
smtp_sasl_auth_enable = yes,smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd,smtp_sasl_security_options = noanonymous,smtp_tls_security_level = encrypt. - Put
[smtp.example.com]:587 user:passwordinsasl_passwd, thenpostmap /etc/postfix/sasl_passwdandchmod 600 /etc/postfix/sasl_passwd*. - Reload:
postfix reload, and test with a mail.
FAQ
What does “no mechanism available” mean?
Postfix has no usable SASL mechanism for this server. Either the plugin package is missing, or the server offers its mechanisms only after STARTTLS, which Postfix did not start.
How is this different from error 535?
With 535 the server answered and refused the credentials. Here Postfix could not even try.