[svn:qpsmtpd] r664 - branches/0.3x/lib/Qpsmtpd

[email protected] Wed, 4 Oct 2006 06:49:50 -0700 (PDT)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: jpeacock
Date: Wed Oct  4 06:49:49 2006
New Revision: 664

Modified:
   branches/0.3x/lib/Qpsmtpd/TcpServer.pm

Log:
Buffer output of Qpsmtpd::TcpServer::respond() for broken clients who don't
follow RFC's for multiline responses.
Patch from Brian Szymanski <[email protected]>

Modified: branches/0.3x/lib/Qpsmtpd/TcpServer.pm
==============================================================================
--- branches/0.3x/lib/Qpsmtpd/TcpServer.pm	(original)
+++ branches/0.3x/lib/Qpsmtpd/TcpServer.pm	Wed Oct  4 06:49:49 2006
@@ -72,11 +72,13 @@
 
 sub respond {
   my ($self, $code, @messages) = @_;
+  my $buf = '';
   while (my $msg = shift @messages) {
     my $line = $code . (@messages?"-":" ").$msg;
     $self->log(LOGDEBUG, $line);
-    print "$line\r\n" or ($self->log(LOGERROR, "Could not print [$line]: $!"), return 0);
+    $buf .= "$line\r\n";
   }
+  print $buf or ($self->log(LOGERROR, "Could not print [$buf]: $!"), return 0);
   return 1;
 }