diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-06-05 02:04:26 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2006-06-05 02:04:26 +0000 |
commit | c6825a090f95530da4ffa9af521d476a2299d891 (patch) | |
tree | f5d7c68d72327d32583157153c3d15ca986a1a27 | |
parent | 65262ede7681d64579dedb8d2e96856ee6ff3bc9 (diff) |
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
-rwxr-xr-x | split-mailman-mails-and-discard-and-save | 36 |
1 files 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 |