This morning I got a call from my client with the new mail server. They were getting an error message when trying to send a file with a 7 MB attachment. Since they send and receive a lot of attachments (of which a 7 meg file would be on the small side) this needed to be fixed. The message they were getting indicated and inability to access a mailbox. I skimmed through /var/log/maillog and found this:
Nov 7 10:48:47 postoffice postfix/local: 0671D344040: to=
I was a bit surprised, since I made sure that /etc/postfix/main.cf did not include any limits on email sizes. After some time searching on Google, it looked like the default value for a mailbox size according to Postfix is 51200000 bytes. I wanted it to be unlimited, so I used postconf to explicitly set the value to 0, for no limit, like so...
% postconf –e mailbox_size_limit=0
... then restarted Postfix.
I then tried to send a 12 MB file from my Gmail account to my test account on the box. I got an SMTP 552 error, “Message too large” back from the box. Again, I skimmed the maillog file and this time came across:
Nov 7 15:51:33 postoffice postfix/postdrop: warning: uid=48: File too large
Back to Google, whereupon I learnt that the default max message size for Postfix is 10240000 bytes. To fix it I ran:
% postconf –e message_size_limit=0
Again, I restarted Postfix and then resent my test email. This time it went through.
If you want to view the default settings for all the parameters you can configure in main.cf, use postconf –d. The output of postconf –d | grep size looks like:
[root@foo]# 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
As an aside, since Postfix on this box is started by MailScanner, I restarted the MailScanner daemon to restart Postfix, like this:
% /etc/init.d/MailScanner restart
... which stops the inbound and outbound Postfix queus then starts them again.