From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2E1776338DA; Sun, 23 Aug 2015 00:02:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH] mbox: use mboxrd quoting rules Date: Sun, 23 Aug 2015 00:02:35 +0000 Message-Id: <1440288155-20688-2-git-send-email-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index bc4d639..332e89a 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); -- EW