about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-26 23:36:36 +0000
committerEric Wong <e@80x24.org>2016-06-26 23:36:36 +0000
commit31a6ff1221fe70f309ac2476024ebb7953a4e477 (patch)
tree9b967a595c077b25dede056fce20e6577803ba5b /lib/PublicInbox/SearchIdx.pm
parenta0c07cba0e5d8b6a518e276e83477fd3892efaec (diff)
downloadpublic-inbox-31a6ff1221fe70f309ac2476024ebb7953a4e477.tar.gz
Some messages will be misimported due to an old bug,
clean them up and ensure we do not propagate the mistake.

Followup-to: a0c07cba0e5d ("mda: drop leading "From " lines again")
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 58eccc1a..c2bf9a2d 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -311,6 +311,8 @@ sub do_cat_mail {
         my ($git, $blob, $sizeref) = @_;
         my $mime = eval {
                 my $str = $git->cat_file($blob, $sizeref);
+                # fixup bugs from import:
+                $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
                 Email::MIME->new($str);
         };
         $@ ? undef : $mime;