From 0cc409a44cac5ac29d0bd18fa13a4e9f2b2f2b96 Mon Sep 17 00:00:00 2001 From: Pawel Salek Date: Fri, 5 Mar 2010 21:22:15 +0100 Subject: Implement submission to smtps service. * examples/mail-file.c: allow testing submission to smtps service. * libesmtp-private.h: add negotiate_ssl() prototype. * libesmtp.h: add Starttls_OVER_SSL to starttls_option enum. * protocol.h: enable SSL on connection whenever selected. * smtp-tls.c: share negotiate_ssl(). --- protocol.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'protocol.c') diff --git a/protocol.c b/protocol.c index 0b44df8..70b80a4 100644 --- a/protocol.c +++ b/protocol.c @@ -303,6 +303,18 @@ do_session (smtp_session_t session) #ifdef USE_TLS session->using_tls = 0; #endif +#if 1 + if (session->starttls_enabled == Starttls_OVER_SSL) + { + if ( !(select_starttls (session) && + negotiate_ssl (conn, session) == 0) ) + continue; + /* Do we handle here negotiate_ssl returning -1? We might + leave a dangling open socket here. */ + } +#endif + printf("%s A %d\n", __func__, session->using_tls); + nresp = 0; session->cmd_state = session->rsp_state = 0; -- cgit