Index: servers/exchange/lib/e2k-autoconfig.c
===================================================================
--- servers/exchange/lib/e2k-autoconfig.c	(revision 8903)
+++ servers/exchange/lib/e2k-autoconfig.c	(working copy)
@@ -1506,15 +1506,21 @@ validate (const char *owa_url, char *use
 		euri = e2k_uri_new (ac->home_uri);
 		path = g_strdup (euri->path + 1);
 		e2k_uri_free (euri);
-		mailbox = strrchr (path, '/');
-		if (mailbox && !mailbox[1]) {
-			*mailbox = '\0';
+
+		/* change a mailbox only if not set by the caller */
+		if (!exchange_params->mailbox || !*exchange_params->mailbox) {
 			mailbox = strrchr (path, '/');
+			if (mailbox && !mailbox[1]) {
+				*mailbox = '\0';
+				mailbox = strrchr (path, '/');
+			}
+			if (mailbox)
+				*mailbox++ = '\0';
+
+			g_free (exchange_params->mailbox);
+			exchange_params->mailbox  = g_strdup (mailbox);
 		}
-		if (mailbox)
-			*mailbox++ = '\0';
 
-		exchange_params->mailbox  = g_strdup (mailbox);
 		exchange_params->owa_path = g_strdup_printf ("%s%s", "/", path);
 		g_free (path);
 		exchange_params->host = g_strdup (ac->pf_server);
Index: servers/exchange/ChangeLog
===================================================================
--- servers/exchange/ChangeLog	(revision 8903)
+++ servers/exchange/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-06-03  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #273627
+
+	* lib/e2k-autoconfig.c: (validate):
+	Use mailbox value from ExchangeParams structure if set, otherwise
+	extract mailbox from the home_uri as before.
+
 2008-05-26  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #473658
