From: Timo Sirainen Date: Tue, 16 Jan 2018 16:17:00 +0000 (+0200) Subject: imapc: Fix imap_features=no-msn-updates to not fail on SELECT X-Git-Tag: 2.3.9~2535 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6303446550dae335bc8c4b147d909e04894e4064;p=thirdparty%2Fdovecot%2Fcore.git imapc: Fix imap_features=no-msn-updates to not fail on SELECT The initial EXISTS reply shouldn't be ignored, only the following ones. --- diff --git a/src/lib-storage/index/imapc/imapc-mailbox.c b/src/lib-storage/index/imapc/imapc-mailbox.c index d5193b114a..5a18b899ad 100644 --- a/src/lib-storage/index/imapc/imapc-mailbox.c +++ b/src/lib-storage/index/imapc/imapc-mailbox.c @@ -151,8 +151,14 @@ imapc_untagged_exists(const struct imapc_untagged_reply *reply, uint32_t exists_count = reply->num; const struct mail_index_header *hdr; - if (mbox == NULL || IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_NO_MSN_UPDATES)) + if (mbox == NULL) return; + if (mbox->exists_received && + IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_NO_MSN_UPDATES)) { + /* ignore all except the first EXISTS reply (returned by + SELECT) */ + return; + } view = mbox->delayed_sync_view; if (view == NULL)