procmail
[Top] [All Lists]

Re: Using an include file in the main procmailrc file

2004-03-03 15:23:09
At 16:38 2004-03-03 -0500, Christopher Benson wrote:

I'm looking to do something that says "If it's not in the rc.exclude_spam file then go ahead and process through the rc.spam include". Not sure how to get that syntax to look.

Personally, I'd set the rc.exclude_spam file to be a recipe in it's own right, and the rc.spam to be another recipe in it's own right:

#[rc.exclude_spam]
:0
* conditions
{
        # actions, or null action even.
}

#[rc.spam]
:0E
* conditions
{
        # actions
}

The E flag on the second one says to execute this only if the preceeding DID NOT evaluate as true/successful.

After playing with it some more and looking at some other examples.. how does this look?

Have you tried it in a sandbox?  You could see the errors yourself.

:0
* !Subject:.*(CT200|Sub-technology)

BTW, you're missing the beginning of line anchor:

* ! ^Subject:...

With the files as you provided, roll 'em out:

:0
:0
* !Subject:.*(CT200|Sub-technology)
{
        :0
        INCLUDERC=$PMDIR/rc.spam
}

Either lose the :0 in the main rc, or in the included one. I'd still go with making the two includes stand-alone recipes though.

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