On 29/08/2020 21:04, Alec Moskvin wrote:
Hello,
I have a rule to always delete a header. If the message gets fileinto'd, the header is gone, but if it's delivered into the INBOX through implicit keep, the header does not get deleted.
Interestingly, if I remove the "if duplicate" filter, the header does get deleted as expected.
I'm using the latest Dovecot 2.3.11.3 / Pigeonhole 0.5.11.
Any idea why this is happening?
Can you enable Sieve tracing? That should show you in detail what is happening during delivery and why.
Regards,
Stephan.
Thanks, Alec
=== Sieve filter
require ["fileinto", "editheader", "duplicate", "mailbox"];
deleteheader "X-Bad-Header";
if duplicate { fileinto :create "Trash"; stop; }
if header :matches "subject" "*filter*" { fileinto :create "Filtered"; }
=== Example (note ${RANDOM} to bypass duplicate filter)
$ /usr/libexec/dovecot/deliver << -end- To: me@example.com From: someone@example.com Subject: Test Message Message-Id: <${RANDOM}@example.net> Date: Thu, 20 Aug 2020 00:21:24 +0000 (UTC) X-Bad-Header: DELETE ME
Hello world -end-