From e5a139171c3d9bfa23c4da009839cd6eafe3dae1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 23 Apr 2020 08:34:18 +0000 Subject: 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 --- lib/PublicInbox/WatchMaildir.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; } -- cgit v1.2.3-24-ge0c7