]> Sergey Matveev's repositories - public-inbox.git/commitdiff
mbox: use mboxrd quoting rules
authorEric Wong <e@80x24.org>
Sun, 23 Aug 2015 00:02:35 +0000 (00:02 +0000)
committerEric Wong <e@80x24.org>
Sun, 23 Aug 2015 00:02:53 +0000 (00:02 +0000)
This redundantly quotes >From from to prevent losing information
as described by qmail

lib/PublicInbox/Mbox.pm

index bc4d639ebad0809f3591cc38ecea7bb736039cb0..332e89a7220c1a153b764db42be8eb6846c97b08 100644 (file)
@@ -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);