[evolution-patches] Patch for integrating exchange x-c-s with mailer.



Hi,

Attched are the patch files for achieving
ximian-connector-setupfunctionality mail configuration. 

X-C-S reads owa URL, user name and password and detects rest of the
settings after authenticating the user.

I have added an entry to read OWA URL to the glade file
and handled it in CamelProviderConfEntry structure. 
(As hostname,user name and path are currently handled).

Asking for the password is done by the page check 
plugin "exchange-account-setup". The plugin code is 
available in CVS.Authenticating user is done using 
camel API, which would authenticatethe user if the 
provider supports. (similar to auto_detect)

Now, since the source and transport URLs need to 
contain OWA url also,I am handling this in decoding of 
camel url, using "&" as the delimiter for owa url, and 
I hope it is ok to use it.

I was getting error while overwriting the labels in
receive page andhiding the sections (like SSL). 
I have made some modifications related to them also. 

Thanks,
Sushma.


Index: camel/camel-url.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-url.c,v
retrieving revision 1.41
diff -u -r1.41 camel-url.c
--- camel/camel-url.c	20 Sep 2004 05:59:53 -0000	1.41
+++ camel/camel-url.c	9 Jan 2005 13:59:54 -0000
@@ -57,7 +57,7 @@
 camel_url_new_with_base (CamelURL *base, const char *url_string)
 {
 	CamelURL *url;
-	const char *end, *hash, *colon, *semi, *at, *slash, *question;
+	const char *end, *hash, *colon, *semi, *at, *slash, *question, *ampersand;
 	const char *p;
 
 	url = g_new0 (CamelURL, 1);
@@ -95,7 +95,7 @@
 	if (strncmp (url_string, "//", 2) == 0) {
 		url_string += 2;
 
-		slash = url_string + strcspn (url_string, "/#");
+		slash = url_string + strcspn (url_string, "&/#");
 		at = strchr (url_string, '@');
 		if (at && at < slash) {
 			colon = strchr (url_string, ':');
@@ -130,7 +130,7 @@
 		if (colon && colon < slash) {
 			url->host = g_strndup (url_string, colon - url_string);
 			url->port = strtoul (colon + 1, NULL, 10);
-		} else {
+		} else if (slash != url_string) {
 			url->host = g_strndup (url_string, slash - url_string);
 			camel_url_decode (url->host);
 			url->port = 0;
@@ -179,6 +179,23 @@
 		end = semi;
 	}
 
+	/* Find URL */
+	if (strncmp (url_string + 1, "&", 1) == 0) 
+		url_string++;
+	if ((strncmp (url_string, "&", 1) == 0)) {
+		ampersand = memchr (url_string, '&', end - url_string);
+		if (ampersand) {
+			if (ampersand[1]) {
+				url_string = ampersand + 1;
+				url->owa_url = g_strndup (url_string,
+							end - url_string);
+				camel_url_decode (url->owa_url);
+			}
+			end = ampersand;
+		}
+		end = url_string;
+	}
+
 	if (end != url_string) {
 		url->path = g_strndup (url_string, end - url_string);
 		camel_url_decode (url->path);
@@ -189,7 +206,7 @@
 		url->protocol = g_strdup (base->protocol);
 	else if (base && !url->protocol) {
 		if (!url->user && !url->authmech && !url->passwd &&
-		    !url->host && !url->port && !url->path &&
+		    !url->host && !url->port && !url->owa_url && !url->path &&
 		    !url->params && !url->query && !url->fragment)
 			url->fragment = g_strdup (base->fragment);
 
@@ -198,6 +215,7 @@
 		url->authmech = g_strdup (base->authmech);
 		url->passwd = g_strdup (base->passwd);
 		url->host = g_strdup (base->host);
+		url->owa_url = g_strdup (base->owa_url);
 		url->port = base->port;
 
 		if (!url->path) {
@@ -339,9 +357,26 @@
 		if (!url->path && (url->params || url->query || url->fragment))
 			g_string_append_c (str, '/');
 	}
-	
 	if (url->path)
 		append_url_encoded (str, url->path, ";?");
+
+	if (url->owa_url) {
+		if (!url->host && url->user) {
+			g_string_append (str, "//");
+			append_url_encoded (str, url->user, ":;@/");
+			if (url->authmech && *url->authmech) {
+				g_string_append (str, ";auth=");
+				append_url_encoded (str, url->authmech, ":@/");
+			}
+			if (url->passwd && !(flags & CAMEL_URL_HIDE_PASSWORD)) {
+				g_string_append_c (str, ':');
+				append_url_encoded (str, url->passwd, "@/");
+			}
+			g_string_append_c (str, '@');
+		}
+		g_string_append_c (str, '&');
+		append_url_encoded (str, url->owa_url, NULL);
+	}
 	if (url->params && !(flags & CAMEL_URL_HIDE_PARAMS))
 		g_datalist_foreach (&url->params, output_param, str);
 	if (url->query) {
@@ -393,6 +428,7 @@
 		g_free (url->authmech);
 		g_free (url->passwd);
 		g_free (url->host);
+		g_free (url->owa_url);
 		g_free (url->path);
 		g_datalist_clear (&url->params);
 		g_free (url->query);
@@ -416,6 +452,7 @@
 DEFINE_CAMEL_URL_SET (authmech)
 DEFINE_CAMEL_URL_SET (passwd)
 DEFINE_CAMEL_URL_SET (host)
+DEFINE_CAMEL_URL_SET (owa_url)
 DEFINE_CAMEL_URL_SET (path)
 DEFINE_CAMEL_URL_SET (query)
 DEFINE_CAMEL_URL_SET (fragment)
@@ -536,6 +573,7 @@
 	ADD_HASH (u->user);
 	ADD_HASH (u->authmech);
 	ADD_HASH (u->host);
+	ADD_HASH (u->owa_url);
 	ADD_HASH (u->path);
 	ADD_HASH (u->query);
 	hash ^= u->port;
@@ -568,6 +606,7 @@
 		&& check_equal(u1->user, u2->user)
 		&& check_equal(u1->authmech, u2->authmech)
 		&& check_equal(u1->host, u2->host)
+		&& check_equal(u1->owa_url, u2->owa_url)
 		&& check_equal(u1->path, u2->path)
 		&& check_equal(u1->query, u2->query)
 		&& u1->port == u2->port;
@@ -584,6 +623,7 @@
 	out->authmech = g_strdup(in->authmech);
 	out->passwd = g_strdup(in->passwd);
 	out->host = g_strdup(in->host);
+	out->owa_url = g_strdup(in->owa_url);
 	out->port = in->port;
 	out->path = g_strdup(in->path);
 	out->params = NULL;
Index: camel/camel-url.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-url.h,v
retrieving revision 1.19
diff -u -r1.19 camel-url.h
--- camel/camel-url.h	23 Apr 2003 01:34:02 -0000	1.19
+++ camel/camel-url.h	9 Jan 2005 14:00:01 -0000
@@ -43,6 +43,7 @@
 	char  *passwd;
 	char  *host;
 	int    port;
+	char  *owa_url;
 	char  *path;
 	GData *params;
 	char  *query;
@@ -69,6 +70,7 @@
 void camel_url_set_authmech (CamelURL *url, const char *authmech);
 void camel_url_set_passwd (CamelURL *url, const char *passwd);
 void camel_url_set_host (CamelURL *url, const char *host);
+void camel_url_set_owa_url (CamelURL *url, const char *owa_url);
 void camel_url_set_port (CamelURL *url, int port);
 void camel_url_set_path (CamelURL *url, const char *path);
 void camel_url_set_param (CamelURL *url, const char *name, const char *value);
Index: camel/camel-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-provider.c,v
retrieving revision 1.36
diff -u -r1.36 camel-provider.c
--- camel/camel-provider.c	2 Dec 2004 08:03:30 -0000	1.36
+++ camel/camel-provider.c	9 Jan 2005 14:20:09 -0000
@@ -414,3 +414,28 @@
 		return 0;
 	}
 }
+
+/**
+ * camel_provider_validate_user:
+ * @provider: camel provider
+ * @url: camel URL 
+ * @ex: exception
+ *
+ * If url is read insted of hostname, the provider can authenticate 
+ * user, based on url and user name entered.  
+ *
+ * If the provider does not support this, this just returns a TRUE. 
+ *
+ * Returns TRUE on success or not supported, and  FALSE on fail.
+ **/
+gboolean
+camel_provider_validate_user (CamelProvider *provider, CamelURL *url, CamelException *ex)
+{
+	g_return_val_if_fail (provider != NULL, -1);
+
+	if (provider->validate_user) {
+		return provider->validate_user (url, ex); 
+	} else {
+		return TRUE; /* FIXME */
+	}
+}
Index: camel/camel-provider.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-provider.h,v
retrieving revision 1.43
diff -u -r1.43 camel-provider.h
--- camel/camel-provider.h	20 Sep 2004 05:59:53 -0000	1.43
+++ camel/camel-provider.h	9 Jan 2005 14:20:16 -0000
@@ -83,6 +83,7 @@
 #define CAMEL_URL_PART_HOST	 (1 << 3)
 #define CAMEL_URL_PART_PORT	 (1 << 4)
 #define CAMEL_URL_PART_PATH	 (1 << 5)
+#define CAMEL_URL_PART_URL	 (1 << 6)
 
 #define CAMEL_URL_PART_NEED	       8
 
@@ -97,6 +98,7 @@
 #define CAMEL_URL_ALLOW_HOST	 (CAMEL_URL_PART_HOST)
 #define CAMEL_URL_ALLOW_PORT	 (CAMEL_URL_PART_PORT)
 #define CAMEL_URL_ALLOW_PATH	 (CAMEL_URL_PART_PATH)
+#define CAMEL_URL_ALLOW_URL	 (CAMEL_URL_PART_URL)
 
 #define CAMEL_URL_NEED_USER	 (CAMEL_URL_PART_USER << CAMEL_URL_PART_NEED)
 #define CAMEL_URL_NEED_AUTH	 (CAMEL_URL_PART_AUTH << CAMEL_URL_PART_NEED)
@@ -104,6 +106,8 @@
 #define CAMEL_URL_NEED_HOST	 (CAMEL_URL_PART_HOST << CAMEL_URL_PART_NEED)
 #define CAMEL_URL_NEED_PORT	 (CAMEL_URL_PART_PORT << CAMEL_URL_PART_NEED)
 #define CAMEL_URL_NEED_PATH	 (CAMEL_URL_PART_PATH << CAMEL_URL_PART_NEED)
+#define CAMEL_URL_NEED_URL	 (CAMEL_URL_PART_URL << CAMEL_URL_PART_NEED)
+
 
 #define CAMEL_URL_FRAGMENT_IS_PATH  (1 << 30) /* url uses fragment for folder name path, not path */
 #define CAMEL_URL_PATH_IS_ABSOLUTE (1 << 31)
@@ -134,8 +138,10 @@
 #define CAMEL_PROVIDER_CONF_DEFAULT_USERNAME  { CAMEL_PROVIDER_CONF_LABEL, "username", NULL, N_("User_name:"), NULL }
 #define CAMEL_PROVIDER_CONF_DEFAULT_HOSTNAME  { CAMEL_PROVIDER_CONF_LABEL, "hostname", NULL, N_("_Host:"), NULL }
 #define CAMEL_PROVIDER_CONF_DEFAULT_PATH      { CAMEL_PROVIDER_CONF_ENTRY, "path", NULL, N_("_Path:"), "" }
+#define CAMEL_PROVIDER_CONF_DEFAULT_URL       { CAMEL_PROVIDER_CONF_ENTRY, "owa_url", NULL, N_("_Url:"), "" }
 
 typedef int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex);
+typedef int (*CamelProviderValidateUserFunc) (CamelURL *url, CamelException *ex);
 
 typedef struct {
 	/* Provider name used in CamelURLs. */
@@ -169,6 +175,8 @@
 	
 	/* auto-detection function */
 	CamelProviderAutoDetectFunc auto_detect;
+
+	CamelProviderValidateUserFunc validate_user;
 	
 	/* CamelType(s) of its store and/or transport. If both are
 	 * set, then they are assumed to be linked together and the
@@ -222,6 +230,8 @@
 
 int camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
 				GHashTable **auto_detected, CamelException *ex);
+gboolean camel_provider_validate_user (CamelProvider *provider, CamelURL *url, 
+				       CamelException *ex);
 
 #ifdef __cplusplus
 }
Index: camel/camel-service.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-service.c,v
retrieving revision 1.98
diff -u -r1.98 camel-service.c
--- camel/camel-service.c	2 Dec 2004 08:03:30 -0000	1.98
+++ camel/camel-service.c	9 Jan 2005 14:22:45 -0000
@@ -185,6 +185,12 @@
 				camel_url_set_host (url, args->argv[i].ca_str);
 				reconnect = TRUE;
 			}
+		} else if (tag == CAMEL_SERVICE_URL) {
+			/* set the server url */
+			if (strcmp (url->owa_url, args->argv[i].ca_str) != 0) {
+				camel_url_set_owa_url (url, args->argv[i].ca_str);
+				reconnect = TRUE;
+			}
 		} else if (tag == CAMEL_SERVICE_PORT) {
 			/* set the port */
 			if (url->port != args->argv[i].ca_int) {
@@ -249,6 +255,10 @@
 			/* get the port */
 			*args->argv[i].ca_int = url->port;
 			break;
+		case CAMEL_SERVICE_URL:
+			/* get the server url */
+			*args->argv[i].ca_str = url->owa_url;
+			break;
 		case CAMEL_SERVICE_PATH:
 			/* get the path */
 			*args->argv[i].ca_str = url->path;
@@ -551,7 +561,7 @@
 		if (url->port)
 			g_string_append_printf (gpath, ":%d", url->port);
 	}
-	
+
 	if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_PATH))
 		g_string_append_printf (gpath, "%s%s", *url->path == '/' ? "" : "/", url->path);
 	
Index: camel/camel-service.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-service.h,v
retrieving revision 1.51
diff -u -r1.51 camel-service.h
--- camel/camel-service.h	2 Dec 2004 08:03:30 -0000	1.51
+++ camel/camel-service.h	9 Jan 2005 14:23:06 -0000
@@ -48,6 +48,7 @@
 	CAMEL_SERVICE_ARG_HOSTNAME,
 	CAMEL_SERVICE_ARG_PORT,
 	CAMEL_SERVICE_ARG_PATH,
+	CAMEL_SERVICE_ARG_URL,
 };
 
 #define CAMEL_SERVICE_USERNAME     (CAMEL_SERVICE_ARG_USERNAME | CAMEL_ARG_STR)
@@ -55,6 +56,7 @@
 #define CAMEL_SERVICE_HOSTNAME     (CAMEL_SERVICE_ARG_HOSTNAME | CAMEL_ARG_STR)
 #define CAMEL_SERVICE_PORT         (CAMEL_SERVICE_ARG_PORT | CAMEL_ARG_INT)
 #define CAMEL_SERVICE_PATH         (CAMEL_SERVICE_ARG_PATH | CAMEL_ARG_STR)
+#define CAMEL_SERVICE_URL          (CAMEL_SERVICE_ARG_URL | CAMEL_ARG_STR)
 
 typedef enum {
 	CAMEL_SERVICE_DISCONNECTED,
Index: e-util/e-config.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-config.c,v
retrieving revision 1.15
diff -u -r1.15 e-config.c
--- e-util/e-config.c	7 Jan 2005 02:32:09 -0000	1.15
+++ e-util/e-config.c	9 Jan 2005 14:55:31 -0000
@@ -442,7 +442,7 @@
 			if ( (sectionnode->empty = itemno == 0) ) {
 				gtk_widget_hide(sectionnode->frame);
 				sectionno--;
-			} else
+			} else if (sectionnode->frame != NULL)
 				gtk_widget_show(sectionnode->frame);
 			d(printf("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno));
 		}
@@ -455,7 +455,7 @@
 			if ( (pagenode->empty = sectionno == 0) ) {
 				gtk_widget_hide(pagenode->frame);
 				pageno--;
-			} else
+			} else if (sectionnode->frame != NULL) 
 				gtk_widget_show(pagenode->frame);
 			d(printf("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno));
 		}
@@ -695,7 +695,7 @@
 		case E_CONFIG_ITEM:
 		case E_CONFIG_ITEM_TABLE:
 			/* generated sections never retain their widgets on a rebuild */
-			if (sectionnode->item->factory == NULL)
+			if (sectionnode && (sectionnode->item->factory == NULL))
 				wn->widget = NULL;
 
 			/* ITEMs are called with the section parent.
@@ -1474,4 +1474,20 @@
 void e_config_hook_class_add_target_map(EConfigHookClass *klass, const EConfigHookTargetMap *map)
 {
 	g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map);
+}
+
+/**
+ * e_config_get_druid_page:
+ *
+ * @config: EConfig object
+ * 
+ * Gets the current druid page
+ *
+ **/
+struct _GtkWidget *
+e_config_get_druid_page (EConfig *config)
+{
+	struct _EConfigPrivate *priv = config->priv;
+
+	return priv->druid_page->frame;
 }
Index: e-util/e-config.h
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-config.h,v
retrieving revision 1.5
diff -u -r1.5 e-config.h
--- e-util/e-config.h	3 Dec 2004 03:41:19 -0000	1.5
+++ e-util/e-config.h	9 Jan 2005 14:58:12 -0000
@@ -255,6 +255,8 @@
 void *e_config_target_new(EConfig *, int type, size_t size);
 void e_config_target_free(EConfig *, void *);
 
+struct _GtkWidget *e_config_get_druid_page (EConfig *config);
+
 /* ********************************************************************** */
 
 /* config plugin target, they are closely integrated */
Index: camel/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution-exchange/camel/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- camel/Makefile.am	11 Dec 2004 09:03:49 -0000	1.2
+++ camel/Makefile.am	9 Jan 2005 13:26:19 -0000
@@ -6,6 +6,7 @@
 INCLUDES =					\
 	$(WARN_CFLAGS)				\
 	-I$(top_srcdir)				\
+	-I$(top_srcdir)/xntlm			\
 	$(GLIB_CFLAGS)				\
 	$(CAMEL_CFLAGS)				\
 	$(SHELL_CFLAGS)				\
@@ -33,5 +34,12 @@
 	camel-stub.h
 
 libcamelexchange_la_LDFLAGS = -avoid-version -module
+
+libcamelexchange_la_LIBADD = 			\
+	$(top_builddir)/lib/libexchange.a	\
+	$(top_builddir)/xntlm/libxntlm.a	\
+	$(LDAP_LIBS)				\ 
+	$(LIBEXCHANGE_LIBS)			\
+	$(EXCHANGE_STORAGE_LIBS)
 
 EXTRA_DIST = libcamelexchange.urls
Index: camel/camel-exchange-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/camel/camel-exchange-provider.c,v
retrieving revision 1.4
diff -u -r1.4 camel-exchange-provider.c
--- camel/camel-exchange-provider.c	14 Oct 2004 08:26:46 -0000	1.4
+++ camel/camel-exchange-provider.c	9 Jan 2005 13:27:31 -0000
@@ -32,16 +32,17 @@
 #include "camel-exchange-store.h"
 #include "camel-exchange-transport.h"
 
+#include "lib/e2k-validate.h"
+
 static guint exchange_url_hash (gconstpointer key);
 static gint exchange_url_equal (gconstpointer a, gconstpointer b);
 
 CamelProviderConfEntry exchange_conf_entries[] = {
 	/* override the labels/defaults of the standard settings */
-	{ CAMEL_PROVIDER_CONF_LABEL, "hostname", NULL,
-	  /* i18n: the '_' should appear before the same letter it
-	     does in the evolution:mail-config.glade "_Host"
-	     translation (or not at all) */
-	  N_("Exc_hange Server:") },
+	{ CAMEL_PROVIDER_CONF_ENTRY, "owa_url", NULL,
+	  /* i18n: "Global Catalog" is a Windowsism, but it's a
+	     technical term and may not have translations? */
+	  N_("OWA URL:") },
 	{ CAMEL_PROVIDER_CONF_LABEL, "username", NULL,
 	  /* i18n: the '_' should appear before the same letter it
 	     does in the evolution:mail-config.glade "User_name"
@@ -59,17 +60,10 @@
 	{ CAMEL_PROVIDER_CONF_CHECKSPIN, "ad_limit", NULL,
 	  N_("Limit number of GAL responses: %s"), "y:1:500:10000" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
-	{ CAMEL_PROVIDER_CONF_SECTION_START, "exchange", NULL,
-	  N_("Exchange Server") },
-	{ CAMEL_PROVIDER_CONF_ENTRY, "mailbox", NULL,
-	  /* i18n: "Mailbox" is an Outlookism. FIXME */
-	  N_("Mailbox name") },
-	{ CAMEL_PROVIDER_CONF_ENTRY, "owa_path", NULL,
-	  /* i18n: "OWA" == "Outlook Web Access". Might not be translated? */
-	  N_("OWA path"), "/exchange" },
-	{ CAMEL_PROVIDER_CONF_ENTRY, "pf_server", NULL,
-	  /* i18n: "Public Folder" is an Outlookism */
-	  N_("Public Folder server") },
+	{ CAMEL_PROVIDER_CONF_SECTION_START, "passwdexpiry", NULL,
+	  N_("Password Expiry Warning") },
+	{ CAMEL_PROVIDER_CONF_CHECKSPIN, "passwd_exp_warn_period", NULL,
+	  N_("Password Expiry Warning period: %s"), "y:1:7:90" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
 	  /* i18n: copy from evolution:camel-imap-provider.c */
@@ -90,11 +84,9 @@
 	"mail",
 
 	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
-	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_EXTERNAL |
-	CAMEL_PROVIDER_SUPPORTS_SSL,
+	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_EXTERNAL, 
 
-	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST |
-	CAMEL_URL_ALLOW_AUTH,
+	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_URL,
 
 	exchange_conf_entries,
 
@@ -137,6 +129,15 @@
 	return 0;
 }
 
+static gboolean
+exchange_validate_user_cb (CamelURL *url, char *host, CamelException *ex)
+{
+	gboolean valid;
+
+	valid = e2k_validate_user (url->owa_url, url->user, &url->host);
+	return valid;
+}
+
 void
 camel_provider_module_init (void)
 {
@@ -146,6 +147,7 @@
 	exchange_provider.url_hash = exchange_url_hash;
 	exchange_provider.url_equal = exchange_url_equal;
 	exchange_provider.auto_detect = exchange_auto_detect_cb;
+	exchange_provider.validate_user = exchange_validate_user_cb;
 
 	bindtextdomain (GETTEXT_PACKAGE, CONNECTOR_LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -176,8 +178,8 @@
 
 	if (u->user)
 		hash ^= g_str_hash (exchange_username (u->user));
-	if (u->host)
-		hash ^= g_str_hash (u->host);
+	if (u->owa_url)
+		hash ^= g_str_hash (u->owa_url);
 
 	return hash;
 }
@@ -201,5 +203,5 @@
 	return  check_equal (u1->protocol, u2->protocol) &&
 		check_equal (exchange_username (u1->user),
 			     exchange_username (u2->user)) &&
-		check_equal (u1->host, u2->host);
+		check_equal (u1->owa_url, u2->owa_url);
 }
Index: lib/e2k-autoconfig.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/lib/e2k-autoconfig.c,v
retrieving revision 1.4
diff -u -r1.4 e2k-autoconfig.c
--- lib/e2k-autoconfig.c	2 Sep 2004 17:45:24 -0000	1.4
+++ lib/e2k-autoconfig.c	9 Jan 2005 13:44:12 -0000
@@ -43,6 +43,7 @@
 #include <resolv.h>
 
 #include "e2k-autoconfig.h"
+#include "e2k-validate.h"
 #include "e2k-encoding-utils.h"
 #include "e2k-context.h"
 #include "e2k-global-catalog.h"
@@ -54,10 +55,13 @@
 
 #include <e-util/e-account.h>
 #include <e-util/e-account-list.h>
+#include <e-util/e-passwords.h>
 #include <gconf/gconf-client.h>
 #include <libxml/tree.h>
 #include <libxml/HTMLparser.h>
 
+#include <gtk/gtk.h>
+
 static char *find_olson_timezone (const char *windows_timezone);
 static void set_account_uri_string (E2kAutoconfig *ac);
 
@@ -1381,4 +1385,69 @@
 	if (!config_options)
 		read_config ();
 	return g_hash_table_lookup (config_options, option);
+}
+
+static gboolean 
+validate (char *owa_url, char *user, char *password, char **host)
+{
+	E2kAutoconfig *ac;
+	E2kOperation op; 
+	E2kAutoconfigResult result;
+	gboolean valid = FALSE;
+
+	ac = e2k_autoconfig_new (owa_url, user, password, 
+				 E2K_AUTOCONFIG_USE_EITHER);
+
+	e2k_operation_init (&op);
+	e2k_autoconfig_set_gc_server (ac, NULL, -1); // FIXME
+	result = e2k_autoconfig_check_exchange (ac, &op);
+
+	if (result == E2K_AUTOCONFIG_OK) {
+		result = e2k_autoconfig_check_global_catalog (ac, &op);
+		e2k_operation_free (&op);
+		// Get GC server
+		valid = TRUE;
+	}
+	else {
+		valid = FALSE; /* FIXME, return proper error code */
+	}
+	*host = g_strdup (ac->pf_server);
+	return valid;
+}
+
+/**
+ * e2k_validate_user:
+ * @owa_url: owa_url value 
+ * @user: Exchage user name
+ * @host: Exchange server host name, need to be filled.
+ * 
+ * Given the owa url and user name, asks for passwords, 
+ * and authenticates the user
+ *
+ * Return value: the boolean value, TRUE id user is authenticated,
+ *		 host name of Exchange server
+ **/
+gboolean
+e2k_validate_user (char *owa_url, char *user, char **host)
+{
+	gboolean valid = FALSE, remember=FALSE;
+	char *key, *password, *prompt;
+
+	key = g_strdup_printf ("%s//%s %s", "exchange:", user, owa_url); /* FIXME */
+	password = e_passwords_get_password ("Exchange", key);
+	if (!password) {
+		prompt = g_strdup_printf (_("Enter password for %s"), user);
+		password = e_passwords_ask_password (_("Enter password"),
+					"Exchange", key, prompt,
+					E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
+					&remember, NULL);
+		if (password) {
+			valid = validate (owa_url, user, password, host);
+			//auto_detect_gc();
+		}
+		g_free (prompt);
+	}
+	g_free (key);
+
+	return valid;
 }
Index: mail/mail-config.glade
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.glade,v
retrieving revision 1.155
diff -u -r1.155 mail-config.glade
--- mail/mail-config.glade	14 Dec 2004 17:10:44 -0000	1.155
+++ mail/mail-config.glade	9 Jan 2005 15:54:13 -0000
@@ -11,11 +11,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GnomeDruid" id="druid">
@@ -222,11 +217,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GtkNotebook" id="account_editor_notebook">
@@ -730,7 +720,6 @@
 			      <property name="label" translatable="yes">Add Ne_w Signature...</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <signal name="clicked" handler="sigAddNewClicked"/>
 			    </widget>
 			    <packing>
@@ -850,7 +839,6 @@
 			  <property name="label" translatable="yes">_Make this my default account</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -1108,16 +1096,16 @@
 			  <child>
 			    <widget class="GtkTable" id="table4">
 			      <property name="visible">True</property>
-			      <property name="n_rows">3</property>
+			      <property name="n_rows">4</property>
 			      <property name="n_columns">2</property>
 			      <property name="homogeneous">False</property>
 			      <property name="row_spacing">6</property>
 			      <property name="column_spacing">12</property>
 
 			      <child>
-				<widget class="GtkLabel" id="source_host_label">
+				<widget class="GtkLabel" id="source_owa_url_label">
 				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">_Host:</property>
+				  <property name="label" translatable="yes">_OWA Url:</property>
 				  <property name="use_underline">True</property>
 				  <property name="use_markup">False</property>
 				  <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1127,7 +1115,7 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xpad">0</property>
 				  <property name="ypad">0</property>
-				  <property name="mnemonic_widget">source_host</property>
+				  <property name="mnemonic_widget">source_owa_url</property>
 				</widget>
 				<packing>
 				  <property name="left_attach">0</property>
@@ -1140,9 +1128,30 @@
 			      </child>
 
 			      <child>
-				<widget class="GtkLabel" id="source_user_label">
+				<widget class="GtkEntry" id="source_owa_url">
 				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">User_name:</property>
+				  <property name="can_focus">True</property>
+				  <property name="editable">True</property>
+				  <property name="visibility">True</property>
+				  <property name="max_length">0</property>
+				  <property name="text" translatable="yes"></property>
+				  <property name="has_frame">True</property>
+				  <property name="invisible_char" translatable="yes">*</property>
+				  <property name="activates_default">False</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="source_host_label">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">_Host:</property>
 				  <property name="use_underline">True</property>
 				  <property name="use_markup">False</property>
 				  <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1152,7 +1161,7 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xpad">0</property>
 				  <property name="ypad">0</property>
-				  <property name="mnemonic_widget">source_user</property>
+				  <property name="mnemonic_widget">source_host</property>
 				</widget>
 				<packing>
 				  <property name="left_attach">0</property>
@@ -1179,8 +1188,33 @@
 				<packing>
 				  <property name="left_attach">1</property>
 				  <property name="right_attach">2</property>
-				  <property name="top_attach">0</property>
-				  <property name="bottom_attach">1</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="source_user_label">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">User_name:</property>
+				  <property name="use_underline">True</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="mnemonic_widget">source_user</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
+				  <property name="x_options">fill</property>
 				  <property name="y_options"></property>
 				</packing>
 			      </child>
@@ -1200,8 +1234,8 @@
 				<packing>
 				  <property name="left_attach">1</property>
 				  <property name="right_attach">2</property>
-				  <property name="top_attach">1</property>
-				  <property name="bottom_attach">2</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
 				  <property name="y_options"></property>
 				</packing>
 			      </child>
@@ -1224,8 +1258,8 @@
 				<packing>
 				  <property name="left_attach">0</property>
 				  <property name="right_attach">1</property>
-				  <property name="top_attach">2</property>
-				  <property name="bottom_attach">3</property>
+				  <property name="top_attach">3</property>
+				  <property name="bottom_attach">4</property>
 				  <property name="x_options">fill</property>
 				  <property name="y_options"></property>
 				</packing>
@@ -1238,7 +1272,6 @@
 				  <property name="browse_dialog_title" translatable="yes">Mailbox location</property>
 				  <property name="directory_entry">False</property>
 				  <property name="modal">False</property>
-				  <property name="use_filechooser">True</property>
 
 				  <child internal-child="entry">
 				    <widget class="GtkEntry" id="source_path">
@@ -1257,8 +1290,8 @@
 				<packing>
 				  <property name="left_attach">1</property>
 				  <property name="right_attach">2</property>
-				  <property name="top_attach">2</property>
-				  <property name="bottom_attach">3</property>
+				  <property name="top_attach">3</property>
+				  <property name="bottom_attach">4</property>
 				  <property name="y_options"></property>
 				</packing>
 			      </child>
@@ -1562,7 +1595,6 @@
 				  <property name="label" translatable="yes"> Ch_eck for Supported Types </property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				</widget>
 				<packing>
 				  <property name="padding">0</property>
@@ -1586,7 +1618,6 @@
 			      <property name="label" translatable="yes">Re_member password</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -1925,7 +1956,6 @@
 				      <property name="label" translatable="yes">Ser_ver requires authentication</property>
 				      <property name="use_underline">True</property>
 				      <property name="relief">GTK_RELIEF_NORMAL</property>
-				      <property name="focus_on_click">True</property>
 				      <property name="active">False</property>
 				      <property name="inconsistent">False</property>
 				      <property name="draw_indicator">True</property>
@@ -2325,7 +2355,6 @@
 					      <property name="label" translatable="yes">Ch_eck for Supported Types </property>
 					      <property name="use_underline">True</property>
 					      <property name="relief">GTK_RELIEF_NORMAL</property>
-					      <property name="focus_on_click">True</property>
 					    </widget>
 					    <packing>
 					      <property name="padding">0</property>
@@ -2368,7 +2397,6 @@
 				      <property name="label" translatable="yes">Remember _password</property>
 				      <property name="use_underline">True</property>
 				      <property name="relief">GTK_RELIEF_NORMAL</property>
-				      <property name="focus_on_click">True</property>
 				      <property name="active">False</property>
 				      <property name="inconsistent">False</property>
 				      <property name="draw_indicator">True</property>
@@ -2586,10 +2614,10 @@
 			      <child>
 				<widget class="Custom" id="sent_button">
 				  <property name="visible">True</property>
-				  <property name="creation_function">em_account_editor_folder_selector_button_new</property>
+				  <property name="creation_function">mail_account_gui_folder_selector_button_new</property>
 				  <property name="int1">0</property>
 				  <property name="int2">0</property>
-				  <property name="last_modification_time">Tue, 14 Dec 2004 17:07:09 GMT</property>
+				  <property name="last_modification_time">Wed, 03 Apr 2002 23:03:59 GMT</property>
 				</widget>
 				<packing>
 				  <property name="left_attach">1</property>
@@ -2604,10 +2632,10 @@
 			      <child>
 				<widget class="Custom" id="drafts_button">
 				  <property name="visible">True</property>
-				  <property name="creation_function">em_account_editor_folder_selector_button_new</property>
+				  <property name="creation_function">mail_account_gui_folder_selector_button_new</property>
 				  <property name="int1">0</property>
 				  <property name="int2">0</property>
-				  <property name="last_modification_time">Tue, 14 Dec 2004 17:07:02 GMT</property>
+				  <property name="last_modification_time">Wed, 03 Apr 2002 23:03:41 GMT</property>
 				</widget>
 				<packing>
 				  <property name="left_attach">1</property>
@@ -2658,7 +2686,6 @@
 				      <property name="label">gtk-revert-to-saved</property>
 				      <property name="use_stock">True</property>
 				      <property name="relief">GTK_RELIEF_NORMAL</property>
-				      <property name="focus_on_click">True</property>
 				    </widget>
 				    <packing>
 				      <property name="padding">0</property>
@@ -2807,7 +2834,6 @@
 				  <property name="label" translatable="yes">Alway_s carbon-copy (cc) to:</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				  <property name="active">False</property>
 				  <property name="inconsistent">False</property>
 				  <property name="draw_indicator">True</property>
@@ -2923,7 +2949,6 @@
 				  <property name="label" translatable="yes">Always _blind carbon-copy (bcc) to:</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				  <property name="active">False</property>
 				  <property name="inconsistent">False</property>
 				  <property name="draw_indicator">True</property>
@@ -3217,7 +3242,6 @@
 			      <property name="label" translatable="yes">Al_ways sign outgoing messages when using this account</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -3236,7 +3260,6 @@
 			      <property name="label" translatable="yes">_Don't sign meeting requests (for Outlook compatibility)</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -3255,7 +3278,6 @@
 			      <property name="label" translatable="yes">Always encrypt to _myself when sending encrypted mail</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">True</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -3274,7 +3296,6 @@
 			      <property name="label" translatable="yes">Always _trust keys in my keyring when encrypting</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -3427,7 +3448,6 @@
 			  <property name="label" translatable="yes">Also encrypt to sel_f when sending encrypted mail</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -3449,7 +3469,6 @@
 			  <property name="label" translatable="yes">Encrypt out_going messages (by default)</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -3471,7 +3490,6 @@
 			  <property name="label" translatable="yes">Digitally _sign outgoing messages (by default)</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -3562,7 +3580,6 @@
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<widget class="GtkAlignment" id="alignment28">
@@ -3571,10 +3588,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox175">
@@ -3636,7 +3649,6 @@
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<widget class="GtkAlignment" id="alignment35">
@@ -3645,10 +3657,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox230">
@@ -3726,7 +3734,6 @@
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<widget class="GtkAlignment" id="alignment29">
@@ -3735,10 +3742,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox176">
@@ -3800,7 +3803,6 @@
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<widget class="GtkAlignment" id="alignment34">
@@ -3809,10 +3811,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox229">
@@ -3935,11 +3933,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GtkHBox" id="toplevel">
@@ -3982,7 +3975,6 @@
 		  <property name="label">gtk-add</property>
 		  <property name="use_stock">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
 		</widget>
 	      </child>
 
@@ -3993,7 +3985,6 @@
 		  <property name="can_default">True</property>
 		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
 
 		  <child>
 		    <widget class="GtkAlignment" id="alignment33">
@@ -4002,10 +3993,6 @@
 		      <property name="yalign">0.5</property>
 		      <property name="xscale">0</property>
 		      <property name="yscale">0</property>
-		      <property name="top_padding">0</property>
-		      <property name="bottom_padding">0</property>
-		      <property name="left_padding">0</property>
-		      <property name="right_padding">0</property>
 
 		      <child>
 			<widget class="GtkHBox" id="hbox224">
@@ -4066,7 +4053,6 @@
 		  <property name="label">gtk-remove</property>
 		  <property name="use_stock">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -4092,7 +4078,6 @@
 		  <property name="label" translatable="yes">De_fault</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
 		</widget>
 	      </child>
 
@@ -4105,7 +4090,6 @@
 		  <property name="label" translatable="yes">E_nable</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -4133,11 +4117,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GtkNotebook" id="preferences_toplevel">
@@ -4232,7 +4211,6 @@
 			      <property name="label" translatable="yes">_Use the same fonts as other applications</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -4287,7 +4265,6 @@
 				  <property name="show_size">True</property>
 				  <property name="use_font_in_label">False</property>
 				  <property name="label_font_size">14</property>
-				  <property name="focus_on_click">True</property>
 				  <signal name="font_set" handler="changed"/>
 				</widget>
 				<packing>
@@ -4309,7 +4286,6 @@
 				  <property name="show_size">True</property>
 				  <property name="use_font_in_label">False</property>
 				  <property name="label_font_size">14</property>
-				  <property name="focus_on_click">True</property>
 				  <signal name="font_set" handler="changed"/>
 				</widget>
 				<packing>
@@ -4465,7 +4441,6 @@
 				  <property name="label" translatable="yes">_Mark messages as read after</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				  <property name="active">False</property>
 				  <property name="inconsistent">False</property>
 				  <property name="draw_indicator">True</property>
@@ -4537,7 +4512,6 @@
 				  <property name="label" translatable="yes">Highlight _quotations with</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				  <property name="active">True</property>
 				  <property name="inconsistent">False</property>
 				  <property name="draw_indicator">True</property>
@@ -4556,7 +4530,6 @@
 				  <property name="dither">True</property>
 				  <property name="use_alpha">False</property>
 				  <property name="title" translatable="yes">Pick a color</property>
-				  <property name="focus_on_click">True</property>
 				</widget>
 				<packing>
 				  <property name="padding">0</property>
@@ -4774,7 +4747,6 @@
 				  <property name="label" translatable="yes">Empty trash folders on e_xit</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				  <property name="active">False</property>
 				  <property name="inconsistent">False</property>
 				  <property name="draw_indicator">True</property>
@@ -4813,7 +4785,6 @@
 			      <property name="label" translatable="yes">Confirm _when expunging a folder</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -4930,7 +4901,6 @@
 			      <property name="label" translatable="yes">_Do not notify me when new mail arrives</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">True</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -4949,7 +4919,6 @@
 			      <property name="label" translatable="yes">Beep w_hen new mail arrives</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -4969,7 +4938,6 @@
 			      <property name="label" translatable="yes">Play sound file when new mail arri_ves</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -5017,7 +4985,6 @@
 				  <property name="browse_dialog_title" translatable="yes">Execute Command...</property>
 				  <property name="directory_entry">False</property>
 				  <property name="modal">False</property>
-				  <property name="use_filechooser">True</property>
 
 				  <child internal-child="entry">
 				    <widget class="GtkEntry" id="txtNotifyPlaySound">
@@ -5169,7 +5136,6 @@
 		      <property name="label" translatable="yes">_Show animated images</property>
 		      <property name="use_underline">True</property>
 		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
 		      <property name="active">False</property>
 		      <property name="inconsistent">False</property>
 		      <property name="draw_indicator">True</property>
@@ -5188,7 +5154,6 @@
 		      <property name="label" translatable="yes">_Prompt when sending HTML messages to contacts that don't want them</property>
 		      <property name="use_underline">True</property>
 		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
 		      <property name="active">False</property>
 		      <property name="inconsistent">False</property>
 		      <property name="draw_indicator">True</property>
@@ -5281,7 +5246,6 @@
 			  <property name="label" translatable="yes">_Never load images from the Internet</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -5300,7 +5264,6 @@
 			  <property name="label" translatable="yes">_Load images if sender is in address book</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -5320,7 +5283,6 @@
 			  <property name="label" translatable="yes">_Always load images from the Internet</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -5450,7 +5412,6 @@
 		      <property name="dither">True</property>
 		      <property name="use_alpha">False</property>
 		      <property name="title" translatable="yes">Pick a color</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -5469,7 +5430,6 @@
 		      <property name="dither">True</property>
 		      <property name="use_alpha">False</property>
 		      <property name="title" translatable="yes">Pick a color</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -5488,7 +5448,6 @@
 		      <property name="dither">True</property>
 		      <property name="use_alpha">False</property>
 		      <property name="title" translatable="yes">Pick a color</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -5507,7 +5466,6 @@
 		      <property name="dither">True</property>
 		      <property name="use_alpha">False</property>
 		      <property name="title" translatable="yes">Pick a color</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -5526,7 +5484,6 @@
 		      <property name="dither">True</property>
 		      <property name="use_alpha">False</property>
 		      <property name="title" translatable="yes">Pick a color</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -5661,7 +5618,6 @@
 			  <property name="label">gtk-revert-to-saved</property>
 			  <property name="use_stock">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -5848,7 +5804,6 @@
 		      <property name="label">gtk-add</property>
 		      <property name="use_stock">True</property>
 		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -5864,7 +5819,6 @@
 		      <property name="label">gtk-remove</property>
 		      <property name="use_stock">True</property>
 		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -6008,7 +5962,6 @@
 			  <property name="label" translatable="yes">Check _incoming mail for junk</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -6108,7 +6061,6 @@
 			  <property name="label" translatable="yes">I_nclude remote tests</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -6231,11 +6183,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GtkNotebook" id="composer_toplevel">
@@ -6330,7 +6277,6 @@
 			      <property name="label" translatable="yes">Format messages in _HTML</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -6349,7 +6295,6 @@
 			      <property name="label" translatable="yes">Automatically _insert smiley images</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -6401,10 +6346,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">1</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hboxReplyStyle">
@@ -6713,7 +6654,6 @@
 			      <property name="label" translatable="yes">_Prompt when sending messages with an empty subject line</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -6732,7 +6672,6 @@
 			      <property name="label" translatable="yes">Pr_ompt when sending messages with only Bcc recipients defined</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -6927,7 +6866,6 @@
 			      <property name="label">gtk-add</property>
 			      <property name="use_stock">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			    </widget>
 			  </child>
 
@@ -6937,7 +6875,6 @@
 			      <property name="can_default">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			      <signal name="clicked" handler="cmdSignatureAddScriptClicked"/>
 
 			      <child>
@@ -6947,10 +6884,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox223">
@@ -7008,7 +6941,6 @@
 			      <property name="can_default">True</property>
 			      <property name="can_focus">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<widget class="GtkAlignment" id="alignment31">
@@ -7017,10 +6949,6 @@
 				  <property name="yalign">0.5</property>
 				  <property name="xscale">0</property>
 				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
 
 				  <child>
 				    <widget class="GtkHBox" id="hbox222">
@@ -7080,7 +7008,6 @@
 			      <property name="label">gtk-remove</property>
 			      <property name="use_stock">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">True</property>
 			    </widget>
 			  </child>
 			</widget>
@@ -7416,7 +7343,6 @@
 				  <property name="label" translatable="yes">_Enable</property>
 				  <property name="use_underline">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
 				</widget>
 				<packing>
 				  <property name="padding">0</property>
@@ -7527,7 +7453,6 @@
 			  <property name="label" translatable="yes">Check spelling while I _type</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="focus_on_click">True</property>
 			  <property name="active">False</property>
 			  <property name="inconsistent">False</property>
 			  <property name="draw_indicator">True</property>
@@ -7574,7 +7499,6 @@
 			      <property name="dither">True</property>
 			      <property name="use_alpha">False</property>
 			      <property name="title" translatable="yes">Pick a color</property>
-			      <property name="focus_on_click">True</property>
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>
@@ -7646,11 +7570,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
     <widget class="GtkVBox" id="toplevel">
@@ -7784,7 +7703,6 @@
 		      <property name="show_size">True</property>
 		      <property name="use_font_in_label">False</property>
 		      <property name="label_font_size">14</property>
-		      <property name="focus_on_click">True</property>
 		      <signal name="font_set" handler="changed"/>
 		    </widget>
 		    <packing>
@@ -7806,7 +7724,6 @@
 		      <property name="show_size">True</property>
 		      <property name="use_font_in_label">False</property>
 		      <property name="label_font_size">14</property>
-		      <property name="focus_on_click">True</property>
 		      <signal name="font_set" handler="changed"/>
 		    </widget>
 		    <packing>
@@ -7850,11 +7767,6 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
   <property name="has_separator">False</property>
 
   <child internal-child="vbox">
@@ -7874,7 +7786,6 @@
 	      <property name="can_default">True</property>
 	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
 	      <property name="response_id">0</property>
 
 	      <child>
@@ -7884,10 +7795,6 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xscale">0</property>
 		  <property name="yscale">0</property>
-		  <property name="top_padding">0</property>
-		  <property name="bottom_padding">0</property>
-		  <property name="left_padding">0</property>
-		  <property name="right_padding">0</property>
 
 		  <child>
 		    <widget class="GtkHBox" id="hbox221">
@@ -7947,7 +7854,6 @@
 	      <property name="label">gtk-cancel</property>
 	      <property name="use_stock">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
 	      <property name="response_id">0</property>
 	    </widget>
 	  </child>
@@ -8113,7 +8019,6 @@
 		      <property name="max_saved">10</property>
 		      <property name="directory_entry">False</property>
 		      <property name="modal">False</property>
-		      <property name="use_filechooser">True</property>
 
 		      <child internal-child="entry">
 			<widget class="GtkEntry" id="combo-entry2">
Index: mail/em-account-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-account-editor.c,v
retrieving revision 1.13
diff -u -r1.13 em-account-editor.c
--- mail/em-account-editor.c	22 Dec 2004 07:38:16 -0000	1.13
+++ mail/em-account-editor.c	9 Jan 2005 15:35:50 -0000
@@ -70,6 +70,8 @@
 #include <e-util/e-account-list.h>
 #include <e-util/e-signature-list.h>
 
+#include <camel/camel-provider.h>
+
 #include <widgets/misc/e-error.h>
 
 #include "em-config.h"
@@ -107,6 +109,7 @@
 	struct _GtkWidget *container;
 
 	struct _GtkLabel *description;
+	struct _GtkEntry *owa_url;
 	struct _GtkEntry *hostname;
 	struct _GtkEntry *username;
 	struct _GtkEntry *path;
@@ -957,6 +960,7 @@
 };
 
 static struct _provider_host_info emae_source_host_info[] = {
+	{ CAMEL_URL_PART_URL, camel_url_set_owa_url, { "source_owa_url", "source_owa_url_label", } },	
 	{ CAMEL_URL_PART_HOST, emae_url_set_hostport, { "source_host", "source_host_label" } },
 	{ CAMEL_URL_PART_USER, camel_url_set_user, { "source_user", "source_user_label", } },
 	{ CAMEL_URL_PART_PATH, camel_url_set_path, { "source_path", "source_path_label", "source_path_entry" } },
@@ -983,6 +987,7 @@
 
 	char *container;
 	char *description;
+	char *owa_url;
 	char *hostname;
 	char *username;
 	char *path;
@@ -1004,7 +1009,7 @@
 } emae_service_info[CAMEL_NUM_PROVIDER_TYPES] = {
 	{ E_ACCOUNT_SOURCE_URL, E_ACCOUNT_SOURCE_SAVE_PASSWD,
 	  "source_frame", "source_type_dropdown",
-	  "source_vbox", "source_description", "source_host", "source_user", "source_path",
+	  "source_vbox", "source_description", "source_owa_url", "source_host", "source_user", "source_path",
 	  "source_security_frame", "source_ssl_hbox", "source_use_ssl", "source_ssl_disabled",
 	  NULL, "source_auth_frame",
 	  "source_auth_dropdown", "source_check_supported",
@@ -1013,7 +1018,7 @@
 	},
 	{ E_ACCOUNT_TRANSPORT_URL, E_ACCOUNT_TRANSPORT_SAVE_PASSWD,
 	  "transport_frame", "transport_type_dropdown",
-	  "transport_vbox", "transport_description", "transport_host", "transport_user", NULL,
+	  "transport_vbox", "transport_description", NULL, "transport_host", "transport_user", NULL,
 	  "transport_security_frame", "transport_ssl_hbox", "transport_use_ssl", "transport_ssl_disabled",
 	  "transport_needs_auth", "transport_auth_frame",
 	  "transport_auth_dropdown", "transport_check_supported",
@@ -1050,6 +1055,12 @@
 }
 
 static void
+emae_owa_url_changed(GtkEntry *entry, EMAccountEditorService *service)
+{
+	emae_service_url_changed(service, camel_url_set_owa_url, entry);
+}
+
+static void
 emae_username_changed(GtkEntry *entry, EMAccountEditorService *service)
 {
 	emae_service_url_changed(service, camel_url_set_user, entry);
@@ -1494,8 +1505,11 @@
 	service->frame = glade_xml_get_widget(gui->xml, info->frame);
 	service->container = glade_xml_get_widget(gui->xml, info->container);
 	service->description = GTK_LABEL (glade_xml_get_widget (gui->xml, info->description));
-	service->hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, info->hostname));
+	if (info->hostname)
+		service->hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, info->hostname));
 	service->username = GTK_ENTRY (glade_xml_get_widget (gui->xml, info->username));
+	if (info->owa_url)
+		service->owa_url = GTK_ENTRY (glade_xml_get_widget (gui->xml, info->owa_url));
 	if (info->path)
 		service->path = GTK_ENTRY (glade_xml_get_widget (gui->xml, info->path));
 
@@ -1503,10 +1517,11 @@
 	gtk_widget_hide (service->ssl_frame);
 	service->ssl_hbox = glade_xml_get_widget (gui->xml, info->ssl_hbox);
 	service->use_ssl = (GtkComboBox *)glade_xml_get_widget (gui->xml, info->use_ssl);
-	service->no_ssl = glade_xml_get_widget (gui->xml, info->ssl_disabled);
+	if (info->ssl_disabled)
+		service->no_ssl = glade_xml_get_widget (gui->xml, info->ssl_disabled);
 
 	/* configure ui for current settings */
-	if (url->host) {
+	if (service->hostname && url->host) {
 		if (url->port) {
 			char *host = g_strdup_printf("%s:%d", url->host, url->port);
 
@@ -1517,6 +1532,8 @@
 	}
 	if (url->user)
 		gtk_entry_set_text(service->username, url->user);
+	if (service->owa_url && url->owa_url)
+		gtk_entry_set_text(service->owa_url, url->owa_url);
 	if (service->path && url->path)
 		gtk_entry_set_text(service->path, url->path);
 
@@ -1531,8 +1548,11 @@
 		}
 	}
 
-	g_signal_connect (service->hostname, "changed", G_CALLBACK (emae_hostname_changed), service);
 	g_signal_connect (service->username, "changed", G_CALLBACK (emae_username_changed), service);
+	if (service->hostname)
+		g_signal_connect (service->hostname, "changed", G_CALLBACK (emae_hostname_changed), service);
+	if (service->owa_url)
+		g_signal_connect (service->owa_url, "changed", G_CALLBACK (emae_owa_url_changed), service);
 	if (service->path)
 		g_signal_connect (service->path, "changed", G_CALLBACK (emae_path_changed), service);
 
@@ -1842,11 +1862,33 @@
 		return NULL;
 
 	entries = emae->priv->source.provider->extra_conf;
-	for (i=0;entries && entries[i].type != CAMEL_PROVIDER_CONF_END;i++)
-		if (entries[i].type == CAMEL_PROVIDER_CONF_SECTION_START
-		    && entries[i].name
-		    && strcmp(entries[i].name, eitem->user_data) == 0)
-			goto section;
+	for (i=0;entries && entries[i].type != CAMEL_PROVIDER_CONF_END;i++) {
+		if (entries[i].name) {
+			if (entries[i].type == CAMEL_PROVIDER_CONF_SECTION_START) {
+		    		if (!strcmp(entries[i].name, eitem->user_data))
+					goto section;
+			}
+			else if (entries[i].type == CAMEL_PROVIDER_CONF_LABEL) {
+				/* FIXME: This is a hack for exchange connector,
+				labels should be removed from confentry */
+				if (!strcmp(entries[i].name, "owa_url"))
+					l = glade_xml_get_widget (emae->priv->xml,
+							"source_owa_url_label");
+				else if (!strcmp(entries[i].name, "hostname"))
+					l = glade_xml_get_widget (emae->priv->xml,
+							"source_host_label");
+				else if (!strcmp(entries[i].name, "username"))
+					l = glade_xml_get_widget (emae->priv->xml,
+							 "source_user_label");
+				else
+					l = NULL;
+				
+				if (l)
+					gtk_label_set_text_with_mnemonic(
+						(GtkLabel *)l, entries[i].text);
+			}
+		}
+	}
 
 	return NULL;
 section:
@@ -1871,6 +1913,8 @@
 			break;
 		case CAMEL_PROVIDER_CONF_LABEL:
 			/* FIXME: This is a hack for exchange connector, labels should be removed from confentry */
+			if (!strcmp(entries[i].name, "owa_url"))
+				l = glade_xml_get_widget(emae->priv->xml, "source_owa_url_label");
 			if (!strcmp(entries[i].name, "hostname"))
 				l = glade_xml_get_widget(emae->priv->xml, "source_host_label");
 			else if (!strcmp(entries[i].name, "username"))
@@ -2208,6 +2252,12 @@
 
 	if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)
 	    && (url->host == NULL || url->host[0] == 0))
+		ok = FALSE;
+
+	if (ok
+	    && CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_URL)
+ 	    && (service->type != CAMEL_PROVIDER_TRANSPORT)
+	    && (url->owa_url == NULL || url->owa_url[0] == 0))
 		ok = FALSE;
 
 	/* We only need the user if the service needs auth as well, i think */


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