Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Feature Requests

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 25th September 2010, 21:14
e100 e100 is offline
Junior Member
Join Date: Sep 2010
Posts: 12
Thanks: 1
Thanked 5 Times in 1 Post
Question Prevent Backscatter from over quota

I have just started using ispconfig.
Using Debian Lenny with postfix and dovecot with ispconfig 3.0.3 beta

One problem I noticed is that the Dovecot LDA is what generates bounces messages for over quota users.
If dovecot was using mysql to store quota information it would be a piece of cake to handle this in postfix and prevent backscatter.

I have another system setup that uses postfix, postfixadmin and dovecot.
It is setup so postfix rejects messages for users who are over quota. It even matches alias domains and user aliases(forwards).

I could create the quota table and change the postfix and dovecot configs to add this feature to ispconfig. But it looks like customizing the ispconfig DB and certain config files is a bad idea.

Below is how my other system is setup, can someone point me in the right direction on the proper way to make these changes with ispconfig?
I do not want to make some change that gets blown away with each ispconfig update!

Quota Dictionary table:
mysql> describe quota2;
| Field    | Type         | Null | Key | Default | Extra |
| username | varchar(100) | NO   | PRI | NULL    |       |
| bytes    | bigint(20)   | NO   |     | 0       |       |
| messages | int(11)      | NO   |     | 0       |       |

plugin {
  quota = dict:user:Proxy::quotadict
  quota_rule = *:storage=10M:messages=1000
dict {
  quotadict = mysql:/etc/dovecot-dict-sql.conf

connect = host=localhost dbname=XXXXXXX user=XXXXXX password=XXXXXXXXXXX
map {
  pattern = priv/quota/storage
  table = quota2
  username_field = username
  value_field = bytes
map {
  pattern = priv/quota/messages
  table = quota2
  username_field = username
  value_field = messages

postfix main.cf:

smtpd_recipient_restrictions =
        check_recipient_access mysql:/etc/postfix/mysql-virtual_over_quota.cf,

hosts = localhost
query = (select IF((quota-quota2.bytes)<102400,'552 5.2.2 Quota exceeded (mailbox for user is full)','OK') as available from mailbox join quota2 on mailbox.username = quota2.username where (select goto from alias where (address = '%u@%d' OR address = CONCAT('%u@',(select target_domain from alias_domain where alias_domain = '%d' limit 1)) )    ) REGEXP mailbox.username ) order by available limit 1;

The query is confusing, but basically it returns "552 5.2.2 Quota exceeded (mailbox for user is full)" for any recipient where the final destination has less than 102400 Bytes remaining in their mailbox.

Obviously that query would need changed to work with ispconfig's schema.

Is there a way to do this without breaking the ispconfig upgrade?
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: Dovecot 1.2.9 + sieve + quota radim_h Tips/Tricks/Mods 10 22nd December 2010 09:35
mailbox quota again and again jmroth Installation/Configuration 4 1st September 2008 10:53
chgrp error new user DKA General 15 28th July 2008 18:45
Not getting Quota Reports - Perfect Serv/Ubuntu 7.10 tonydm Server Operation 0 22nd March 2008 22:52
Problems with copy & paste dspuser Server Operation 3 23rd May 2006 18:21

All times are GMT +2. The time now is 08:50.

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