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 2026/01/15 08:22:07 UTC

svn commit: r1931330 - spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore

Author: gbechis
Date: Thu Jan 15 08:22:07 2026
New Revision: 1931330

Log:
fix password protected Redis access with legacy configuration
bz #8362

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm	Thu Jan 15 04:20:03 2026	(r1931329)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm	Thu Jan 15 08:22:07 2026	(r1931330)
@@ -287,8 +287,12 @@ sub new {
   }
 
   # Override with specific settings if provided
-  $self->{db_id} = $bconf->{bayes_redis_database} if defined $bconf->{bayes_redis_database};
-  $self->{password} = $bconf->{bayes_redis_password} if defined $bconf->{bayes_redis_password};
+  if (defined $bconf->{bayes_redis_database} and ($bconf->{bayes_redis_database} =~ /\d+/)) {
+    $self->{db_id} = $bconf->{bayes_redis_database} 
+  }
+  if (defined $bconf->{bayes_redis_password} and ($bconf->{bayes_redis_password} ne "")) {
+    $self->{password} = $bconf->{bayes_redis_password};
+  }
 
   if (!$bconf->{bayes_auto_expire}) {
     $self->{expire_token} = $self->{expire_seen} = undef;