You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/01/07 15:30:25 UTC

svn commit: r1056334 - /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Author: mmartinec
Date: Fri Jan  7 14:30:25 2011
New Revision: 1056334

URL: http://svn.apache.org/viewvc?rev=1056334&view=rev
Log:
Bug 6531: clear_uridnsbl_skip_domain feature to allow admin override of default configuration

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm?rev=1056334&r1=1056333&r2=1056334&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm Fri Jan  7 14:30:25 2011
@@ -57,6 +57,18 @@ Specify a domain, or a number of domains
 URIBL checks.  This is very useful to specify very common domains which are
 not going to be listed in URIBLs.
 
+=over 4
+
+=item clear_uridnsbl_skip_domain [domain1 domain2 ...]
+
+If no argument is given, then clears the entire list of domains declared
+by I<uridnsbl_skip_domain> configuration directives so far. Any subsequent
+I<uridnsbl_skip_domain> directives will start creating a new list of skip
+domains.
+
+When given a list of domains as arguments, only the specified domains
+are removed from the list of skipped domains.
+
 =back
 
 =head1 RULE DEFINITIONS AND PRIVILEGED SETTINGS
@@ -382,6 +394,7 @@ sub parsed_metadata {
 
   # don't keep dereferencing this
   my $skip_domains = $conf->{uridnsbl_skip_domains};
+  $skip_domains = {}  if !$skip_domains;
 
   # list of hashes to use in order
   my @uri_ordered;
@@ -764,6 +777,22 @@ sub set_config {
     }
   });
 
+  push (@cmds, {
+    setting => 'clear_uridnsbl_skip_domain',
+    type => $Mail::SpamAssassin::Conf::CONF_TYPE_HASH_KEY_VALUE,
+    code => sub {
+      my ($self, $key, $value, $line) = @_;
+      if (!defined $value || $value eq '') {
+        # clear the entire list
+        $self->{uridnsbl_skip_domains} = {};
+      } else {
+        foreach my $domain (split(/\s+/, $value)) {
+          delete $self->{uridnsbl_skip_domains}->{lc $domain};
+        }
+      }
+    }
+  });
+
   # obsolete
   push(@cmds, {
     setting => 'uridnsbl_timeout',