From f859d437e60ba97fb0b955019ac7bdc3f7024f84 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 12 Jun 2019 10:58:37 +0300 Subject: [PATCH] lib-storage: Sync mailbox after autoexpunging 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/mail-autoexpunge.c b/src/lib-storage/mail-autoexpunge.c index de6c31b955..11740c3c2d 100644 --- a/src/lib-storage/mail-autoexpunge.c +++ b/src/lib-storage/mail-autoexpunge.c @@ -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; } -- 2.47.3