procmail
[Top] [All Lists]

RE: Space at start of name

2001-03-15 04:42:40
Here is my solution for grabbing the real name.  If the only text is the
email address it grabs that.  It does it with two processes rather than
four.
It handles:
  From: Geoff Mulligan <geoff(_at_)hz(_dot_)com>
  From: geoff(_at_)hz(_dot_)com (Geoff Mulligan)
  From: geoff(_at_)hz(_dot_)com

FROM=`formail -z -xFrom: | \
nawk '{a=$0; sub(/[^ ]*(_at_)[^ ]*/,"",a);if(a=="") print $0; else {gsub(/
*[()<>]/, "",a);print a}}'`

If you don't want to capture email addresses you can use this

FROM=`formail -z -xFrom: | \
nawk '{sub(/[^ ]*(_at_)[^ ]*/,""); gsub(/ *[()<>]/, "");print $0}}'`

        geoff

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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