From: Timo Sirainen Date: Wed, 1 Sep 2010 16:32:37 +0000 (+0100) Subject: lib-storage: If mailbox deletion fails, mark the index back as undeleted. X-Git-Tag: 2.0.2~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef652c941b5eb54a3ec534ce67388ffeb4ab5737;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: If mailbox deletion fails, mark the index back as undeleted. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index f1bdc5095f..2241310353 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -748,6 +748,12 @@ int mailbox_delete(struct mailbox *box) } ret = box->v.delete(box); + if (ret < 0 && box->marked_deleted) { + /* deletion failed. revert the mark so it can maybe be + tried again later. */ + if (mailbox_mark_index_deleted(box, FALSE) < 0) + return -1; + } box->deleting = FALSE; mailbox_close(box);