Am 28.10.2011 03:54, schrieb Fred Kilbourn: > Hi, > > I've been doing a bit of research into implementing quota based rejections > for incoming messages with postfix. I want to do this before I hand it off > to my LDA (which currently is handling the quota rejections) so that I can > reject mail and stop sending backscatter when a recipient is over-quota.
if you use lmtp with dovecot vers 2, the overquota reject comes early in smtp income stage so the backscatter problem is solved then otherwise use the vda patch for postfix http://vda.sourceforge.net/ this patch didnt get in stable postfix versions by tec reasons but i used it serveral years without problems, there are a few distros which may have it allready patched or distribute it as separte packs anyway you should prefer the lmtp stuff, cause its the more clean implementation so you dont need to search more > > I've not been able to find any mature, stable, and well maintained package > available to do this with postfix, so I am looking into rolling my own > solution. > > My environment uses quotas stored in mysql and manages quotas with dovecot. > > For my implantation, the following comes to mind so far: > * Must be fast (to send a timely smtp response), for this reason, I'd likely > use a daemon that caches quota limits from sql and reads stored quota sizes > pre-calculated by dovecot whenever receiving a message. > * Should be able to calculate the true message size, not simply trust any > size headers sent. > * Should handle multi-recipient messages somewhat gracefully. Optimally, > I'd like to be able to deliver to everyone except for those over quota, and > then reject with a "5.2.2 Mailbox full". My thought is, I'd still get the > message to the intended recipients by re-injecting the message somehow, > minus those recipients that are over quota. Also, I'd indicate in the > rejection message that "only x, y, z.... users didn't receive the message" > for the benefit of legitimate senders. > > From what I've read, the three ways to implement such a system would be > either as an smtp policy server, a before-queue milter, or a before-queue > content filter. > > Finally, my questions are these: > > 1: Is there some package out there I may have missed that does this nicely? > > 2: Are these the only three candidate methods within postfix for > implementing such a system? Have I missed anything? Does someone have a > suggested alternative? > > 3: Of these candidate methods, which has the best potential performance, > are there any with limitations that will preclude me from implementing the > features I've mentioned? (I know I could read more on this one, but I'm > looking for a small shortcut here please). > > 4: Are my ideas for multi-recipient handling too hacking or outlandish? > Violate RFCs too egregiously? If I must, I could either patently reject the > whole delivery, or silently discard the messages internally with some kind > of notification message to the intended recipients instead. But, I don't > want to stick with the current post-queue system that is filling my outbound > queue with backscatter. > > Sorry for the length, just trying to be as comprehensive and concise as > possible in my first posting. There is a lot in my mind right now on this > project, so if I forgot to mention anything I'll elaborate further later. > Please feel free to question my motives / assumptions / plans and suggest > better alternatives. I want to do this right and not have some hack job. > > Thank you, > > Fred Kilbourn > -- Best Regards MfG Robert Schetterer Germany/Munich/Bavaria