about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-23 00:02:35 +0000
committerEric Wong <e@80x24.org>2015-08-23 00:02:53 +0000
commit76ce9fbacfd29e19b47aeba786daca20b2b01117 (patch)
tree733d612a8ba8ed4bd75c9825fcd8f20a50884768 /lib/PublicInbox/Mbox.pm
parentf1747921cf00e251ea0d814d732fb8c9dc9e39cd (diff)
downloadpublic-inbox-76ce9fbacfd29e19b47aeba786daca20b2b01117.tar.gz
This redundantly quotes >From from to prevent losing information
as described by qmail
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index bc4d639e..332e89a7 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -42,7 +42,11 @@ sub emit_msg {
 
         $buf = $simple->body;
         $simple->body_set('');
-        $buf =~ s/^(From )/>$1/gm;
+
+        # mboxrd quoting style
+        # ref: http://www.qmail.org/man/man5/mbox.html
+        $buf =~ s/^(>*From )/>$1/gm;
+
         $buf .= "\n" unless $buf =~ /\n\z/s;
 
         $fh->write($buf);