On Sat, 28 Feb 2004 17:02:05 +0100, Bram Mertens wrote:
> On Sat, 2004-02-28 at 06:12, Loren Wilton wrote:
>> This is more complicated than it looks to do right.
>> You have to handle several cases.  Off the top of my head, all
>> are valid
>> addresses:
>>
>> Joe Foo <[EMAIL PROTECTED]>
>> "Joe Foo" [EMAIL PROTECTED]
>> "Joe Foo" <[EMAIL PROTECTED]>
>> [EMAIL PROTECTED]
>> <[EMAIL PROTECTED]>
>> "Joe the-one-and-only Foo" [EMAIL PROTECTED]
>
> They are valid addresses but when I send mail the From field should
> be
> what my MUA sets it no?  No server relaying the message should alter
> this, right?
>
> When I started using Evolution I set it to:
> Mertens Bram <[EMAIL PROTECTED]>
> Later I altered it to:
> Bram Mertens <[EMAIL PROTECTED]>
>
> Am I wrong then to assume that messages containing:
> "Bram Mertens" <[EMAIL PROTECTED]>
> bram-mertens <[EMAIL PROTECTED]>
> are most likely faked?  Or could this be altered by some mailing
> list
> software or something like that?
>
>> You also have to handle
>> [EMAIL PROTECTED], [EMAIL PROTECTED]
>
> Is it possible to have more than one address in the From field?  Or
> are
> you checking the TO and Cc fields?
>
>> After a good deal of work, I came up with the following check for
>> my name,
>> which so far seems reliable in all cases that I've checked
>>
>> header   __TO_ME    ToCc =~ /(?:^|\>,|\>|,)\s*(?:\"?Loren.*
>> ?\b?Wilton\s*\"?\s*
>> \<[EMAIL PROTECTED]>?|\<[EMAIL PROTECTED]>?)/
> [...]
>
> Thanks for thinking about this but again doesn't this check the To
> and
> Cc fields?  I am looking for someone claiming to be me...
>
> As I said above I do have to check two cases so I edited my code to:
> header    LOCAL_TEST_RULE  From =~ /(?<!
> (?:Bram\sMertens)|(?:Mertens\sBram))\s<[EMAIL PROTECTED]>/
> score     LOCAL_TEST_RULE  0.2
> describe  LOCAL_TEST_RULE  Is someone faking to be me?
>
> Doesn't this allow messages with the following From headers?
> From: Mertens Bram <[EMAIL PROTECTED]>
> From: Bram Mertens <[EMAIL PROTECTED]>
> (and off course everything that doesn't contain 'bram-
> [EMAIL PROTECTED]')
>
> So it should trigger on:
> From: "odessa" <[EMAIL PROTECTED]>
> From: "michael" <[EMAIL PROTECTED]>
> From: "al" <[EMAIL PROTECTED]>
> From: "bram-mertens" <[EMAIL PROTECTED]>
> (and all other variants of this...)
>
> TIA

Hi,

I think it also allows through addresses like:

From: Mr Mertens Bram <[EMAIL PROTECTED]>
From: Bob<[EMAIL PROTECTED]>

where there is some text before the Mertens Bram in the first one (or
likewise before Bram Mertens) and no space after the name in the
second one. Not sure if these will affect you in practise but
otherwise it seems to work great.

Kind regards,
Mat


Reply via email to