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]

You also have to handle
    [EMAIL PROTECTED], [EMAIL PROTECTED]

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]
t\>?)/

Note there are no spaces in that regexp, regardless of how it ended up
folded.

        Loren

Reply via email to