I get a similar behavior between dovecot quota plugin and courier quota with the attached patch. When the client change flags, then is forced to recalc. This is because I don't know how to get the changed flags on quota sync method. The courier quota behavior is avoid to count all deleted mails, include "mark as deleted" mails. -- Antonio P?rez-Aranda Alcaide aperezaranda at yaco.es Yaco Sistemas S.L. http://www.yaco.es/ C/ Rioja 5, 41001 Sevilla Tel?fono +34 954 50 00 57 Fax ? ? ?+34 954 50 09 29 -------------- next part -------------- A non-text attachment was scrubbed... Name: quota-courier.patch Type: text/x-patch Size: 3614 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20101227/dc6daa7a/attachment-0002.bin>
On Mon, 2010-12-27 at 12:08 +0100, Antonio Perez-Aranda wrote:> I get a similar behavior between dovecot quota plugin and courier > quota with the attached patch. > > When the client change flags, then is forced to recalc. This is > because I don't know how to get the changed flags on quota sync > method.Right, there's no way to see what flags changed with the current API. I guess you could modify the API for that.. In maildir_sync_flags() the old flags are in ctx->flags after: /* get the current flags and keywords */ maildir_filename_get_flags(ctx->keywords_sync_ctx, fname, &ctx->flags, &ctx->keywords); And new flags are set to ctx->flags also later. The API change could be something like: struct mailbox_sync_notify { enum mailbox_sync_type sync_type; uint8_t old_flags, new_flags; }; void (*sync_notify)(struct mailbox *box, uint32_t uid, const struct mailbox_sync_notify *notify); I guess I could do this change for v2.1.> The courier quota behavior is avoid to count all deleted mails, > include "mark as deleted" mails.I don't much like this feature though..> + /* YACO: Avoid to count in dirsize Trash Marked mails*/ > + p = strchr(dp->d_name, 'T'); > + if (p != NULL){ > + continue; > + }This isn't always reliable (e.g. hostname could have 'T' letter in it). You should first find the ':' in the filename and look for 'T' only after that. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20101230/8169ed68/attachment-0002.bin>
I don't like that, because \Deleted files are in disk and take space. But well, it's a customer decissi?n. Another posibility could be delete-to-trash but it doesn't run on Dovecot 2.0.x. I though that lazy-expunge take \Deleted files and "expunged" files, but not. I think that I can use this with the ":" modification until delete-to-trash run on Dovecot 2.0 2010/12/30 Timo Sirainen <tss at iki.fi>:> On Mon, 2010-12-27 at 12:08 +0100, Antonio Perez-Aranda wrote: >> I get a similar behavior between dovecot quota plugin and courier >> quota with the attached patch. >> >> When the client change flags, then is forced to recalc. This is >> because I don't know how to get the changed flags on quota sync >> method. > > Right, there's no way to see what flags changed with the current API. I > guess you could modify the API for that.. In maildir_sync_flags() the > old flags are in ctx->flags after: > > ? ? ? ?/* get the current flags and keywords */ > ? ? ? ?maildir_filename_get_flags(ctx->keywords_sync_ctx, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fname, &ctx->flags, &ctx->keywords); > > And new flags are set to ctx->flags also later. > > The API change could be something like: > > struct mailbox_sync_notify { > ? ? ? ?enum mailbox_sync_type sync_type; > ? ? ? ?uint8_t old_flags, new_flags; > }; > > ? ? ? ?void (*sync_notify)(struct mailbox *box, uint32_t uid, > ? ? ? ? ? ? ? ? ? ? ? ? ? ?const struct mailbox_sync_notify *notify); > > I guess I could do this change for v2.1. > >> The courier quota behavior is avoid to count all deleted mails, >> include "mark as deleted" mails. > > I don't much like this feature though.. > >> + ? ? ? ? ? ? ? ?/* YACO: Avoid to count in dirsize Trash Marked mails*/ >> + ? ? ? ? ? ? ? ?p = strchr(dp->d_name, 'T'); >> + ? ? ? ? ? ? ? ?if (p != NULL){ >> + ? ? ? ? ? ? ? ? ? ? continue; >> + ? ? ? ? ? ? ? ?} > > This isn't always reliable (e.g. hostname could have 'T' letter in it). > You should first find the ':' in the filename and look for 'T' only > after that. >-- Antonio P?rez-Aranda Alcaide aperezaranda at yaco.es Yaco Sistemas S.L. http://www.yaco.es/ C/ Rioja 5, 41001 Sevilla Tel?fono +34 954 50 00 57 Fax ? ? ?+34 954 50 09 29