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.
Verify Current Postfix Local Mailbox Size Limit:
- [root@dev ~]# 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
- debug_peer_level = 2
- html_directory = no
- inet_interfaces = localhost
- 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.3.3/README_FILES
- sample_directory = /usr/share/doc/postfix-2.3.3/samples
- sendmail_path = /usr/sbin/sendmail.postfix
- setgid_group = postdrop
- unknown_local_recipient_reject_code = 550
- [root@dev ~]#
As you can see in the output of “postconf -n” above the mailbox size is not noted which means it is configured at the default size of 51200000 bytes or roughly 50MB. Depending on what this server is used for this should typically be plenty of space however on the server used in the example above it is important for us to track all of the mail sent to the root user account and store it locally as well as send it to a remote server for archiving. In the example below the size will change from roughly 50MB of space to roughly 500MB of space for all users mailboxes. This is why it is important to make sure you modify this to the proper size since if this server has a bunch of different user accounts it could eat up disk space rapidly depending on the size of the disks and the number of users.
Modify Postfix Mailbox Size Using postconf:
- [root@dev ~]# postconf -e mailbox_size_limit=512000000
- [root@dev ~]#
There will not be any output when the above command is issued on the Linux server however you can verify the setting change has taken place by issuing the “postconf -n” command again as shown below.
Verify Postfix Mailbox Size Has Changed:
- [root@dev ~]# 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
- debug_peer_level = 2
- html_directory = no
- inet_interfaces = localhost
- mail_owner = postfix
- mailbox_size_limit = 512000000
- 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.3.3/README_FILES
- sample_directory = /usr/share/doc/postfix-2.3.3/samples
- sendmail_path = /usr/sbin/sendmail.postfix
- setgid_group = postdrop
- unknown_local_recipient_reject_code = 550
- [root@dev ~]#
Notice the addition of “mailbox_size_limit = 512000000” to the output. The change should be immediate so no restart of postfix mail server is required.
Thank you
Much appreciated