summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-15 21:31:57 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-15 21:31:57 +0000
commitef5f6b47ad5fe90a3229ecff3a30ed84d371bdc9 (patch)
treeeedc4ce2a7a0f127b93a36b6514b14e1d374437b
parentfada6f84dad5885bb1fa268d5ed3023ac25894e7 (diff)
Do not run as amavis
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@133 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xoftc-listmod-learn-mail11
1 files changed, 7 insertions, 4 deletions
diff --git a/oftc-listmod-learn-mail b/oftc-listmod-learn-mail
index 6f758af..6c218ee 100755
--- a/oftc-listmod-learn-mail
+++ b/oftc-listmod-learn-mail
@@ -5,6 +5,9 @@ SPAMOUT="mail/spam-learned"
HAMIN="mail/ham-learn"
HAMOUT="mail/ham-learned"
+#PREFIX = "sudo -H -u amavis "
+PREFIX = ""
+
$verbose = 0
if ARGV[0] == "-v"
$verbose = 1
@@ -33,8 +36,8 @@ 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")
- if system("sudo -H -u amavis bogofilter --register-spam < #{filename} > /dev/null")
+ if system("#{PREFIX}sa-learn --spam < #{filename} > /dev/null")
+ if system("#{PREFIX}bogofilter --register-spam < #{filename} > /dev/null")
puts "moving #{filename}" if $verbose > 0
move(filename, SPAMOUT)
else
@@ -46,8 +49,8 @@ Dir[SPAMIN+"/new/*"].each do |filename|
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")
- if system("sudo -H -u amavis bogofilter --register-ham < #{filename} > /dev/null")
+ if system("#{PREFIX}sa-learn --ham < #{filename} > /dev/null")
+ if system("#{PREFIX}bogofilter --register-ham < #{filename} > /dev/null")
puts "moving #{filename}" if $verbose > 0
move(filename, HAMOUT)
else