aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/smtp
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-01 05:55:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-01 05:55:06 +0800
commit32a764399bed6e64b6f03578025bf4255cc63183 (patch)
tree12b73b3e78e9d7f7835fa25907f0d62e9947ace3 /camel/providers/smtp
parent6dafeefcc2561cab454d85074dca43f71ef670b9 (diff)
downloadgsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar.gz
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar.bz2
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar.lz
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar.xz
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.tar.zst
gsoc2013-evolution-32a764399bed6e64b6f03578025bf4255cc63183.zip
Same as IMAP and POP.
2003-02-28 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/camel-smtp-transport.c (connect_to_server): Same as IMAP and POP. * providers/imap/camel-imap-store.c (connect_to_server): Same as the POP3 code. * providers/pop3/camel-pop3-store.c (connect_to_server): Pass in appropriate flags for camel_tcp_stream_ssl_new*() functions. * camel-tcp-stream-ssl.c (enable_ssl): Not all ssl/tls streams will want to allow each of SSLv2, SSLv3 and TLSv1 so use flags to decide which to enable/disable. (camel_tcp_stream_ssl_new): Now takes a flags argument to mask out which SSL/TLS versions the stream should be compatable with. (camel_tcp_stream_ssl_new_raw): Same. svn path=/trunk/; revision=20111
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index d43f5c6e38..57e1b52779 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -228,6 +228,9 @@ smtp_error_string (int error)
}
}
+#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
+#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
+
static gboolean
connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
{
@@ -252,11 +255,11 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
#ifdef HAVE_SSL
if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) {
- if (try_starttls)
- tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host);
- else {
+ if (try_starttls) {
+ tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host, STARTTLS_FLAGS);
+ } else {
port = service->url->port ? service->url->port : 465;
- tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host);
+ tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host, SSL_PORT_FLAGS);
}
} else {
tcp_stream = camel_tcp_stream_raw_new ();