procmail
[Top] [All Lists]

Re: flag lines

2003-07-04 13:28:20
Lee asked,

What other numbers can be used in flag lines and what
do they signify? (Notably, David's mention of unasterisked conditions refers
to something I hadn't known: I thought all conditions have to begin with an
asterisk...)

Back in the days when email filtering was much simpler and recipes with more than one condition were rare, procmail syntax required a number on the flag line for the number of conditions the recipe had, so that procmail would know where the conditions ended and the next line was the action. If the recipe had an `A' or `a' flag, the default was zero; otherwise, the default was one. Many recipes began

 ::

to indicate one condition and the implicit name for a local lockfile.

As more complex recipes came to be needed, that presented problems. People would miscount the conditions on a recipe, or they'd forget to update the number at the top when they added or removed conditions.

So Stephen came up with a new method: procmail would read the number of conditions it expected per the flag line, but if the action line began with an asterisk, that would mean, "not the action yet, we have another condition first, and this is it." That way recipes written with the old syntax would work, but so would a new one: if you have an asterisk in front of every condition and a zero on every flag line, procmail will always recognize which of the following lines is not a condition any more but is the action.

So if you use a zero, yes, all conditions must begin with an asterisk.

There's been only one change since then: the `E' or `e' flag (they were introduced after asterisk notation came in) will also make the number of unasterisked conditions default to zero.


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