]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: If mailbox deletion fails, mark the index back as undeleted.
authorTimo Sirainen <tss@iki.fi>
Wed, 1 Sep 2010 16:32:37 +0000 (17:32 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 1 Sep 2010 16:32:37 +0000 (17:32 +0100)
src/lib-storage/mail-storage.c

index f1bdc5095fe37330ecb55b9d6dabdd4ce00e848e..2241310353c10ec3fedadc0c08eb4b9e02dbf912 100644 (file)
@@ -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);