Thomas Leuxner
2010-Dec-25 09:08 UTC
[Dovecot] Quota Calculation seems to be wrong when using dsync
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Recently I encountered odd quota increases when using 'dsync' with the latest and greatest: 2.0.8 (89936539e3b8). Say you got something in place like this: 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. It doesn't seem to matter whether 'mirror' or 'backup' mode is used, both increase the "source" quota. Doesn't sound right to me. You can only get to the "real" usage by running a recalc manually: $ doveadm quota recalc -u user at domain.tld Anyone else seen this? Regards Thomas P.S. Merry Christmas -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) iEYEARECAAYFAk0VtH8ACgkQ+meF/S97aXjUkwCfdZFpUPCOY9UiukT+G68jCHHr mmMAnRHz56BXMzpC84CIYvUn4KHpl8OA =M0AZ -----END PGP SIGNATURE-----
Timo Sirainen
2012-Feb-09 18:24 UTC
[Dovecot] Quota Calculation seems to be wrong when using dsync
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 there. 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..