From 174adfa471581f0a322b4e381d9671b2b50ac9d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 14 Mar 2001 21:59:40 +0000 Subject: Numerous fixes to get it to build correctly with NSS enabled. 2001-03-14 Jeffrey Stedfast * camel-tcp-stream-ssl.c: Numerous fixes to get it to build correctly with NSS enabled. * camel-remote-store.c (remote_connect): Pass in the session and expected host args, oops. * camel-provider.h (CAMEL_URL_ALLOW_SSL): Defined. * providers/imap/camel-imap-store.c (camel_imap_store_init): Check to see if we are supposed to use SSL and set the options accordingly. (imap_connect): Return FALSE here instead of NULL. * providers/imap/camel-imap-provider.c: Add CAMEL_URL_ALLOW_SSL. * providers/imap/libcamelimap.urls: Add "imaps" which is the protocol for Secure IMAP. svn path=/trunk/; revision=8711 --- camel/providers/imap/camel-imap-provider.c | 3 ++- camel/providers/imap/camel-imap-store.c | 17 +++++++++++++---- camel/providers/imap/libcamelimap.urls | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'camel/providers/imap') diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c index 9b962df5f4..91f397277a 100644 --- a/camel/providers/imap/camel-imap-provider.c +++ b/camel/providers/imap/camel-imap-provider.c @@ -46,7 +46,8 @@ static CamelProvider imap_provider = { CAMEL_PROVIDER_IS_STORAGE, CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | - CAMEL_URL_ALLOW_PATH | CAMEL_URL_ALLOW_AUTH, + CAMEL_URL_ALLOW_PATH | CAMEL_URL_ALLOW_AUTH | + CAMEL_URL_ALLOW_SSL, { 0, 0 }, diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index c13a584a33..db1c1f9c80 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -144,9 +144,18 @@ camel_imap_store_init (gpointer object, gpointer klass) CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object); CamelImapStore *imap_store = CAMEL_IMAP_STORE (object); CamelStore *store = CAMEL_STORE (object); + CamelURL *url; + + url = CAMEL_SERVICE (store)->url; + + if (!g_strcasecmp (url->protocol, "imaps")) { + remote_store->default_port = 993; + remote_store->use_ssl = TRUE; + } else { + remote_store->default_port = 143; + remote_store->use_ssl = FALSE; + } - remote_store->default_port = 143; - imap_store->dir_sep = '\0'; imap_store->current_folder = NULL; @@ -155,7 +164,7 @@ camel_imap_store_init (gpointer object, gpointer klass) imap_store->connected = FALSE; imap_store->subscribed_folders = NULL; - imap_store->priv = g_malloc0(sizeof(*imap_store->priv)); + imap_store->priv = g_malloc0 (sizeof (*imap_store->priv)); #ifdef ENABLE_THREADS imap_store->priv->command_lock = e_mutex_new(E_MUTEX_REC); #endif @@ -469,7 +478,7 @@ imap_connect (CamelService *service, CamelException *ex) * a bad password. So reconnect here. */ if (!connect_to_server (service, ex)) - return NULL; + return FALSE; } if (authtype) diff --git a/camel/providers/imap/libcamelimap.urls b/camel/providers/imap/libcamelimap.urls index c301c0ffac..cf07f4426f 100644 --- a/camel/providers/imap/libcamelimap.urls +++ b/camel/providers/imap/libcamelimap.urls @@ -1 +1,2 @@ imap +imaps -- cgit v1.2.3