summaryrefslogtreecommitdiffstats
path: root/protocol.c
diff options
context:
space:
mode:
authorPawel Salek <pawsa@fedorapeople.org>2010-03-05 21:22:15 +0100
committerPawel Salek <pawsa@fedorapeople.org>2010-03-05 21:22:15 +0100
commit0cc409a44cac5ac29d0bd18fa13a4e9f2b2f2b96 (patch)
tree5a54b7a2e3f0d767cbf587212c95897b8310a28b /protocol.c
parent5d3cf8a33ced580af0d3e30b8fbd3cf9a5aa315a (diff)
downloadlibesmtp-0cc409a44cac5ac29d0bd18fa13a4e9f2b2f2b96.tar.gz
libesmtp-0cc409a44cac5ac29d0bd18fa13a4e9f2b2f2b96.tar.xz
libesmtp-0cc409a44cac5ac29d0bd18fa13a4e9f2b2f2b96.zip
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().
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c12
1 files changed, 12 insertions, 0 deletions
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;