Sieve and handling multiple addresses
Benny Pedersen
me at junc.eu
Sun Jul 12 19:17:26 EEST 2020
@lbutlr skrev den 2020-07-12 16:43:
> I an trying to write a sieve action that will take mail that is
> addressed to a user only it is filed in a mailbox (e.g. "Direct") if
> it is to the email AND to any other email address, then file it in a
> mailbox named, e.g. "Cc". And if the mail is not addressed to the user
> at all, sieve does nothing with it.
>
> Message 1: to foo at example.com => Direct
>
> Message 2: to/cc foo at example.com & to/cc to
> anyone at anydomain.tlf => CC
> Optional: If it contains a specific header like
> "X-bypass: secret string" => no action
>
> Message 3: NOT to/cc foo at example.com => no action
>
> I've gotten exactly nowhere so far
>
> Something like
>
> if :allof (header :contains ["to"] ["foo#example.com"],
> header :contains ["cc"] ["foo#example.com"])
>
> Takes care of the first part of the message 1 and 2 criteria. But then
> what?
to, cc can be one single header test
https://p5r.uk/blog/2011/sieve-tutorial.html
allof will force all headers to match, and thus it will not always work
if foo is not in both
will this solve it ?
More information about the dovecot
mailing list