about summary refs log tree commit homepage
path: root/public-inbox-mda
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-10-03 10:18:07 +0000
committerEric Wong <e@80x24.org>2015-10-03 10:40:13 +0000
commit9bc8cf2e9866393470cdb76a2af39d63f4246204 (patch)
treebd6d055ddc1ab7d153eeefbd91ed69fe6504c64d /public-inbox-mda
parentc68a1fcd75f103d08f8c2dabf9b3a1db4239f59c (diff)
downloadpublic-inbox-9bc8cf2e9866393470cdb76a2af39d63f4246204.tar.gz
For list where we are not the primary archival entry point,
defaulting to filter=scrub makes sense since their list
conventions may be more tolerant of HTML and other crap
than we are.
Diffstat (limited to 'public-inbox-mda')
-rwxr-xr-xpublic-inbox-mda13
1 files changed, 12 insertions, 1 deletions
diff --git a/public-inbox-mda b/public-inbox-mda
index 1a9469ba..df8ca38c 100755
--- a/public-inbox-mda
+++ b/public-inbox-mda
@@ -38,7 +38,18 @@ if (PublicInbox::MDA->precheck($filter, $dst->{address}) &&
         $filtered = undef;
         $filter->simple($msg);
 
-        if (PublicInbox::Filter->run($msg, $filter)) {
+        my $filter_arg;
+        my $fcfg = $dst->{filter};
+        if (!defined $fcfg || $filter eq 'reject') {
+                $filter_arg = $filter;
+        } elsif ($fcfg eq 'scrub') {
+                $filter_arg = undef; # the default for legacy versions
+        } else {
+                warn "publicinbox.$dst->{listname}.filter=$fcfg invalid\n";
+                warn "must be either 'scrub' or 'reject' (the default)\n";
+        }
+
+        if (PublicInbox::Filter->run($msg, $filter_arg)) {
                 # run spamc again on the HTML-free message
                 if (do_spamc($msg, \$filtered)) {
                         $msg = Email::MIME->new(\$filtered);