From: Eric Wong Date: Sun, 19 Jun 2016 00:23:27 +0000 (+0000) Subject: import: allow messages without subject X-Git-Tag: v1.0.0~409 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=0c17b6e39fe98a0da0b0deaa4fd014343362a33f import: allow messages without subject Because our WatchMaildir module is liberal about what it accepts, we can potentially have messages without a subject. --- 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); }