]> Pileus Git - ~andy/fetchmail/commitdiff
Regression fix for multiline SMTP bugfix. Reported by Thomas Jarosch.
authorMatthias Andree <matthias.andree@gmx.de>
Wed, 28 Oct 2009 16:24:23 +0000 (16:24 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Wed, 28 Oct 2009 16:24:23 +0000 (16:24 -0000)
svn path=/branches/BRANCH_6-3/; revision=5445

NEWS
smtp.c

diff --git a/NEWS b/NEWS
index 63810f4515a95cdb630f7ac6501688a4a86effb7..a164fd71a394326cd4a5630350025495920373ee 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,12 @@ removed from a 6.4.0 or newer release.)
 
 fetchmail 6.3.13 (not yet released):
 
+# REGRESSION FIXES
+* The multiline SMTP error fix in release 6.3.12 caused fetchmail to lose
+  message codes 400..599 and treat all of these as temporary error. This would
+  cause messages to be left on the server even if softbounce was turned off.
+  Reported by Thomas Jarosch.
+
 # TRANSLATION UPDATES
 * [cs]    Czech, by Petr Pisar
 * [zh_CN] Chinese (simplified), by Ji ZhengYu
diff --git a/smtp.c b/smtp.c
index e6047f8fc3595495d700f76ff138e95fb8badd76..ef6cdb2d6325e6b700b4f5d2467e6a7a2893cb9a 100644 (file)
--- a/smtp.c
+++ b/smtp.c
@@ -352,16 +352,16 @@ int SMTP_ok(int sock, char smtp_mode, int mintimeout)
 
        last_smtp_ok = time((time_t *) NULL);
 
+       strlcat(smtp_response, reply,  sizeof(smtp_response));
+
        if (strchr("123", reply[0])
                && isdigit((unsigned char)reply[1])
                && isdigit((unsigned char)reply[2])
                && strchr(" ", reply[3])) /* matches space and \0 */ {
-           strlcat(smtp_response, reply, sizeof(smtp_response));
            return SM_OK;
        } else if (reply[3] != '-')
            return SM_ERROR;
 
-       strlcat(smtp_response, reply,  sizeof(smtp_response));
        strlcat(smtp_response, "\r\n", sizeof(smtp_response));
 
        /* set an alarm for smtp ok */