diff options
author | Eric Wong <e@80x24.org> | 2023-10-11 07:20:53 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-11 22:10:48 +0000 |
commit | 770d8b3f465db89d80922c32d766b022cf4b31ed (patch) | |
tree | 3bd60df35645436d0aaac95227fa372b1e6f73a9 /lib/PublicInbox/MboxReader.pm | |
parent | 3b7cdd9173bd0d74fc181b05c02d90b320d621ae (diff) | |
download | public-inbox-770d8b3f465db89d80922c32d766b022cf4b31ed.tar.gz |
Aside from our prior import bugs (fixed in a0c07cba0e5d8b6a (mda: drop leading "From " lines again, 2016-06-26)), we'll always have to be dealing with mutt piping messages to us and `git format-patch' output. So just share the regexp so we can use it everywhere. In may be desirable to allow importing messages with a leading "From " line for FUSE, even. Additionally, some instances of this regexp needlessly added optional `\r?' (CR) checks ahead of the `\n' (LF) element; but they're pointless anyways since [^\n]* is enough to exclude all non-LF bytes.
Diffstat (limited to 'lib/PublicInbox/MboxReader.pm')
-rw-r--r-- | lib/PublicInbox/MboxReader.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/MboxReader.pm b/lib/PublicInbox/MboxReader.pm index e4209022..d67fb4eb 100644 --- a/lib/PublicInbox/MboxReader.pm +++ b/lib/PublicInbox/MboxReader.pm @@ -93,7 +93,7 @@ sub _mbox_cl ($$$;@) { undef $mbfh; } while (my $hdr = _extract_hdr(\$buf)) { - $$hdr =~ s/\A[\r\n]*From [^\n]*\n//s or + PublicInbox::Eml::strip_from($$hdr) or die "E: no 'From ' line in:\n", Dumper($hdr); my $eml = PublicInbox::Eml->new($hdr); next unless $eml->raw_size; |