]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict quota: Don't fail quota recalculation if mailbox syncing fails with non-temp...
authorTimo Sirainen <tss@iki.fi>
Fri, 6 Aug 2010 15:01:20 +0000 (16:01 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 6 Aug 2010 15:01:20 +0000 (16:01 +0100)
This could happen e.g. with mbox if a file isn't in a valid mbox.

src/plugins/quota/quota-count.c

index 609421bedc0f4233b9dbc04d7446c872b931edf0..f80582d117247f883d377bee69b3e5d7cd5f0a8d 100644 (file)
@@ -32,7 +32,7 @@ quota_count_mailbox(struct quota_root *root, struct mail_namespace *ns,
 
        box = mailbox_alloc(ns->list, storage_name,
                            MAILBOX_FLAG_READONLY | MAILBOX_FLAG_KEEP_RECENT);
-       if (mailbox_open(box) < 0) {
+       if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
                mail_storage_get_last_error(mailbox_get_storage(box), &error);
                mailbox_free(&box);
                if (error == MAIL_ERROR_TEMP)
@@ -41,11 +41,6 @@ quota_count_mailbox(struct quota_root *root, struct mail_namespace *ns,
                return 0;
        }
 
-       if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
-               mailbox_free(&box);
-               return -1;
-       }
-
        trans = mailbox_transaction_begin(box, 0);
        mail = mail_alloc(trans, MAIL_FETCH_PHYSICAL_SIZE, NULL);