svn commit: r1931832 - spamassassin/trunk/lib/Mail/SpamAssassin

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <177091735446.2322733.17581006180082981088@svn02-us-east.apache.org>
Author: gbechis
Date: Thu Feb 12 17:29:14 2026
New Revision: 1931832

Log:
add "empty_tags" configuration.
This is a list of tags that might be undefined because they are set by 3rd party plugins.
Setting this configuration will prevent those tags from being set with an invalid value
if they are not defined.

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
   spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	Thu Feb 12 16:29:44 2026	(r1931831)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	Thu Feb 12 17:29:14 2026	(r1931832)
@@ -3738,6 +3738,25 @@ e.g.
     }
   });
 
+=item empty_tags string
+
+This is a list of tags that might be undefined because they are set by 3rd party plugins.
+Setting this configuration will prevent those tags from being set with an invalid value
+if they are not defined.
+
+e.g.
+
+  empty_tags mytag1 mytag2
+
+=cut
+
+  push (@cmds, {
+    setting => 'empty_tags',
+    is_admin => 1,
+    default => undef,
+    type => $CONF_TYPE_STRING,
+  });
+
 =item test SYMBOLIC_TEST_NAME (ok|fail) Some string to test against
 
 Define a regression testing string. You can have more than one regression test

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Thu Feb 12 16:29:44 2026	(r1931831)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Thu Feb 12 17:29:14 2026	(r1931832)
@@ -342,6 +342,9 @@ sub new {
               URIDOMAINS URICNAMES)) {
     $tag_data_ref->{$_} = undef;  # exist, but undefined
   }
+  foreach (split(' ', $self->{conf}->{empty_tags})) {
+    $tag_data_ref->{$_} = undef;  # exist, but undefined
+  }
 
   bless ($self, $class);
   $self;
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.