You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by gb...@apache.org on 2025/05/15 10:37:37 UTC

svn commit: r1925562 - in /spamassassin/trunk: lib/Mail/SpamAssassin.pm lib/spamassassin-run.pod spamassassin.raw

Author: gbechis
Date: Thu May 15 10:37:37 2025
New Revision: 1925562

URL: http://svn.apache.org/viewvc?rev=1925562&view=rev
Log:
add remove-addr-from-blocklist option

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin.pm
    spamassassin/trunk/lib/spamassassin-run.pod
    spamassassin/trunk/spamassassin.raw

Modified: spamassassin/trunk/lib/Mail/SpamAssassin.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin.pm?rev=1925562&r1=1925561&r2=1925562&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin.pm Thu May 15 10:37:37 2025
@@ -1086,6 +1086,7 @@ sub remove_address_from_welcomelist {
   $self->call_plugins("remove_address", { address => $addr,
                                           cli_p => $cli_p });
 }
+*remove_address_from_blocklist = \&remove_address_from_welcomelist;
 *remove_address_from_whitelist = \&remove_address_from_welcomelist; # removed in 4.1
 
 ###########################################################################

Modified: spamassassin/trunk/lib/spamassassin-run.pod
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/spamassassin-run.pod?rev=1925562&r1=1925561&r2=1925562&view=diff
==============================================================================
--- spamassassin/trunk/lib/spamassassin-run.pod (original)
+++ spamassassin/trunk/lib/spamassassin-run.pod Thu May 15 10:37:37 2025
@@ -58,7 +58,8 @@ Options:
                                    persistent address list
  --add-addr-to-welcomelist=addr    Add addr to persistent address welcomelist
  --add-addr-to-blocklist=addr      Add addr to persistent address blocklist
- --remove-addr-from-welcomelist=addr Remove addr from persistent address list
+ --remove-addr-from-welcomelist=addr Remove addr from persistent address welcomelist
+ --remove-addr-from-blocklist=addr Remove addr from persistent address blocklist
  -u username, --username=username  Override username taken from the runtime
                                    environment, used with SQL
  -4 --ipv4only, --ipv4-only, --ipv4 Use IPv4, disable use of IPv6 for DNS etc.
@@ -221,6 +222,12 @@ Remove the named email address from a pe
 you must be running C<spamassassin> or C<spamd> with a persistent address
 list plugin enabled for this to work.
 
+=item B<--remove-addr-from-blocklist>
+
+Remove the named email address from a persistent address blocklist.  Note that
+you must be running C<spamassassin> or C<spamd> with a persistent address
+list plugin enabled for this to work.
+
 =item B<-u> I<username>, B<--username>=I<username>
 
 If specified this username will override the username taken from the runtime

Modified: spamassassin/trunk/spamassassin.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/spamassassin.raw?rev=1925562&r1=1925561&r2=1925562&view=diff
==============================================================================
--- spamassassin/trunk/spamassassin.raw (original)
+++ spamassassin/trunk/spamassassin.raw Thu May 15 10:37:37 2025
@@ -201,6 +201,7 @@ GetOptions(
   'mbx'                                     => sub { $opt{'format'} = 'mbx'; },
   'prefspath|prefs-file|p=s'                => \$opt{'prefspath'},
   'remove-addr-from-welcomelist=s'          => \$opt{'remove-addr-from-welcomelist'},
+  'remove-addr-from-blocklist=s'            => \$opt{'remove-addr-from-blocklist'},
   'remove-from-welcomelist|R'               => \$opt{'remove-from-welcomelist'},
   'remove-addr-from-whitelist=s'            => \$opt{'remove-addr-from-welcomelist'}, # removed in 4.1
   'remove-from-whitelist'                   => \$opt{'remove-from-welcomelist'}, # removed in 4.1
@@ -294,6 +295,7 @@ if ($opt{'lint'}) {
 }
 
 if ($opt{'remove-addr-from-welcomelist'} ||
+    $opt{'remove-addr-from-blocklist'} ||
     $opt{'add-addr-to-welcomelist'} ||
     $opt{'add-addr-to-blocklist'})
 {
@@ -308,6 +310,9 @@ if ($opt{'remove-addr-from-welcomelist'}
   elsif ( $opt{'add-addr-to-blocklist'} ) {
     $spamtest->add_address_to_blocklist($opt{'add-addr-to-blocklist'}, 1);
   }
+  elsif ( $opt{'remove-addr-from-blocklist'} ) {
+    $spamtest->remove_address_from_blocklist($opt{'remove-addr-from-blocklist'}, 1);
+  }
   else {
     die "spamassassin: oops! unhandled welcomelist operation";
   }