Postfix Illegal seek / queue file write mail server error and solution

Most mail servers are tight on resources. The Postfix system is designed to run within a finite memory budget. These limits are imposed on each and every user to avoid resource exhaustion. The idea is pretty simple, keep mail server running under conditions of stress, without making the problem worse.

However some time user sends large attachment and these are rejected by Postfix. The message_size_limit sets the maximal size of a postfix queue file, including envelope information (sender, recipient, etc.). The default is 10240000 bytes. You may see an error message in maillog file:

Sep 21 17:03:53 p5smtp22 postfix/postdrop[528]: warning: uid=2012: Illegal seek
Sep 21 12:03:53 p5smtp22 postfix/sendmail[527]: fatal: reports(2012): queue file write error

Postfix version 2.3 or olders reports “illegal seek” instead of “file too large” error. There are two ways to fix this problem:

  1. First upgrade Postfix to latest stable version such as 2.5
  2. Set message_size_limit parameter

Set message_size_limit

Open /etc/postfix/main.cf config file:
# vi /etc/postfix/main.cf
Set message_size_limit to 20971520 bytes (20 megabytes):
message_size_limit = 20971520
Restart postfix mail server:
# /etc/init.d/postfix restart

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.