Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-mta/qpsmtpd/files: qpsmtpd-0.83-accept-empty-email.patch
Date: Wed, 29 Feb 2012 09:33:51
Message-Id: 20120229093337.5D1AB2004C@flycatcher.gentoo.org
1 robbat2 12/02/29 09:33:37
2
3 Added: qpsmtpd-0.83-accept-empty-email.patch
4 Log:
5 Version bump and fix for mails with no body (submitted upstream).
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch
11
12 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
13 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
14
15 Index: qpsmtpd-0.83-accept-empty-email.patch
16 ===================================================================
17 Accept messages with no body.
18
19 If a message has no body, there is nothing in the RFC spec that says it
20 needs to have a trailing \n for a blank line after the headers.
21
22 Thumderbird 10 generates some emails like this, which will always cause
23 plugin errors when $transaction->header is accessed otherwise, as there
24 is almost no checking that $transaction->header is defined before usage.
25
26 Signed-off-by: Robin H. Johnson <robbat2@g.o>
27 Thanks-To: Jack Bates <ms419@×××××××××××.uk>
28
29 --- qpsmtpd-0.83.orig/lib/Qpsmtpd/SMTP.pm 2009-04-03 06:24:21.000000000 +0000
30 +++ qpsmtpd-0.83/lib/Qpsmtpd/SMTP.pm 2012-02-25 05:52:14.000000000 +0000
31 @@ -632,7 +632,7 @@
32
33 my $timeout = $self->config('timeout');
34 while (defined($_ = $self->getline($timeout))) {
35 - $complete++, last if $_ eq ".\r\n";
36 + $complete++, $_ = '' if $_ eq ".\r\n";
37 $i++;
38
39 # should probably use \012 and \015 in these checks instead of \r and \n ...
40 @@ -648,7 +648,7 @@
41 unless (($max_size and $size > $max_size)) {
42 s/\r\n$/\n/;
43 s/^\.\./\./;
44 - if ($in_header and m/^$/) {
45 + if ($in_header and (m/^$/ or $complete > 0)) {
46 $in_header = 0;
47 my @headers = split /^/m, $buffer;
48
49 @@ -691,9 +691,10 @@
50
51 # copy all lines into the spool file, including the headers
52 # we will create a new header later before sending onwards
53 - $self->transaction->body_write($_);
54 + $self->transaction->body_write($_) unless $complete;
55 $size += length $_;
56 }
57 + last if $complete > 0;
58 #$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300);
59 }