PDA

View Full Version : [SOLVED] postfix+saslauthd+pam: password verification failed



pgf1234
June 14th, 2016, 03:52 PM
I'm trying to configure postfix to authenticate to pam via saslauthd following the instructions at https://help.ubuntu.com/community/Postfix, but I'm beginning to think postfix is not communicating with saslauthd. When I use testsaslauthd it authenticates without a problem:


testsaslauthd -u testuser -p testpassword
0: OK "Success."


Postfix, though, gives an authentication failure for the same user/password combination:



Jun 14 10:44:38 fs1 postfix/smtpd[21212]: Anonymous TLS connection established from unknown[192.168.236.156]: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: xsasl_cyrus_server_create: SASL service=smtp, realm=(null)
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: name_mask: noanonymous
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: watchdog_pat: 0x7f4c58e08100
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: < unknown[192.168.236.156]: EHLO [192.168.236.156]
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: match_list_match: unknown: no match
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: match_list_match: 192.168.236.156: no match
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-mail.home4now.ca
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-PIPELINING
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-SIZE 10240000
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-VRFY
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-ETRN
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-AUTH DIGEST-MD5 NTLM CRAM-MD5 PLAIN LOGIN
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-AUTH=DIGEST-MD5 NTLM CRAM-MD5 PLAIN LOGIN
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-ENHANCEDSTATUSCODES
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250-8BITMIME
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 250 DSN
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: watchdog_pat: 0x7f4c58e08100
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: < unknown[192.168.236.156]: AUTH PLAIN dGVzdHVzZXIAdGVzdHVzZXIAbGV0bWVpbg==
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: xsasl_cyrus_server_first: sasl_method PLAIN, init_response dGVzdHVzZXIAdGVzdHVzZXIAbGV0bWVpbg==
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: xsasl_cyrus_server_first: decoded initial response testuser
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: warning: SASL authentication failure: Password verification failed
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: warning: unknown[192.168.236.156]: SASL PLAIN authentication failed: authentication failure
Jun 14 10:44:38 fs1 postfix/smtpd[21212]: > unknown[192.168.236.156]: 535 5.7.8 Error: authentication failed: authentication failure


Since it appears to be impossible to tell which path Postfix is going to use to communicate with saslauthd I have tried both of the "usual" paths: /var/run/saslauthd and /var/spool/postfix/var/run/saslauthd. Neither works. I've gone around on this for over a week now. Any useful suggestions would be appreciated. saslfinger output follows:


saslfinger -s
saslfinger - postfix Cyrus sasl configuration Tue Jun 14 10:04:38 EDT 2016
version: 1.0.4
mode: server-side SMTP AUTH


-- basics --
Postfix: 2.9.6
System: Ubuntu 12.04.5 LTS \n \l


-- smtpd is linked to --
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f58bbfc6000)


-- active SMTP AUTH and TLS parameters for smtpd --
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes




-- listing of /usr/lib/sasl2 --
total 36
drwxr-xr-x 2 root root 4096 Jun 9 11:38 .
drwxr-xr-x 97 root root 24576 Jun 9 14:36 ..
-rw-r--r-- 1 root root 1 May 4 2012 berkeley_db.txt


-- listing of /etc/sasl2 --
total 20
drwxr-xr-x 2 root root 4096 May 15 09:32 .
drwxr-xr-x 146 root root 12288 Jun 14 09:06 ..
-rw-r--r-- 1 root root 62 May 15 09:32 smtpd.conf


-- listing of /etc/postfix/sasl --
total 20
drwxr-xr-x 2 root root 4096 Jun 14 09:32 .
drwxr-xr-x 4 root root 4096 Jun 14 09:55 ..
-rw-r----- 1 root root 49 Jun 1 12:11 passwd-old
-rw-r--r-- 1 root root 227 Sep 5 2013 README
-rw-r--r-- 1 root root 62 Jun 14 09:08 smptd.conf








-- content of /etc/sasl2/smtpd.conf --
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level: 5




-- active services in /etc/postfix/master.cf --
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
smtp inet n - - - - smtpd -v
pickup unix n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr unix 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
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
retry 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} ${extension}
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 DIGEST-MD5 NTLM CRAM-MD5 PLAIN LOGIN
250-AUTH=DIGEST-MD5 NTLM CRAM-MD5 PLAIN LOGIN




-- end of saslfinger output --

pgf1234
June 16th, 2016, 02:09 PM
Someone over at the postfix-users list noticed a typo in my configuration. The file

/etc/postfix/sasl/smptd.conf
should have been

/etc/postfix/sasl/smtpd.conf
note the transposed "tp" in the first file name.

Once I corrected this typo it all worked.