aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/smtp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 2433a6447..6204de0e8 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -543,7 +543,8 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode,
/* We don't have a SSL/TLS connection yet, but SSL is requested. Switch
to TLS connection now */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS");
- state(conn, SMTP_STARTTLS);
+ if(!result)
+ state(conn, SMTP_STARTTLS);
}
else
result = smtp_authenticate(conn);