]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Re-open mailbox after it's undeleted.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 15 Feb 2017 16:20:05 +0000 (18:20 +0200)
committerGitLab <gitlab@git.dovecot.net>
Thu, 16 Feb 2017 10:38:36 +0000 (12:38 +0200)
This is needed with mailbox formats that didn't fully open the mailbox while
it was undeleted.

src/lib-storage/mail-storage.c

index 90bc26d52738f0ad4326ef05b26b3be817692428..c61abbe2b9e7453e12fb5ec927a199bf0cb70c23 100644 (file)
@@ -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;
        }