X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2FPublicInbox%2FWatchMaildir.pm;h=985f9192078f3497de62e6da5691f706579ef90a;hb=5d39caaf83799ba3a94b73463a3597c181816425;hp=0b284bdba41bc5dcf0de46e0f8711a3f679ba3ea;hpb=c265481528208a832c5731b8da597554f2a8f693;p=public-inbox.git diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 0b284bdb..985f9192 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -97,7 +97,8 @@ sub _try_fsn_paths { sub _remove_spam { my ($self, $path) = @_; - $path =~ /:2,[A-R]*S[T-Z]*\z/i or return; + # path must be marked as (S)een + $path =~ /:2,[A-R]*S[T-Za-z]*\z/ or return; my $mime = _path_to_mime($path) or return; _force_mid($mime); $self->{config}->each_inbox(sub { @@ -238,11 +239,17 @@ sub _scrubber_for { my ($inbox) = @_; my $f = $inbox->{filter}; if ($f && $f =~ /::/) { + my @args; + # basic line splitting, only + # Perhaps we can have proper quote splitting one day... + ($f, @args) = split(/\s+/, $f) if $f =~ /\s+/; + eval "require $f"; if ($@) { warn $@; } else { - return $f->new; + # e.g: PublicInbox::Filter::Vger->new(@args) + return $f->new(@args); } } undef;