This redundantly quotes >From from to prevent losing information
as described by qmail
$buf = $simple->body;
$simple->body_set('');
$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);
$buf .= "\n" unless $buf =~ /\n\z/s;
$fh->write($buf);