Re: Exim Filter

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Tim Patterson
Datum:  
To: exim-users
Betreff: Re: Exim Filter
Thank you, Dom Mitchell and T. William Wells.

So far I still *not* get my filter to return *true* as expected.

It may be a BSDI 2.1 or Exim 1.62. or a Tim issue. I am a
beginner+ to pattern matching.

The facts seem to be as follows:

#the email message contains the following in the header
From: 1234@???

#!exim filter

Observed results using exim -bf spam_filter < test.msg

True $h_from: contains global
True $h_from: matches global
False $h_from: matches 'global'
False $h_from: contains 'global'
False $h_from: matches \b[0-9]+@.*\.com\b
Error $h_from: matches ^[0-9]+@.*\.com$
False $h_from: matches ^[0-9]+@.*\.com
Error $h_from: matches '^[0-9]+@.*\.com'

Thank you,

Tim Patterson

---------History-------


On Tue, 14 Oct 1997, T. William Wells wrote:

> In article <Pine.BSI.3.95.971014092630.10988R-100000@???>,
> Tim Patterson  <tim@???> wrote:
> : if
> :   ($h_to: contains        "internetusers@???" or
> :    $h_to: contains        "Friend@???" or
> :    $h_from: contains  '[0-9]+@' or
> :    $h_from: contains  '^[0-9]+@*\.com'or

>
> This does what you want:
>
>     $h_from: matches \b[0-9]+@.*\.com\b

>
> "contains" does substring matching.
>
> "matches" does regular expression matching.
>
> the \b match word boundaries.



>From hdm@??? Tue Oct 14 15:13:31 1997

Date: Tue, 14 Oct 1997 17:45:45 +0100
From: Dom Mitchell <hdm@???>
To: Tim Patterson <tim@???>
Cc: exim-users@???
Subject: Re: Exim Filter

On 14 October 1997, Tim Patterson proclaimed:
> Hello,
>
> I am unable to get my filter to reject 12345@???
> I understand that filter From: is not of much use, but
> I am just trying to resolve the syntax.
>
> Please send me a line of code that will filter all
> [numeric only]@domain.com in an *exim filter*
>
> I have tried
> ^[0-9]+@*\.com
> ^[0-9]+@*\\.com$


You are misunderstanding regular expressions. You should try this one
instead:

^[0-9]+@.*\.com$

-Dom



--
* This is sent by the exim-users mailing list.  To unsubscribe send a
    mail with subject "unsubscribe" to exim-users-request@???
* Exim information can be found at http://www.exim.org/