From ce18cf78aee4c8d05f6de0ca370a55674611f0a0 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 20 Jul 2012 11:35:20 -0400 Subject: [PATCH] allow messages with no body: Robin's patch This is Robin's patch from here: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch?view=markup --- lib/Qpsmtpd/SMTP.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index 4247503..f1b48db 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -634,7 +634,10 @@ sub data_respond { my $timeout = $self->config('timeout'); while (defined($_ = $self->getline($timeout))) { - $complete++, last if $_ eq ".\r\n"; + if ( $_ eq ".\r\n" ) { + $complete++; + $_ eq ''; + }; $i++; # should probably use \012 and \015 in these checks instead of \r and \n ... @@ -650,7 +653,7 @@ sub data_respond { unless (($max_size and $size > $max_size)) { s/\r\n$/\n/; s/^\.\./\./; - if ($in_header and m/^$/) { + if ($in_header && (m/^$/ || $complete > 0)) { $in_header = 0; my @headers = split /^/m, $buffer; @@ -693,9 +696,10 @@ sub data_respond { # copy all lines into the spool file, including the headers # we will create a new header later before sending onwards - $self->transaction->body_write($_); + $self->transaction->body_write($_) if ! $complete; $size += length $_; } + last if $complete > 0; #$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300); }