RE: [Exim] Router conditional Statement for spamassassin

Top Pagina
Delete this message
Reply to this message
Auteur: Owen Creger
Datum:  
Aan: 'exim-users@exim.org'
Onderwerp: RE: [Exim] Router conditional Statement for spamassassin
I think I got it with regexps
I want to determine if IP address is NOT from 10.10.32.0/24 10.10.33.0/24 or
10.223.196.0/24

condition = "${if and { {!def:h_X-Spam-Flag:} {!eq
{$received_protocol}{spam-scanned}} {!match
{$sender_host_address}{/^10\.(10\.(32|33))|(222\.196)\./}} } {1}{0}}"

Does my regexps look correct?

> -----Original Message-----
> From: Philip Hazel [mailto:ph10@cus.cam.ac.uk]
> Sent: Wednesday, December 04, 2002 9:31 AM
> To: Owen Creger
> Cc: 'exim-users@???'
> Subject: Re: [Exim] Router conditional Statement for spamassassin
>
>
> On Tue, 3 Dec 2002, Owen Creger wrote:
>
> > I would {!eq {$sender_host_address}{10.0.0.0/8}} cover all
> the 10 addresses?
>
> No. "eq" does a straight text comparison. It is not magic; it doesn't
> know you are dealing with IP addresses here.
>
> However, there *is* some magic that can help you. Check out the "mask"
> expansion operator. That will enable you to turn the contents of
> $sender_host_address into a masked value such that eq can compare it.
>
> Hint: "exim -be" is your friend for testing expansions.
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.

>