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

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

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:

Transcript of session follows.

Out: 220 mx1.example.com ESMTP Postfix
In: EHLO mx2.example.com
Out: 250-mx1.example.com
Out: 250-PIPELINING
Out: 250-SIZE 50000000
Out: 250-VRFY
Out: 250-ETRN
Out: 250-STARTTLS
Out: 250-AUTH PLAIN LOGIN
Out: 250-AUTH=PLAIN LOGIN
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In: MAIL FROM:<> SIZE=17038
Out: 250 2.1.0 Ok
In: RCPT TO: ORCPT=rfc822;someone@example.com
Out: 451 4.3.0 Error: queue file write error
In: DATA
Out: 554 5.5.1 Error: no valid recipients
In: RSET
Out: 250 2.0.0 Ok
In: QUIT
Out: 221 2.0.0 Bye

For other details, see the local mail logfile

In main.cf, try adding:

smtpd_proxy_timeout = 240s

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.