More pollserver fixes

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@727 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2007-03-19 21:40:56 +00:00
parent b1c9101bfa
commit 46acae5c7f

View File

@ -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;
}