svn commit: r1928495 - in spamassassin/trunk/lib/Mail/SpamAssassin: . Message

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <175795124001.1867441.3482015811559538928@svn02-us-east.apache.org>
Author: fkento
Date: Mon Sep 15 15:47:19 2025
New Revision: 1928495

Log:
Include SVG files in rawbody rules

SVG files can contain text, html, and JavaScript so treat them just like
html files.

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
   spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm	Mon Sep 15 12:45:02 2025	(r1928494)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm	Mon Sep 15 15:47:19 2025	(r1928495)
@@ -1368,7 +1368,7 @@ sub get_decoded_body_text_array {
   # Go through each part
   for(my $pt = 0 ; $pt <= $#parts ; $pt++ ) {
     # skip non-text parts (Bug 6439)
-    next unless $parts[$pt]->effective_type() =~ /^(?:text|message)\b/;
+    next unless $parts[$pt]->effective_type() =~ /^(?:text|message|image\/svg\+xml)\b/;
     # bug 4843: skip text/calendar parts since they're usually an attachment
     # and not displayed
     next if ($parts[$pt]->{'type'} eq 'text/calendar');

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	Mon Sep 15 12:45:02 2025	(r1928494)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	Mon Sep 15 15:47:19 2025	(r1928495)
@@ -747,7 +747,7 @@ sub rendered {
   # we also want to skip things like text/x-vcard
   # text/x-aol is ignored here, but looks like text/html ...
   my $type = $self->effective_type();
-  unless ($type eq 'text/plain' || $type eq 'text/html') {
+  unless ($type eq 'text/plain' || $type eq 'text/html' || $type eq 'image/svg+xml') {
     return (undef,undef);
   }
 
@@ -761,7 +761,7 @@ sub rendered {
   }
 
   # render text/html always
-  if ($text ne '' && $type eq 'text/html')
+  if ($text ne '' && $type ne 'text/plain' )
   {
     $self->{rendered_type} = 'text/html';
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.