From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 707561F794 for ; Thu, 26 Jan 2017 03:40:15 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] watchmaildir: allow arguments for filters Date: Thu, 26 Jan 2017 03:40:07 +0000 Message-Id: <20170126034008.6396-2-e@80x24.org> In-Reply-To: <20170126034008.6396-1-e@80x24.org> References: <20170126034008.6396-1-e@80x24.org> List-Id: We'll want to allow some degree of configuration for various mailing lists. --- lib/PublicInbox/WatchMaildir.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 0b284bd..1823c24 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -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; -- EW