summaryrefslogtreecommitdiff
path: root/split-mailman-mails-and-discard-and-save
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-05-16 13:58:35 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-05-16 13:58:35 +0000
commitdff37b95fba027ba8ab52a25967d852f29da4bf7 (patch)
tree9c8f7da89e23bc926826495867848ddf62d86d96 /split-mailman-mails-and-discard-and-save
parentec52e1c0287929ecda9194f00bd582d53e13de39 (diff)
support ham
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@89 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'split-mailman-mails-and-discard-and-save')
-rwxr-xr-xsplit-mailman-mails-and-discard-and-save36
1 files changed, 24 insertions, 12 deletions
diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save
index aec0bc8..d5d1ffa 100755
--- a/split-mailman-mails-and-discard-and-save
+++ b/split-mailman-mails-and-discard-and-save
@@ -2,10 +2,19 @@
require 'rmail'
-
-MAILIN="mail-in"
-SPAM="spam-learn"
-OUTBOX="outbox"
+if ARGV[0] == "spam"
+ MAILIN="spam-in"
+ MAILLEARN="spam-learn"
+ OUTBOX="outbox"
+ SEND_DISCARD_MAIL = true
+elsif ARGV[0] == "ham"
+ MAILIN="ham-in"
+ MAILLEARN="ham-learn"
+ OUTBOX="outbox"
+ SEND_DISCARD_MAIL = false
+else
+ stderr.puts "Usage: $0 ham|spam"
+end
DOMAIN='lists.oftc.net'
FROM="listmoderators@lists.oftc.net"
@@ -68,17 +77,20 @@ def process_mail(filename)
throw "Could not find cookie in discard_part" unless matchdata and matchdata[1]
cookie = matchdata[1]
- store_in_maildir(SPAM, held_part)
- 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.body = ''
- store_in_maildir(OUTBOX, mail_request)
+ store_in_maildir(MAILLEARN, held_part)
+
+ if SEND_DISCARD_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.body = ''
+ store_in_maildir(OUTBOX, mail_request)
+ end
end
check_maildir MAILIN
-check_maildir SPAM
+check_maildir MAILLEARN
check_maildir OUTBOX
Dir[MAILIN+"/new/*"].each do |filename|