PDA

View Full Version : SASL SMTP authentication


frosig
16th December 2008, 00:31
Hi,

I have once upon a time followed 'Virtual Users And Domains With Postfix, Courier And MySQL' for Fedora 8, but now I need to use my server to send emails. Unfortunately I am rejected, when I try to log on to the server. Postfix gives me this error:

Dec 15 23:16:10 bilbo postfix/smtpd[16945]: warning: unknown[192.168.0.101]: SASL LOGIN authentication failed: authentication failure


and when I look for the sasl log, I get this:

Dec 15 23:16:58 bilbo saslauthd[14420]: do_auth : auth failure: [user=xxx] [service=smtp] [realm=xxx.xxx] [mech=pam] [reason=PAM auth error]

I have tried to take a look at my log file from mysql, but it does not contain any SQL requests regarding this (or any error), so it seems that saslauthd does not check the login information against my server.

I have double checked the different confoguration files and everything seems to be OK, but I might have missed something. Where should I begin to look?

Thanks,

Rasmus

falko
16th December 2008, 20:00
What's in /etc/pam.d/smtp?

frosig
16th December 2008, 20:33
#%PAM-2.0
auth include system-auth
account include system-auth

falko
17th December 2008, 17:46
What's in /usr/lib/sasl2/smtpd.conf? What's the output of uname -a?
Did you disable SELinux?

frosig
17th December 2008, 20:37
My smtpd.conf looks like this

pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket


and the output from uname -a is

Linux bilbo.froesig.dk 2.6.23.1-49.fc8 #1 SMP Thu Nov 8 22:14:09 EST 2007 x86_64 x86_64 x86_64 GNU/Linux


I have also found this in my log, if it helps

Dec 17 19:23:38 bilbo saslauthd[24125]: pam_unix(smtp:auth): check pass; user unknown
Dec 17 19:23:38 bilbo saslauthd[24125]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Dec 17 19:23:38 bilbo saslauthd[24125]: pam_succeed_if(smtp:auth): error retrieving information about user rasmus


It seems that my domain is not appended to my username, which could explain why it does not work.

Rasmus

frosig
18th December 2008, 01:24
Google has helped me to find a solution to the problem. I have told saslauthd to also include my domain when trying to authenticate by running the service with a -r option.

I still had the problem that pam did not try to look up the users in my database, but I also found a solution to that problem. /etc/pam.d/smtp now looks like this

#%PAM-2.0
#auth include system-auth
#account include system-auth
auth required pam_mysql.so user=XXX passwd=XXX db=mail table=users usercolumn=email passwdcolumn=password crypt=1 md5=1
account sufficient pam_mysql.so user=XXX passwd=XXX db=mail table=users usercolumn=email passwdcolumn=password crypt=1 md5=1


Thanks a lot for your help. It brought me closer to the above solution.

Rasmus

falko
18th December 2008, 14:04
You're on an x86_64 system, so instead of /usr/lib/sasl2/smtpd.conf you must modify /usr/lib64/sasl2/smtpd.conf.