On 01 March 2002, Nels Lindquist said:
> One caveat.
> 
> E-mail of the form [ "Your Name" <[EMAIL PROTECTED]> ] is legal.
> 
> E-mail of the form [ [EMAIL PROTECTED] (Your Name) ] is also legal.
> 
> Not knowing much about regexp, I'm not sure if your proposed 
> expression handles the second case.

You are correct; my regex doesn't handle the second case.  But it
doesn't matter; I'm not trying to match on all legal "To" headers, I'm
trying to match on a style of "To" header commonly seen in spam.  That
is, I occasionally see spam like this:

  To: gward <[EMAIL PROTECTED]>

but I don't think I've ever seen one like this:

  To: [EMAIL PROTECTED] (gward)

Hey, I just had another idea: I occasionally see spam with this in the
body:

  Dear gward:

Perhaps 

  /^dear\s+$local_part/i

ought to be worth a point or so.  But I don't see a good way to do
*that* with a regex.  That sort of thing really should be done by fully
parsing the message header, pulling out the local-part of the "To"
address, and then looking in the body for that.

        Greg
-- 
Greg Ward - software developer                [EMAIL PROTECTED]
MEMS Exchange                            http://www.mems-exchange.org

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to