Mail is consistently the biggest single category of disk usage on a busy cPanel server. Customers underestimate the size of their archive by an order of magnitude. The audit produces the numbers that turn “we need to clean up your mail” from an awkward request into a conversation about specific folders and specific dates.
What’s happening
cPanel mail accounts use Maildir format under /home/<user>/mail/<domain>/<account>. Each message is a file; each folder is a directory. A mailbox grows by message count (which drives inodes) and by per-message size (which drives bytes). Trash, Sent, and Junk folders that never get emptied are the typical culprits.
How to verify
Per-account, per-domain, per-mailbox breakdowns:
du -sh /home/*/mail/* 2>/dev/null | sort -h | tail -20
du -sh /home/<user>/mail/<domain>/* 2>/dev/null | sort -h
find /home/<user>/mail -name 'maildirsize' | head
ls -la /home/<user>/mail/<domain>/<account>/{cur,new,Trash,Junk}
maildirsize files inside the maildir contain cPanel’s accounting. Inspecting them shows what the quota system thinks vs what du reports — divergence here is a quota-cache issue.
The fix
- Produce a server-wide ranking:
du -sh /home/*/mail/* | sort -h | tail -20. Identify the top 5 mailboxes by size. - For each top mailbox, drill into folders:
du -sh /home/<user>/mail/<domain>/<account>/* | sort -h. Show the customer which folders are the bulk — usually Trash, Sent, and one folder named after a former employee. - Have the archival conversation with numbers. “Your
info@mailbox is 18 GB; of that, 14 GB is in Trash going back to 2018.” This is actionable; “you have a lot of mail” is not. - For accounts that exceed reasonable size, propose: empty Trash older than 90 days, archive Sent older than 1 year to a separate IMAP store or local PST/mbox, set Junk auto-expire to 30 days.
- Document the cleanup in the ticket, including the byte recovery, and schedule a follow-up audit in 90 days.
Stack Harbor produces mail-size audits as a routine deliverable under cPanel/WHM management.