SASLAUTHD crashing randomly

Sometimes saslauthd crashes randomly without leaving a trace in the logs. The downside of this is that users can't send emails then and any other service using the daemon for authentication will not authenticate. This was on our CentOS 5 x64 box.

saslauthd uses 5 threads as a default option and gives you the ability to start it with a different number of threads. We changed that number some time ago and until now there haven't been any crashes. Here what the manpage says:

-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.

Now, how do we change that number? Here on a CentOS box:

* open /etc/sysconfig/saslauthd with your editor (e.g. vim, nano etc)
* change the line FLAGS="" to FLAGS="-n 0" and save the file
* now restart the saslauthd service

That resolved our crashes.