From: Eric Wong Date: Thu, 23 Apr 2020 08:34:18 +0000 (+0000) Subject: watchmaildir: scan all matching headers X-Git-Tag: v1.5.0~42 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=e5a139171c3d9bfa23c4da009839cd6eafe3dae1 watchmaildir: scan all matching headers Some headers may appear more than once in a message, so it's probably best to ensure we attempt matches on all of them. This ought to allow matching on Received: or similar because a list lacks List-IDs :P --- diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 7b9e8915..02e4b32f 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -175,10 +175,8 @@ sub _try_path { my $ok; my $hdr = $mime->header_obj; for my $wh (@$watch_hdrs) { - my $v = $hdr->header_raw($wh->[0]); - next unless defined($v) && $v =~ $wh->[1]; - $ok = 1; - last; + my @v = $hdr->header_raw($wh->[0]); + $ok = grep(/$wh->[1]/, @v) and last; } next unless $ok; }