Re: [exim] Filter separator

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Mike Cardwell
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Filter separator
* on the Thu, Feb 20, 2014 at 01:59:15PM -0300, Maxi Cooper - EGS wrote:

> Thanks for your reply Mike. What would you recommend to do this if the
> comma filter won't be safe (I certainly didn't considered the commas in the
> name field :S )? I will have messages with one or several addresses in the
> To header, among which there could be two specific ones which I wanna
> remove, any other suggestions?


The "addresses" string expansion looks useful:

root@glue:~# exim4 -be '${addresses:"Mike,Cardwell" <foo@???>, Wibble <wobble@???>}'
foo@???:wobble@???
root@glue:~#

Here it is in action:

root@glue:~# exim4 -be '${filter{${addresses:"Mike,Cardwell" <foo@???>, Wibble <wobble@???>}}{and{{!eq{foo@???}{$item}}{!eq{notinthelist@???}{$item}}}}}'
wobble@???
root@glue:~#

So you probably want something like this:

${filter{${addresses:$h_To:}}{and{{!eq{ADDRESS1}{$item}}{!eq{ADDRESS2}{$item}}}}}

Don't forget about Cc headers.

-- 
Mike Cardwell  https://grepular.com/     http://cardwellit.com/
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3  B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1  BF1B 295C 3C78 3EF1 46B4