Mailing List Archive

svn commit: rev 6430 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Author: felicity
Date: Sun Feb 1 18:50:25 2004
New Revision: 6430

Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/MsgParser.pm
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Log:
deal with the mbox seperator ...

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/MsgParser.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/MsgParser.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/MsgParser.pm Sun Feb 1 18:50:25 2004
@@ -81,9 +81,6 @@
@message = split ( /^/m, $message );
}

- # trim mbox seperator if it exists
- shift @message if ( @message > 0 && $message[0] =~ /^From\s/ );
-
# Generate the main object and parse the appropriate MIME-related headers into it.
my $msg = Mail::SpamAssassin::MsgContainer->new();
my $header = '';
@@ -92,6 +89,11 @@
while ( my $last = shift @message ) {
# Store the non-modified headers in a scalar
$msg->{'pristine_headers'} .= $last;
+
+ if ( $last =~ /^From\s/ ) {
+ $msg->{'mbox_sep'} = $last;
+ next;
+ }

# NB: Really need to figure out special folding rules here!
if ( $last =~ /^[ \t]+/ ) { # if its a continuation

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Sun Feb 1 18:50:25 2004
@@ -707,6 +707,7 @@

EOM

+ $newmsg = $self->{msg}->{'mbox_sep'} . $newmsg if ( exists $self->{msg}->{'mbox_sep'} );
my @lines = split (/^/m, $newmsg);
return Mail::SpamAssassin::MsgParser->parse(\@lines);
}
@@ -749,6 +750,7 @@
push(@pristine_headers, "X-Spam-$header: $line\n");
}

+ splice @pristine_headers, 0, 0, $self->{msg}->{'mbox_sep'} if ( exists $self->{msg}->{'mbox_sep'} );
push(@pristine_headers, "\n", split (/^/m, $self->{msg}->get_pristine_body()));
return Mail::SpamAssassin::MsgParser->parse(\@pristine_headers);
}