]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 13 Oct 2016 08:20:59 +0000 (10:20 +0200)
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 2c173536691797e864a69843518d40ad9f90e2fb..9861c8fb6f63b92abbd937fa83e847a15973c40e 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",