postfix

Webmin postfix SASL failure

 postfix/smtpd[12410]: connect from 
Sep 24 02:10:52 mail postfix/smtpd[12410]: warning: : SASL LOGIN authentication failed: authentication failure
Sep 24 02:10:52 mail postfix/smtpd[12410]: lost connection after AUTH from 
Sep 24 02:10:52 mail postfix/smtpd[12410]: disconnect from  ehlo=1 auth=0/1 commands=1/2

The weirdest errors are those on a fresh system . The type where you expect for everything to just work with the default configs but just my luck, a new installs and email isnt working…

Totroubleshoot it all , Roudcube successfully connects and sends emails when connecting to localhost (as Ropundcube it runs on the same server):

– in /var/log/maillog:

postfix/smtpd[2700]: 9DE0553623CF: client=localhost.localdomain[127.0.0.1], sasl_method=LOGIN, sasl_username=username-domain.tld

Showing that we had a login, but at the same time, external clients are unable to send emails through SMTP. Thunderbird also fails by showing login failure to the SMTP server. Further inspecting the logs reveals to be a SASL authentication issue:

– in /var/log/maillog:
postfix/smtpd[24182]: warning: unknown[]: SASL LOGIN authentication failed: authentication failure

– in /var/log/messages:
saslauthd[21745]: do_auth  : auth failure: [user=username] [service=smtp] [realm=domain.tld] [mech=pam] [reason=PAM auth error]

So clearly an authentication issue with webmin and PAM. Furhter digging reveals the issues is caused by SASL incorrectly handling @ in emails (when logins are set to the username@domain.tld format in Virtualmin). Roundcube works as it replaces @ with in the username.

To solve this, edit /etc/default/saslauthd and in the FLAGS option add a -r:

FLAGS="-n 2 -r"

This will tell saslauthd to properly process username@domain.tld logins.

though others will say add without r https://virtualmin.com/node/53194

Interesting\\ Helpful?
YN

Leave a Reply

Your email address will not be published. Required fields are marked *