procmail
[Top] [All Lists]

for John Hardin's wish list

1998-08-21 11:58:45
Been meaning to send this ...

1. A $VERSION or $PROCMAIL_VERSION read-only variable so that an rcfile can
tell which procmail version is reading it and route older versions to appro-
priate code (with braces or INCLUDERCs) instead of having them choke on or
misunderstand code intended for newer versions.

2. A $LEVEL or $DEPTH read-only variable that would say how deep in
INCLUDERCs procmail is, so that we could take steps to prevent recursion
overflow and do other things for which it helps to know how deep we are.
It would be 0 in any rcfile being read because it was named on the command
line or used by default where none was named on the command line, 1 inside
an INCLUDERC called from a level-0 rcfile, 2 inside an INCLUDERC called from
level 1, etc.

3. John wanted a way to deem a recipe matched as soon as the score became
positive to make for easier ORing.  I'm not so sure that that's the way to
do it, as later recipes might make it zero or negative.  Rather, this is what
I'd like to see (or dream of seeing, since I'm guessing it would mean major
code bloat): an `o' [for "or"] or `d' [for "disjunction"] flag -- please
don't make it capital O because so many newbies type ":O" instead of ":0" --
that would make the logic work like this:

with `o' flag:                        without `o' [same as current behavior]

 if one unweighted condition matches,
 recipe is a match; procmail skips
 remaining conditions and runs action
                                      if an unweighted condition matches,
                                      remaining conditions are still tested
 
 if an unweighted condition fails, re-
 maining conditions are still tested
                                      if one unweighted condition fails,
                                      procmail aborts recipe

 intermediate supremum score deems
 recipe a match and runs action
                                      intermediate supremum score deems score
                                      positive, skips remaining weighted con-
                                      ditions, but still requires matches on
                                      all remaining unweighted conditions;
                                      failure of an unweighted condition
                                      aborts recipe despite supremum score

 intermediate infemum score deems
 score negative and skips remaining
 weighted conditions but procmail
 tests remaining unweighted conditions;
 any match on an unweighted condition
 makes the recipe match despite the
 infemum score
                                      intermediate infemum score aborts recipe

The left-hand column results can be achieved now by putting supremum weights
on all conditions that would normally be unweighted and placing them before
conditions that should be weighted.  Generally the disjunction flag would
be used without weights or scores, though, and it would be an easy answer
to "how to I make procmail OR conditions instead of ANDing them"?

<Prev in Thread] Current Thread [Next in Thread>