summaryrefslogtreecommitdiff
path: root/split-mailman-mails-and-discard-and-save
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-18 15:09:35 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-18 15:09:35 +0000
commit60a2a64e6059eb2f9019c8fdda283e8eb6ba06cc (patch)
treecfad158d5838a8261188b29a1bf96dab72ceb257 /split-mailman-mails-and-discard-and-save
parent3b702816ce991cca485fe0736d643d327d54c4ce (diff)
revert: Rewrite header for all mails
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@143 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'split-mailman-mails-and-discard-and-save')
-rwxr-xr-xsplit-mailman-mails-and-discard-and-save21
1 files changed, 9 insertions, 12 deletions
diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save
index 10cdd88..45e449f 100755
--- a/split-mailman-mails-and-discard-and-save
+++ b/split-mailman-mails-and-discard-and-save
@@ -224,17 +224,6 @@ def process_mail(filename)
spam_info.body = sa_text + "\n\n" + bogo_text
message.body.unshift spam_info
-
- # rewrite Delivered-To to X-OLD-Delivered-To to avoid mail loop warnings.
- m = message.to_s.split(/\n/)
- new_m = []
- while m.size > 0 and (line = m.shift) != ""
- new_m << line.gsub(/^Delivered-To:/, 'X-OLD-Delivered-To:')
- end
- new_m.concat m
- message = new_m
-
-
if sa_class == "Ham" and bogo_class == "Ham"
store_in_maildir(MAIL_PROCESSED_HAM, message)
approve(cookie, request_address)
@@ -247,7 +236,15 @@ def process_mail(filename)
discard(cookie, request_address)
else
store_in_maildir(MAIL_PROCESSED_FORWARDED, message)
- store_in_maildir(OUTBOX_HUMANS, message.join("\n"))
+
+ # rewrite Delivered-To to X-OLD-Delivered-To to avoid mail loop warnings.
+ m = message.to_s.split(/\n/)
+ new_m = []
+ while m.size > 0 and (line = m.shift) != ""
+ new_m << line.gsub(/^Delivered-To:/, 'X-OLD-Delivered-To:')
+ end
+ new_m.concat m
+ store_in_maildir(OUTBOX_HUMANS, new_m.join("\n"))
end
else
STDERR.puts "Unknown action #{ACTION}!"