From c6825a090f95530da4ffa9af521d476a2299d891 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 5 Jun 2006 02:04:26 +0000 Subject: r162@danube: weasel | 2006-06-05 04:04:21 +0200 And once more git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@120 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- split-mailman-mails-and-discard-and-save | 36 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save index 9dc5b1a..3478b85 100755 --- a/split-mailman-mails-and-discard-and-save +++ b/split-mailman-mails-and-discard-and-save @@ -7,13 +7,13 @@ if ARGV[0] == "spam" MAILIN="mail/spam-in" MAILLEARN="mail/spam-learn" OUTBOX="mail/outbox" - SEND_CONFIRM_MAIL = true + DO_APPROVE = false APPROVE_PASSWORD = nil elsif ARGV[0] == "ham" MAILIN="mail/ham-in" MAILLEARN="mail/ham-learn" OUTBOX="mail/outbox" - SEND_CONFIRM_MAIL = true + DO_APPROVE = true APPROVE_PASSWORD = YAML::load( File.open( 'mailman-passwords.yaml' ) ) else STDERR.puts "Usage: #{$0} ham|spam" @@ -84,23 +84,21 @@ def process_mail(filename) store_in_maildir(MAILLEARN, held_part) - if SEND_CONFIRM_MAIL - if APPROVE_PASSWORD and not APPROVE_PASSWORD[request_address] then - mail_error = RMail::Message.new() - mail_error.header['From'] = FROM - mail_error.header['To'] = ERRORSTO - mail_error.header['Subject'] = "approving #{cookie} failed" - mail_error.body = 'Sorry, this script does not have the admin/moderator password for #{request_address}.' - store_in_maildir(OUTBOX, mail_request) - else - mail_request = RMail::Message.new() - mail_request.header['From'] = FROM - mail_request.header['To'] = request_address - mail_request.header['Subject'] = "Re: confirm #{cookie}" - mail_request.header['Approved'] = APPROVE_PASSWORD if APPROVE_PASSWORD - mail_request.body = '' - store_in_maildir(OUTBOX, mail_request) - end + if DO_APPROVE and not APPROVE_PASSWORD[request_address] then + mail_error = RMail::Message.new() + mail_error.header['From'] = FROM + mail_error.header['To'] = ERRORSTO + mail_error.header['Subject'] = "approving #{cookie} failed" + mail_error.body = 'Sorry, this script does not have the admin/moderator password for #{request_address}.' + store_in_maildir(OUTBOX, mail_request) + else + mail_request = RMail::Message.new() + mail_request.header['From'] = FROM + mail_request.header['To'] = request_address + mail_request.header['Subject'] = "Re: confirm #{cookie}" + mail_request.header['Approved'] = APPROVE_PASSWORD[request_address] if DO_APPROVE + mail_request.body = '' + store_in_maildir(OUTBOX, mail_request) end end -- cgit v1.2.3