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

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <[email protected]>
Author: gbechis
Date: Mon Oct 13 16:33:35 2025
New Revision: 1929117

Log:
check that is possible to verify if the DNS answer is a CNAME
bz #8353

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Mon Oct 13 16:09:32 2025	(r1929116)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Mon Oct 13 16:33:35 2025	(r1929117)
@@ -2928,16 +2928,18 @@ sub add_uri_detail_list {
         # if a CNAME is present
         $self->{dns_cname_cache}{$host} = 'invalid';
         foreach my $ans ( @answ ) {
-          return if not defined $ans->cname;
-          if(not exists $self->{dns_cname_cache}{$host}) {
-            $self->{dns_cname_cache}{$host} = $ans->cname;
-            dbg("dns: found CNAME " . $ans->cname . " for host $host");
-            my $cname_types = { %{$types} };
-            $cname_types->{unlinked} = 1;
-            $cname_types->{noclean} = 1;
-            $self->{uri_cnames}{$ans->cname} = $host;
-            $self->add_uri_detail_list($ans->cname, $cname_types, $source, 1);
-	  }
+          if($ans->can("cname")) {
+            return if not defined $ans->cname;
+            if(not exists $self->{dns_cname_cache}{$host}) {
+              $self->{dns_cname_cache}{$host} = $ans->cname;
+              dbg("dns: found CNAME " . $ans->cname . " for host $host");
+              my $cname_types = { %{$types} };
+              $cname_types->{unlinked} = 1;
+              $cname_types->{noclean} = 1;
+              $self->{uri_cnames}{$ans->cname} = $host;
+              $self->add_uri_detail_list($ans->cname, $cname_types, $source, 1);
+            }
+          }
         }
       } or do {
         undef $pkt;
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.