Mailing List Archive

svn commit: r261909 - /spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm
Author: duncf
Date: Sat Aug 27 18:04:50 2005
New Revision: 261909

URL: http://svn.apache.org/viewcvs?rev=261909&view=rev
Log:
Bug 4535: Tweak MIME boundary regexp

Modified:
spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm

Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm?rev=261909&r1=261908&r2=261909&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message.pm Sat Aug 27 18:04:50 2005
@@ -654,7 +654,7 @@
foreach ( @{$body} ) {
# if we're on the last body line, or we find any boundary marker,
# deal with the mime part
- if ( --$line_count == 0 || (defined $boundary && /^--\Q$boundary\E(?:--|\s*$)/) ) {
+ if ( --$line_count == 0 || (defined $boundary && /^--\Q$boundary\E(?:--)?\s*$/) ) {
my $line = $_; # remember the last line

# per rfc 1521, the CRLF before the boundary is part of the boundary:
@@ -681,10 +681,10 @@
dbg("message: found part of type ".$part_msg->{'type'}.", boundary: ".(defined $p_boundary ? $p_boundary : ''));
$self->parse_body( $msg, $part_msg, $p_boundary, $part_array, 0 );

- # rfc 1521 says /^--boundary--$/ but MUAs have a tendancy to just
- # require /^--boundary--/ due to malformed messages, so that'll work for
- # us as well.
- if (defined $boundary && $line =~ /^--\Q${boundary}\E--/) {
+ # rfc 1521 says /^--boundary--$/, some MUAs may just require /^--boundary--/
+ # but this causes problems with horizontal lines when the boundary is
+ # made up of dashes as well, etc.
+ if (defined $boundary && $line =~ /^--\Q${boundary}\E--\s*$/) {
# Make a note that we've seen the end boundary
$self->{mime_boundary_state}->{$boundary}--;
last;