changeset 21569:716b798e11d0

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.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 15 Feb 2017 18:20:05 +0200
parents 5accb4ee4d95
children d1860907acf9
files src/lib-storage/mail-storage.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.c	Wed Feb 15 18:18:46 2017 +0200
+++ b/src/lib-storage/mail-storage.c	Wed Feb 15 18:20:05 2017 +0200
@@ -1179,6 +1179,11 @@
 		   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;
 	}