]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add "mail_expunged" event
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Mon, 29 Mar 2021 23:37:59 +0000 (00:37 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 15 Apr 2021 07:06:27 +0000 (07:06 +0000)
Emitted when a message is actually expunged. Has UID as a field.

src/lib-storage/mail-storage.c

index a67ef34ea18c19ef9c844d302bb5b627b497a190..5813f1d490eec7d358f2f8cfd3285718fdce6576 100644 (file)
@@ -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);
+       }
 }