[Dovecot] quota warning

Timo Sirainen tss at iki.fi
Thu Mar 1 12:02:16 EET 2007


On 27.2.2007, at 17.21, Nicolas Boullis wrote:

> It is configured in the plugin section of the configuration file:
>   quota_warning = 80:0:/usr/local/bin/quota_warning.sh

I've tried to make it possible to support more than message size and  
message count limits, although I don't know if there ever is going to  
be more than those two. But I think the configuration should be more  
like:

quota_warning = storage=80% /usr/local...
quota_warning = storage=80%:messages=80% /usr/local...

That would even allow implementing eg. storage=512k or something to  
give a warning when there is only 512kB of quota left.

As for the code, like you said the quota implementation is rewritten  
in CVS HEAD so getting this patch to work there would require some  
changes. And I don't want to add any more new features to v1.0.

Some things about the code:

  - You're creating a warnings array, but quota_warning_init()  
supports only a single warning. I guess it could be useful to have  
multiple ones, so you could setup the rest in eg. quota_warning2,  
quota_warning3, etc. environments.
  - storage_limit should be uint64_t. int holds only 2GB which isn't  
all that much anymore. :)
  - If quota_warning_init() fails, it could just do i_fatal("quota:  
Invalid value in quota_warning") or something instead of silently  
ignoring it.
  - system() waits for the command execution to finish. I think fork() 
+exec() would be better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070301/d2ee71fa/attachment.pgp 


More information about the dovecot mailing list