I have a lot of rules in my Sieve script. Sometimes an email message ends up in the wrong folder, due to a problem with one of the rules. However, this is very difficult to debug, because I have no idea which rule matched the email.
A log file might be helpful, but that wouldn't be readable without shell access to the mail server. This is not a solution that would work for everyday users, who configure their rules via a web page UI.
What would be great would be for the Sieve interpreter to append a custom header to each email message after it gets processed. This header would record which Sieve rules matched the email.
Does this feature exist already? Or is there a way to accomplish it via the Dovecot server configuration? Thanks!