ISPConfig 3 mail quota exceeded warning

Discussion in 'Tips/Tricks/Mods' started by taittinger_hi, Nov 14, 2011.

  1. taittinger_hi

    taittinger_hi New Member

    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 with courier on ubuntu 8.04lts.

    Looking forward to your suggestions!

    Kind regards,

  2. esezako

    esezako New Member


    Any solution?
  3. vwpete

    vwpete New Member


    yes do we have a solution for this? this would be real handy
  4. esezako

    esezako New Member

    Any solution? manual script?
  5. till

    till Super Moderator Staff Member ISPConfig Developer

  6. esezako

    esezako New Member

    Sorry. Exist a similar script for inform of user global quota? Not mail quota.

  7. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
  8. esezako

    esezako New Member

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    This thread here is about email quota (which is enforced by dovecot deliver or courier maildrop). The link you posted is about website harddisk quota, both quotas are not related.
  10. Parsec

    Parsec New Member

    Well this might help if you are using postfix + courier with maildrop

    /etc/postfix/ - change the maildrop line so it includes the quota warning. Add -w 90 (where 90 means 90% full - you can alter this figure) just before the -d vmail bit eg:

    flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d vmail ${extension} ..etc

    (restart postfix)

    Create a simple text message /etc/courier/quotawarn - make it look something like this (don't forget to edit for your preferences):
    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:
    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 :)
    Last edited: Feb 11, 2013
  11. scarleo

    scarleo New Member

Share This Page