summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-17 13:25:37 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-17 13:25:37 +0000
commitaa601f0f720de2fb1b3775029ad672447ab87582 (patch)
tree399d8590732e204bf214324fdbd57d46df0b651c
parent10ecc02a6c33a240b5b7e7c2ef21aefba222668d (diff)
Rewrite Delivered-To to X-OLD-Delivered-To to avoid mail-loop warnings
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@136 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xsplit-mailman-mails-and-discard-and-save7
1 files changed, 6 insertions, 1 deletions
diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save
index 9cfb9ea..daa4047 100755
--- a/split-mailman-mails-and-discard-and-save
+++ b/split-mailman-mails-and-discard-and-save
@@ -236,7 +236,12 @@ def process_mail(filename)
discard(cookie, request_address)
else
store_in_maildir(MAIL_PROCESSED_FORWARDED, message)
- store_in_maildir(OUTBOX_HUMANS, message)
+
+ headers = message.header.to_s
+ body = message.body.to_s
+ new_headers = headers.gsub(/^Delivered-To:/, 'X-OLD-Delivered-To:')
+ new_message = RMail::Parser.read new_headers + "\n" + body
+ store_in_maildir(OUTBOX_HUMANS, new_message)
end
else
STDERR.puts "Unknown action #{ACTION}!"