Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st October 2009, 21:23
jimjxr jimjxr is offline
Junior Member
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default saslauthd auth failure in CentOS postfix/mysql setup

Hi,

I followed the howto to setup postfix/sasl/postfixadmin/mysql on CentOS 5.2, everything works except the auth part, I can use telnet to send email to virtual user in mysql without problem. The only problem is I couldn't do authentication, I got the following error when trying "testsaslauthd -s smtp -u test@mydomain -p mypass -f /var/run/saslauthd/mux":
Quote:
0: NO "authentication failed"
auth.log shows
Quote:
saslauthd[17903]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module

saslauthd[17903]: do_auth : auth failure: [user=test@mydomain] [service=smtp] [realm=mydomain] [mech=pam] [reason=PAM auth error]
I suspect this is because pam is not authenticating against mysql, so I installed pam_mysql, and changed
/etc/pam.d/smtp from
Quote:
#%PAM-1.0
auth include system-auth
account include system-auth
to

Quote:
#%PAM-1.0
auth required pam_mysql.so user=postfix passwd=pass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=3
account sufficient pam_mysql.so user=postfix passwd=pass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=3
and restarted saslauthd. However testsaslauthd still failed, with a slightly different error in auth.log:

Quote:
saslauthd[18048]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
do_auth : auth failure: [user=test@mydomain] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]
Any ideas?

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 22nd October 2009, 06:53
jimjxr jimjxr is offline
Junior Member
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

It's amazing what a good night sleep can do:
1. Enable mysql query logging in /etc/my.cnf
2. Confirmed mysql is being queried when testsaslauthd is run, so pam_mysql is doing its job.
3. Conclusion: password doesn't match is the only explanation.
4. Fix: Check postfixadmin's config.inc.php, $CONF['encrypt'] is set to 'md5crypt', realized this incompatible with pam_mysql's crypt=3, changed it to 'md5', authentication works now!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dovecot Auth. Failure spams Message log d3m0nic Installation/Configuration 4 20th October 2009 19:47
Centos 5.2 + ISPConfig 3 tutorial - Problem with email tanakskool Server Operation 1 3rd June 2009 17:22
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 22:12
Mail server attack princebenin Server Operation 1 19th November 2007 15:02


All times are GMT +2. The time now is 03:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.