]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: If view syncing sees index is reset, always mark the view as inconsistent.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 27 Sep 2016 16:48:14 +0000 (19:48 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 4 Oct 2016 20:32:29 +0000 (23:32 +0300)
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.

src/lib-index/mail-index-view-sync.c

index 2c07942e5432bda20da9fddf06d6c2e540f335dc..01d5bb04a20eea988f97777812e40bb7be318cf4 100644 (file)
@@ -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",