“Error: queue file write error” with Postfix and Amavis

If you’re using Postfix and Amavis, you may be seeing “Error: queue file write error”, especially with larger than usually email rates. Here is what you can do to get rid of them.

If you’re getting too many of such messages:

In main.cf, try adding:

The default setting is 100s, so if there is not enough CPU, RAM, or disk IO in your system, this setting might help. Note however that if your traffic rates are more or less the same over time and you’re seeing these messages, it may be the time to upgrade or fine-tune your system.