Hi,
About one month ago, I sent a patch to this list to implement warnings when a user is close to reach his quota.
I tried to follow Timo's advice to improve my code, and here (at last) is a new patch. Things I did not fix:
- This patch is still for dovecot 1.0, as I will need warnings with dovecot 1.0. I may rewrite it for CVS HEAD in the future but can't promise.
- I'm still using system() rather than fork()+exec()+waitpid() since I don't know a good time to run waitpid().
Comments are welcome.
Timo, will you consider to add this to your unofficial patches?
Cheers,
Nicolas Boullis
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Nicolas Boullis schrieb:
Hi,
About one month ago, I sent a patch to this list to implement warnings when a user is close to reach his quota.
I tried to follow Timo's advice to improve my code, and here (at last) is a new patch. Things I did not fix:
- This patch is still for dovecot 1.0, as I will need warnings with dovecot 1.0. I may rewrite it for CVS HEAD in the future but can't promise.
- I'm still using system() rather than fork()+exec()+waitpid() since I don't know a good time to run waitpid().
Comments are welcome.
Timo, will you consider to add this to your unofficial patches?
Cheers,
Nicolas Boullis Hi Nicolas, hi Timo, i would very welcome including this patch in the near future cause the function is wanted from from many of my users. For now i have written a shell script with cron to do something equal. Please do not see my wish as some kind of pressure to release it to the next stable cause i know you have a hard time to code it these days, but it would be nice to see it in the near future in dovecot.
Mit freundlichen Gruessen Best Regards
Robert Schetterer
https://www.schetterer.org Munich/Bavaria/Germany -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFGDuTGfGH2AvR16oERAjmqAJ9UWmPvX4BRKE7B09sf7h6MzmWQ2QCfV8LX QBTF4lrTMIByT6DqmKKVZus= =ZVy5 -----END PGP SIGNATURE-----
On Sat, 2007-03-31 at 23:00 +0200, Nicolas Boullis wrote:
- I'm still using system() rather than fork()+exec()+waitpid() since I don't know a good time to run waitpid().
struct child_wait * child_wait_new_with_pid(pid_t pid, child_wait_callback_t *callback, void *context);
This would make it easy. That code is already written, but it's not in Dovecot's CVS yet. It would be useful also in dovecot-auth. Originally I was thinking about using the code to replace the waitpid() calls in master, but that change got a bit complex so I forgot about it then.
Timo, will you consider to add this to your unofficial patches?
Added.
Timo Sirainen wrote:
On Sat, 2007-03-31 at 23:00 +0200, Nicolas Boullis wrote:
- I'm still using system() rather than fork()+exec()+waitpid() since I don't know a good time to run waitpid().
struct child_wait * child_wait_new_with_pid(pid_t pid, child_wait_callback_t *callback, void *context);
This would make it easy. That code is already written, but it's not in Dovecot's CVS yet. It would be useful also in dovecot-auth. Originally I was thinking about using the code to replace the waitpid() calls in master, but that change got a bit complex so I forgot about it then.
OK, then I guess I should consider it when I do the porting to current CVS HEAD. Right? By the way, any documentation I should read about quota setups, quota rules, and quota roots for IMAP? When I had a look at the quota backport for 1.0, I failed to understand how things work together...
Timo, will you consider to add this to your unofficial patches?
Added.
Does this mean it looks good enough for you and you have nothing to criticize? Wow!
Cheers,
-- Nicolas Boullis Ecole Centrale Paris
On Wed, 2007-04-04 at 17:34 +0200, Nicolas Boullis wrote:
This would make it easy. That code is already written, but it's not in Dovecot's CVS yet. It would be useful also in dovecot-auth. Originally I was thinking about using the code to replace the waitpid() calls in master, but that change got a bit complex so I forgot about it then.
OK, then I guess I should consider it when I do the porting to current CVS HEAD. Right?
Yea.
By the way, any documentation I should read about quota setups, quota rules, and quota roots for IMAP? When I had a look at the quota backport for 1.0, I failed to understand how things work together...
v1.0's quota code is somewhat kludgy. Quota setup is nothing, forget that. It's already removed from CVS HEAD. I think the examples in dovecot-example.conf should help with understanding quota rules and roots:
# Quota limits are set using "quota_rule" parameters, either in here or in # userdb. It's also possible to give mailbox-specific limits, for example: # quota_rule = *:storage=1048576 # quota_rule2 = Trash:storage=102400 # User has now 1GB quota, but when saving to Trash mailbox the user gets # additional 100MB. # # Multiple quota roots are also possible, for example: # quota = dict:user::proxy::quota # quota2 = dict:domain:%d:proxy::quota_domain # quota_rule = *:storage=102400 # quota2_rule = *:storage=1048576 # Gives each user their own 100MB quota and one shared 1GB quota within # the domain.
Does this mean it looks good enough for you and you have nothing to criticize? Wow!
I was mostly concerned about if the the configuration should be done like that or somehow differently. But I think it's good now. With CVS HEAD you'd have to support multiple quota roots though, so:
quota_warning = .. quota_warning2 = .. quota2_warning = ..
There are also some minor coding style things to keep it consistent, but I'll change them when I merge the code. And :2 needs to be removed here, it's a GCC extension:
- enum quota_warning_limit_kind storage_limit_kind:2;
- enum quota_warning_limit_kind count_limit_kind:2;
On Sat, 2007-03-31 at 23:00 +0200, Nicolas Boullis wrote:
Hi,
About one month ago, I sent a patch to this list to implement warnings when a user is close to reach his quota.
I tried to follow Timo's advice to improve my code, and here (at last) is a new patch. Things I did not fix:
- This patch is still for dovecot 1.0, as I will need warnings with dovecot 1.0. I may rewrite it for CVS HEAD in the future but can't promise.
Quota warnings are now in v1.1 tree: http://hg.dovecot.org/dovecot/rev/6edca218d48a
I ended up rewriting all of your code, but it still helped a lot. :)
participants (3)
-
Nicolas Boullis
-
Robert Schetterer
-
Timo Sirainen