From d6ceec7f3ab027ecf76de88ffd6c05c147f90a6d Mon Sep 17 00:00:00 2001 From: Siavash Tavakoli Date: Tue, 30 Mar 2021 00:37:59 +0100 Subject: [PATCH] lib-storage: Add "mail_expunged" event Emitted when a message is actually expunged. Has UID as a field. --- src/lib-storage/mail-storage.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index a67ef34ea1..5813f1d490 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -3179,4 +3179,12 @@ void mailbox_sync_notify(struct mailbox *box, uint32_t uid, { if (box->v.sync_notify != NULL) box->v.sync_notify(box, uid, sync_type); + + /* Send an event for expunged mail. */ + if (sync_type == MAILBOX_SYNC_TYPE_EXPUNGE) { + e_debug(event_create_passthrough(box->event)-> + set_name("mail_expunged")-> + add_int("uid", uid)->event(), + "UID %u: Mail expunged", uid); + } } -- 2.47.3