From: Timo Sirainen Date: Fri, 6 Aug 2010 15:01:20 +0000 (+0100) Subject: dict quota: Don't fail quota recalculation if mailbox syncing fails with non-temp... X-Git-Tag: 2.0.rc5~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73ec9ad7268103e9fd91cf11cdbd6ef6a0b1d1a9;p=thirdparty%2Fdovecot%2Fcore.git dict quota: Don't fail quota recalculation if mailbox syncing fails with non-temp error. This could happen e.g. with mbox if a file isn't in a valid mbox. --- diff --git a/src/plugins/quota/quota-count.c b/src/plugins/quota/quota-count.c index 609421bedc..f80582d117 100644 --- a/src/plugins/quota/quota-count.c +++ b/src/plugins/quota/quota-count.c @@ -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);