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/13 18:12:40 UTC
svn commit: r170049 - /spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
Author: felicity
Date: Fri May 13 09:12:39 2005
New Revision: 170049
URL: http://svn.apache.org/viewcvs?rev=170049&view=rev
Log:
bug 4328: a mime part's filename was not properly being parsed and stored in the tree node, use the full output provided by parse_content_type() to set this as necessary.
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=170049&r1=170048&r2=170049&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm Fri May 13 09:12:39 2005
@@ -734,8 +734,9 @@
dbg("message: 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
@@ -743,7 +744,7 @@
# 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;