Setting message_size_limit greater than 50 MB causes Postfix fatal error

Oct 19 23:12:06 server2 postfix/qmgr[19009]: E07833C363: from=russell@example.com, size=98965, nrcpt=1 (queue active) Oct 19 23:12:06 server2 postfix/local[19047]: fatal: main.cf configuration error: mailbox_size_limit is smaller than message_size_limit

postconf -n:

[root@server2 log]# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = no command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 header_checks = regexp:/etc/postfix/header_checks home_mailbox = Maildir/ html_directory = no inet_interfaces = all mail_owner = postfix mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 75000000 mydestination = $myhostname, localhost.$mydomain, localhost, localhost.localdomain 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 sender_bcc_maps = hash:/etc/postfix/bcc sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_security_options = noanonymous smtpd_tls_cert_file = /etc/postfix/server.crt smtpd_tls_key_file = /etc/postfix/server.key smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_security_level = may smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual [root@server2 log]#

Cause: It is my understanding that by default Postfix sets mailbox_size_limit to 50 megs:

[root@server2 log]# postconf -d | grep mailbox_size_limit mailbox_size_limit = 51200000 [root@server2 log]#

For some reason Postfix is not paying attention to what the user's quota is that is receiving the messages. The user has a 2 GB quota, but it is still failing:

[root@server2 log]# quota -us russell@example.com Disk quotas for user russell@example.com (uid 503): Filesystem blocks quota limit grace files quota limit grace /dev/xvda 7144 2048M 2048M 230 0 0 [root@server2 log]#

The only way to fix this seems to be to manually set mailbox_size_limit in main.cf to match your message_size_limit, even though a user with a quota larger than mailbox_size_limit / message_size_limit can still receive message up to their normal quota. I tested this by setting both to 5 MB, setting the user's quota to 10 MB, and I was able to send mail past the 5 MB setting for mailbox_size_limit.

EDIT: Upon further investigation of how mailbox_size_limit corresponds with a Maildir setup, it appears that it basically acts the same as message_size_limit. So perhaps mailbox_size_limit should be set to 0 on a default Virtualmin installation to prevent this problem.

Status: 
Closed (fixed)

Comments

I've seen this before when Postfix is setup to deliver to a mbox-format mail file instead of ~/Maildir , which is the Virtualmin default. Are you using Maildir there for inboxes, or an mbox file in /var/mail ?

This is a standard Virtualmin setup with Maildir, and email usernames in user@domain.tld format.

[root@server2 homes]# pwd

/home/texas3006/homes

[root@server2 homes]# ls

new russell tmp

[root@server2 homes]#

[root@server2 homes]# cd russell

[root@server2 russell]# ls

Maildir

[root@server2 russell]#

Did you adjust mailbox_size_limit or message_size_limit manually, or were those settings that Virtualmin made when it was installed? (which is surprising, as it doesn't set mailbox_size_limit or message_size_limit).

I adjusted these manually using postconf -e, as I noticed that the default message_size_limit was only 10 megs. I adjusted it to be 50, and that's when I started noticing the problem with messages no longer being delivered due to message_size_limit being larger than the default mailbox_size_limit of 10 megs.

If you would like you are more than welcome to login to my server and test. This is not really a production box yet. If you want to do that, just let me know how best to provide the login details.

So it looks like the best solution would be for Virtualmin to simply set :

message_size_limit = 0
mailbox_size_limit = 0

at install time, and rely on quotas to limit disk usage..

If you do not want to have a limit on how big incoming messages would be.

I would say myself the best solution would be to have mailbox_size_limit set to 0 at installation, and leave message_size_limit as the default and allow the end user to set it themselves.

Or even better, just build message_size_limit into Postfix's configuration module, and allow them to set it there.

mailbox_size_limit set to 0 makes mailbox_size_limit unlimited, regular disk quotas for the user accounts work just fine as the "mailbox" quota, and message_size_limit can be set to anything.

Sounds good to me .. I'll do this in the next installer version.

You can also change it from within Virtualmin, at Webmin -> Servers -> Postfix Mail Server -> General Resource Control.

Automatically closed -- issue fixed for 2 weeks with no activity.