S Semple wrote:
I have email coming to me in the following way.
To: Fake Name <[EMAIL PROTECTED]>

In other words it has two words before the email address. Eventually I will make it so it searches the prefix name for letters not found in my name. However to start I just wanted to see if I could find two words before the email address. All reasoning tells me that the following should work but it does not. Im stumpted. The name has a space as indicated in my example.

header   CM_BAD_NAM_PREFIX To =~ /[[:alnum:]]{1,10} [[:alpha:]]{1,10} 
(<name\@(domain|domain2))\.COM>/i

I have found that /[[:alpha:]]+ (<name\@(domain|domain2))\.COM>/i finds :
To: Fred <[EMAIL PROTECTED]>


I thought searches didn't need to be anchored.

Any advice.


Try replacing the literal spaces with \s+ also, the < and > should be followed by ? as they will not always be there.

In any case, it won't necessarily work, as the display name is controlled by the senders mail client, and they can call you anything they want. If, for instance, I have you in my work address book, the display name would be "Steve Semple (email)" were I to send you email.

--
Brian R. Jones
Ob.  tagline:
        "I never follow the herd.
                Even when it's going the right direction."

Reply via email to