/[Apache-SVN]/spamassassin/branches/3.0/lib/Mail/SpamAssassin/Message.pm
ViewVC logotype

Diff of /spamassassin/branches/3.0/lib/Mail/SpamAssassin/Message.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/Message.pm	2005/05/20 04:45:49	171047
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/Message.pm	2005/05/20 04:47:46	171048
@@ -586,8 +586,9 @@ sub _parse_normal {
 
   dbg("parsing normal part");
 
-  $part_msg->{'type'} =
-    Mail::SpamAssassin::Util::parse_content_type($part_msg->header('content-type'));
+  # 0: content-type, 1: boundary, 2: charset, 3: filename
+  my @ct = Mail::SpamAssassin::Util::parse_content_type($part_msg->header('content-type'));
+  $part_msg->{'type'} = $ct[0];
 
   # multipart sections are required to have a boundary set ...  If this
   # one doesn't, assume it's malformed and revert to text/plain
@@ -595,7 +596,7 @@ sub _parse_normal {
 
   # attempt to figure out a name for this attachment if there is one ...
   my $disp = $part_msg->header('content-disposition') || '';
-  my($filename) = $disp =~ /name="?([^\";]+)"?/i || $part_msg->{'type'} =~ /name="?([^\";]+)"?/i;
+  my($filename) = $disp =~ /name="?([^\";]+)"?/i || $ct[3];
 
   $part_msg->{'raw'} = $body;
   $part_msg->{'boundary'} = $boundary;

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26