]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watchmaildir: scan all matching headers
authorEric Wong <e@yhbt.net>
Thu, 23 Apr 2020 08:34:18 +0000 (08:34 +0000)
committerEric Wong <e@yhbt.net>
Sat, 25 Apr 2020 04:41:37 +0000 (04:41 +0000)
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

index 7b9e891508aa069ce2981ffd4baa45ff102dc025..02e4b32f254a8933e81e60b2001b8cc5ebce63c8 100644 (file)
@@ -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;
                }