procmail
[Top] [All Lists]

Re: Any logical combination of conditions

2001-04-09 11:42:52
Timothy advised Marie,

| This can be done nice and clean:
| 
| :0
| * ^Cond1
| * ^Cond2
| * ^Cond3
| { INCLUDERC=action.rc }
| 
| :0
| * ^Cond4
| * ^Cond5
| *!^X-Note: action.rc processed
| { INCLUDERC=action.rc }
| 
| :0
| * ^Cond6
| *!^X-Note: action.rc processed
| { INCLUDERC=action.rc }

| (Note, put this as one of the first lines in "action.rc"
| 
|       formail -A"X-Note: action.rc processed"
| 
| and that will keep it from duplicating efforts, i.e. if a message that
| comes in that matches conditions 4 and 5 AND 6 there's probably no need to
| have it run through the action.rc twice.... you could use the "E" flag too,
| but I prefer the X-Note: method because I like to have headers telling me
| what has been done to the message anyway. YMMV & "there's more than one way
| to do it."

I disagree very strongly.  The `E' flag is much quicker for procmail to 
process than a search of the headers for an "X-Note:" entry (even if you
still filter through the formail filter to add the X-Note: so that you can
see it on the delivered message).  Then again, just sending the message to
an indicatively named folder can take the place of adding a header line.

If you must use that X-Note: system, at least put the !^X-Note: condition
*first*.

Also, if the action is a one-liner, just put it there in the main rcfile;
only if it's a long brace nest is it worth having it in a separate file
called by INCLUDERC.

Finally, Timothy, why did you add carets to the conditions?  Marie never said
that they were left-anchored regexps; some or all of them might not be reg-
exps at all.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail