Re: [exim] Rejecting over quota at RCPT time - revisited

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Todd Lyons
Dátum:  
Címzett: Robert Blayzor
CC: exim-users@exim.org
Tárgy: Re: [exim] Rejecting over quota at RCPT time - revisited
On Thu, Nov 29, 2012 at 8:23 AM, Robert Blayzor <rblayzor.bulk@???> wrote:
> On Nov 29, 2012, at 11:03 AM, Todd Lyons <tlyons@???> wrote:
>> Dammit. I'm right back where we were before I started experimenting.
> I'm actually in the same situation here. Without being able to trap the first over condition hit by Exim there is no way to just check people who are over quota, you have to run the expensive quota computation for each RCPT you get.


Expensive? slurp in a file, parse it line by line adding it up. The
maildir++ spec says that the file should be recalculated if it ever
gets about 5120 bytes. If you want to avoid potential abuses, simply
check if the file size is bigger than 5120 bytes and abort if it is.

> I was hoping that somehow I could trap an over quota condition in Exim and use a string expansion based on this. I could then mark the account as over quota and to only run the expensive quota recalculation after a certain time or some other changing condition. But without that, I can't tell who is over quota and who isn't unless you check it for everyone at RCPT time, which I think is too costly of an operation and you end up actually checking quotas twice; once at RCPT time using your own method and then Exim will check it at delivery.


I'm envisioning an external daemon to check for over_quota condition:
1. Listen on $port.
2. Accept requests such as "CHECK_QUOTA local_part domain"
3. Check for key in memcache for this email address, return "1" if
found and is overquota (has value bigger than zero).
4. If not found, or has value 0, do the quota calculation from the
maildirsize file, set the key in memcache with some small TTL, then
return answer to socket ("0" = ok, "1" = over quota) and close.

Along the same lines as your thoughts? (aside from external daemons == UGLY).

...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