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.3.0.rc1~2090 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb9065b1c34dafe68382f1f1d0d951e12a411c2d;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; }