[Dovecot] Quota in mysql dict not properly recalculated on 1.2?

Timo Sirainen tss at iki.fi
Fri Jul 2 15:35:49 EEST 2010

On Fri, 2010-07-02 at 14:31 +0200, Joan wrote:
> > Did you try the quota recalculation when logging in normally, instead of
> > with --exec-mail?
> I sent a 5M mail to myself, there's the mail  in inbox and the copy to
> sent (amounting 10M), I connected to the server and manually removed
> the mail (rm file).
> After that sending a new mail updates the quota, but it doesn't recalculate it.

Right. Quota isn't automatically recalculated if you go manually adding
or removing files.

> After deleting the entry for test at testing.com from the database, the
> quota gets properly recalculated.

So the problem exists only with --exec-mail?

> The problem is that I rely on db quota for some accounting scritpts,
> and the users might not enter to their webmail or download the mail
> for days.
> How could I trigger this quota recalculation?

If the problem is only with --exec-mail, you could create a master user
that can login to any user's account and triggers the quota
recalculation. Something like:

printf "a login destuser*masteruser masterpass\nb getquotaroot inbox\n" | nc localhost 143


> .- Maybe the most practical would be to have a crontab to update the
> real values from time to time, at least until 2.0 is not available in
> our environment...

In v2.0 you can do it even more easily :)
doveadm quota recalc -u username

More information about the dovecot mailing list