procmail
[Top] [All Lists]

Re: extract username from email address

2005-09-26 13:05:53
Cerebus the Aardvark wrote:
On 9/26/05, Joe <joe(_at_)freakyacres(_dot_)com> wrote:

I'm trying to get the username portion of an email
address.  No match though.  Any tips?


Sean wrote this, once upon a time:

# user(_at_)domain(_dot_)tld
:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:

# user
:0
* CLEANFROM ?? ^\/[^(_at_)]+
{ FROM_USER=$MATCH }

Also, for completeness:

# domain.tld
:0
* CLEANFROM ?? @\/.*
{ FROM_DOMAIN = $MATCH }

Great! Thanks!


____________________________________________________________
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>