Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.139.2.19
diff -u -p -u -r1.139.2.19 ChangeLog
--- ChangeLog	5 Nov 2004 05:17:42 -0000	1.139.2.19
+++ ChangeLog	5 Nov 2004 05:52:08 -0000
@@ -1,4 +1,11 @@
-2004-10-26  Sushma Rai  <rsushma@novell.com>
+2004-11-05  Sarfraaz Ahmed <asarfraaz@novell.com>
+
+	 * storage/exchange-account.c (exchange_account_connect)(exchange_account_new)
+        : Check if the user has provided a domain as part of the username field and
+        store it for connecting to the server using form-based-authentication
+        (finalize) : Cleanup the private member.
+
+2004-11-05  Sushma Rai  <rsushma@novell.com>
 
 	* lib/e2k-user-dialog.c (addressbook_clicked_cb): Setting
 	the window non-modal, so that the user selection dialog
Index: storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-account.c,v
retrieving revision 1.18
diff -u -p -u -r1.18 exchange-account.c
--- storage/exchange-account.c	27 Aug 2004 15:31:49 -0000	1.18
+++ storage/exchange-account.c	5 Nov 2004 05:52:08 -0000
@@ -66,7 +66,7 @@ struct _ExchangeAccountPrivate {
 	gboolean uris_use_email;
 
 	char *identity_name, *identity_email, *source_uri, *password_key;
-	char *username, *password, *ad_server;
+	char *username, *password, *windows_domain, *ad_server;
 	E2kAutoconfigAuthPref auth_pref;
 	int ad_limit;
 
@@ -265,6 +265,9 @@ finalize (GObject *object)
 			strlen (account->priv->password));
 		g_free (account->priv->password);
 	}
+	if (account->priv->windows_domain)
+		g_free (account->priv->windows_domain);
+
 	if (account->priv->ad_server)
 		g_free (account->priv->ad_server);
 
@@ -959,6 +962,7 @@ exchange_account_connect (ExchangeAccoun
 	struct dirent *dent;
 	DIR *d;
 	char *old_password, *new_password;
+	char *user_name = NULL;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
@@ -975,10 +979,18 @@ exchange_account_connect (ExchangeAccoun
 	account->priv->connecting = TRUE;
 	g_mutex_unlock (account->priv->connect_lock);
 
+	if (account->priv->windows_domain)
+		user_name = g_strdup_printf ("%s\\%s", account->priv->windows_domain, 
+							account->priv->username);
+	else
+		user_name = g_strdup (account->priv->username);
+
 	ac = e2k_autoconfig_new (account->home_uri,
-				 account->priv->username,
+				 user_name,
 				 NULL,
 				 account->priv->auth_pref);
+	g_free (user_name);
+
 	e2k_autoconfig_set_gc_server (ac, account->priv->ad_server,
 				      account->priv->ad_limit);
 
@@ -1508,6 +1520,12 @@ exchange_account_new (EAccountList *acco
 	account->priv->password_key = g_strdup_printf ("exchange://%s", account->priv->uri_authority);
 
 	account->priv->username = g_strdup (uri->user);
+
+	if (uri->domain)
+		account->priv->windows_domain = g_strdup (uri->domain);
+	else
+		account->priv->windows_domain = NULL;
+
 	account->exchange_server = g_strdup (uri->host);
 	if (uri->authmech && !strcmp (uri->authmech, "Basic"))
 		account->priv->auth_pref = E2K_AUTOCONFIG_USE_BASIC;
