X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWatchMaildir.pm;h=02e4b32f254a8933e81e60b2001b8cc5ebce63c8;hb=e5a139171c3d9bfa23c4da009839cd6eafe3dae1;hp=bea2ed2aac47b82b91a42c23cdd5b2ef2b05d893;hpb=0f6b0cac5bf10d036a84dbab732e8991edf56c34;p=public-inbox.git diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index bea2ed2a..02e4b32f 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -59,9 +59,11 @@ sub new { my $watch = $ibx->{watch} or return; if (is_maildir($watch)) { my $watch_hdrs = []; - if (my $wh = $ibx->{watchheader}) { - my ($k, $v) = split(/:/, $wh, 2); - push @$watch_hdrs, [ $k, qr/\Q$v\E/ ]; + if (my $whs = $ibx->{watchheader}) { + for (@$whs) { + my ($k, $v) = split(/:/, $_, 2); + push @$watch_hdrs, [ $k, qr/\Q$v\E/ ]; + } } if (my $list_ids = $ibx->{listid}) { for (@$list_ids) { @@ -173,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; }