Sieve and handling multiple addresses

@lbutlr kremels at kreme.com
Sun Jul 12 23:47:52 EEST 2020


On 12 Jul 2020, at 10:17, Benny Pedersen <me at junc.eu> wrote:
> @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 ?

That is helpful, but I still do not see how to test for "email has anndress other than this address". If I simply say the address does not contain the address, then to will not match any mail that is sent to both foo at ewxample.com AND to another unknown email.



-- 
'I'm not a thief, madam. But if I were, I would be the kind that
	steals fire from the gods.' 'We've already got fire.' 'There must
	be an upgrade by now.'



More information about the dovecot mailing list