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