projects
/
public-inbox.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88cc653
)
mda: support loading arbitrary filters
author
Eric Wong <e@80x24.org>
Thu, 16 Jun 2016 22:45:27 +0000 (22:45 +0000)
committer
Eric Wong <e@80x24.org>
Fri, 17 Jun 2016 01:13:57 +0000 (
01:13
+0000)
Give users some rope to do their own filtering.
script/public-inbox-mda
patch
|
blob
|
history
diff --git
a/script/public-inbox-mda
b/script/public-inbox-mda
index 63096fee9a8812fe13f30010437a9b89b75d5305..26b70cfb6cfc8f2fc7d4631b829648e0e34d068f 100755
(executable)
--- a/
script/public-inbox-mda
+++ b/
script/public-inbox-mda
@@
-57,7
+57,11
@@
do_exit(0) unless $spam_ok;
my $fcfg = $dst->{filter} || '';
my $filter;
-if ($fcfg eq 'scrub') { # TODO:
+if ($fcfg =~ /::/) {
+ eval "require $fcfg";
+ die $@ if $@;
+ $filter = $fcfg->new;
+} elsif ($fcfg eq 'scrub') { # TODO:
require PublicInbox::Filter::Mirror;
$filter = PublicInbox::Filter::Mirror->new;
} else {