Managing Mailbox Size

September 14, 2009 Mail Server Basics

There are default mailbox sizes which may lead to mail delivery failure when you go beyond the defaults.  In order to avoid problems you need to understand the difference between mailboxes and virtual_mailboxes as well as know the default sizes and how to adjust them.

Here is the error that you want to avoid:

mailbox /var/spool/vmaill/vmail/1: error

writing message: File too large

Mailbox Size Limit
Default mailbox size is 50 MB.  This means that if your mailbox goes beyond 50 MB, you will need to adjust the default or you will see the error, “File too large”.
The limit for any local mailbox or maildir is 50 MB but,  this can easily be changed with by using this directive in the main.cf file.  Be sure to restart Postfix if you make changes.

mailbox_size_limit=102400000

This changes the mailbox limit to 100 MB.  Or you can make it umlimited by using a “0″.

mailbox_size_limit=0

If you would like to review the current settings on your Postfix server use this command:

postconf -d | grep size
berkeley_db_create_buffer_size = 16777216
berkeley_db_read_buffer_size = 131072
body_checks_size_limit = 51200
bounce_size_limit = 50000
header_size_limit = 102400
mailbox_size_limit = 51200000
message_size_limit = 10240000


Message Size Limit
message_size_limit = 20480000

This is 20 MB.

Virtual Mailbox Limit
Note that the virtual_mailbox_limit is for the virtual accounts not the local accounts which are controlled by mailbox_size_limit.  The default limit is 50 MB or 51200000

virtual_mailbox_limit=0

This is unlimited.

If you are using PHP to send mail you may need to change other parameters  in the /etc/php.ini. Modify those  parameters to a higher value as below:

post_max_size = 30M
upload_max_filesize = 30M

Be sure to use the settings that work for you and recognize that as these limits get larger they may impact more aspects of your server so test them completely.

Tags: , , ,

Comments are closed.