summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-05 01:02:08 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-05 01:02:08 +0000
commitd8328246652565dbac5c92ddd9ee495bbc9ffd0f (patch)
tree9a4bf05476e16d12ffc7746df6d4433c1996ab9f
parent204a49f5c1b3ca1798f5c4dcd7170750d72748f6 (diff)
Handle mail approving
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@117 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-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