expunging messages doesn't update maildirsize

WJCarpenter bill-dovecot at carpenter.org
Wed Apr 20 02:17:49 UTC 2016

This might be something that everybody thinks of as a well-known fact, 
but I've been searching around quite a bit without finding anything 
definitive. Maybe I just have the wrong idea of what's supposed to be 
going on.

I'm using maildir+ quotas. For arriving mail, it works as I expect: new 
lines are appended to maildirsize to reflect the size of the new 
messages. But I also expected that mail that is deleted (and expunged, 
yes totally gone from the disk drive, verified from the command line) 
would lead to some kind of update to maildirsize or maybe even a 
complete recalculation. But that does not happen on my system (dovecot 
2.2.9 on a Ubuntu variant).

Now, I know that I can run "doveadm" from a cron job or whatever to have 
the maildirsize info recomputed. I also know that the maildirsize file 
will be recreated when it gets larger than 4k. That's all fine. But I 
don't see why I should have to have this out-of-band cron job, and I 
don't see why my users should have to wait if their maildirsize file 
doesn't tip over the magical 4k mark (which is a lot of individual 
messages being recorded).

Is it by design that dovecot doesn't update maildirsize immediately when 
messages are expunged? If yes, why?

More information about the dovecot mailing list