From a831d8cd2e45fdc6b3b62d17b91bfcef251d77ff Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 12 May 2017 20:57:06 +0200 Subject: [PATCH] starttls fix Change-Id: I271bb3bb0db4308254fe193efddcdb19fd0ab9f0 Signed-off-by: SJ --- src/smtp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smtp.c b/src/smtp.c index e2dcc8ac..499cd13c 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -209,7 +209,10 @@ void process_command_starttls(struct smtp_session *session){ session->starttls = 1; send_smtp_response(session, SMTP_RESP_220_READY_TO_START_TLS); session->protocol_state = SMTP_STATE_INIT; - session->use_ssl = 1; + + if(session->starttls == 1 && session->use_ssl == 0) + wait_for_ssl_accept(session); + return; } syslog(LOG_PRIORITY, "%s: SSL_set_fd() failed", session->ttmpfile); } syslog(LOG_PRIORITY, "%s: SSL_new() failed", session->ttmpfile);