Enlightenment CVS committal
Author : tsauerbeck
Project : misc
Module : embrace
Dir : misc/embrace/src/plugins/imap
Modified Files:
imap.c
Log Message:
OpenSSL support arrives :)
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/imap/imap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- imap.c 21 Mar 2004 13:37:07 -0000 1.4
+++ imap.c 31 Mar 2004 18:28:47 -0000 1.5
@@ -1,5 +1,5 @@
/*
- * $Id: imap.c,v 1.4 2004/03/21 13:37:07 tsauerbeck Exp $
+ * $Id: imap.c,v 1.5 2004/03/31 18:28:47 tsauerbeck Exp $
* vim:noexpandtab:ts=4:sw=4:sts=4
*
* Copyright (C) 2004 Embrace project.
@@ -100,6 +100,7 @@
static bool imap_check (MailBox *mb)
{
+ Ecore_Con_Type type = ECORE_CON_REMOTE_SYSTEM;
char *host;
int port;
@@ -109,8 +110,12 @@
assert (host);
assert (port);
- ecore_con_server_connect (ECORE_CON_REMOTE_SYSTEM,
- host, port, mb);
+#ifdef HAVE_OPENSSL
+ if ((int) mailbox_property_get (mb, "ssl"))
+ type |= ECORE_CON_USE_SSL;
+#endif
+
+ ecore_con_server_connect (type, host, port, mb);
return true;
}
@@ -156,15 +161,26 @@
return true;
}
-static bool imap_load_config (MailBox *mb, E_DB_File *edb, char *root)
+static bool imap_load_config (MailBox *mb, E_DB_File *edb,
+ const char *root)
{
char key[32], *str;
- int val;
+ int val, use_ssl = 0;
assert (mb);
assert (edb);
assert (root);
+#ifdef HAVE_OPENSSL
+ /* check whether OpenSSL should be used */
+ snprintf (key, sizeof (key), "%s/ssl", root);
+
+ if (!e_db_int_get (edb, key, &use_ssl))
+ use_ssl = 0;
+
+ mailbox_property_set (mb, "ssl", (int *) use_ssl);
+#endif
+
/* read server */
snprintf (key, sizeof (key), "%s/host", root);
@@ -177,7 +193,7 @@
snprintf (key, sizeof (key), "%s/port", root);
if (!e_db_int_get (edb, key, &val))
- val = 143;
+ val = use_ssl ? 993 : 143;
mailbox_property_set (mb, "port", (int *) val);
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs