I have followed various sets of instructions, most recently this one: https://help.ubuntu.com/community/Postfix. As far as I can tell saslauthd is working:
testsaslauthd -u testuser -p testpassword 0: OK "Success.” Postgres, however, fails to authenticate the user: 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 It does not look like Postgres is communicating with saslauthd. When I run it in debug mode (/usr/sbin/saslauthd -a pam -c -m /var/run/saslauthd -d) I can see activity when I use testsasl, but not when Postgres attempts to authenticate. I have been fighting with this for over a week. I’m pretty sure it is some simple setup or configuration issue, but I’m not seeing it. saslfinger output follows: saslfinger - postfix Cyrus sasl configuration Wed Jun 15 09:38:48 EDT 2016 version: 1.0.4 mode: server-side SMTP AUTH -- basics -- Postfix: 2.9.6 System: Ubuntu 12.04.5 LTS -- smtpd is linked to -- libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f68bb1a3000) -- 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 10:43 .. -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 10:54 .. -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 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 --