From: Timo Sirainen Date: Sun, 25 Mar 2018 21:01:26 +0000 (+0300) Subject: imapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH X-Git-Tag: 2.2.36.rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd66b8184cedc38ed67f4beac07b29ab4cd97359;p=thirdparty%2Fdovecot%2Fcore.git imapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH Otherwise duplicate UIDs aren't detected and it causes an assert-crash: Panic: file imapc-mailbox.c: line 533 (imapc_untagged_fetch): assertion failed: (lseq == mbox->sync_next_lseq) --- diff --git a/src/lib-storage/index/imapc/imapc-mailbox.c b/src/lib-storage/index/imapc/imapc-mailbox.c index d4cbc4ec3c..13392cf2e1 100644 --- a/src/lib-storage/index/imapc/imapc-mailbox.c +++ b/src/lib-storage/index/imapc/imapc-mailbox.c @@ -357,11 +357,14 @@ imapc_mailbox_msgmap_update(struct imapc_mailbox *mbox, msgmap = imapc_client_mailbox_get_msgmap(mbox->client_box); msg_count = imapc_msgmap_count(msgmap); - if (fetch_uid != 0 && + if (fetch_uid != 0 && mbox->state_fetched_success && (IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_FETCH_MSN_WORKAROUNDS) || IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_NO_MSN_UPDATES))) { /* if we know the UID, use own own generated rseq instead of - the potentially broken rseq that the server sent. */ + the potentially broken rseq that the server sent. + Skip this during the initial FETCH 1:* (UID ..) handling, + or we can't detect duplicate UIDs and will instead + assert-crash later on. */ uint32_t fixed_rseq; if (imapc_msgmap_uid_to_rseq(msgmap, fetch_uid, &fixed_rseq))