Hi guys,
I'm currently experimenting with Postfix, Dovecot and OpenLDAP to setup a mail server hosting virtual users. The standard stuff works fine so far. The only thing that doesn't work as I'd like it to do is Quota.
Currently, Dovecot handles/enforces quota through the deliver LDA. When Postfix tries to deliver a mail to a mailbox that is over quota, the deliver LDA bounces the mail back to the sender.
I don't like that. I'd rather prefer Postfix to reject the mail right after receiving the '.' DATA termination line and having checked whether the users quota is or would be exceeded.
This could work by writing a small Postfix policy server/daemon that does exactly that Dovecot does:
- get the user quota limit from userdb (from LDAP in my case)
- get the user quota used (from maildirsize in my case) _ check whether the current mail size + quota used exceed the quota limit and if true, reject the mail
Of course this would only work for mails going to a single local recipient address, but most of the time, that's just the case.
Now I can re-implement that part of functionality from Dovecot in Perl and write such a small policy daemon that does exactly fit my setup (LDAP + maildirsize).
There's one thing I'd like much better, though:
What about extending Dovecot by a small policy server module for Postfix? Dovecot already has all the code to do the "over quota" checks and supports a great number of combinations for quota limit and used quota storage. My Postfix instance already kinda depends on a running Dovecot due to Dovecot-SASL for SMTP-Authentication and Dovecot-deliver for mail delivery, so it wouldn't introduce a completely new dependency either.
Timo (and all others), what do you think about such a Postfix policy server implemented as a part of Dovecot?
Regards, Wolfram Schlich wschlich@gentoo.org Gentoo Linux * http://dev.gentoo.org/~wschlich/