[Dovecot] Question regarding reverse quota_warning

Timo Sirainen tss at iki.fi
Mon Sep 14 03:43:05 EEST 2009


On Thu, 2009-09-10 at 14:37 +0200, jeroen at intuxicated.org wrote:
> Hi Everyone,
> 
> I have a question regarding reverse quota_warnings. I'm building a new
> setup, and I would like to block sending messages if a person is over
> his/her quota limit.

Well, users typically are never over quota. They're just a few kilobytes
under quota.. I guess you could use 99% as the limit when to start
blocking messages.

>  Although this can be accomplished using a
> quota_warning script, I can't find how to accomplish the reverse. Has
> anyone tried to do something like this?
> 
> By looking at the source code:
> 
> ---- quote ----
> if ((bytes_before < (uint64_t)warnings[i].rule.bytes_limit &&
>      bytes_current >= (uint64_t)warnings[i].rule.bytes_limit) ||
>     (count_before < (uint64_t)warnings[i].rule.count_limit &&
>      count_current >= (uint64_t)warnings[i].rule.count_limit)) {
> 	quota_warning_execute(root, warnings[i].command);
> 	break;
> }
> ----- /quote -----
> 
> I think it could be as simple as adding a second if statement and prefixing
> a string, but that's not a very clean solution.

Yeah, similar second if statement should work. I can't think of any
really nice and clean way to do this, so I think I'm not going to add
that feature until more people want it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090913/fe981ac9/attachment.bin 


More information about the dovecot mailing list