From: Timo Sirainen Date: Tue, 27 Sep 2016 16:48:14 +0000 (+0300) Subject: lib-index: If view syncing sees index is reset, always mark the view as inconsistent. X-Git-Tag: 2.3.0.rc1~2955 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96d1b0c8126121fdceff98144c932433e3fdeb92;p=thirdparty%2Fdovecot%2Fcore.git lib-index: If view syncing sees index is reset, always mark the view as inconsistent. Not only when the mailbox has messages, because that could still mess up assumptions about UIDs. A somewhat better check could have been to do this only when next_uid>1 (= there have been messages at some point in this mailbox), but it's safer to just always mark the view as inconsistent. --- diff --git a/src/lib-index/mail-index-view-sync.c b/src/lib-index/mail-index-view-sync.c index 2c07942e54..01d5bb04a2 100644 --- a/src/lib-index/mail-index-view-sync.c +++ b/src/lib-index/mail-index-view-sync.c @@ -596,7 +596,7 @@ mail_index_view_sync_begin(struct mail_index_view *view, ctx->finish_min_msg_count = reset ? 0 : view->map->hdr.messages_count - expunge_count; - if (reset && view->map->hdr.messages_count > 0) { + if (reset) { view->inconsistent = TRUE; mail_index_set_error(view->index, "%s reset, view is now inconsistent",