procmail
[Top] [All Lists]

Extracting substring from formail -rzx "To:"

2004-06-29 10:51:52
Upon achieving a match, I have a line in my recipe that extracts the sender's 
address and stores it to pass of to a PERL script. The problem is,
ADDRESS=`formail -rzx "To:"`
sometimes returns a proper name before the email address. (Example from 
procmail log: Assigning "ADDRESS="Jim Bernardi" 
<jbernardi(_at_)23skidoo(_dot_)net>"). 
This is tripping up the perl script, which is matching $ADDRESS to a MySQL db 
that contains only email addresses without names.

How can I ensure that ADDRESS contains only the email address, losing any 
proper name that might be in front of it?

Thank you for any help you can give.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>