Duplicate e-mail with Dovecot and Sieve
Claudio Corvino
ccorvino at trustitalia.it
Thu Nov 28 18:44:29 EET 2019
Hi,
I think that the test "if not duplicate" could not work for our case, as
the out of office should answer everytime, we only wants the redirect to
not be sent as a duplicate for the users of the alias LIST.
In other words we would like:
1) To redirect the e-mail directed to a single user (with out of office
active) to LIST at domain.tld, so that every user of the LIST receives one
copy;
2) To delete one copy for the e-mail directed to LIST at domain.tld,
otherwise every user of the LIST will receive two e-mail, one directed
to the LIST and one generated from the redirect of the sieve script by
the user with out of office in active state.
So we're considering to add this part to the users sieve scripts:
/# rule:[RemoveMail]/
/if allof (header :contains "X-Sieve" "Pigeonhole Sieve", header
:contains "X-Sieve-Redirected-From" "domain.tld", header :contains
["to", "cc"] "LIST at domain.tld")//
//{//
// fileinto "Trash";//
//}/
So the script become:
/require ["fileinto","vacation-seconds"];/
/# rule:[RemoveDuplicateMail]/
///if allof (header :contains "X-Sieve" "Pigeonhole Sieve", header
:contains "X-Sieve-Redirected-From" "domain.tld", header :contains
["to", "cc"] "LIST at domain.tld")
{
fileinto "Trash";
/
/}/
/# rule:[Outofoffice] if true { vacation :addresses "//xxxxxxx at domain.tld <https://dovecot.org/mailman/listinfo/dovecot>//" :subject "Automatic Reply" text: <Text here> . ; fileinto
"INBOX"; redirect "//LIST at domain.tld <https://dovecot.org/mailman/listinfo/dovecot>//"; }/
In this way, the duplicate e-mail generated from the redirect to
LIST at domain.tld should be moved into Trash.
Just one problem remaining: the e-mail that have LIST at domain.tld in BCC
could not be intercepted by the sieve filter as in the header is not
present any reference to LIST at domain.tld; am I missing something or this
cannot be fixed?
Thanks
Claudio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4206 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://dovecot.org/pipermail/dovecot/attachments/20191128/4a327fc7/attachment.p7s>
More information about the dovecot
mailing list