[Dovecot] mail to admin when quota exceeded
We're using Dovecot v1.2.15 LDA/IMAP/POP3+MySQL with quota plugin, quota_rule per-user size, quota_exceed_message and quota_warning on storage=90%%.with script. Everything is working as expected. But I've been asked to configure it the way, that when a user gets message, which would make his maildir over quota limit, notification go not only to sender, but also to postmaster@domain.com. Browsed wiki, mailinglist archive - couldn't find anything on that. Is there a way to implement such feature? And what about possibility to send a message to user, notifying him about rejected email "from: xxx@yyy.com" with "subj: blah blah" due to full mailbox? Such messages are small and would not take too much space. Thus the user would know what he misses, urging him to clean his mailbox.
Thank you in advance.
Karolis
On Wed, 2011-01-12 at 01:06 +0200, Karolis Žvaigždinas wrote:
We're using Dovecot v1.2.15 LDA/IMAP/POP3+MySQL with quota plugin, quota_rule per-user size, quota_exceed_message and quota_warning on storage=90%%.with script. Everything is working as expected.
But I've been asked to configure it the way, that when a user gets message, which would make his maildir over quota limit, notification go not only to sender, but also to postmaster@domain.com. Browsed wiki, mailinglist archive - couldn't find anything on that. Is there a way to implement such feature?
I use a perl script querying DB and test active domains (since there is no domain quotas) every hour, you could adapt it to test users and send a message rather than what it does, if you dont have many users it should not be much of a problem. it warns the domain manager, and suspends inbound mail. nasty but a necessary evil. but I think you need to make your warning messages more compliance strict, we send a friendly relaxed warning at 75%, a more serious message at 90% telling them to clear out old stuff and purge unneeded now, not wait until they dont see any new mail and wonder why, if they dont clear out the mail, they have no one but themselves to blame.
And what about possibility to send a message to user, notifying him about rejected email "from: xxx@yyy.com" with "subj: blah blah" due to full mailbox? Such messages are small and would not take too much space. Thus the user would know what he misses, urging him to clean his mailbox.
Thats all nice and well, but what if you have these limits because of disk space, 1000 users getting 100 of these a day WILL add up.
That said, if you use dovecot 2.0.x's LDA, you *can* do this now, and the wiki IIRC, does tell you how - we still use 1.2.x so I don't have the command immediately at hand but recall seeing it (it might even work on 1.2.x, but never bothered trying it)
Replying to myself is bad I know but its holiday time :) at least for a few more days...
On Wed, 2011-01-12 at 09:32 +1000, Noel Butler wrote:
That said, if you use dovecot 2.0.x's LDA, you *can* do this now, and the wiki IIRC, does tell you how - we still use 1.2.x so I don't have the command immediately at hand but recall seeing it (it might even work on 1.2.x, but never bothered trying it)
I actually found we added it in our quota warning script commented out for when we do more to 2.0.. :
-o "plugin/quota=maildir:User quota:noenforcing"
is what you add in your warning script pipped command to bypass it for 2.0, the fact we dont use it now means old age is setting in as we must have tried it and given its commented out, it wont work with 1.2.x
On Wed, 2011-01-12 at 01:06 +0200, Karolis Žvaigždinas wrote:
We're using Dovecot v1.2.15 LDA/IMAP/POP3+MySQL with quota plugin, quota_rule per-user size, quota_exceed_message and quota_warning on storage=90%%.with script. Everything is working as expected. But I've been asked to configure it the way, that when a user gets message, which would make his maildir over quota limit, notification go not only to sender, but also to postmaster@domain.com. Browsed wiki, mailinglist archive - couldn't find anything on that. Is there a way to implement such feature?
You could configure sendmail_path to a script that adds postmaster to the recipients list before execing the real sendmail. This of course assumes that you're not using Sieve, because then the sendmail_path is executed for other reasons as well. Or alternatively you could read the message body and see if it's a out-of-quota reply or not..
And what about possibility to send a message to user, notifying him about rejected email "from: xxx@yyy.com" with "subj: blah blah" due to full mailbox? Such messages are small and would not take too much space. Thus the user would know what he misses, urging him to clean his mailbox.
Same as above, make the script deliver the "out of quota" mail to user (with quota disabled so it won't go to infinite loop).
participants (3)
-
Karolis Žvaigždinas
-
Noel Butler
-
Timo Sirainen