Sieve: deleteheader now working with duplicate filter for implicit keep

Alec Moskvin alecm at
Sat Aug 29 22:04:18 EEST 2020


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 / Pigeonhole 0.5.11.

Any idea why this is happening?


=== Sieve filter

require ["fileinto", "editheader", "duplicate", "mailbox"];

deleteheader "X-Bad-Header";

if duplicate {
        fileinto :create "Trash";

if header :matches "subject" "*filter*" {
    fileinto :create "Filtered";

=== Example (note ${RANDOM} to bypass duplicate filter)

$ /usr/libexec/dovecot/deliver << -end-
To: me at
From: someone at
Subject: Test Message
Message-Id: <${RANDOM}>
Date: Thu, 20 Aug 2020 00:21:24 +0000 (UTC)
X-Bad-Header: DELETE ME

Hello world

More information about the dovecot mailing list