]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Don't do temp file scanning for mailbox directories
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 20 Jun 2023 15:44:52 +0000 (18:44 +0300)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Wed, 28 Jun 2023 12:20:40 +0000 (14:20 +0200)
The intention was to delete any temporary mail files that have been left
behind by crashed processes, but mail files are written to storage/
directory.

src/lib-storage/index/dbox-common/dbox-storage.c
src/lib-storage/index/dbox-common/dbox-storage.h
src/lib-storage/index/dbox-single/sdbox-storage.c

index fccf4a26487bd5bac19cfe6460c0612791f35aa8..b9f651f7468589d9a0d8af43e30de5e93ac8a138 100644 (file)
@@ -282,7 +282,7 @@ int dbox_mailbox_open(struct mailbox *box)
        return 0;
 }
 
-static void dbox_mailbox_close_cleanup(struct mailbox *box)
+void dbox_mailbox_close_cleanup(struct mailbox *box)
 {
        if (box->view == NULL)
                return;
@@ -319,7 +319,6 @@ static void dbox_mailbox_close_cleanup(struct mailbox *box)
 
 void dbox_mailbox_close(struct mailbox *box)
 {
-       dbox_mailbox_close_cleanup(box);
        index_storage_mailbox_close(box);
 }
 
index d7855fc36a6be09a59b4a06242b10a63ff2a55b5..9c614e730017aabdd8d85d6a1741dc17fdcfc187 100644 (file)
@@ -75,6 +75,7 @@ void dbox_notify_changes(struct mailbox *box);
 int dbox_mailbox_check_existence(struct mailbox *box);
 int dbox_mailbox_open(struct mailbox *box);
 void dbox_mailbox_close(struct mailbox *box);
+void dbox_mailbox_close_cleanup(struct mailbox *box);
 int dbox_mailbox_create(struct mailbox *box,
                        const struct mailbox_update *update, bool directory);
 int dbox_mailbox_create_indexes(struct mailbox *box,
index 23cf6e34e0bb493ad54b41f7fe5ba40470d6872c..a25c325306b427df4bc0eb9442dc4cbe2bd15081 100644 (file)
@@ -376,6 +376,7 @@ static void sdbox_mailbox_close(struct mailbox *box)
        if (mbox->corrupted_rebuild_count != 0)
                (void)sdbox_sync(mbox, 0);
 
+       dbox_mailbox_close_cleanup(box);
        dbox_mailbox_close(box);
 }