Skip to content

Commit

Permalink
imapc: Fix assert-crash when reconnecting during initial FETCH finds …
Browse files Browse the repository at this point in the history
…expunges

The initial FETCH is automatically retried on failure, but the FETCH state
wasn't reset during the reconnection.

Fixes:
Panic: file imapc-sync.c: line 328 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq) || seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid))
  • Loading branch information
sirainen committed Jun 26, 2018
1 parent 7a52620 commit 56b939c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib-storage/index/imapc/imapc-storage.c
Expand Up @@ -611,6 +611,14 @@ static void imapc_mailbox_reopen(void *context)
i_assert(!mbox->initial_sync_done);
return;
}
if (!mbox->initial_sync_done) {
/* Initial FETCH 1:* didn't fully succeed. We're reconnecting
and lib-imap-client is automatically resending it. But we
need to reset the sync_next_* state so that if any of the
mails are now expunged we won't get confused and crash. */
mbox->sync_next_lseq = 1;
mbox->sync_next_rseq = 1;
}

mbox->initial_sync_done = FALSE;
mbox->selecting = TRUE;
Expand Down

0 comments on commit 56b939c

Please sign in to comment.