Bug#283230: marked as done (Exim4 drops connection with "too many syntax or protocol errors")

Debian Bug Tracking System owner@bugs.debian.org
Tue, 07 Dec 2004 05:33:55 -0800


Your message dated Tue, 07 Dec 2004 08:17:16 -0500
with message-id <E1CbfDQ-0001mi-00@newraff.debian.org>
and subject line Bug#283230: fixed in exim4 4.34-9
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 27 Nov 2004 12:03:41 +0000
>From cb@math.uni-sb.de Sat Nov 27 04:03:41 2004
Return-path: <cb@math.uni-sb.de>
Received: from janus.rz.uni-saarland.de [134.96.7.10] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CY1Ii-0000o6-00; Sat, 27 Nov 2004 04:03:40 -0800
Received: from mail.math.uni-sb.de (mail.math.uni-sb.de [134.96.51.197])
	by janus.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id iARC37hi20834549
	for <submit@bugs.debian.org>; Sat, 27 Nov 2004 13:03:07 +0100 (CET)
Received: from gemini.math.uni-sb.de ([134.96.50.85]:44936 ident=mail)
	by mail.math.uni-sb.de with esmtp (Exim 4.34)
	id 1CY1IK-0006MK-Sp
	for submit@bugs.debian.org; Sat, 27 Nov 2004 13:03:16 +0100
Received: from cb (helo=localhost)
	by gemini.math.uni-sb.de with local-esmtp (Exim 3.35 #1 (Debian))
	id 1CY1IA-0007Q7-00
	for <submit@bugs.debian.org>; Sat, 27 Nov 2004 13:03:06 +0100
Date: Sat, 27 Nov 2004 13:03:06 +0100 (CET)
From: Christoph Barbian <cb@math.uni-sb.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Exim4 drops connection with "too many syntax or protocol errors"
Message-ID: <Pine.LNX.4.44.0411271219580.28509-100000@gemini.math.uni-sb.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (janus.rz.uni-saarland.de [134.96.7.10]); Sat, 27 Nov 2004 13:03:07 +0100 (CET)
X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.28.0.19; VDF 6.28.0.93
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: <exim4-daemon-heavy>
Version: <4.34-7>

When exim receives many messages in one connection it somtetimes drops the
connection, more precisely: whenever exim receives a message with valid
recipient which is delivered and after that 4 ( = smtp_max_synprot_errors
+ 1) messages with invalid recipients (and all in the same connection) it
drops the connection and logs

(4 passages similar to this one)
14196 SMTP<< MAIL From:<> SIZE=4669
14196 SMTP>> 250 OK
14196 SMTP<< RCPT To:<Prince8Gunn@math.uni-sb.de>
14196 SMTP>> 550 unknown user
14196 SMTP<< DATA
14196   SMTP protocol error in "DATA" H=eris.rz.uni-saarland.de
[134.96.7.8]:23385 valid RCPT command must precede DATA
14196 SMTP>> 503 valid RCPT command must precede DATA
14196 SMTP<< RSET
14196 SMTP>> 250 Reset OK
14196 SMTP<< RSET
14196 SMTP>> 250 Reset OK

(and finally)
14196   SMTP call from eris.rz.uni-saarland.de [134.96.7.8]:23385 dropped:
too many syntax or protocol errors (last command was "DATA")

This means that exim considers a DATA sent by the delivering MTA after
an invalid RCPT as an error (but it should not as we are pipelining)

The reason for this lies in the function
   int smtp_setup_msg (void)
in smtp_in.c ...

There is a variable pipelining_advertised in this function which is
set to FALSE by default and is set to TRUE after a successful EHLO
response (exim always advertises pipelining). So during the first call of
smtp_setup_msg everything is fine, as the following SMTP dialogue shows

14196 SMTP<< MAIL From:<fidion@yoda.proserv-msg.com> SIZE=1182
14196 SMTP>> 250 OK
14196 SMTP<< RCPT To:<abc@math.uni-sb.de>
14196 SMTP>> 550 unknown user
14196 SMTP<< DATA
14196 SMTP>> 503 valid RCPT command must precede DATA
14196 SMTP<< RSET
14196 SMTP>> 250 Reset OK
14196 SMTP<< RSET
14196 SMTP>> 250 Reset OK

Here exim answers with a 503 to the DATA but does not encounter an error
(what is ok as pipelining is advertised).

After exim has left this first call of smtp_setup_msg (what is does for
example whenever a message is accepted for delivery) we see log messages
of the first kind and exims gets out after 4 errors.

Therefore the problem is that the variable pipelining_advertised is
declared within the function smtp_setup_msg and only set to TRUE
when an EHLO is received what is only the case in the first call of
smtp_setup_msg. In all following calls it remains FALSE and exim
counts the DATA's as errors ...

  case DATA_CMD:
    if (!discarded && recipients_count <= 0)
      {
      if (pipelining_advertised && last_was_rcpt)
        smtp_printf("503 valid RCPT command must precede DATA\r\n");
      else
        done = synprot_error(L_smtp_protocol_error, 503, NULL,
          US"valid RCPT command must precede DATA");
      break;
      }

(lines 2991 - 3000 in smtp_in.c of exim-4.34-orig)

In my opinion the variable pipelining_advertised should be declared
outside smtp_setup_msg so its value is persistent over several calls
of this smtp_setup_msg...

In newer versions of exim4 I think this is fixed (I took a look at
4.43)...

By this problem you may lose email if your delivering MTA (in my case
sendmail does) defers all remaining messages in its queue to a later queue
run whenever exim drops the connection as described here...


-- System Information:
Debian Release: 3.1
Kernel: 2.4.26-1-686-smp #1 SMP
Glibc: libc-2.3.2




---------------------------------------
Received: (at 283230-close) by bugs.debian.org; 7 Dec 2004 13:19:48 +0000
>From katie@ftp-master.debian.org Tue Dec 07 05:19:48 2004
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CbfFs-0006N2-00; Tue, 07 Dec 2004 05:19:48 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1CbfDQ-0001mi-00; Tue, 07 Dec 2004 08:17:16 -0500
From: Andreas Metzler <ametzler@debian.org>
To: 283230-close@bugs.debian.org
X-Katie: $Revision: 1.54 $
Subject: Bug#283230: fixed in exim4 4.34-9
Message-Id: <E1CbfDQ-0001mi-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Tue, 07 Dec 2004 08:17:16 -0500
Delivered-To: 283230-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 
X-CrossAssassin-Score: 7

Source: exim4
Source-Version: 4.34-9

We believe that the bug you reported is fixed in the latest version of
exim4, which is due to be installed in the Debian FTP archive:

exim4-base_4.34-9_i386.deb
  to pool/main/e/exim4/exim4-base_4.34-9_i386.deb
exim4-config_4.34-9_all.deb
  to pool/main/e/exim4/exim4-config_4.34-9_all.deb
exim4-daemon-heavy_4.34-9_i386.deb
  to pool/main/e/exim4/exim4-daemon-heavy_4.34-9_i386.deb
exim4-daemon-light_4.34-9_i386.deb
  to pool/main/e/exim4/exim4-daemon-light_4.34-9_i386.deb
exim4_4.34-9.diff.gz
  to pool/main/e/exim4/exim4_4.34-9.diff.gz
exim4_4.34-9.dsc
  to pool/main/e/exim4/exim4_4.34-9.dsc
exim4_4.34-9_all.deb
  to pool/main/e/exim4/exim4_4.34-9_all.deb
eximon4_4.34-9_i386.deb
  to pool/main/e/exim4/eximon4_4.34-9_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 283230@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Metzler <ametzler@debian.org> (supplier of updated exim4 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue,  7 Dec 2004 12:40:49 +0100
Source: exim4
Binary: eximon4 exim4-daemon-custom exim4-daemon-heavy exim4-base exim4 exim4-daemon-light exim4-config
Architecture: source i386 all
Version: 4.34-9
Distribution: unstable
Urgency: low
Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
Changed-By: Andreas Metzler <ametzler@debian.org>
Description: 
 exim4      - An MTA (Mail Transport Agent)
 exim4-base - EXperimental Internal Mailer -- a Mail Transport Agent
 exim4-config - Debian configuration for exim4
 exim4-daemon-heavy - Exim (v4) with extended features, including exiscan-acl
 exim4-daemon-light - Lightweight version of the Exim (v4) MTA
 eximon4    - X monitor for the Exim (v4) mail transport agent
Closes: 274597 276450 276958 279205 281249 281249 282731 283230 284529
Changes: 
 exim4 (4.34-9) unstable; urgency=low
 .
   * Translation updates:
     - he (Hebrew) by Lior Kaplan (am) (Closes: #281249)
   * cy (Welsh) translation of debconf templates by Dafydd Harries.
     (am) (Closes: #282731)
   * sq (Albanian) translation of debconf templates by Elian Myftiu. (am)
     (Closes: #284529)
   * new patch 64_pipeliningfixup pulled from 4.42. Exim was forgetting that it
     had advertised PIPELINING for the second and subsequent messages on an
     SMTP connection.  Thanks to Christoph Barbian. (am) (Closes: #283230)
   * allow arbitrary Sender: and envelope headers in locally submitted
     messages, no longer force them to be the local account name at the
     local host name. (mh)
   * delete /var/spool/exim4/gnutls-params in cron.daily. (mh).
   * remove outdated info from README.SMTP-AUTH and clarify corresponding
     comments in configuration file (Closes: #281249) (am).
   * Add an example for AUTH LOGIN using saslauthd. (Closes: #276450) (am).
   * exim4-base.cron.daily: Use find | xargs -0r  (Closes: #279205) (am).
   * run debian/rules update-mtaconflicts
   * Document /etc/email-addresses in README.Debian (Closes: #276958) (am).
   * exim_tidydb did not work properly with split spool directory. (am)
   * Make the prefered local transport (maildir/mailspool) configurable in
     update-exim4.conf.conf, attacking #250980. Document this, therefore
     (Closes: #274597) (am)
Files: 
 1a83cafec5d61f7feb680684b8eeebcd 1062 mail important exim4_4.34-9.dsc
 9bfbcaf0caf56bace34e3a6f89bbcd26 536522 mail important exim4_4.34-9.diff.gz
 afe85470264c0cae99be6a016c94d2c1 791622 mail important exim4-base_4.34-9_i386.deb
 8e8b402bc2a3f68a0929444be927f6ee 347682 mail important exim4-daemon-light_4.34-9_i386.deb
 4bc7017f6a82eb507b2b1aa61ea98aa1 71254 mail optional eximon4_4.34-9_i386.deb
 be272f85af89d33abaa753644ec6d864 416914 mail optional exim4-daemon-heavy_4.34-9_i386.deb
 571956b3702cc4eef29b170236344722 210046 mail important exim4-config_4.34-9_all.deb
 cfdc014c65a026cb32a405d2a481cf84 1198 mail important exim4_4.34-9_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBtaozHTOcZYuNdmMRAt3dAJ48KlthmWmjEtGSKKGPSULeCEG3qwCgr7Qr
sksjX2Jb1CPqN3nclOk2B+o=
=pNAG
-----END PGP SIGNATURE-----