From: Timo Sirainen Date: Thu, 11 Mar 2021 15:27:54 +0000 (+0200) Subject: trash: Replace mailbox_set_reason() with reason_code=trash:clean X-Git-Tag: 2.3.18~338 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d31e44e66cc6a07e9c4594acded73e66b6e7c03f;p=thirdparty%2Fdovecot%2Fcore.git trash: Replace mailbox_set_reason() with reason_code=trash:clean --- diff --git a/src/plugins/trash/trash-plugin.c b/src/plugins/trash/trash-plugin.c index cfcd246894..d918484edd 100644 --- a/src/plugins/trash/trash-plugin.c +++ b/src/plugins/trash/trash-plugin.c @@ -55,7 +55,6 @@ static int trash_clean_mailbox_open(struct trash_mailbox *trash) struct mail_search_args *search_args; trash->box = mailbox_alloc(trash->ns->list, trash->name, 0); - mailbox_set_reason(trash->box, "trash plugin"); if (mailbox_open(trash->box) < 0) { mailbox_free(&trash->box); return 0; @@ -106,12 +105,15 @@ static int trash_try_clean_mails(struct quota_transaction_context *ctx, { struct trash_user *tuser = TRASH_USER_CONTEXT_REQUIRE(ctx->quota->user); struct trash_mailbox *trashes; + struct event_reason *reason; unsigned int i, j, count, oldest_idx; time_t oldest, received = 0; uint64_t size, size_expunged = 0; unsigned int expunged_count = 0; int ret = 0; + reason = event_reason_begin("trash:clean"); + trashes = array_get_modifiable(&tuser->trash_boxes, &count); for (i = 0; i < count; ) { /* expunge oldest mails first in all trash boxes with @@ -176,6 +178,7 @@ err: mailbox_free(&trash->box); } + event_reason_end(&reason); if (size_expunged < size_needed) { e_debug(ctx->quota->user->event,