about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiInput.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiInput.pm')
-rw-r--r--lib/PublicInbox/LeiInput.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiInput.pm b/lib/PublicInbox/LeiInput.pm
index c62b0893..859fdb11 100644
--- a/lib/PublicInbox/LeiInput.pm
+++ b/lib/PublicInbox/LeiInput.pm
@@ -32,6 +32,10 @@ sub input_fh {
                         return $self->{lei}->child_error(1 << 8, <<"");
 error reading $name: $!
 
+                # mutt pipes single RFC822 messages with a "From " line,
+                # but no Content-Length or "From " escaping.
+                # "git format-patch" also generates such files by default.
+                $buf =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
                 $self->eml_cb(PublicInbox::Eml->new(\$buf), @args);
         } else {
                 # prepare_inputs already validated $ifmt