X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWatchMaildir.pm;h=71bd84fc0d13c62941ca6a66a65aae03ab3029c8;hb=b70473ab8296d31ebb600adb4fa8fe0ac5935ca8;hp=7b9e891508aa069ce2981ffd4baa45ff102dc025;hpb=4bebfa0c80ad7f4596a7dca98b39121470a42af0;p=public-inbox.git diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 7b9e8915..71bd84fc 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -62,12 +62,17 @@ sub new { if (my $whs = $ibx->{watchheader}) { for (@$whs) { my ($k, $v) = split(/:/, $_, 2); + # XXX should this be case-insensitive? + # Or, mutt-style, case-sensitive iff + # a capital letter exists? push @$watch_hdrs, [ $k, qr/\Q$v\E/ ]; } } if (my $list_ids = $ibx->{listid}) { for (@$list_ids) { - my $re = qr/<[ \t]*\Q$_\E[ \t]*>/; + # RFC2919 section 6 stipulates + # "case insensitive equality" + my $re = qr/<[ \t]*\Q$_\E[ \t]*>/i; push @$watch_hdrs, ['List-Id', $re ]; } } @@ -175,10 +180,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; }