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
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;
}