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

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <176846532787.2288485.1504705537375641201@svn02-us-east.apache.org>
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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.