From 4decb8ca5ce533715b4d2d2e8fb7d5f591f69983 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 15 Feb 2017 18:20:05 +0200 Subject: [PATCH] lib-storage: Re-open mailbox after it's undeleted. This is needed with mailbox formats that didn't fully open the mailbox while it was undeleted. --- src/lib-storage/mail-storage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 90bc26d527..c61abbe2b9 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -1179,6 +1179,11 @@ int mailbox_open(struct mailbox *box) undelete it and reopen. */ if(!mailbox_try_undelete(box)) return -1; + + /* make sure we close the mailbox in the middle. some backends + may not have fully opened the mailbox while it was being + undeleted. */ + mailbox_close(box); if (mailbox_open_full(box, NULL) < 0) return -1; }