]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't use mailbox list index if it has refresh_flag set
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 10 Jul 2017 12:54:07 +0000 (15:54 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 10 Jul 2017 13:22:17 +0000 (16:22 +0300)
For example if INBOX is deleted, looking up its GUID shouldn't be returned
from the list index since it contains the old GUID.

src/lib-storage/list/mailbox-list-index-status.c

index 4f0d68f2da43a69ba462b4fc116cb1e5a8c40eef..9256620a1acea0e4f1eaacf5c482de34ad2c139f 100644 (file)
@@ -55,7 +55,11 @@ index_list_open_view(struct mailbox *box, bool status_check,
        }
 
        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) {