Hi list :)
We want to make some changes to our spam filter, but we first want to be able to check if what we do does have any effect.
So I was thinking of storing in our statistics if somebody moves an email to their Junk folder (or even better: vice versa).
I have created the following metric for this:
metric imap_command_move { filter = event=imap_command_finished AND cmd_name="UID MOVE" AND (cmd_args = "* Junk" OR cmd_args = "* INBOX") group_by = cmd_args }
And when I move something to the Junk folder I get the following after a doveadm stats dump:
(...) imap_command_move duration 5 252529 27061 124989 50505.80 34476 37503.81 124989 imap_command_move_15_Junk duration 1 124989 124989 124989 124989.00 124989 0.00 124989 imap_command_move_14_Junk duration 1 38725 38725 38725 38725.00 38725 0.00 38725 imap_command_move_12_INBOX duration 1 27061 27061 27061 27061.00 27061 0.00 27061 imap_command_move_13_INBOX duration 1 27278 27278 27278 27278.00 27278 0.00 27278 imap_command_move_3_INBOX duration 1 34476 34476 34476 34476.00 34476 0.00 34476
In my example, I moved 6 messages: 2 from INBOX to Junk, 1 from INBOX to a separate folder, 2 from Junk back to INBOX and 1 from the separate folder back to INBOX.
However, because I'm grouping by cmd_args, it includes the full parameters: IMAP command’s full parameters (e.g. 1:* FLAGS)
https://doc.dovecot.org/admin_manual/list_of_events/#imap-command
Is there a way to filter out the first part so that I ideally get a stat named imap_command_move_Junk & imap_command_move_INBOX?
Is there perhaps a way to get to know specifically the from and to folders the user is moving the mail from and to?
Thanks!