From: Timo Sirainen Date: Sun, 4 Mar 2012 11:19:03 +0000 (+0200) Subject: lib-storage: mailbox_enable() shouldn't actually open the mailbox. X-Git-Tag: 2.1.2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d7ab441915339d9eec00cdcfa5f02b22dbdc30b;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mailbox_enable() shouldn't actually open the mailbox. This combined with mailbox_get_status() never synced the mailbox, so if there were any changes they weren't visible in STATUS reply. --- diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index c7c83bb0d3..6c965ef356 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -272,6 +272,9 @@ int index_storage_mailbox_open(struct mailbox *box, bool move_to_memory) box->opened = TRUE; + if ((box->enabled_features & MAILBOX_FEATURE_CONDSTORE) != 0) + mail_index_modseq_enable(box->index); + index_thread_mailbox_opened(box); hook_mailbox_opened(box); return 0; @@ -313,14 +316,8 @@ void index_storage_mailbox_alloc(struct mailbox *box, const char *vname, int index_storage_mailbox_enable(struct mailbox *box, enum mailbox_feature feature) { - if ((feature & MAILBOX_FEATURE_CONDSTORE) != 0) { + if ((feature & MAILBOX_FEATURE_CONDSTORE) != 0) box->enabled_features |= MAILBOX_FEATURE_CONDSTORE; - if (mailbox_open(box) < 0) - return -1; - T_BEGIN { - mail_index_modseq_enable(box->index); - } T_END; - } return 0; }