Modifying cPanel Mailbox Quota Errors “invalid maildirsize file”

My sysadmin email address which server notifications come to started getting emails about a mailbox quota getting close on a cPanel server. I logged into the client’s control panel to increase their mailbox quota, I found the account, doubled the quota and went to save it when I got the following error message:

invalid maildirsize file

While I didn’t actually check the size of the user’s mailbox in file size, which I would have done with:

du -sch /home/username/mail/domain.com/john.smith/*

I would have found that the actual usage was near zero, while cPanel was reporting the mail box usage was over 200mb.

The cause of the invalid maildirsize file error message is a corruption in the maildirsize file – as the error might suggest. It is no longer accurately keeping track of the usage properly. The solution is simple, all you need to do is delete the file and it will rebuild itself without a problem (will occur on new activity like a login or modification of quota).

There are two common ways of deleting it. First is to login to your server via SSH. The follow example applies where the email address is john.smith@domain.com, and the account username is “username”. Substitute the values in bold.

cd /home/username/mail/domain.com/john.smith/
rm -f maildirsize

That’s all there is to it for SSH.

The second method is probably more easier for the laymen, FTP. Login to the account with the primary login details (e.g. username will be the account username [avoid the sub user FTP accounts], and the password the account password). Browse to:

/mail/domain.com/john.smith/
Delete file named maildirsize

Problem solved. The disk usage dropped back to zero and I’ve not received any more annoying emails since, and the quota reset didn’t give me a invalid maildirsize file error message.

Similar Posts:

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: -1 (from 1 vote)
Modifying cPanel Mailbox Quota Errors "invalid maildirsize file", 5.0 out of 5 based on 1 rating
Tags: , , .

4 Responses to Modifying cPanel Mailbox Quota Errors “invalid maildirsize file”

  1. Alex Angelico says:

    Great, it works flawlessly!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Bethany says:

    Works like a charm! Thanks for the tip.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. Brendan says:

    Glad I was able to assist you! Thanks for your feedback!

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. Brilliant, thank you for posting this. Instead of FTP I used cPanel file manager (from the Home Directory) and deleted the file. cPanel Email Accounts then immediately reported the correct, newly created quota, even though I had received the error message earlier when trying to update it. And although there is no maildirsize file any longer, the quota and current usage are reporting correctly… strange but satisfying.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

What are your thoughts?