about summary refs log tree commit homepage
path: root/lib/PublicInbox/WatchMaildir.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-23 08:34:18 +0000
committerEric Wong <e@yhbt.net>2020-04-25 04:41:37 +0000
commite5a139171c3d9bfa23c4da009839cd6eafe3dae1 (patch)
treeeec0aac87eb9fa3c38c64644eb415b5aa1d691fd /lib/PublicInbox/WatchMaildir.pm
parent5f113019334c3fcdcc71e8a573c30ec10f7bcbb9 (diff)
downloadpublic-inbox-e5a139171c3d9bfa23c4da009839cd6eafe3dae1.tar.gz
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
Diffstat (limited to 'lib/PublicInbox/WatchMaildir.pm')
-rw-r--r--lib/PublicInbox/WatchMaildir.pm6
1 files 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;
                 }