
Email Account Disk Usage Issue in cPanel
While checking the email accounts in my cPanel, I noticed that some accounts show incorrect disk usage. Even after deleting all messages and ensuring the inbox is empty, it still reports usage like 5GB, and the values are not updating.
I checked the mailbox through Webmail and confirmed that there were no visible messages.
Then, I manually checked and cleaned the cur
, new
, tmp
, .Trash
, and .Sent
directories inside the mail folder (/home/username/mail/
), restarted cPanel — but nothing changed. The reported disk usage remained the same.
I suspected this could be due to a cPanel configuration issue or a glitch in the scripts that handle disk usage updates for email accounts.
Luckily, the solution is simple — and I’m sharing it here in case it helps others too.
Step-by-Step Solution
Connect to your server using SSH or from the Terminal section of your WHM panel, then run the following command:
/scripts/generate_maildirsize --confirm --allaccounts --verbose CPANELUSERNAME
Important: This command only works if your email system is using maildir
format. It won’t work with mdbox
format.
Replace CPANELUSERNAME
with your actual cPanel username.
If you want to fix all accounts forcefully, use the command below instead:
/scripts/generate_maildirsize --confirm --allaccounts --verbose --force
Related Articles

Common cPanel Errors and Solutions - Part 1

Changing Cpanel Theme and Style
