Fixing SMTP slowness with QMail
Tagged:  •    •    •  

At some point, an local SMTP server (QMail) responded really slow on connection attempts. There was no traffic between the client and server so it was a bit unclear why it was locked for about 30 seconds until the so-called '220' response.

Google suggested me (indirectly) to disable reverse DNS lookups on the tcpserver (with the -R, -P, -l 'hostname') flags. But that didn't help.

Instead, I adjusted the call made by tcpserver to not call rblsmtpd anymore when new connections are made (this is used for referencing blacklisted servers). This fixed the problem, the SMTP server responded quickly again. I confess I don't really know why this started happening from one day to another.

So:

exec /usr/local/bin/softlimit -m 20000000 \
/usr/local/bin/tcpserver -H -v -P -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/sbin/rblsmtpd -r rbl.example.com \
/var/qmail/bin/qmail-smtpd 2>&1

becomes

exec /usr/local/bin/softlimit -m 20000000 \
/usr/local/bin/tcpserver -H -v -P -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1