From eae22806b520d99ae5390271f60fcc38bb479ad4 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 21 May 2006 01:31:06 +0000 Subject: bogolearn git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@100 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- oftc-listmod-learn-mail | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/oftc-listmod-learn-mail b/oftc-listmod-learn-mail index d8074f9..6f758af 100755 --- a/oftc-listmod-learn-mail +++ b/oftc-listmod-learn-mail @@ -34,18 +34,26 @@ check_maildir HAMOUT Dir[SPAMIN+"/new/*"].each do |filename| puts "learning #{filename}" if $verbose > 0 if system("sudo -H -u amavis sa-learn --spam < #{filename} > /dev/null") - puts "moving #{filename}" if $verbose > 0 - move(filename, SPAMOUT) + if system("sudo -H -u amavis bogofilter --register-spam < #{filename} > /dev/null") + puts "moving #{filename}" if $verbose > 0 + move(filename, SPAMOUT) + else + STDERR.puts "Learning of #{filename} failed (bogofilter)." + end else - STDERR.puts "Learning of #{filename} failed." + STDERR.puts "Learning of #{filename} failed (SA)." end end Dir[HAMIN+"/new/*"].each do |filename| puts "learning #{filename}" if $verbose > 0 if system("sudo -H -u amavis sa-learn --ham < #{filename} > /dev/null") - puts "moving #{filename}" if $verbose > 0 - move(filename, HAMOUT) + if system("sudo -H -u amavis bogofilter --register-ham < #{filename} > /dev/null") + puts "moving #{filename}" if $verbose > 0 + move(filename, HAMOUT) + else + STDERR.puts "Learning of #{filename} failed (bogofilter)." + end else - STDERR.puts "Learning of #{filename} failed." + STDERR.puts "Learning of #{filename} failed (SA)." end end -- cgit v1.2.3