Once upon a time, /dev/rob0 <r...@gmx.co.uk> said: > On Sat, Sep 15, 2012 at 06:50:38PM -0500, Chris Adams wrote: > > I wrote a milter for our Plesk servers to check quota at RCPT TO > > time instead (and return a permanent error for over-quota) to fix > > the bad behavior. > > Unfortunately that only replaces one potential problem with another. > You're relying on SIZE in the MAIL command, which might be wrong or > might be omitted. The only sure way to know the actual size of the > mail is to receive the DATA.
I've found it to be a "good enough" solution. My checker takes the SIZE argument from MAIL FROM; if it isn't there, it assumes the largest message the server allows. It also adds a little to the size to allow for local headers (local Received: line, From_ header if mbox, etc.). This means that if the remote system doesn't set SIZE, it is possible for some small messages to be rejected that could have just fit under the quota. Almost all legitimate servers set SIZE; the only place I typically don't see it is from clients (and IIRC some do set it, but not from Microsoft). This also doesn't handle multiple messages come in at a time (especially if one is a large message from a slow remote system). > P.S.: I complied with your Reply-To: and sent the Cc:. It will fail > SPF, if you're checking that. That's not me; that's the list. -- Chris Adams <cmad...@hiwaay.net> Systems and Network Administrator - HiWAAY Internet Services I don't speak for anybody but myself - that's enough trouble.