From: Timo Sirainen Date: Wed, 15 Feb 2017 16:20:05 +0000 (+0200) Subject: lib-storage: Re-open mailbox after it's undeleted. X-Git-Tag: 2.2.28.rc1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4decb8ca5ce533715b4d2d2e8fb7d5f591f69983;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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; }