procmail
[Top] [All Lists]

Re: web pointers

1998-02-18 04:54:22
On Tue, 17 Feb 1998 19:10:22 -0800 (PST), John M Vinopal
<banshee(_at_)abattoir(_dot_)com> wrote:
Certain procmail rules are bizarre.  To match '$', I was forced to use
\\$ and only through trial and error did I locate that.  Is there a nice
web page that sums this kind of stuff up?  ie: operators, metacharacters,
etc.

There's the manuals, of course, and the "pitfalls" section of the FAQ
which explains this (but you'd have to know you're looking for a
"leading backslash" clue, not a "funny how you have to go through
machinations to match a literal dollar sign" clue). The FAQ is at
<http://www.iki.fi/~era/procmail/mini-faq.html>

The other thing I'm looking for is citations for the scoring rulesets,
how do I invoke various actions depending on the summation level?  Or am
I stuck with a not-so-useful true/false invoke/don't invoke setup?

The score ends up in the $= pseudovariable which you can copy to a
real variable and do the usual regex matching stuff on: 

    :0
    * 1^1 moo
    { }
    SCORE = $=

    :0:
    * SCORE ?? [1-9][0-9]+
    enough

You can even do more subtle mathematics, like "if it's between 25 and
35" but it gets slightly cumbersome:

    :0
    * $ $SCORE^0
    * -25^0
    {
        :0
        * $ -$SCORE^0
        * 35^0
        { }

        :0
        suitably
    }

    :0 # this is "else"
    | formail -rt -i"Subject: Message rejected (too much/little moo in it)" ...

Hope this helps,

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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