spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felic...@apache.org
Subject svn commit: rev 6499 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Date Wed, 04 Feb 2004 20:24:59 GMT
Author: felicity
Date: Wed Feb  4 12:24:58 2004
New Revision: 6499

Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Log:
parse more things out of content-type

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	Wed Feb  4 12:24:58 2004
@@ -576,16 +576,19 @@
   # white space, the white space must be presumed to have been added by
   # a gateway, and must be deleted.)"
   #
-  my ($boundary) = $ct =~ m!boundary\s*=\s*("[^"]*[^"\s]"|[^";\s]+)!i;
+  my ($boundary) = $ct =~ m!\bboundary\s*=\s*("[^"]*[^"\s]"|[^";\s]+)!i;
   $boundary =~ tr/"//d if ( defined $boundary ); # remove the double quotes ...
 
+  my($charset) = $ct =~ /\bcharset\s*=\s*["']?(.*?)["']?(?:;|$)/i;
+  my($name) = $ct =~ /name\s*=\s*["']?(.*?)["']?(?:;|$)/i;
+
   # Get the type out ...
   $ct =~ s/;.*$//;                    # strip everything after first semi-colon
   $ct =~ s@^([^/]+(?:/[^/]*)?).*$@$1@;	# only something/something ...
   $ct =~ tr/\000-\040\177-\377\042\050\051\054\056\072-\077\100\133-\135//d;    # strip inappropriate
chars
   $ct = lc $ct;
 
-  return wantarray ? ($ct,$boundary) : $ct;
+  return wantarray ? ($ct,$boundary,$charset,$name) : $ct;
 }
 
 ###########################################################################

Mime
View raw message