[Dovecot] Quota Calculation seems to be wrong when using dsync

Timo Sirainen tss at iki.fi
Thu Feb 9 20:24:58 EET 2012

On Sat, 2010-12-25 at 10:08 +0100, Thomas Leuxner wrote:
> plugin {
>   quota = dict:user::file:%h/mdbox/dovecot-quota
>   quota_rule = *:storage=1GB
>   quota_rule2 = Trash:storage=+10%%
> }
> Kick off a manual backup:
> $ dsync -u user at domain.tld backup mdbox:/<path to backup>/mdbox
> This results in doubling the quota for the backed up user.

This is problematic. With dict quota you'll have this problem, because
both source and destination uses the same file. So it would kind of make
sense to disable quota for the destination dsync.. Except with Maildir++
the quota is stored in the Maildir root directory. There are no problems
with dsyncing it, and you most likely wouldn't want quota disabled

So .. I'm not really sure what I can do about this. There are some
workarounds you could do, like:

dsync -u user at domain.tld backup dsync -o mail=mdbox:/<path to backup>/mdbox -o plugin/quota=

(works only with latest 2.0/2.1 hg, but with older versions you could do
e.g. -o mail_plugins=)

Still, it would be nice if there was some generic solution to this.
Perhaps the destination username should be something different, like
"backup". In dict-sql case then it would modify "backup" user's quota.
For dict-file the %h could maybe expand to backup user's homedir.. The
backup username probably should be a parameter to dsync I guess.. But an
extra parameter wouldn't fix this automatically..

More information about the dovecot mailing list