0

I have a weird problem on postfix trying to authenticate user/pass saslauthd

relevant lines in mail.log

Feb 14 16:06:21 smswtc postfix/smtpd[3577]: warning: SASL authentication failure: Requested identity not authenticated identity
Feb 14 16:06:21 smswtc postfix/smtpd[3577]: warning: unknown[192.168.10.134]: SASL PLAIN authentication failed: authentication failure

strange thing is (from the strace of the smtpd process of postfix):

read(10, "AUTH PLAIN fXOlcM5hbWLAc21wcABmaVFh\r\n", 4096) = 37
socket(PF_LOCAL, SOCK_STREAM, 0)        = 12
connect(12, {sa_family=AF_LOCAL, sun_path="/var/run/saslauthd/mux"}, 110) >= 0
**writev(12, [{"\0\4user\0\4password\0\4smtp\0\6realm", 26}], 1) = 26
read(12, "\0\2", 2)                     = 2
read(12, "OK", 2)                       = 2**
close(12)                               = 0
sendto(8, "<20>Feb 14 16:04:58 postfix/smtpd[3395]: warning: SASL authentication failure: Requested identity not authenticated identity", 124, MSG_NOSIGNAL, NULL, 0) = 124
sendto(8, "<20>Feb 14 16:04:58 postfix/smtpd[3395]: warning: unknown[192.168.10.134]: SASL PLAIN authentication failed: authentication failure", 131, MSG_NOSIGNAL, NULL, 0) = 131

It really seems that saslauthd answered back OK to postfix !

Also from the saslauthd log (debug)

saslauthd[3169] :do_auth         : auth success: [user=user] [service=smtp] realm="realm"] [mech=shadow]
saslauthd[3169] :do_request      : response: OK

it is also clear that saslauthd autheticated the user. So I don't really understand why postfix complains about SASL Authetication failure (see above postifix mail.log)

conf files:

root@xxx:~# cat /etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN


root@smswtc:~# cat /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = smswtc
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = wtc99.com, localhost, localhost.localdomain, localhost
relayhost = out.alice.sm
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_sasl_local_domain = ""
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
relay_domains = wtc99.com
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972

1 Answers1

3

For SASL authentication PLAIN requires a user name and password, but I can't see it in your /etc/postfix/main.cf. Please try adding it to /etc/postfix/sasl_passwd:

[relayhost.com]:relayPort    UserName@mailDomain:Password

Then run postmap /etc/postfix/sasl_passwd, and add to your /etc/postfix/main.cf the following lines:

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
Alvaro Niño
  • 359
  • 2
  • 6