procmail
[Top] [All Lists]

Re: Scoring for a header

2004-04-28 11:02:13
On Wed, Apr 28, 2004 at 11:24:22AM -0600, LuKreme wrote:
procmail: Matched " LuKreme <kremels(_at_)kreme(_dot_)com>"
procmail: Match on  
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(- 
Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)\/.*"
procmail: Executing "echo "$MATCH" | sed 's/[, ] \{1,\}/|/g'"
procmail: Assigning "ETO= LuKreme <kremels(_at_)kreme(_dot_)com>"

This is odd, I thought it would assign both the To and Cc address based  
on the $MATCH above...

Procmail matches stingy to the left of \/, so it will depend on the
order of the headers you receive (with To: often coming before Cc:)

In this case, then, you'll get the To: field, even though your
original trigger (^Cc:) led into this recipe. You may have to attack
this from a different angle to make sure the inner recipe is looking
at the same thing you matched:

:0
* 9876543210^0 ^()\/Cc:.*
* 9876543210^0 ^()\/To:.*,
{
    :0
    * MATCH ?? ^TO_\/.*
    { ETO=`echo "$MATCH" | sed 's/[, ] \{1,\}/|/g'` }
}

I haven't tested this, btw.

Scott
-- 
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org

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