pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] suggestion - nested rules


From: Duncan
Subject: Re: [Pan-users] suggestion - nested rules
Date: Tue, 18 Dec 2012 17:14:13 +0000 (UTC)
User-agent: Pan/0.140 (Chocolate Salty Balls; GIT 04c43ec /usr/src/portage/src/egit-src/pan2)

FritzS - gmx posted on Tue, 18 Dec 2012 17:03:53 +0100 as excerpted:

> Hi,
> how could I create nested rules?
> With Boolean terms -->  (...)  AND  OR
> 
> like this
> (User-Agent: ^MacSOUP/D-2\.8\.3 \(Mac OS X version 10\.6\.8 \(x86\)\)$)
> AND
> (X-Trace: netfront.net)

Please turn off the HTML, at least when posting to the pan list.  I 
suppose you know how bad it looks in pan when others post with it.

I'm guessing you mean scoring rules, not just rules, which in pan context 
have a different meaning, as old-pan had something called "rules" that it 
used differently.

For complex scoring rules, you may have to edit the scorefile directly, 
as pan's scoring GUI simply wasn't designed for that.  pan uses slrn 
scorefile format (minus advanced stuff like include, and case insensitive 
by default).  The documentation for it is available here:

http://www.slrn.org/docs/score.txt

Quoting from it:

  The `Score' keyword is used to assign a score to the header.
  If it is followed by a single colon, the score is only given if all
  tests are passed (logical AND); two colons indicate that the score
  should be awarded if any of the tests are passed (logical OR).


I'd suggest reading the linked document in full, especially the example 
scorefile (part 3) and explanation (part 4), as that can be clearer than 
the bare rules in the first couple parts.

Down at the bottom, there's this (with an example I'm not posting), but I 
don't know for sure if pan supports it or not, and I'm headed to work in 
a few minutes so I don't have time to experiment before I post:

  Lines enclosed in curly braces are grouped; the initial brace is
  followed by one or two colons that indicate whether only one (`::') or
  all of the lines (`:') inside the group need to match for the group to
  pass.

If pan doesn't take the curly-brace grouping, you can of course still do 
the same thing using separate scoring rules.

One thing to note if compare the example file against what pan creates 
using its GUI.  The pan GUI doesn't create the most elegant or organized 
scorefile, for sure.  If you do a lot of scorefile hand editing (and 
possibly even if you don't, simply for scoring efficiency if you have a 
lot of scoring rules), it's worthwhile to organize things manually, and 
do most of your editing manually after that.  Here, I did my 
organization, leaving a comment at the bottom under which all new entries 
are added if I use the pan GUI to do so.  Particularly for expiring 
scores, I'll often create the score initially using the GUI, then edit 
the scorefile, removing all comments but the %BOS line with the date and 
possible a reason appended.  And I'll go in and kill all the expired ones 
occasionally.

For non-expiring scores, I'll generally remove all comments and add the 
new condition to an existing scoring section under an existing scoring 
rule.  As a result, on startup, pan logs only six rules (including a 
couple expiring rules) in two sections, even tho I actually have hundreds 
of individual condition lines (mostly non-expiring spam-kill, with a few 
non-expiring watches on individual authors).

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




reply via email to

[Prev in Thread] Current Thread [Next in Thread]