Fixing SMTP timeout issues
I’ve recently been having a problem with my mailserver. I could receive mail fine, but trying to send would frequently time out, whether it was me sending email manually from my mail client or services on the same box as postfix
.
The fact that the problem was limited to SMTP led me to suspect that saslauthd
might be the culprit. A quick squint at man saslauthd later and I spotted an interesting flag:
-n threads Use threads processes for responding to authentication queries. (default: 5) A value of zero will indicate that saslauthd should fork an individual process for each connection. This can solve leaks that occur in some deployments.
I figured it could be worth a shot, so I opened up /etc/default/saslauthd
and zeroed the offending flag:
THREADS=0 |
A quick restart of the daemon later and no more timeouts, so it looks very much like this server is a member of “some deployments”. Given that this is a low tenancy server with only a handful of active mailboxes I don’t see the workaround causing any issues.
“Run your own mailserver”, they said. “It’ll be fun”, they said.
@raymo Aye, it’s a bit nonspecific. I’d dig into it more, but I was more interested in getting it back up and running than a post mortem so I’d have to set up a whole test VM and try to replicate the problem, and I’m lazy so that’s a non starter.