diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-11-15 12:50:37 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-11-15 12:50:37 +0000 |
commit | 4a9fe268374456312afeecfb2497fd0e8ee2fbbf (patch) | |
tree | 87cc3a8cf57a2febfa72ac6f44611841db571ce5 | |
parent | 90ec8763a572a99fa971c288cc8d933cab3fb4c6 (diff) |
smtp: Fixed handling of multiline server greeting responses
Incorrectly processed multiline server greeting responses as "wanted"
continue responses in smtp_endofresp(), from commit f16c0de4e9bbe3,
which in turn broke the SMTP server detection in the test suite,
because the EHLO command would not be sent.
-rw-r--r-- | lib/smtp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 1db28478a..e18947ec1 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -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 */ } |