Search code examples
ubuntuamazon-ec2amazon-sespostfix-mtasasl

Amazon EC2 Ubuntu Postfix-SASL Error: No worthy mechs found


I've just migrated our EC2 instance from RHEL to new Ubuntu instance and had to reconfigure our mail system. I've set up Postfix service to relay mails to SES, using postmapped sasl_password DB containing SES credentials, the same as in former system.

But now I've got this error when trying to send mail out via SES:

postfix/smtp[16253]: warning: SASL authentication failure: No worthy mechs found
postfix/smtp[16253]: B8B0541007: SASL authentication failed; cannot authenticate to server email-smtp.us-east-1.amazonaws.com[54.204.36.221]: no mechanism available

The RHEL instance had not have such problem before.

Here is my mail relay config in /etc/postfix/main.cf:

relayhost = [email-smtp.us-east-1.amazonaws.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

I've searched the web and AWS forums but still quite not found any successful solution. I've installed sasl2-bin (Cyrus SASL2), but the results are still the same.

(apt-get could not find cyrus-sasl2-dbg or other Ubuntu packages addressed in topics about this issue)

Any idea please?

Best Regards,

Chakrit W.


Solution

  • Well, I've figured this out. (After trying dpkg-reconfigure postfix without success) It seems I missed this line in /etc/postfix/main.cf configuration:

    smtp_sasl_security_options = noanonymous
    

    Thanks to this reference: http://www.postfix.org/SASL_README.html#client_sasl_policy