procmail
[Top] [All Lists]

Re: $=, last score, behaviour (Procmail 3.22_5 on FreeBSD 5.3)

2005-07-04 08:02:13
in message <20050702075249(_dot_)GA13286(_at_)panix(_dot_)com>,
wrote Dallman Ross thusly...

On Sat, Jul 02, 2005 at 02:09:37AM -0400, Parv wrote:

I have the following recipe to weed out Subjects: w/ very low
number of [a-z] characters ...
...
    :0 D
    *  $=
    *  -1^1  subj  ??  ()[a-z]
    /dev/null

    #  Part 3
    :0 D
    *     $=
    *     2^1  subj  ??  ()[A-Z][^a-z]
    *  $  1^2  subj  ??  ()[${WS}][${WS}][${WS}]
    /dev/null
...
  score: 45
  procmail: Match on "="
  procmail: Score:       0       0 "()[a-z]"
  procmail: Match on "="
...
My problem lately has been that "$=" is assigned 0 -- in 2d & 3d
parts -- instead of the score of the last matched recipe. Or, it
seems to me that procmail is parsing all "* $=" lines as if i
had written "* $ =", so tries to match a "=" (in the headers)  &
fails.
...
The trouble is that you need a $ expandor in those conditions
where the token appear, and you need to turn them into scoring
tokens, anyway:

  :0 D
  * $ $=^0
  *   -1^1
  /dev/null

I did not thought before that a procmail's own variable would also
need to be expanded.

After reading Rudd's slightly cryptic email, i was somewhat
perplexed just how to "[u]se a variable to transport the score".  I
knew i would have to do variable expansion, but was not quite sure
how to translate that into a score.

I was writing a test recipe (similar to yours) when your message
arrived.  Thanks for the confirmation (of using "^0").


You also need to make sure $= will never come up in either
part undefined.

The recipe in OP was encapsulated in another recipe which sets the
initial score; i did not include the encapsulating recipe.


Thanks again.

  - Parv

-- 


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail