Re: [Exim] System filtering on recipient addresses

Pàgina inicial
Delete this message
Reply to this message
Autor: Nigel Metheringham
Data:  
A: Dave Bretton
CC: 'exim-users@exim.org'
Assumpte: Re: [Exim] System filtering on recipient addresses
On Fri, 2001-11-02 at 13:26, Dave Bretton wrote:
>
> I'm having some troubles filtering on recipient addresses under exim 3.22.
>
> 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]@


this is testing whether recipients has the literal
'abc[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]@' as a substring
within it.

You need to use the match operators to check against regular
expressions. ie

if $recipients matches abc\d{10} then

You might however want to do this elsewhere than in the system filter. 
Why not intercept it early on in a director and fail it (off hand not
sure how you can do this directly, but you can use an alias one with a
single 
    *: :fail:we hate you
entry in the alias file, then have the director look something like


  bouncecrap:
    driver=aliasfile
    file=/var/exim/crap
    local_parts=^abc\d{10}


if you have recipient verification on you then have the chance to reject
these at SMTP time and never transfer them in.

    Nigel.