* [PATCH] learn: drop leading "From " line from mboxes
@ 2016-04-09 1:33 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-04-09 1:33 UTC (permalink / raw)
To: meta
It can confuse Email::MIME if we have it.
---
script/public-inbox-learn | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/script/public-inbox-learn b/script/public-inbox-learn
index 0c7b419..81675d0 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;
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-09 1:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-09 1:33 [PATCH] learn: drop leading "From " line from mboxes Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).