0

I stuck with not starting saslauthd service after upgrade Ubuntu to 24.04 (it runs along with Virutalmin). So i can't authenticate to smtp (cant send mails, but still can recieve) due to error: 454 4.7.0 Temporary authetnitaction failure: generic failiure

I was trying to run saslauthd service by (systemctl status saslauthd shows service as: inactive (dead)): systemctl start saslauthd ends with timed out:

Job for saslauthd.service failed because a timeout was exceeded.
See "systemctl status saslauthd.service" and "journalctl -xeu saslauthd.service" for details.

during the start process - its create some files in /var/spool/postfix/var/run/saslauthd but after it ends with time out - directory its again empty.

I managed to run saslauthd by command bellow: /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5 and authorization started to work

Also after creating symlink: ln -s /var/spool/postfix/var/run/saslauthd /var/run I can start saslauthd by systemctl start saslauthd and it works.

  • tested with command bellow (also desktop client works):
nc localhost 25
220 ################ ESMTP Postfix (Ubuntu)
AUTH LOGIN
334 VXNlcm5hbWU6
######
334 UGFzc3dvcmQ6
######
235 2.7.0 Authentication successful

Envoirnment:

postfix 3.8.6
saslauthd 2.1.28
Ubuntu 24.04

Postfix 3.8.6 smtp config /etc/postfix/master.cf:

smtp inet n - y - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may

smtps inet n - y - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may -o smtpd_tls_wrappermode=yes

saslauthd 2.1.28 config /etc/default/saslauthd (remove commented lines)

START=yes

DESC="SASL Authentication Daemon"

NAME="saslauthd"

MECHANISMS="pam"

OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

THREADS=5

OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"

1 Answer 1

0

I can't vouch for Virtulmin as I don't use it but what I did notice is that Ubuntu 24.04 uses a correct systemd file for saslauthd compared to 22.04 which used the init file loaded via systemd.

To get it working with Postfix 3.8 in a chroot on Ubuntu 24.04 this is what I did. This might not be what Virtulmin does or expects but it might help you figure it out.

Create /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

Run...

sudo mkdir -p /var/spool/postfix/var/run/saslauthd
sudo chmod 710 /var/spool/postfix/var/run/saslauthd
sudo chown :sasl /var/spool/postfix/var/run/saslauthd
adduser postfix sasl

Create /etc/default/saslauthd-postfix

NAME="saslauthd-postf"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

Create /etc/systemd/system/saslauthd-postfix.service

[Unit]
Description=SASL Authentication Daemon for Postfix
Documentation=man:saslauthd(8)

[Service]
Type=forking
PIDFile=/var/spool/postfix/var/run/saslauthd/saslauthd.pid
EnvironmentFile=/etc/default/saslauthd-postfix
ExecStart=/usr/sbin/saslauthd -a $MECHANISMS $MECH_OPTIONS $OPTIONS -n $THREADS
RuntimeDirectory=saslauthd

[Install]
WantedBy=multi-user.target

Run..

sudo systemctl daemon-reload
sudo systemctl enable saslauthd-postfix.service
sudo systemctl start saslauthd-postfix.service

Obviously you need the relevant postfix configuration in main.cf or master.cf so thats is assumed here - likewise the relevant packages installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .