1 |
diff -up smeserver-mailstats-1.0/root/usr/bin/spamfilter-stats-7.pl.spamfilter smeserver-mailstats-1.0/root/usr/bin/spamfilter-stats-7.pl |
2 |
--- smeserver-mailstats-1.0/root/usr/bin/spamfilter-stats-7.pl.spamfilter 2013-09-23 17:15:00.000000000 -0400 |
3 |
+++ smeserver-mailstats-1.0/root/usr/bin/spamfilter-stats-7.pl 2013-09-23 17:26:01.000000000 -0400 |
4 |
@@ -61,7 +61,7 @@ if ($cdb->get('mailstats')){ |
5 |
|
6 |
#Configuration section |
7 |
my %opt = ( |
8 |
- version => '0.6.23', # please update at each change. |
9 |
+ version => '0.6.26', # please update at each change. |
10 |
debug => 0, # guess what ? |
11 |
sendmail => '/usr/sbin/sendmail', # Path to sendmail stub |
12 |
from => 'spamfilter-stats', # Who is the mail from |
13 |
@@ -242,10 +242,12 @@ while ( $nhour < $end / 3600 ) { |
14 |
} |
15 |
$nhour++; |
16 |
} |
17 |
-# and grand totals and display status from db entries, and column widths |
18 |
+# and grand totals, percent and display status from db entries, and column widths |
19 |
$ncateg = 0; |
20 |
while ( $ncateg < @categs) { |
21 |
$counts{$GRANDTOTAL}{$categs[$ncateg]} = 0; |
22 |
+ $counts{$PERCENT}{$categs[$ncateg]} = 0; |
23 |
+ |
24 |
if ($cdb->get('mailstats')){ |
25 |
$display[$ncateg] = lc($cdb->get('mailstats')->prop($categs[$ncateg])) || "auto"; |
26 |
} else { |
27 |
@@ -264,6 +266,13 @@ my $starttai = Time::TAI64::unixtai64n($ |
28 |
my $endtai = Time::TAI64::unixtai64n($end); |
29 |
my $sum_SARules = 0; |
30 |
|
31 |
+# we remove non valid files |
32 |
+my @ARGV2; |
33 |
+foreach ( map { glob } @ARGV){ |
34 |
+ push(@ARGV2,($_)); |
35 |
+} |
36 |
+@ARGV=@ARGV2; |
37 |
+ |
38 |
LINE: while (<>) { |
39 |
my($tai,$log) = split(' ',$_,2); |
40 |
|