procmail
[Top] [All Lists]

Extracting email addresses from subdomains

1997-01-17 12:09:28
Does anyone have any suggestions on how to cut sub-domains out of a email
address in a procmail recipe?

Say I get email all from J. User but of various formats:

   From: juser(_at_)domain(_dot_)com
   From: juser(_at_)subdomain(_dot_)domain(_dot_)com
   From: "J. User" juser(_at_)sub(_dot_)domain(_dot_)com
   From: J. User <juser(_at_)subx(_dot_)suby(_dot_)domain(_dot_)com>

I want to compare incoming addresses against a file of addresses, but the
file is contains addresses of the format user(_at_)domain(_dot_)com  -- no 
subdomains).

So what I want to do is extract the subdomains and then grep the result
with the list file.

So, I'd like to set 
   $SENDER=juser(_at_)domain(_dot_)com(_dot_)  

Although not as important, I actually wouldn't mind retaining the comment, so 
   $SENDER="J. User" juser(_at_)domain(_dot_)com

Any suggestions?  Would this be a nice formail feature?


Thanks very much,

Bill Moseley
mailto:moseley(_at_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>
  • Extracting email addresses from subdomains, Bill Moseley <=