Re: [Exim] System filtering on recipient addresses

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Dave Bretton
CC: 'exim-users@exim.org'
Subject: Re: [Exim] System filtering on recipient addresses
On Fri, 2 Nov 2001, Dave Bretton wrote:

> What is required it to blackhole all incoming mail with a local part
> matching ABC{10 digits}.
>
> The following conditionals have failed to catch it:
>
> if $recipients contains
> abc[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]@


You don't want "contains", you want "matches".

"contains" does a literal string match; you want a regular expression
match.

A better regex is    ^abc\d{10}@     because (a) it ensures abc is at
the start of the address and (b) it is less cumbersome. However, in a
filter you'll need to write    ^abc\\d{10}@    because the string is
expanded.


And if you really want to match ABC (upper case) and not abc (lower
case) or aBc (mixed case), use "MATCHES" instead of "matches".

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.