From 0c17b6e39fe98a0da0b0deaa4fd014343362a33f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 19 Jun 2016 00:23:27 +0000 Subject: import: allow messages without subject Because our WatchMaildir module is liberal about what it accepts, we can potentially have messages without a subject. --- lib/PublicInbox/Import.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index c13d4834..5ffc26ef 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -112,8 +112,11 @@ sub remove { defined($n) or die "read final byte of cat-blob failed: $!"; die "bad read on final byte: <$lf>" if $lf ne "\n"; my $cur = Email::MIME->new($buf); - if ($cur->header('Subject') ne $mime->header('Subject') || - norm_body($cur) ne norm_body($mime)) { + my $cur_s = $cur->header('Subject'); + $cur_s = '' unless defined $cur_s; + my $cur_m = $mime->header('Subject'); + $cur_m = '' unless defined $cur_m; + if ($cur_s ne $cur_m || norm_body($cur) ne norm_body($mime)) { return ('MISMATCH', $cur); } -- cgit v1.2.3-24-ge0c7