public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in mail-mta/qpsmtpd/files: qpsmtpd-0.83-accept-empty-email.patch
@ 2012-02-29  9:33 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; only message in thread
From: Robin H. Johnson (robbat2) @ 2012-02-29  9:33 UTC (permalink / raw
  To: gentoo-commits

robbat2     12/02/29 09:33:37

  Added:                qpsmtpd-0.83-accept-empty-email.patch
  Log:
  Version bump and fix for mails with no body (submitted upstream).
  
  (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch?rev=1.1&content-type=text/plain

Index: qpsmtpd-0.83-accept-empty-email.patch
===================================================================
Accept messages with no body.

If a message has no body, there is nothing in the RFC spec that says it
needs to have a trailing \n for a blank line after the headers.

Thumderbird 10 generates some emails like this, which will always cause
plugin errors when $transaction->header is accessed otherwise, as there
is almost no checking that $transaction->header is defined before usage.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Thanks-To: Jack Bates <ms419@freezone.co.uk>

--- qpsmtpd-0.83.orig/lib/Qpsmtpd/SMTP.pm	2009-04-03 06:24:21.000000000 +0000
+++ qpsmtpd-0.83/lib/Qpsmtpd/SMTP.pm	2012-02-25 05:52:14.000000000 +0000
@@ -632,7 +632,7 @@
 
   my $timeout = $self->config('timeout');
   while (defined($_ = $self->getline($timeout))) {
-    $complete++, last if $_ eq ".\r\n";
+    $complete++, $_ = '' if $_ eq ".\r\n";
     $i++;
 
     # should probably use \012 and \015 in these checks instead of \r and \n ...
@@ -648,7 +648,7 @@
     unless (($max_size and $size > $max_size)) {
       s/\r\n$/\n/;
       s/^\.\./\./;
-      if ($in_header and m/^$/) {
+      if ($in_header and (m/^$/ or $complete > 0)) {
         $in_header = 0;
         my @headers = split /^/m, $buffer;
 
@@ -691,9 +691,10 @@
 
       # 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($_) unless $complete;
       $size += length $_;
     }
+    last if $complete > 0;
     #$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300);
   }
 






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-29  9:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29  9:33 [gentoo-commits] gentoo-x86 commit in mail-mta/qpsmtpd/files: qpsmtpd-0.83-accept-empty-email.patch Robin H. Johnson (robbat2)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox