[Dovecot] Dovecot Quota Problem
I'm using Dovecot LDA with Exim. I'm also using Dictionary Quotas in a MySQL database. I want to avoid backscatter completely, so I set "quota_full_tempfail = yes" and handle quota checking in the Exim RCPT ACL during the SMTP session. The problem lies in the case where a user's account is nearly full. Smaller messages will continue to come through, but a larger message would get queued for retry since it will push the account over quota. I need Dovecot's quota to exhibit the same behavior as Exim's "quota_is_inclusive=false".
From Exim docs: quota_is_inclusive=false When this is done, the check for exceeding the quota does not include the current message. Thus, deliveries continue until the quota has been exceeded; thereafter, no futher messages are delivered.
Any ideas on how I can implement this inside of Dovecot?
Thanks, -Ken Price
I'm using Dovecot LDA with Exim. I'm also using Dictionary Quotas in a MySQL database. I want to avoid backscatter completely, so I set "quota_full_tempfail = yes" and handle quota checking in the Exim RCPT ACL during the SMTP session. The problem lies in the case where a user's account is nearly full. Smaller messages will continue to come through, but a larger message would get queued for retry since it will push the account over quota. I need Dovecot's quota to exhibit the same behavior as Exim's "quota_is_inclusive=false".
From Exim docs: quota_is_inclusive=false When this is done, the check for exceeding the quota does not include
On Tue, 05 Jan 2010 11:59:45 -0500, Ken Price
current message. Thus, deliveries continue until the quota has been exceeded; thereafter, no futher messages are delivered.
Any ideas on how I can implement this inside of Dovecot?
Ok, since I've received no responses on my original post, I went about digging through the source. I *think* I found the line which I need to change in order to check the available quota, but not include the current message size in the calculation. My C++ is rusty to say the least, and I'm having a bit of trouble understanding some of the functions, so any help will be appreciated. This is part of the "quota_default_test_alloc()" function. Ideally the patch would add the ability to enable/disable this capability in the dovecot config file, but I'm just looking for a quick 'n' dirty hack at the moment. -------------- dovecot-1.2.9/src/plugins/quota/quota.c @@ -969,4 +969,4 @@ *too_large_r = FALSE; - if (ctx->count_left != 0 && ctx->bytes_left >= ctx->bytes_used + size) + if (ctx->count_left != 0 && ctx->bytes_left > 0) return 1; -------------- Any help would be appreciated! Thanks, Ken
On 5.1.2010, at 18.59, Ken Price wrote:
I'm using Dovecot LDA with Exim. I'm also using Dictionary Quotas in a MySQL database. I want to avoid backscatter completely, so I set "quota_full_tempfail = yes" and handle quota checking in the Exim RCPT ACL during the SMTP session. The problem lies in the case where a user's account is nearly full. Smaller messages will continue to come through, but a larger message would get queued for retry since it will push the account over quota. I need Dovecot's quota to exhibit the same behavior as Exim's "quota_is_inclusive=false".
If backscatter is the only reason, would it work simply to keep quota_full_tempfail=no and use -e option for deliver? Then configure Exim to delay replying to to DATA command until deliver is finished. I guess the main problem with this is increased load when tons of mails are being delivered at the same time..
participants (2)
-
Ken Price
-
Timo Sirainen