Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default checkmailquota - script to alert POP/IMAP users near quota

    After very nearly losing a key customer who lost a lot of important mail when his POP account went over quota, I've been looking for something that would send email alerts to POP account holders when their mailboxes are near quota, and summaries of accounts near quota to the hostmaster. Didn't find anything that seemed to do the job neatly, so wrote a shell script for cPanel systems, available here:

    http://hosting.birdhouse.org/scripts/checkmailquota.txt

    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. At end of script, sends a summary of accounts near quota to postmaster.

    When I switched to cPanel, I did so because I was getting tired of writing stuff like this all the time. cPanel has seemed pretty complete, but it seems bizarre to me that a script like this, or equivalent functionality, isn't built into the system (at version 10 no less!) Weird. Anyway, hope someone finds this useful.

    If you make modifications or have suggestions, please send them on.

  2. #2
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default

    This script has been revved to v 1.2, and now works on cPanel systems with boxtrapper installed. Also now handles cases where users have deleted their quota files.

  3. #3
    Member
    Join Date
    Oct 2001
    Posts
    92

    Default

    There is a script that's included with cPanel.

    Under tweak settings look for:

    Notifications

    * Disable Suspending accounts that exceed their bandwidth limit (will clear all suspensions is disabled)
    * Disk Space Usage Warnings
    * Email Box Usage Warnings

    The wording from this email is ordinary at best but it's functional. The message comes from a host based email address so it may not be suitable to run if you offer reseller based hosting. From memory this script runs at the 80% mark.

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Indeed, but it it only run once per day as part of the nightly upcp run.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default

    Odd - I have that enabled, have always had it enabled. But neither I nor my customers have ever received autogenerated email quota notifications. So it works on your cPanel systems?

    Well, I like the configurability of my script:

    - Ability to alter the message text
    - Ability to modify layout of the summary message
    - Ability to turn/off notifications to POP owners or hostmaster separately
    - Ability to customize the checking schedule via crontab

  6. #6
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default

    v 1.3 adds a mailbox count as an FYI, so you know roughly how many mailboxes are handled by your server.

  7. #7
    Member
    Join Date
    Nov 2001
    Posts
    492

    Default

    Be sure to add this as a "bug" to the bugzilla.cpanel.net system. Let them know that you have developed it and wish the code to be added into the cpanel system...

    Eventually (2 years from now?) they might add this functionality.. (or add it to what crappy functionality already exists.)

    Be sure to post the bugzilla number here so we can vote for it.


  8. #8
    Member
    Join Date
    Feb 2004
    Posts
    469

    Thumbs up Thank You!

    Quote Originally Posted by shacker23
    v 1.3 adds a mailbox count as an FYI, so you know roughly how many mailboxes are handled by your server.
    Thank you very much for sharing your most useful script with us. Seems logical that cPanel should include something like this and will get my vote if you do as electric suggests.
    Thanks again.

  9. #9
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default

    v 1.4 only sends warning messages to users if mail quota usage is over specified threshold but also under 100% -- no point in sending to over-quota accounts since user won't receive them, and the bounces will just be returned to root anyway.

    Glad to hear people are finding this useful, thanks.

    If you want to vote on it, this is bug #3306 in bugzilla:
    http://bugzilla.cpanel.net/show_bug.cgi?id=3306
    Last edited by shacker23; 10-02-2005 at 02:13 AM.

  10. #10
    Member
    Join Date
    Feb 2004
    Posts
    469

    Thumbs up I Just Voted

    Quote Originally Posted by shacker23
    ...If you want to vote on it, this is bug #3306 in bugzilla:
    http://bugzilla.cpanel.net/show_bug.cgi?id=3306
    Well done. I hope lots of people spend the few seconds it takes to add their vote for this great time saving improvement.
    Thanks again.

  11. #11
    Member
    Join Date
    Mar 2002
    Posts
    448

    Default

    Quote Originally Posted by shacker23
    v 1.4 only sends warning messages to users if mail quota usage is over specified threshold but also under 100% -- no point in sending to over-quota accounts since user won't receive them, and the bounces will just be returned to root anyway.

    Glad to hear people are finding this useful, thanks.

    If you want to vote on it, this is bug #3306 in bugzilla:
    http://bugzilla.cpanel.net/show_bug.cgi?id=3306
    Just got my vote. I MASSIVELY agree with your comment "For many of us, over-quota mailboxes continue to be one of the leading support issues."

    I only just heard about your script over here: http://forums.cpanel.net/showthread.php?t=43698 and have added some additional comments on what a complimentary script might look like.
    • Web Design Perth .:. Itomic Business Website Solutions of Perth, Western Australia

  12. #12
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Just added my thoughts to the entry about using the inbuilt exim commands to achieve a similar solution.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Replies: 4
    Last Post: 11-30-2010, 09:15 AM
  2. Auto alert - Mail Box quota at 80 percent
    By anakowi in forum E-mail Discussions
    Replies: 1
    Last Post: 04-13-2010, 01:26 PM
  3. convert2maildir did its job, courier-imap (imap & pop) are causing problems
    By hariskhan in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-05-2006, 07:13 AM
  4. Volunerability in IMAP - ALERT
    By SupermanInNY in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-25-2004, 08:31 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube