changeset 22321:85e328807153

lib-storage: Don't use mailbox list index if it has refresh_flag set For example if INBOX is deleted, looking up its GUID shouldn't be returned from the list index since it contains the old GUID.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 10 Jul 2017 15:54:07 +0300
parents 4f99fd557c92
children 97f8c7098b30
files src/lib-storage/list/mailbox-list-index-status.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-index-status.c	Mon Jul 10 13:34:17 2017 +0300
+++ b/src/lib-storage/list/mailbox-list-index-status.c	Mon Jul 10 15:54:07 2017 +0300
@@ -55,7 +55,11 @@
 	}
 
 	view = mail_index_view_open(ilist->index);
-	if (!mail_index_lookup_seq(view, node->uid, &seq)) {
+	if (mailbox_list_index_need_refresh(ilist, view)) {
+		/* mailbox_list_index_refresh_later() was called.
+		   Can't trust the index's contents. */
+		ret = 1;
+	} else if (!mail_index_lookup_seq(view, node->uid, &seq)) {
 		/* our in-memory tree is out of sync */
 		ret = 1;
 	} else if (!status_check) {