aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2006-10-12 18:19:01 +0000
committerNikolaus Schulz <microschulz@web.de>2006-10-12 18:19:01 +0000
commit88ef628f20318c9b38c3503a60d589e79cde7c66 (patch)
tree847cdb675cb55b3ab285e79b8f23c53ae5bee717
parenta0994e6a57d6c02dc75e14b61cf5eef02ce16ade (diff)
downloadarchivemail-88ef628f20318c9b38c3503a60d589e79cde7c66.tar.gz
archivemail-88ef628f20318c9b38c3503a60d589e79cde7c66.tar.bz2
archivemail-88ef628f20318c9b38c3503a60d589e79cde7c66.zip
Mangle From_ in message bodies.
-rwxr-xr-xarchivemail.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/archivemail.py b/archivemail.py
index 7f22bba..dbb2448 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -62,6 +62,10 @@ import tempfile
import time
import urlparse
+# From_ mangling regex.
+from_re = re.compile(r'^From ', re.MULTILINE)
+
+
############## class definitions ###############
class Stats:
@@ -335,6 +339,7 @@ class Mbox(mailbox.UnixMailbox):
body = msg.fp.read(options.read_buffer_size)
if not body:
break
+ body = from_re.sub('>From ', body)
self.mbox_file.write(body)
self.mbox_file.write(os.linesep)