about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-09 01:27:37 +0000
committerEric Wong <e@80x24.org>2016-04-09 01:27:37 +0000
commitdea396ae54867cc901d586c8af70d5f9fc14f1a8 (patch)
treea8c3c50daaf1f71381bb270958370e482d7b2942
parent7e575fda2b05ae616530457e3ce2e6a7f6f47ee2 (diff)
downloadpublic-inbox-dea396ae54867cc901d586c8af70d5f9fc14f1a8.tar.gz
It can confuse Email::MIME if we have it.
-rwxr-xr-xscript/public-inbox-learn7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/public-inbox-learn b/script/public-inbox-learn
index 0c7b4199..81675d02 100755
--- a/script/public-inbox-learn
+++ b/script/public-inbox-learn
@@ -17,7 +17,12 @@ if ($train !~ /\A(?:ham|spam)\z/) {
 }
 
 my $pi_config = PublicInbox::Config->new;
-my $mime = Email::MIME->new(eval { local $/; <> });
+my $mime = Email::MIME->new(eval {
+        local $/;
+        my $data = scalar <STDIN>;
+        $data =~ s/\AFrom [^\r\n]*\r?\n//s;
+        $data
+});
 
 # get all recipients
 my %dests;