ISPConfig 3 mail quota exceeded warning

In current versions of ispconfig, when a user's mailbox quota is exceeded, the mailbox user is not informed about this.

Has anyone tried to create, for example, a cron script to scan all 80% and up quota's and sending out an email to the mailbox user or the administrator to inform about the fact that this user(s) is/are running out of mailbox space?

I'm working on a standard ispconfig 3.0.3.3 with courier on ubuntu 8.04lts.

ISPConfig uses the normal linux quotas for the website quota, it can be queried e.g. with the repquota command. Most likely there are also scripts available somewhere that use repquota to inform users about their quota usage.

Your mailbox on the server is now more than 90% full.
To continue to receive mail you must remove some messages from your mailbox. If you should reach 100% of your quota, mail delivery to you will stop. Your quota is displayed in the webmail interface

Thank You

Click to expand...

Now check your mailbox directory, after receiving mail there will be 2 files in there. "ispconfig_mailsize" which I have no idea what it's doing (never seems to update when mail is removed) and "maildirsize" which thankfully is what maildrop is looking at. Once the mailbox hits 90% full it will notice and then send the user the message above. It will also add a file to the mailbox directory called "quotawarn".

Now there are a couple of problems here. That quotawarn file never gets deleted - so stays even if the user cleans out the mailbox. This will interfere with future quota warnings. So you could add a little script run by cron say in the middle of the night. The little script would be something like:

#/bin/sh
find /var/vmail -name 'quotawarn' -exec rm -f {} \;

Click to expand...

This won't affect the quotas because if it's still hit the 90% limit, maildrop will simply rewrite that quotawarn file and send them another message.

You could also be a little smart and check up on your users to make sure they are not filling up their mailboxes. Simple, just find the mailboxes that have the quotawarn message. You can do this with a cron as well, you could even make it a little more infiormative, but the most simple thing to execute is:

Edit: Oops! I better mention that if you want to be emailed about the quotawarnings you best run the above warning thing before the previous one that shows how to delete them - else there will be no quotawarnings for it to report on