Autor: Todd Lyons Datum: To: Robert Blayzor CC: exim-users@exim.org Betreff: Re: [exim] Rejecting over quota at RCPT time - revisited
On Thu, Nov 29, 2012 at 3:08 AM, Robert Blayzor <rblayzor.bulk@???> wrote: > On Nov 28, 2012, at 10:47 PM, Todd Lyons <tlyons@???> wrote:
>> Tomorrow, I will be experimenting with jamming the following into a
>> perl function (I use the embedded perl a lot) and call it as a
>> condition for a verify_only router, and then defer with an appropriate
>> quota related message is customer is already over quota to stop
> Seems feasible and not that expensive, but possibly doing that check for each and every RCPT could be costly overall depending on mail volume and number of accounts you have. Perhaps adding something in to either touch a file in the maildir or use something else (database or memcached) to say signal the box is over quota if that condition happens. You could then check a timestamp and determine if you want to run the more expensive operation or computing the quota again. If the file time expires, recompute; if they're still over quota, refresh the timestamp, if they're not, remove the entry and return an under quota condition.
Sounds workable, but I don't know how you would check the timestamp
without shelling out to something external or connecting to some
external daemon that's already running. Since I already fork perl
with each exim instance, I have lost nothing. You on the other hand,
would now have the added load and memory pressure of forking perl for
just this one thing. Sticky...
> In our environment since this would be done as a router condition we already know the homedir/maildir so we could just pass that into the Perl function (one would hope). So that part of the code isn't really needed if you grab that info early enough to pass it in.
In my system, I don't yet know the homedir/maildir because it's part
of the SQL lookup in the router. I can however construct it because I
know how it's built, but I'd prefer the results from the lookup to be
used. I dunno if that's easy at this point. Beginning testing...
...Todd
--
The total budget at all receivers for solving senders' problems is $0.
If you want them to accept your mail and manage it the way you want,
send it the way the spec says to. --John Levine