]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
When updating maildir quota create also missing maildirsize file and make
authorTimo Sirainen <tss@iki.fi>
Sun, 4 May 2008 00:44:09 +0000 (03:44 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 May 2008 00:44:09 +0000 (03:44 +0300)
sure the limits in the header are up-to-date.

--HG--
branch : HEAD

src/plugins/quota/quota-maildir.c

index 694b1b85a3bdad60fe6afc2ba83c14b60175e8d2..d4f9884f2e02dce42b809ff2fff36d60ebe66c42 100644 (file)
@@ -738,8 +738,13 @@ maildir_quota_update(struct quota_root *_root,
                /* no limits */
                return 0;
        }
-       /* make sure the latest file is opened. */
-       (void)maildirsize_open(root);
+
+       /* even though we don't really care about the limits in here ourself,
+          we do want to make sure the header gets updated if the limits have
+          changed. also this makes sure the maildirsize file is created if
+          it doesn't exist. */
+       if (maildirquota_refresh(root) < 0)
+               return -1;
 
        if (root->fd == -1 || ctx->recalculate ||
            maildirsize_update(root, ctx->count_used, ctx->bytes_used) < 0)