procmail
[Top] [All Lists]

Re: How to record the score?

1997-09-26 07:39:31
Stephane Bortzmeyer <bortzmeyer(_at_)pasteur(_dot_)fr> replied to me:
    :0
    *  1^1 foo
    * -2^1 bar
    { }
    SCORE = $=
Unfortunately, it doesn't seem to work. SCORE assigned after the recipe 
is always zero (SCORE assigned between the {}, when the score was 
positive, is correct, thanks).
...
[most of recipe cut]
* -250^0 ^Subject: *Fwd:
{
      SCORE=$=
      # The following works fine, thanks for the people who helped
      :0f
      | formail -i "X-Filtered-Spam: semantic ($SCORE)"

No. That is different than what I wrote. The score gets set to
0 when that filtering recipe gets run. You *must* have an empty
set of braces. (Or at least a set of braces empty of recipes.)

Watch:
:r procrc
        VERBOSE=yes
        :0
        *  1^1 foo
        * -2^2 bar
        { }
        a=$=

        :0
        *  1^1 foo
        * -2^2 bar
        {
          :0f
          | echo Whee: fun ; cat -
        }
        b=$=

        :0
        *  1^1 foo
        * -2^2 bar
        {
          whee = fun
        }
        c=$=

        :0
        /dev/null

:r proclet
        From foo Fooof
        To: bar
        Subject foobar
         
        body

:r! procmail -m procrc < proclet
        procmail: [20175] Fri Sep 26 10:25:23 1997
        procmail: Score:       3       3 "foo"
        procmail: Score:      -6      -3 "bar"
        procmail: Assigning "a=-3"
        procmail: Score:       3       3 "foo"
        procmail: Score:      -6      -3 "bar"
        procmail: Assigning "b=0"
        procmail: Score:       3       3 "foo"
        procmail: Score:      -6      -3 "bar"
        procmail: Assigning "c=-3"
        procmail: Assigning "LASTFOLDER=/dev/null"
        procmail: Opening "/dev/null"
        From foo Fooof
          Folder: /dev/null                                                  46

I had written:
| This is slightly tricky to do, because you must grab the score
| immediately after the scoring recipe.

Perhaps I should have left "slightly" out and emphasized
"immediately".

Elijah
------
I /dev/null dupes, no need to CC list posts.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.

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