From ef5f6b47ad5fe90a3229ecff3a30ed84d371bdc9 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 15 Jun 2006 21:31:57 +0000 Subject: Do not run as amavis git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@133 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- oftc-listmod-learn-mail | 11 +++++++---- 1 file 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 -- cgit v1.2.3