smtp: Fixed handling of multiline server greeting responses

Incorrectly processed multiline server greeting responses as "wanted"
continue responses in smtp_endofresp(), from commit f16c0de4e9,
which in turn broke the SMTP server detection in the test suite,
because the EHLO command would not be sent.
This commit is contained in:
Steve Holme 2013-11-15 12:50:37 +00:00
parent 90ec8763a5
commit 4a9fe26837
1 changed files with 2 additions and 1 deletions

View File

@ -228,6 +228,7 @@ static void smtp_to_smtps(struct connectdata *conn)
static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len,
int *resp)
{
struct smtp_conn *smtpc = &conn->proto.smtpc;
bool result = FALSE;
/* Nothing for us */
@ -247,7 +248,7 @@ static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len,
*resp = 0;
}
/* Do we have a multiline (continuation) response? */
else if(line[3] == '-') {
else if(line[3] == '-' && smtpc->state == SMTP_EHLO) {
result = TRUE;
*resp = 1; /* Internal response code */
}