summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-17 13:43:56 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-17 13:43:56 +0000
commitd64dd293d64d2fae379617ef2ebecd3203af02c7 (patch)
treecfad158d5838a8261188b29a1bf96dab72ceb257
parenta17e97217cb24fa3561254fddd7ece04c273c313 (diff)
Rewrite Delivered-To to X-OLD-Delivered-To to avoid mail-loop warnings, 6
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@141 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xsplit-mailman-mails-and-discard-and-save7
1 files changed, 2 insertions, 5 deletions
diff --git a/split-mailman-mails-and-discard-and-save b/split-mailman-mails-and-discard-and-save
index 6ef6c53..45e449f 100755
--- a/split-mailman-mails-and-discard-and-save
+++ b/split-mailman-mails-and-discard-and-save
@@ -240,14 +240,11 @@ def process_mail(filename)
# rewrite Delivered-To to X-OLD-Delivered-To to avoid mail loop warnings.
m = message.to_s.split(/\n/)
new_m = []
- while true
- break if m.size == 0
- line = m.shift
+ while m.size > 0 and (line = m.shift) != ""
new_m << line.gsub(/^Delivered-To:/, 'X-OLD-Delivered-To:')
- break if line == ""
end
new_m.concat m
- store_in_maildir(OUTBOX_HUMANS, m.join("\n"))
+ store_in_maildir(OUTBOX_HUMANS, new_m.join("\n"))
end
else
STDERR.puts "Unknown action #{ACTION}!"