checkmailquota

The cPanel account management system used by Birdhouse Hosting has proved to be very complete (though not without its glitches and surprises), and its tools have saved me a ton of work. It’s been nice to not have to write a script for every new piece of functionality needed. But was shocked recently to discover that cPanel doesn’t send alert messages to POP account holders when mailboxes are nearing quota. Started looking for something to fit the bill, didn’t find anything that did the job neatly, so wrote a shell script for cPanel systems.

checkmailquota loops through the home dirs and, for each home, loops through hosted domains. For each domain, loops through mailboxes, recording byte sizes. Compares these sizes to what’s listed in the quota file for that mailbox. If usage is within xx% of quota, sends a warning message to that mailbox. Also sends a summary of accounts near quota to postmaster.

It seems bizarre to me that a script like this, or equivalent functionality, isn’t built into cPanel (at version 10 no less!)

Music: Can :: Ethnological Forgery Series No. 7

3 Replies to “checkmailquota”

  1. Scott, when you say that the postmaster receives a notice, who would that be in a shared hosting environment? The user who manages that particular domain name? I know there are some users who would want this on the shared hosting service that I use, but the admins at the hosting company are not going to want to get quota alerts for all their user acounts. To wit, from the host company forums:

    “Quota alerts are disabled by default on all shared servers. There is no option to enable alerts on a per-domain or per-user basis, as this is a global setting for each server. We disable them as otherwise we’d drown in notices generated to the system administrator (us) every day.”

  2. Hi Michael – postmaster in this case is me. I’m not sure what the quantity of users on your servers is, but in my case, it’s manageable. Point of reference: Birdhouse has about 60 main accounts, and under those a total of about 125 mailboxes scattered over various domains. Out of all those, the email that postmaster gets (which is just ONE message) 4x daily showed 6 accounts near quota. After just 24 hours of running this, I’ve seen those 6 drop to 3. In other words, now that people are getting the message, they’re taking steps to reduce their storage or increase their quotas, and the problem is going away.

    It would be nice to have the individual quota messages also go to the domain adminstrators, but that will be quite a bit more tricky due to the way cPanel stores that information. But it should be do-able.

Leave a Reply

Your email address will not be published. Required fields are marked *