From: Siavash Tavakoli Date: Mon, 29 Mar 2021 12:01:40 +0000 (+0100) Subject: lib-storage: Emit "mail_expunge_requested" event X-Git-Tag: 2.3.15~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0972d42cdbbc978a7d8ee820b93a8f25b5d5012c;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Emit "mail_expunge_requested" event Adds a new event, "mail_expunge_requested" which is emitted when a message is marked to being expunged. --- diff --git a/src/lib-storage/mail-storage-private.h b/src/lib-storage/mail-storage-private.h index 5e5dd90afd..d08c86ec2f 100644 --- a/src/lib-storage/mail-storage-private.h +++ b/src/lib-storage/mail-storage-private.h @@ -798,6 +798,9 @@ int mail_set_attachment_keywords(struct mail *mail); /* Emit mail opened events */ void mail_opened_event(struct mail *mail); +/* Emit mail expunge_requested event */ +void mail_expunge_requested_event(struct mail *mail); + void mailbox_set_deleted(struct mailbox *box); int mailbox_mark_index_deleted(struct mailbox *box, bool del); /* Easy wrapper for getting mailbox's MAILBOX_LIST_PATH_TYPE_MAILBOX. diff --git a/src/lib-storage/mail.c b/src/lib-storage/mail.c index 61c49421cd..6bcbbd1e34 100644 --- a/src/lib-storage/mail.c +++ b/src/lib-storage/mail.c @@ -428,6 +428,7 @@ void mail_expunge(struct mail *mail) T_BEGIN { p->v.expunge(mail); } T_END; + mail_expunge_requested_event(mail); } void mail_autoexpunge(struct mail *mail) @@ -589,3 +590,12 @@ void mail_opened_event(struct mail *mail) else e_debug(e->event(), "Opened mail"); } + +void mail_expunge_requested_event(struct mail *mail) +{ + struct event_passthrough *e = event_create_passthrough(mail->event)-> + set_name("mail_expunge_requested")-> + add_int("uid", mail->uid)-> + add_int("seq", mail->seq); + e_debug(e->event(), "Expunge requested"); +}