]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Fix assert that checks if mail is expunged locally.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 23 Nov 2016 15:14:48 +0000 (17:14 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 23 Nov 2016 16:21:09 +0000 (18:21 +0200)
The EXPUNGE may have been sent while imapc_sync_index() was issuing
remote imapc commands. It would end up being in delayed_expunged_uids,
so the assert needs to check that too.

Fixes:
Panic: file imapc-sync.c: line 290 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq))

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

index fa3e66f6253aa7ed19309661256bbe09ac6cb68a..4d94f9e36fbf441367771a1adf865487f7c43335 100644 (file)
@@ -287,7 +287,8 @@ imapc_initial_sync_check(struct imapc_sync_context *ctx, bool nooped)
                                break;
                        }
                        /* it's already expunged and we should have marked it */
-                       i_assert(mail_index_is_expunged(view, lseq));
+                       i_assert(mail_index_is_expunged(view, lseq) ||
+                                seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid));
                        lseq++;
                } else {
                        /* message doesn't exist in index, but exists in