On 12 Feb 2016, at 01:37, Heiko Schlittermann <hs@schlittermann.de> wrote:
Hello,
I'm using dovecot 2.2.9 and a director/backend setup. On the director I've the LMTP in proxy mode, mapping the users to one of the backends.
The backends to quota check and return the OverQuota message already at RCPT TO time.
Here is what I typed, connected to the director
Connection to director1 2525 port [tcp/*] succeeded! 220 director1.rz.hs-example.de Dovecot (Ubuntu) ready. LHLO mailhub1.rz.hs-example.de 250-director1.rz.hs-example.de 250-8BITMIME 250-ENHANCEDSTATUSCODES 250 PIPELINING MAIL FROM:<hs@schlittermann.de> 250 2.1.0 OK RCPT TO:<heiko@hs-example.de> 250 2.1.5 OK
..
It looks as if the backend tells the director/proxy about the full mailbox (552 5.2.2 <heiko@hs-example.de> Quota exceeded (mailbox for user is full)) already before the DATA phase starts, right as the response to the RCPT TO.
But the proxy seems to ignore it…
Right.. RCPT TO in proxy answers immediately when it has verified that the user exists. It doesn't wait until it has connected to the backend and sent RCPT TO there. I'm also not entirely sure how good of an idea that is if it would, since at least without pipelining it would slow down all the LMTP operations when there are multiple recipients. But then again, if pipelining is used it wouldn't matter, at least in theory. It would require some more coding though.
The way it's commonly done in larger environments is that the over-quota is already checked by the MTA and have it fail the RCPT TO. You can have Dovecot update the over-quota flags via quota-warning scripts (and quota_over_script) in whatever way and have the MTA look that up. Then in Dovecot LMTP you could simply disable quota checks.