This has been a nut that i haven't been able to crack for a long time
now and i was wondering how one would solve this problem.
My setup is the following:
a) Multiple domains hosted in a single box
b) Postfix delivers emails to virtual mailboxes (so all the domains run
under the same virtual UID/GID).
c) Users are stored in a MySQL database
d) I'm currently using the Postfix VDA quota patch, but it only limits
quota for a single email.
e) The objective is to limit the quota domain wide. For instance:
The domain quota is 50 MB, there are two users on the domain (user A and
User A has 40 MB of used quota, user B has 0 MB of used quota.
If someone sends an email sized 20 MB to user B, the email must be
rejected because it would exceed the available quota for the domain (10 MB)
I'm getting kind of desperate so i'm probably going to do something very
hacky like running a routine every 10 minutes or so that does the following:
a) Read all domains and users from the database
b) For each domain, add the quota in the IMAP maildirsize file for each
email in the domain to get the total used quota for the entire domain
c) Save the total used quota for each domain in the database.
Then i must add some kind of check to Postfix that rejects the email if
it exceeds the available quota.
But this is really ugly and slow. Has anyone come up with a better
solution for this?
If not, how would i add to Postfix a check that would reject an email if
it exceeds quota (i can check using an SQL query).
|Question about address verification in MX2 when primary MX is down...||17|
|Permission denied /var/lib/postfix/master.lock error||7|
|Re: OpenSSL 0.9.8 <-> 1.0.0 CApath (in)compatibility||0|
|how long does smtpd leave connection open?||3|
|limiting messages sent from command line||3|
|Case folding with address extensions||2|
|transport private/smtp: Connection refused||3|
|interesting log entries||3|
|About website www.postfix.org||14|