procmail
[Top] [All Lists]

Re: Regexp help

2002-04-26 13:22:03
At 14:02 2002-04-26 -0500, James Raney wrote:

postfix transport).  I have postfix (as arg $2) passing a list of
recipients from the envelope.  I need to take the first recipient from
that arg and parse the domain out of the address (unfortunatly postfix

I can see from all the FAQ's, etc. how to go about parsing from a header
and doing an extraction but I can't see how to do this from an existing
variable.  Can anyone give me a pointer?

SOMEVARIABLE=$2

:0
* SOMEVARIABLE ?? @\/[^ ]+
{
        USERDOMAIN=$MATCH
        LOG="is $USERDOMAIN what you want?
"
}

# subsequently, you could do specific comparisons for $USERDOMAIN


Test it:

procmail -m test.rc first_argument useraddress(_at_)domain(_dot_)tld < 
some_message_file


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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