]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix stats script
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jul 2016 15:29:30 +0000 (16:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jul 2016 15:29:30 +0000 (16:29 +0100)
utils/rspamd_stats.pl

index d5336f43d109dd0a5a691f1ae400f6b26419393f..13ebb979caa615192fd8cf819353e5baf301c69f 100644 (file)
@@ -10,6 +10,7 @@ use strict;
 my @symbols_search;
 my $reject_score = 15.0;
 my $junk_score = 6.0;
+my $diff_alpha = 0.1;
 my $log_file = "";
 my $man = 0;
 my $help = 0;
@@ -19,6 +20,7 @@ GetOptions(
   "junk-score=f" => \$junk_score,
   "symbol=s@" => \@symbols_search,
   "log=s" => \$log_file,
+  "alpha=f" => \$diff_alpha,
   "help|?" => \$help,
   "man" => \$man
 ) or pod2usage(2);
@@ -36,7 +38,6 @@ my $spam_symbols = 0;
 my $ham_symbols = 0;
 my $ham_spam_change = 0;
 my $ham_junk_change = 0;
-my $diff_alpha = 0.1;
 my %sym_res;
 my $rspamd_log;
 
@@ -85,6 +86,7 @@ while(<$rspamd_log>) {
               next;
             }
           }
+          next if $sym_name !~ /^$s/;
 
           if (!$sym_res{$sym_name}) {
             $sym_res{$sym_name} = {
@@ -195,6 +197,7 @@ rspamd_stats [options] --symbol=SYM1 [--symbol=SYM2...] [--log file]
    --reject-score=score   set reject threshold (15 by default)
    --junk-score=score     set junk score (6.0 by default)
    --symbol=sym           check specified symbol (perl regexps are supported)
+   --alpha=value          set ignore score for symbols (0.1 by default)
    --help                 brief help message
    --man                  full documentation
 
@@ -214,6 +217,10 @@ Specifies the reject (spam) threshold.
 
 Specifies the junk (add header or rewrite subject) threshold.
 
+=item B<--alpha-score>
+
+Specifies the minimum score for a symbol to be considered by this script.
+
 =item B<--symbol>
 
 Add symbol or pattern (pcre format) to analyze.