From 9e7c70034a91b90f09dd507b43214f84c05532ca Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jul 2016 16:29:30 +0100 Subject: [Fix] Fix stats script --- utils/rspamd_stats.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'utils/rspamd_stats.pl') diff --git a/utils/rspamd_stats.pl b/utils/rspamd_stats.pl index d5336f43d..13ebb979c 100644 --- a/utils/rspamd_stats.pl +++ b/utils/rspamd_stats.pl @@ -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. -- cgit v1.2.3