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 2005/05/06 19:59:41 UTC

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

Author: felicity
Date: Fri May  6 10:59:40 2005
New Revision: 168632

URL: http://svn.apache.org/viewcvs?rev=168632&view=rev
Log:
bug 4103: deal with deep recursive message/* attachments

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm?rev=168632&r1=168631&r2=168632&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm Fri May  6 10:59:40 2005
@@ -106,6 +106,11 @@
   my $message = $opts->{'message'} || \*STDIN;
   my $parsenow = $opts->{'parsenow'} || 0;
 
+  # Specifies whether or not to parse message/rfc822 parts into its own tree.
+  # If the # > 0, it'll subparse, otherwise it won't.  By default, do one
+  # level deep.
+  my $subparse = defined $opts->{'subparse'} ? $opts->{'subparse'} : 1;
+
   # protect it from abuse ...
   local $_;
 
@@ -740,12 +745,12 @@
 
   # If this part is a message/* part, and the parent isn't also a
   # message/* part (ie: the main part) go ahead and parse into a tree.
-  if ($part_msg->{'type'} =~ /^message\b/i) {
+  if ($part_msg->{'type'} =~ /^message\b/i && $msg->{subparse}) {
     # Get the part ready...
     my $message = $part_msg->decode();
 
     if ($message) {
-      my $msg_obj = Mail::SpamAssassin::Message->new({message=>$message, parsenow=>1});
+      my $msg_obj = Mail::SpamAssassin::Message->new({message=>$message, parsenow=>1, subparse=>$msg->{subparse}-1});
 
       # main message is a message/* part ...
       if ($msg == $part_msg) {