1 |
diff -ruN qpsmtpd-0.84.old/lib/Qpsmtpd/SMTP.pm qpsmtpd-0.84/lib/Qpsmtpd/SMTP.pm |
2 |
--- qpsmtpd-0.84.old/lib/Qpsmtpd/SMTP.pm 2013-06-29 18:30:46.000000000 -0700 |
3 |
+++ qpsmtpd-0.84/lib/Qpsmtpd/SMTP.pm 2013-06-29 18:36:25.000000000 -0700 |
4 |
@@ -642,7 +642,10 @@ |
5 |
|
6 |
my $timeout = $self->config('timeout'); |
7 |
while (defined($_ = $self->getline($timeout))) { |
8 |
- $complete++, last if $_ eq ".\r\n"; |
9 |
+ if ( $_ eq ".\r\n" ) { |
10 |
+ $complete++; |
11 |
+ $_ eq ''; |
12 |
+ }; |
13 |
$i++; |
14 |
|
15 |
# should probably use \012 and \015 in these checks instead of \r and \n ... |
16 |
@@ -658,7 +661,7 @@ |
17 |
unless (($max_size and $size > $max_size)) { |
18 |
s/\r\n$/\n/; |
19 |
s/^\.\./\./; |
20 |
- if ($in_header and m/^$/) { |
21 |
+ if ($in_header && (m/^$/ || $complete > 0)) { |
22 |
$in_header = 0; |
23 |
my @headers = split /^/m, $buffer; |
24 |
|
25 |
@@ -701,9 +704,10 @@ |
26 |
|
27 |
# copy all lines into the spool file, including the headers |
28 |
# we will create a new header later before sending onwards |
29 |
- $self->transaction->body_write($_); |
30 |
+ $self->transaction->body_write($_) if ! $complete; |
31 |
$size += length $_; |
32 |
} |
33 |
+ last if $complete > 0; |
34 |
#$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300); |
35 |
} |
36 |
|