summaryrefslogtreecommitdiff
path: root/oftc-listmod-learn-mail
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-05-21 01:31:06 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-05-21 01:31:06 +0000
commiteae22806b520d99ae5390271f60fcc38bb479ad4 (patch)
tree4c35cb636705b32343243872369ba5d575520df4 /oftc-listmod-learn-mail
parent0ca5e97d456bc72df24804997d2c446878113032 (diff)
bogolearn
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@100 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'oftc-listmod-learn-mail')
-rwxr-xr-xoftc-listmod-learn-mail20
1 files 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