]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Sync mailbox after autoexpunging
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 12 Jun 2019 07:58:37 +0000 (10:58 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 4 Jul 2019 09:25:05 +0000 (12:25 +0300)
This actually finishes expunging the mails. Previously the mails were
just marked to be expunged in the transaction log, and the next session
that opened the mailbox finished the expunging.

src/lib-storage/mail-autoexpunge.c

index de6c31b955e5172554e460f79cc04b206616aa7a..11740c3c2db9610019fd344640b237833bf5bea2 100644 (file)
@@ -124,8 +124,11 @@ mailbox_autoexpunge(struct mailbox *box, unsigned int interval_time,
        mail_free(&mail);
        if (mailbox_transaction_commit(&t) < 0)
                ret = -1;
-       else
+       else if (count > 0) {
+               if (mailbox_sync(box, 0) < 0)
+                       ret = -1;
                *expunged_count += count;
+       }
        return ret;
 }