From 46acae5c7fac0d4927b91f0f5b6e04ddbcf2c22b Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Mon, 19 Mar 2007 21:40:56 +0000 Subject: [PATCH] More pollserver fixes git-svn-id: https://svn.perl.org/qpsmtpd/trunk@727 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/PollServer.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Qpsmtpd/PollServer.pm b/lib/Qpsmtpd/PollServer.pm index bbeaaab..8219418 100644 --- a/lib/Qpsmtpd/PollServer.pm +++ b/lib/Qpsmtpd/PollServer.pm @@ -249,7 +249,7 @@ sub got_data { $data =~ s/\r\n/\n/mg; $data =~ s/^\.\./\./mg; - if ($self->{in_header} and $data =~ s/\A(.*?)\n[ \t]*\n//ms) { + if ($self->{in_header} and $data =~ s/\A(.*?\n)\n/\n/ms) { $self->{header_lines} .= $1; # end of headers $self->{in_header} = 0; @@ -260,7 +260,7 @@ sub got_data { # When forwarding a message into or out of the Internet environment, a # gateway MUST prepend a Received: line, but it MUST NOT alter in any # way a Received: line that is already in the header. - my @header_lines = split(/\n/, $self->{header_lines}); + my @header_lines = split(/^/m, $self->{header_lines}); my $header = Mail::Header->new(\@header_lines, Modify => 0, MailFrom => "COERCE"); @@ -271,15 +271,16 @@ sub got_data { # FIXME - call plugins to work on just the header here; can # save us buffering the mail content. + + # Save the start of just the body itself + $self->transaction->set_body_start(); } if ($self->{in_header}) { $self->{header_lines} .= $data; } - else { - $self->transaction->body_write(\$data); - } - + + $self->transaction->body_write(\$data); $self->{data_size} += length $data; }