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/05/06 15:34:38 UTC

svn commit: r1100210 - /spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Author: mmartinec
Date: Fri May  6 13:34:37 2011
New Revision: 1100210

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

Modified:
    spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Modified: spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm?rev=1100210&r1=1100209&r2=1100210&view=diff
==============================================================================
--- spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm (original)
+++ spamassassin/branches/3.3/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm Fri May  6 13:34:37 2011
@@ -56,6 +56,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
@@ -333,6 +345,7 @@ sub parsed_metadata {
 
   # don't keep dereferencing this
   my $skip_domains = $scanner->{main}->{conf}->{uridnsbl_skip_domains};
+  $skip_domains = {}  if !$skip_domains;
 
   # list of hashes to use in order
   my @uri_ordered;
@@ -710,6 +723,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',