Re: [Exim] System filtering on recipient addresses

Top Pagina
Delete this message
Reply to this message
Auteur: Philip Hazel
Datum:  
Aan: Dave Bretton
CC: 'exim-users@exim.org'
Onderwerp: 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.