From 3b9dc7add27b5a280065933d41c35a670e01fc5d Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 31 Aug 2014 14:32:09 +0300 Subject: [PATCH] SMTP: Support multiline greeting from server in INIT state. Thanks to Ivanov Juriy for helping identify the problem. Relates to #1845. --- src/smtp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/smtp.cpp b/src/smtp.cpp index 63e91bb35..d980df8bb 100644 --- a/src/smtp.cpp +++ b/src/smtp.cpp @@ -174,6 +174,10 @@ void Smtp::readyRead() switch(state) { case Init: { if (code[0] == '2') { + // The server may send a multiline greeting/INIT/220 response. + // We wait until it finishes. + if (line[3] != ' ') + break; // Connection was successful ehlo(); } else {