You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2006/08/13 02:20:18 UTC

svn commit: r431118 - /spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm

Author: felicity
Date: Sat Aug 12 17:20:18 2006
New Revision: 431118

URL: http://svn.apache.org/viewvc?rev=431118&view=rev
Log:
bug 4942: ignore text/calendar parts when looking for rendered/decoded text

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm?rev=431118&r1=431117&r2=431118&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm Sat Aug 12 17:20:18 2006
@@ -832,6 +832,10 @@
   for(my $pt = 0 ; $pt <= $#parts ; $pt++ ) {
     my $p = $parts[$pt];
 
+    # bug 4843: skip text/calendar parts since they're usually an attachment
+    # and not displayed
+    next if ($p->{'type'} eq 'text/calendar');
+
     # put a blank line between parts ...
     $text .= "\n";
 
@@ -892,6 +896,10 @@
   for(my $pt = 0 ; $pt <= $#parts ; $pt++ ) {
     my $p = $parts[$pt];
 
+    # bug 4843: skip text/calendar parts since they're usually an attachment
+    # and not displayed
+    next if ($p->{'type'} eq 'text/calendar');
+
     # put a blank line between parts ...
     $text .= "\n";
 
@@ -946,6 +954,10 @@
   for(my $pt = 0 ; $pt <= $#parts ; $pt++ ) {
     my $p = $parts[$pt];
 
+    # bug 4843: skip text/calendar parts since they're usually an attachment
+    # and not displayed
+    next if ($p->{'type'} eq 'text/calendar');
+
     # put a blank line between parts ...
     $text .= "\n" if ( $text );
 
@@ -989,6 +1001,10 @@
 
   # Go through each part
   for(my $pt = 0 ; $pt <= $#parts ; $pt++ ) {
+    # bug 4843: skip text/calendar parts since they're usually an attachment
+    # and not displayed
+    next if ($parts[$pt]->{'type'} eq 'text/calendar');
+
     push(@{$self->{text_decoded}}, "\n") if ( @{$self->{text_decoded}} );
     push(@{$self->{text_decoded}}, $parts[$pt]->decode());
   }