18

I try to setup postfix with smtp authentication. I want to use /etc/shadow as my realm

Unfortunately I get a "generic error" when i try to authenticate

# nc localhost 25
220 mail.foo ESMTP Postfix
AUTH PLAIN _base_64_encoded_user_name_and_password_
535 5.7.8 Error: authentication failed: generic failure

In the mail.warn logfile i get the following entry

Oct  8 10:43:40 mail postfix/smtpd[1060]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Oct  8 10:43:40 mail postfix/smtpd[1060]: warning: SASL authentication failure: Password verification failed
Oct  8 10:43:40 mail postfix/smtpd[1060]: warning: _ip_: SASL PLAIN authentication failed: generic failure

However the sasl setup seems to be fine

$ testsaslauthd -u _user_ -p _pass_
0: OK "Success."

i added smtpd_sasl_auth_enable = yes to the main.cf

This is my smtpd.conf

$ cat /etc/postfix/sasl/smtpd.conf 
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
saslauthd_path: /var/run/saslauthd/mux
autotransition:true

I tried this conf with the last two commands and without.

I'm running debian stable.

How can postfix find and connect to the saslauthd server?

Edit:

I'm not sure whether postfix runs in a chroot The master.cf looks like this: http://pastebin.com/Fz38TcUP

saslauth is located in the sbin

$ which saslauthd
/usr/sbin/saslauthd

The EHLO has this response

EHLO _server_name_
250-_server_name_
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
6
  • Are you running Postfix in chroot?
    – quanta
    Oct 8, 2011 at 11:20
  • Postfix is Running in a chroot. Oct 8, 2011 at 11:33
  • So where is your saslauthd located? What does the EHLO show?
    – mailq
    Oct 8, 2011 at 12:29
  • # which saslauthd /usr/sbin/saslauthd my master.cf looks like this: pastebin.com/Fz38TcUP
    – user97262
    Oct 12, 2011 at 12:47
  • 1
    is /var/run/saslauthd/mux made available in the chroot somehow? If not, there might be your problem. May 19, 2012 at 22:23

2 Answers 2

11

Are you perhaps missing the symlink from /var/run/saslauthd to /var/spool/postfix/var/run/saslauthd?

From my working system:

root@mail:/etc/postfix/sasl# ls -la /var/run/saslauthd
lrwxrwxrwx 1 root root 36 Dec 31  2010 /var/run/saslauthd -> /var/spool/postfix/var/run/saslauthd
10
  • is it normal for an update followed by a restart to remove the symlink? this happens from time to time on ubuntu 16.04
    – Gaia
    Jun 24, 2017 at 20:36
  • 1
    I'm out of ideas, sorry. :-(
    – Paul Gear
    Aug 30, 2017 at 23:41
  • 1
    This blog from 2005 sorted out my similar issue: jimmy.co.at/weblog/2005/12/05/postfix-and-sasl-debian Jun 21, 2019 at 16:24
  • 2
    @MiSHuTka Postfix runs in a chroot jail in /var/spool/postfix, but saslauthd doesn't. So the saslauthd running outside the jail needs to point at the path where postfix expects the saslauthd files to be.
    – Paul Gear
    Feb 4, 2022 at 6:59
  • 2
    @MiSHuTka Note also that nowadays saslauthd is automatically configured to point at the correct place, without the need for a symlink. See OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd" in /etc/default/saslauthd.
    – Paul Gear
    Feb 4, 2022 at 7:00
0

I just had this happen to me following an update and reboot, so it's still an issue (Oct 2023 Debian 11) and @paul-gear's instructions here fixed the underlying issue by restoring the symlink (thanks), but my fail2ban had decided in the meantime that my and my clients' IP's should be banned so our mail clients still couldn't connect. I removed and then re-added the postfix-sasl jail and all was well... i think/hope!

You must log in to answer this question.