]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WatchMaildir.pm
watchmaildir: allow arguments for filters
[public-inbox.git] / lib / PublicInbox / WatchMaildir.pm
index 0b284bdba41bc5dcf0de46e0f8711a3f679ba3ea..1823c24862e6e6da36112ce86f123692f1b82e1d 100644 (file)
@@ -238,11 +238,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;