49MB mailbox size limit (Postfix & procmail)
by bigpresh on Jul.06, 2007, under Linux, System Administration
Here for future reference more than anything else, and to help anyone who’s Googling for this.
I have my email delivered to a box at home running Postfix, and stored by procmail into mbox mailboxes.
I was finding that, whenever a mailbox file reached about 49MB, procmail would no longer deliver mail into that mailbox, instead dumping it into my main system mailbox.
A look at procmail’s logs would reveal:
procmail: Error while writing to "lists/cpan-testers"
procmail: Truncated file to former size
And sure enough, the file was 49MB:
[davidp@supernova:~/INBOX/lists]$ ls -lh cpan-testers
-rw------- 1 davidp users 49M 2007-07-06 16:42 cpan-testers
[davidp@supernova:~/INBOX/lists]$ ls -l cpan-testers
-rw------- 1 davidp users 51198081 2007-07-06 16:42 cpan-testers
After a bit of Googling, I found that this isn’t due to procmail but due to Postfix’s mailbox_size_limit setting. This limit is enforced via UNIX process limits, hence will apply to procmail or whatever the local delivery agent is.
Checking the default value shows:
[root@supernova:]# postconf -d mailbox_size_limit
mailbox_size_limit = 51200000
Okay… there’s the problem.
Changing it to a stupidly high value:
[root@supernova:]# postconf -ev mailbox_size_limit=99999999999999
Problem solved :)
I found the details I needed at: http://www.security-express.com/archives/postfix/2003-02/2131.html
Hope this helps somebody.
July 15th, 2007 on 6:08 pm
Wow – I’ve been looking to fix this problem (and find the source) forever… thanks for the solution.
Hardest part was finding something in some logs somewhere so I could perform a helpful Google search. Finally stumbled on the procmail logs…
July 16th, 2007 on 12:02 pm
@TheCase:
Glad it was of use to you, and thanks for taking the time to leave a comment :)
August 7th, 2007 on 9:23 pm
Made my day as well. Thank you for posting this!
February 26th, 2008 on 6:36 am
I, too, have been trying to figure this out for ages. Thanks!
February 28th, 2008 on 1:42 pm
It might be worth noting that the -d flag for postconf displays the *default* value always. After changing the setting, if you want to see the currently used setting, you need to using the -n flag instead:
postconf -n mailbox_size_limit
April 6th, 2008 on 6:59 pm
Thank you so much!
April 14th, 2008 on 5:46 pm
Thanks for the page — finding it saved me considerable troubleshooting time on my similar mail setup.
BTW, you can also set mailbox_size_limit to 0, meaning no limit.
Jason.
April 15th, 2008 on 3:19 pm
@Jason:
Glad it was useful to you! Thanks for the comment, and for the hint on setting mailbox_size_limit to zero too!
April 23rd, 2008 on 11:27 am
Many thanks for your help – saved me ages with this tip!
Cheers,
John
June 7th, 2008 on 7:20 am
good job.
really helped me out.
thanks
uli
September 5th, 2008 on 9:37 am
I’m so glad there are still people who unselfish and generously help others.
Thank you very much.
stan
October 16th, 2008 on 9:09 am
Hey,
Thanks a lot.. Faced the same problem this morning, and was wondering what was wrong with procmail. on googling found this post, and it helped.
October 27th, 2008 on 2:41 pm
Thanks! Had the same problem and was errantly looking at procmail as the culprit.
November 3rd, 2008 on 5:04 pm
Thank you… this is this, what the Internet is about… just share with the piece of information and for sure someone will find it useful.
February 4th, 2009 on 5:51 pm
Thank you for posting this tip! It saved me this morning.
February 18th, 2009 on 3:07 am
my hosting company is so good that they fixed it for me in past but I am more than happy to know the procedure myself. Thanks for sharing it.
November 23rd, 2009 on 5:53 pm
Thanks! This problem had been bugging me for a while, I was assuming it was some bizarre procmail limitation and searched the mailing lists in vain. Every few months my spam mbox overflows 50 Mb and then it would deliver them all as if they hadn’t matched the spam rules which was totally obnoxious.
March 11th, 2011 on 11:45 am
Thanks a lot :)
January 10th, 2012 on 9:45 am
Saved my butt. I’ve inherited an ancient mail system that runs procmail, system-wide. LOVE YOU MEEEN! :)
January 6th, 2014 on 3:35 pm
Brilliant!
I’ve just moved to a new email server, and procmail suddenly started to bounce emails back to the sender.
All documentation & support suggested that the inbox had wrong permissions – totally wrong, it was the fact that the inbox had reached 49MB and so postfix (when procmail called it) was denying adding any more email to the inbox.
Sorted now – thanks to this post!
Dean Richardson
iCounsellor.co.uk