OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: SMTP AUTH failure SASL

From: Andreas Winkelmann (mlawinkelmann.de)
Date: Mon Jan 29 2007 - 04:02:34 CST


On Monday 29 January 2007 09:18, Ray Lozano wrote:

> I am having trouble with SMTP AUTH in Postfix on Debian Sarge.
>
> Using 'telnet host.example.com 25' I get "535 5.7.0 Error:
> authentication failed: authentication failure", but I cannot determine
> why.
>
> What leads me to believe something good is happening are the lines
> from syslog that read as follow while trying to authenticate user
> "test":
> Jan 29 01:02:05 host postfix/smtpd[17657]: <
> host.example.com[10.10.10.106]: AUTH PLAIN dGVzdAB0ZXN0AHR1c3RwYXNz
> Jan 29 01:02:05 host postfix/smtpd[17657]: xsasl_cyrus_server_first:
> sasl_method PLAIN, init_response dGVzdAB0ZXN0AHR1c3RwYXNz
> Jan 29 01:02:05 host postfix/smtpd[17657]: xsasl_cyrus_server_first:
> decoded initial response test

$ echo "dGVzdAB0ZXN0AHR1c3RwYXNz"|mimencode -u|hexdump -C
00000000 74 65 73 74 00 74 65 73 74 00 74 75 73 74 70 61 |test.test.tustpa|
00000010 73 73 |ss|
00000012

Ok, username is "test" without Domain-Part.

> -- active SMTP AUTH and TLS parameters for smtpd --
> broken_sasl_auth_clients = yes
> smtpd_sasl_auth_enable = yes
> smtpd_sasl_local_domain = $myhostname

sasldb has four Values for an Entry. userid, realm, Password-Type and the
Password. The lookup happens with username and realm (Password-Type should
always be "userPassword"). If the username has a domain-part this will be
taken for the realm, if not the value from smtpd_sasl_local_domain is used
for the Realm. In your case, the realm in sasldb should match the Value of
smtpd_sasl_local_domain.

Check the contents of sasldb, if Entries exist for your Username and the
Realm. Maybe show the entry for the "test"-User.

I don't see Errors accessing sasldb in your Log, so I think this has to do
with the Lookup (Keys) itself.

> smtpd_sasl_security_options = noanonymous

> -- listing of /usr/lib/sasl2 --
> total 904
> drwxr-xr-x 2 root root 4096 2007-01-20 19:06 .
> drwxr-xr-x 138 root root 53248 2007-01-20 23:09 ..
> -rw-r--r-- 1 root root 13304 2007-01-20 18:47 libanonymous.a
> -rw-r--r-- 1 root root 855 2007-01-20 18:47 libanonymous.la
> -rw-r--r-- 1 root root 12844 2007-01-20 18:47 libanonymous.so
> -rw-r--r-- 1 root root 12844 2007-01-20 18:47 libanonymous.so.2
> -rw-r--r-- 1 root root 12844 2007-01-20 18:47 libanonymous.so.2.0.22
> -rw-r--r-- 1 root root 15502 2007-01-20 18:47 libcrammd5.a
> -rw-r--r-- 1 root root 841 2007-01-20 18:47 libcrammd5.la
> -rw-r--r-- 1 root root 15052 2007-01-20 18:47 libcrammd5.so
> -rw-r--r-- 1 root root 15052 2007-01-20 18:47 libcrammd5.so.2
> -rw-r--r-- 1 root root 15052 2007-01-20 18:47 libcrammd5.so.2.0.22
> -rw-r--r-- 1 root root 46320 2007-01-20 18:47 libdigestmd5.a
> -rw-r--r-- 1 root root 864 2007-01-20 18:47 libdigestmd5.la
> -rw-r--r-- 1 root root 43040 2007-01-20 18:47 libdigestmd5.so
> -rw-r--r-- 1 root root 43040 2007-01-20 18:47 libdigestmd5.so.2
> -rw-r--r-- 1 root root 43040 2007-01-20 18:47 libdigestmd5.so.2.0.22
> -rw-r--r-- 1 root root 13864 2007-01-20 18:47 libldapdb.a
> -rw-r--r-- 1 root root 848 2007-01-20 18:47 libldapdb.la
> -rw-r--r-- 1 root root 14412 2007-01-20 18:47 libldapdb.so
> -rw-r--r-- 1 root root 14412 2007-01-20 18:47 libldapdb.so.2
> -rw-r--r-- 1 root root 14412 2007-01-20 18:47 libldapdb.so.2.0.22
> -rw-r--r-- 1 root root 13482 2007-01-20 18:47 liblogin.a
> -rw-r--r-- 1 root root 835 2007-01-20 18:47 liblogin.la
> -rw-r--r-- 1 root root 13384 2007-01-20 18:47 liblogin.so
> -rw-r--r-- 1 root root 13384 2007-01-20 18:47 liblogin.so.2
> -rw-r--r-- 1 root root 13384 2007-01-20 18:47 liblogin.so.2.0.22
> -rw-r--r-- 1 root root 29300 2007-01-20 18:47 libntlm.a
> -rw-r--r-- 1 root root 829 2007-01-20 18:47 libntlm.la
> -rw-r--r-- 1 root root 28776 2007-01-20 18:47 libntlm.so
> -rw-r--r-- 1 root root 28776 2007-01-20 18:47 libntlm.so.2
> -rw-r--r-- 1 root root 28776 2007-01-20 18:47 libntlm.so.2.0.22
> -rw-r--r-- 1 root root 13818 2007-01-20 18:47 libplain.a
> -rw-r--r-- 1 root root 835 2007-01-20 18:47 libplain.la
> -rw-r--r-- 1 root root 13992 2007-01-20 18:47 libplain.so
> -rw-r--r-- 1 root root 13992 2007-01-20 18:47 libplain.so.2
> -rw-r--r-- 1 root root 13992 2007-01-20 18:47 libplain.so.2.0.22
> -rw-r--r-- 1 root root 21726 2006-12-13 15:26 libsasldb.a
> -rw-r--r-- 1 root root 856 2006-12-13 15:25 libsasldb.la
> -rw-r--r-- 1 root root 17980 2006-12-13 15:26 libsasldb.so
> -rw-r--r-- 1 root root 17980 2006-12-13 15:26 libsasldb.so.2
> -rw-r--r-- 1 root root 17980 2006-12-13 15:26 libsasldb.so.2.0.22
> -rw-r--r-- 1 root root 23576 2007-01-20 18:47 libsql.a
> -rw-r--r-- 1 root root 964 2007-01-20 18:47 libsql.la
> -rw-r--r-- 1 root root 23072 2007-01-20 18:47 libsql.so
> -rw-r--r-- 1 root root 23072 2007-01-20 18:47 libsql.so.2
> -rw-r--r-- 1 root root 23072 2007-01-20 18:47 libsql.so.2.0.22

> ?--------- ? ? ? ? ? /usr/lib/sasl2/sasl2

This looks strange. But I don't think this has something to do with the
Problem.

> -- content of /etc/postfix/sasl/smtpd.conf --
> log_level: 7
> pwcheck_method: auxprop
> mech_list: plain login digest-md5 cram-md5
> # auxiliary Plugin parameters
> auxprop_plugin: sasldb
>
> -- active services in /etc/postfix/master.cf --
> # service type private unpriv chroot wakeup maxproc command + args
> # (yes) (yes) (yes) (never) (100)
> smtp inet n - n - - smtpd -v
> pickup fifo n - - 60 1 pickup
> cleanup unix n - - - 0 cleanup
> qmgr fifo n - n 300 1 qmgr
> tlsmgr unix - - - 1000? 1 tlsmgr
> rewrite unix - - - - - trivial-rewrite
> bounce unix - - - - 0 bounce
> defer unix - - - - 0 bounce
> trace unix - - - - 0 bounce
> verify unix - - - - 1 verify
> flush unix n - - 1000? 0 flush
> proxymap unix - - n - - proxymap
> smtp unix - - - - - smtp
> relay unix - - - - - smtp
> -o fallback_relay=
> showq unix n - - - - showq
> error unix - - - - - error
> discard unix - - - - - discard
> local unix - n n - - local
> virtual unix - n n - - virtual
> lmtp unix - - - - - lmtp
> anvil unix - - - - 1 anvil
> scache unix - - - - 1 scache
> maildrop unix - n n - - pipe
> flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
> uucp unix - n n - - pipe
> flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
> ($recipient) ifmail unix - n n - - pipe
> flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
> bsmtp unix - n n - - pipe
> flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender
> $recipient scalemail-backend unix - n n - 2
> pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
> ${nexthop} ${user} ${extensi
> on}
> mailman unix - n n - - pipe
> flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
> ${nexthop} ${user}
>
> -- mechanisms on localhost --
> 250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5
> 250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5
>
> ------------ END OF OUTPUT OF saslfinger -s -----------------

--
        Andreas