From: Timo Sirainen Date: Sun, 31 Mar 2013 14:24:35 +0000 (+0300) Subject: lib-storage: mailbox_get_status() no longer forces mailbox to be synced. X-Git-Tag: 2.2.rc4~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75b6f320d3efe979f1994bb07e5eff05fd9f7d71;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mailbox_get_status() no longer forces mailbox to be synced. This fixes copying messages with keywords to a virtual mailbox, where syncing happened too late and caused assert-crash (status was only used to lookup list of keywords). The crash could have been solved another way too, but it's probably better if automatic syncing isn't always performed. doveadm index -n parameter handling also relies on this behavior. --- diff --git a/src/lib-storage/index/index-status.c b/src/lib-storage/index/index-status.c index 19bb411507..1e7d5d7e29 100644 --- a/src/lib-storage/index/index-status.c +++ b/src/lib-storage/index/index-status.c @@ -36,8 +36,6 @@ int index_storage_get_status(struct mailbox *box, if (!box->opened) { if (mailbox_open(box) < 0) return -1; - } - if (!box->synced) { if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0) return -1; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 0d2d6cc42c..4e414a53d8 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -541,7 +541,10 @@ bool mailbox_backends_equal(const struct mailbox *box1, do forced CLOSE. */ bool mailbox_is_inconsistent(struct mailbox *box); -/* Gets the mailbox status information, opening the mailbox if necessary. */ +/* Gets the mailbox status information. If mailbox isn't opened yet, try to + return the results from mailbox list indexes. Otherwise the mailbox is + opened and synced. If the mailbox is already opened, no syncing is done + automatically. */ int mailbox_get_status(struct mailbox *box, enum mailbox_status_items items, struct mailbox_status *status_r); /* Gets the mailbox status, requires that mailbox is already opened. */