X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWatchMaildir.pm;h=7ca35403517ecd82e9e1a08f72c21c1d0234b08c;hb=46742d95647c7a80cb2f60d5c134717dd91e22e2;hp=02e4b32f254a8933e81e60b2001b8cc5ebce63c8;hpb=e5a139171c3d9bfa23c4da009839cd6eafe3dae1;p=public-inbox.git diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 02e4b32f..7ca35403 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -6,7 +6,7 @@ package PublicInbox::WatchMaildir; use strict; use warnings; -use PublicInbox::MIME; +use PublicInbox::Eml; use PublicInbox::InboxWritable; use File::Temp 0.19 (); # 0.19 for ->newdir use PublicInbox::Filter::Base qw(REJECT); @@ -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 ]; } } @@ -277,7 +282,7 @@ sub _spamcheck_cb { my ($mime) = @_; my $tmp = ''; if ($sc->spamcheck($mime, \$tmp)) { - return PublicInbox::MIME->new(\$tmp); + return PublicInbox::Eml->new(\$tmp); } warn $mime->header('Message-ID')." failed spam check\n"; undef;