From: Siavash Tavakoli Date: Mon, 29 Mar 2021 23:37:59 +0000 (+0100) Subject: lib-storage: Add "mail_expunged" event X-Git-Tag: 2.3.15~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6ceec7f3ab027ecf76de88ffd6c05c147f90a6d;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Add "mail_expunged" event Emitted when a message is actually expunged. Has UID as a field. --- 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); + } }