Hope some of you find this script usefull.

Its aim is to be fed one of the rule handles and spit out the score,
definition and the rule itself by regex so several may be brought up.

Its just a simple perl regex finding script that trawls thru your *.cf
files for a regex and chops off the lines returned at the first `:'.
That may need some refinement.  But as a quick and dirty way to relate
rules appearing in messages to there individual scores (and content)
its fast and for the most part shows you what you need to see to
juggle scores or whatever.

example:

  $ ./spam_a SIGNATURE_DELIM
    body     SIGNATURE_DELIM        /^-- $/
    describe SIGNATURE_DELIM        Standard signature delimiter present  
    score SIGNATURE_DELIM                0.753

You may need to reset the path to perl or the path to directory
containing *.cf files. (The $dir variable [line 7] in the script)
Or maybe reset the perl regex so it isn't `i' (ignore case).

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#!/usr/local/bin/perl -w
if (!$ARGV[0] || $ARGV[1]){
   print "One argument containing a regex ['REGEX'] is required\n";
   exit;
}
$regex = shift;
## set location of *.cf files
$dir = "/usr/local/share/spamassassin";
chdir $dir|| die "cant change directory to $dir: $!";
opendir(DIR,"$dir");

## Plow thru the directory reading only *.cf files
while($file =  readdir(DIR)){
   if($file =~ /\.cf$/){;
     open(FILE,"$file");
     while(<FILE>){

## If we find our regex, chop it off at first colon and print
        if (/$regex/i){
          ($line = $_) =~ s/^.*?://;
          print "$line";
        }
     }
     close(FILE);
   }
}
close(DIR);


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to