summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsplit-mailman-mails-and-discard-and-save8
1 files changed, 5 insertions, 3 deletions
diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save
index aae4932..5f2a60c 100755
--- a/split-mailman-mails-and-discard-and-save
+++ b/split-mailman-mails-and-discard-and-save
@@ -6,12 +6,13 @@ if ARGV[0] == "spam"
MAILIN="mail/spam-in"
MAILLEARN="mail/spam-learn"
OUTBOX="mail/outbox"
- SEND_DISCARD_MAIL = true
+ SEND_CONFIRM_MAIL = true
elsif ARGV[0] == "ham"
MAILIN="mail/ham-in"
MAILLEARN="mail/ham-learn"
OUTBOX="mail/outbox"
- SEND_DISCARD_MAIL = false
+ SEND_CONFIRM_MAIL = true
+ APPROVE_PASSWORD = File.open('mailman-site-password').readline.chomp
else
STDERR.puts "Usage: #{$0} ham|spam"
exit 1
@@ -80,11 +81,12 @@ def process_mail(filename)
store_in_maildir(MAILLEARN, held_part)
- if SEND_DISCARD_MAIL
+ if SEND_CONFIRM_MAIL
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