Linux Log Error: cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large

When checking the server in the morning, I accidentally found this log error in tail – F/var/log/message,

cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large

Earlier today while looking into an issue on a CentOS Linux server I noticed an error message in the maillog file. The mail server running on this Linux server is Postfix and it appeared to have been complaining of the size of root’s mailbox located at /var/mail/root. When I first started investigating I figured I was going to see root’s mailbox at a size of 1GB or 2GB but I was surprised when looking into the issue that root’s mailbox was only about 48MB in size so at first I thought there might be another problem. After some digging around in /etc/postfix I figured out that Postfix limits the size of local mailboxes to 51200000 bytes or 48.8MB. Below is information on how I discovered the issue as well as how to modify the size that Postfix limits local mailboxes to.
You can use postconf -n to view the relevant configuration information, as follows;

[root@localhost ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

The main reason for this problem is that in the postfix configuration file

mailbox_size_limit = 51200000(50M)

That is, when the size of the user’s corresponding/var/mail/username file cannot exceed 50m, if it exceeds this value, it may be unacceptable to send.


Yes, reset  postfix the corresponding mailbox in the configuration file_size_limit=51200000

If change to mailbox_size_imit = 0, there is no limit


[root@localhost ~]# postconf -e mailbox_size_limit=0

After modifying postfix maincf You need to reload postfix # service # postfix # reload when deafault configuration file is

Similar Posts: