[Dovecot] update of current quota usage

Timo Sirainen tss at iki.fi
Fri Mar 20 20:25:13 EET 2009


On Fri, 2009-03-20 at 19:10 +0100, floss at pBartels.info wrote:
> > If you removed spam messages and purged trash via IMAP you wouldn't have
> > to worry about updating quota.
> >
> 
> I mean if you do this directly on the server using a "croned" script.

Yes, but I meant that you could rewrite your script in a way that it
uses IMAP to do the actualy work, instead of modifying the filesystem
directly. For example with v1.2 you could do it easily:

printf "1 select Trash
2 search return (save) before 01-jan-2009
3 store $ +flags.silent \deleted
4 expunge
5 logout
" | dovecot --exec-mail imap

v1.1 doesn't have the return (save) and $ feature though, so it would
need a more interactive script.

> >> What did you mean with too much work?
> >
> > I mean that currently quota is updated only while changes are actually
> > done. To be able to figure out when mailbox changes were done outside
> > Dovecot it would need to keep some kind of state which
> > messages/mailboxes were added to quota and which weren't. Index files
> > help somewhat in implementing that, but it's still a lot of extra code.
> >
> 
> Yes as I see it quota usage is only done if something is done via  
> IMAP, or perhaps if you fetch mail via POP?! (not tested).

Quota is updated whenever Dovecot is the one doing changes and quota
plugin is loaded. So assuming you've added mail_plugins=quota inside
pop3 section, Dovecot pop3 updates the quota.

> And then it  
> is not recalculated, it's just updated like if you remove a file the  
> quota is decreased of filesize, etc.

Yes. Recalculating quota all the time would be way too much unnecessary
work.
-------------- 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/20090320/1d702410/attachment.bin 


More information about the dovecot mailing list