[Dovecot] Dovecot Quota Problem
Ken Price
lists at nettwrek.com
Fri Jan 8 21:45:28 EET 2010
On Tue, 05 Jan 2010 11:59:45 -0500, Ken Price <lists at nettwrek.com> 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".
>
>>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?
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
More information about the dovecot
mailing list