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.2.34~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2f3c13502fc6577167b00fb70eb5514b1fee6fb;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 7e5b134ec6..048b037a22 100644 --- a/src/lib-storage/index/imapc/imapc-mailbox.c +++ b/src/lib-storage/index/imapc/imapc-mailbox.c @@ -274,8 +274,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; + } mbox->exists_count = exists_count; mbox->exists_received = TRUE;