So i was trying to setup ny SMTP email in a laravel app and it is giving me following error
Swift_TransportException in AuthHandler.php line 181: Failed to authenticate on SMTP server with username “info@domain.com” using 2 possible authenticators
What error do you see in your email logs when trying to authenticate? Those would be located in either /var/log/maillog or /var/log/mail.log, depending on your distribution.
*sorry for late reply…i am not getting any notification about email due to the new cms of virtualmin forums
here are the maillogs
Jan 15 05:14:58 domain postfix/anvil[15641]: statistics: max connection rate 1/60s for (smtp:199.16.156.149) at Jan 15 05:11:33
Jan 15 05:14:58 domain postfix/anvil[15641]: statistics: max connection count 1 for (smtp:199.16.156.149) at Jan 15 05:11:33
Jan 15 05:14:58 domain postfix/anvil[15641]: statistics: max cache size 1 at Jan 15 05:11:33
Jan 15 07:15:49 domain postfix/smtpd[22294]: connect from domain.com [107.1a5.87.13]: SASL LOGIN authentication failed: authentication failure
Jan 15 07:15:53 domain postfix/smtpd[22294]: warning: SASL authentication failure: Password verification failed
Jan 15 07:15:53 domain postfix/smtpd[22294]: warning: domain.com[107.1a5.87.13]: SASL PLAIN authentication failed: authentication failure
Jan 15 07:15:54 domain postfix/smtpd[22294]: lost connection after RSET from domain.com[107.1a5.87.13]
Jan 15 07:15:54 domain postfix/smtpd[22294]: disconnect from domain.pk[107.1a5.87.13]
where domain = user, domain.com = actial domain and 1a5 = actual IP
i don’t know the solution, but here is how you can try to diagnose the problem. Either enable extremely verbose logging in Postfix (see debugging howto http://www.postfix.org/DEBUG_README.html) or use tcpdump on the server to monitor tcp traffic. The idea is to see what login name and password is being transmitted.
The “SASL authentication failure: Password verification failed” error means that there is mismatch between the login/password being transmitted and the one that the SASL process is looking up somewhere. If you can see that the correct login/password is being transmitted (previous paragraph) then the value stored, that is being looked up, is wrong. Or vice versa.
Where is your SASL process looking up the login/password? It’s probably either in /etc/shadow or some other Postfix-specific file. See SASL howto http://www.postfix.org/SASL_README.html for details.
So here is the summary: 1. use postfix verbose logging or tcpdump to figure out what login/password is being transmitted. 2. compare its value with the stored value.
Also, ltrace is really good at letting you see what’s happening inside a running program. Usage: ltrace -p pid. It will show you all the shared library calls, and usually you can tell what strings are being sent to library functions.