1 |
brianr |
1.1 |
--- smeserver-learn-1.0/root/usr/bin/Learn.pl.beef 2016-03-09 06:41:21.200000000 -0500 |
2 |
|
|
+++ smeserver-learn-1.0/root/usr/bin/Learn.pl 2016-03-09 06:42:33.887000000 -0500 |
3 |
|
|
@@ -138,7 +138,7 @@ foreach my $user (@users) { |
4 |
|
|
my $SpamDir = ($sadb->get_prop($mode, "LearnNew") eq "enabled")? $MailDir . "/" . $logdir : $MailDir . "/" . $logdir . "/cur/" ; |
5 |
|
|
#taking action according to actual mode |
6 |
|
|
my $counter = 0; |
7 |
|
|
- find( { wanted => sub { -f && $counter++;}, no_chdir => 1, follow_fast => 1 }, $SpamDir ); |
8 |
|
|
+ find( { wanted => sub { -f && $_ =~ m/($logdir\/cur|$logdir\/new|$logdir\/tmp)/ && $counter++;}, no_chdir => 1, follow_fast => 1 }, $SpamDir ); |
9 |
|
|
if ($mode eq "LearnAsSpam" and $counter>0) { |
10 |
|
|
my $result = `/usr/bin/sa-learn --spam $SpamDir`; |
11 |
|
|
chomp($result); printf("+Learning Spam from %s: %s\n",$logdir,$result); |