procmail
[Top] [All Lists]

Re: Capture MATCH?

2001-07-17 08:53:20
At 20:35 2001-07-16 -0400, James Ervin wrote:

In the sample I submitted, procmail attempts to deliver to the "USER=XYZ(_at_)externalserver(_dot_)mysite(_dot_)org", so I jumped the quick conclusion that it was interpreting it as an action.

It was, because of where you put it.

Try it this way:

:0H
* ^To: \/(_dot_)*(_at_)externalserver(_dot_)mysite(_dot_)org
USER|=echo $MATCH|sed -e
's/@externalserver.mysite.org/@internalserver.mysite.org/g'

:0BHA
* ^Content-(Type|Disposition):.*name=.*\.\/(exe|com|zip|vbs|shs|hta|scr|chm)
{
        :0f
        | formail -I "X-VIRUSWARNING: This file had a $MATCH attachment"

        :0
        ! $USER
}

Because you want to use two separate $MATCHes, you need to bust it out into two recipes. The second one chains to the first by using the 'A' flag (see man procmailrc). You might note that all you're doing is inserting the second flag line, and revising the flags on the first (removal of B for slight optimization).


The basic format of a procmail recipe:

:flags
* conditions
* more conditions (as appropriate)
action {braced if multiple sub-actions or conditions}

Don't intersperse actions between conditions - actions appear at the END of a rule, thus, your second condition and the braced bit after it are not considered part of the rule (not to mention that it doesn't have a flags line, so it goesn't get seen as a valid recipe).


Unfortunately I still get a choke in the log:

Do as above, this will go away.

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