From 76ce9fbacfd29e19b47aeba786daca20b2b01117 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 23 Aug 2015 00:02:35 +0000 Subject: mbox: use mboxrd quoting rules This redundantly quotes >From from to prevent losing information as described by qmail --- lib/PublicInbox/Mbox.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Mbox.pm') 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); -- cgit v1.2.3-24-ge0c7