Commit 4a9fe268 authored by Steve Holme's avatar Steve Holme
Browse files

smtp: Fixed handling of multiline server greeting responses

Incorrectly processed multiline server greeting responses as "wanted"
continue responses in smtp_endofresp(), from commit f16c0de4,
which in turn broke the SMTP server detection in the test suite,
because the EHLO command would not be sent.
parent 90ec8763
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 */
  }