]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 16 Jan 2018 16:17:00 +0000 (18:17 +0200)
The initial EXISTS reply shouldn't be ignored, only the following ones.

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

index d5193b114a2e8aa399fea505bd7815565ecbb7e6..5a18b899adcfc6abba7119883cd58fb8c801b08d 100644 (file)
@@ -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)