From ef652c941b5eb54a3ec534ce67388ffeb4ab5737 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 1 Sep 2010 17:32:37 +0100 Subject: [PATCH] lib-storage: If mailbox deletion fails, mark the index back as undeleted. --- src/lib-storage/mail-storage.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.47.3