]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Fix imap_features=no-msn-updates to not fail on SELECT
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 16 Jan 2018 16:17:00 +0000 (18:17 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 18 Jan 2018 10:15:10 +0000 (12:15 +0200)
The initial EXISTS reply shouldn't be ignored, only the following ones.

src/lib-storage/index/imapc/imapc-mailbox.c

index 7e5b134ec6e076ae1dd97da8d7d668eff30cb679..048b037a22ce04cb8a7ff13ad41693a6ddc40c60 100644 (file)
@@ -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;