HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   ISPConfig 3 mail quota exceeded warning (http://www.howtoforge.com/forums/showthread.php?t=54937)

taittinger_hi 14th November 2011 18:28

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.

Looking forward to your suggestions!

Kind regards,

Tom

esezako 19th December 2012 15:25

+1

Any solution?

vwpete 27th January 2013 04:17

+2
 
yes do we have a solution for this? this would be real handy

esezako 30th January 2013 12:12

Any solution? manual script?

till 30th January 2013 12:18

Edit the /var/vmail/.mailfilter file and use deliverquota for email delivery to get quota notifications similar to this example:

http://courier-mail-server.10983.n7....s-td19080.html

esezako 1st February 2013 11:16

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

Thanks

till 1st February 2013 13:11

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.

esezako 5th February 2013 09:43

http://bugtracker.ispconfig.org/inde...s&task_id=1082

till 5th February 2013 10:06

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.

Parsec 11th February 2013 05:54

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

/etc/postfix/master.cf - 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):
Quote:

From: Mail Delivery System <Mailer-Daemon@server.example.com>
Reply-To: sysadmin@server.example.com
To: "Valued Customer";
Subject: Mail quota warning
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

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
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:
Quote:

#/bin/sh
find /var/vmail -name 'quotawarn' -exec rm -f {} \;
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:
Quote:

#/bin/sh
find /var/vmail -name 'quotawarn' |/usr/bin/mail -s "Server Example - Quota Warnings" your_email@your_domain.com
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 :-)


All times are GMT +2. The time now is 05:15.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.