Re: [evolution-patches] ssl/tls patch (bug #65714)




The patch attached applied after the original one, should fix the problem.

On Mon, 2004-09-27 at 09:08 +0800, Not Zed wrote:

Umm, i should've tested this more, too busy on friday.  It breaks at least pop3s connections.  I thought mail was down all weekend but it was just this patch still in my build.  Blah.

On Fri, 2004-09-24 at 13:09 +0800, Not Zed wrote:

looks ok to me, apart from perhaps the string changes for the exceptions, e.g.

_("Failed to connect to POP server %s in secure mode: STLS not supported"),

may as well leave the old one:

camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
-       _("Failed to connect to POP server %s in secure mode: %s"),
-       service->url->host, _("SSL/TLS extension not supported."));


i'm not that hot on the popup menu names 'SSL encryption', 'TLS encryption', etc but i can't really suggest an alternative.

The code is fine though.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
diff -urp camel/ChangeLog camel.save/ChangeLog
--- camel/ChangeLog	2004-09-27 09:18:16.254982456 +0800
+++ camel.save/ChangeLog	2004-09-27 09:15:01.000000000 +0800
@@ -1,3 +1,14 @@
+2004-09-27  Not Zed  <NotZed Ximian com>
+
+	* providers/smtp/camel-smtp-transport.c
+	(connect_to_server_wrapper): yay for cut and paste bugs.
+
+	* providers/imap/camel-imap-store.c (connect_to_server_wrapper):
+	as below.
+
+	* providers/pop3/camel-pop3-store.c (connect_to_server_wrapper):
+	actually grab the service name properly.
+
 2004-09-22  Jeffrey Stedfast  <fejj novell com>
 
 	* providers/imap/camel-imap-store.c (connect_to_server): Instead
diff -urp camel/providers/imap/camel-imap-store.c camel.save/providers/imap/camel-imap-store.c
--- camel/providers/imap/camel-imap-store.c	2004-09-27 09:18:16.268980328 +0800
+++ camel.save/providers/imap/camel-imap-store.c	2004-09-27 09:12:42.000000000 +0800
@@ -889,22 +889,21 @@ connect_to_server_wrapper (CamelService 
 	if ((command = camel_url_get_param (service->url, "command")))
 		return connect_to_server_process (service, command, ex);
 	
-	if (service->url->port) {
-		serv = g_alloca (16);
-		sprintf (serv, "%d", service->url->port);
-	}
-	
 	if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
 		for (i = 0; ssl_options[i].value; i++)
 			if (!strcmp (ssl_options[i].value, ssl_mode))
 				break;
 		mode = ssl_options[i].mode;
+		serv = ssl_options[i].serv;
 	} else {
 		mode = MODE_CLEAR;
-	}
-	
-	if (!serv)
 		serv = "imap";
+	}
+
+	if (service->url->port) {
+		serv = g_alloca (16);
+		sprintf (serv, "%d", service->url->port);
+	}
 	
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_socktype = SOCK_STREAM;
diff -urp camel/providers/nntp/camel-nntp-store.c camel.save/providers/nntp/camel-nntp-store.c
--- camel/providers/nntp/camel-nntp-store.c	2004-09-27 09:18:16.281978352 +0800
+++ camel.save/providers/nntp/camel-nntp-store.c	2004-09-27 09:14:09.000000000 +0800
@@ -290,22 +290,21 @@ nntp_connect_online (CamelService *servi
 	char *serv = NULL;
 	int mode, ret, i;
 	
-	if (service->url->port) {
-		serv = g_alloca (16);
-		sprintf (serv, "%d", service->url->port);
-	}
-	
 	if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
 		for (i = 0; ssl_options[i].value; i++)
 			if (!strcmp (ssl_options[i].value, ssl_mode))
 				break;
 		mode = ssl_options[i].mode;
+		serv = ssl_options[i].serv;
 	} else {
 		mode = MODE_CLEAR;
-	}
-	
-	if (!serv)
 		serv = "nntp";
+	}
+
+	if (service->url->port) {
+		serv = g_alloca (16);
+		sprintf (serv, "%d", service->url->port);
+	}
 	
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_socktype = SOCK_STREAM;
diff -urp camel/providers/pop3/camel-pop3-store.c camel.save/providers/pop3/camel-pop3-store.c
--- camel/providers/pop3/camel-pop3-store.c	2004-09-27 09:18:16.288977288 +0800
+++ camel.save/providers/pop3/camel-pop3-store.c	2004-09-27 09:11:00.000000000 +0800
@@ -284,24 +284,23 @@ connect_to_server_wrapper (CamelService 
 	const char *ssl_mode;
 	char *serv = NULL;
 	int mode, ret, i;
-	
-	if (service->url->port) {
-		serv = g_alloca (16);
-		sprintf (serv, "%d", service->url->port);
-	}
-	
+		
 	if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
 		for (i = 0; ssl_options[i].value; i++)
 			if (!strcmp (ssl_options[i].value, ssl_mode))
 				break;
 		mode = ssl_options[i].mode;
+		serv = ssl_options[i].serv;
 	} else {
 		mode = MODE_CLEAR;
-	}
-	
-	if (!serv)
 		serv = "pop3";
+	}
 	
+	if (service->url->port) {
+		serv = g_alloca (16);
+		sprintf (serv, "%d", service->url->port);
+	}
+
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_family = PF_UNSPEC;
diff -urp camel/providers/smtp/camel-smtp-transport.c camel.save/providers/smtp/camel-smtp-transport.c
--- camel/providers/smtp/camel-smtp-transport.c	2004-09-27 09:18:16.295976224 +0800
+++ camel.save/providers/smtp/camel-smtp-transport.c	2004-09-27 09:14:54.000000000 +0800
@@ -394,22 +394,21 @@ connect_to_server_wrapper (CamelService 
 	int mode, ret, i;
 	char *serv = NULL;
 	
-	if (service->url->port) {
-		serv = g_alloca (16);
-		sprintf (serv, "%d", service->url->port);
-	}
-	
 	if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
 		for (i = 0; ssl_options[i].value; i++)
 			if (!strcmp (ssl_options[i].value, ssl_mode))
 				break;
 		mode = ssl_options[i].mode;
+		serv = ssl_options[i].serv;
 	} else {
 		mode = MODE_CLEAR;
-	}
-	
-	if (!serv)
 		serv = "smtp";
+	}
+
+	if (service->url->port) {
+		serv = g_alloca (16);
+		sprintf (serv, "%d", service->url->port);
+	}
 	
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_socktype = SOCK_STREAM;
Only in camel: ssl.diff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]