]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Emit "mail_expunge_requested" event
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Mon, 29 Mar 2021 12:01:40 +0000 (13:01 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 15 Apr 2021 07:06:27 +0000 (07:06 +0000)
Adds a new event, "mail_expunge_requested" which is emitted when a
message is marked to being expunged.

src/lib-storage/mail-storage-private.h
src/lib-storage/mail.c

index 5e5dd90afd8be99cb65b5e1379de07c48cb5c614..d08c86ec2fb15f4700246d38db5105d809190ad5 100644 (file)
@@ -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.
index 61c49421cd01ca31afc6497170bd459b7a32f0a8..6bcbbd1e34d058b530866a917498921f5be59ef7 100644 (file)
@@ -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");
+}