Index: widgets/misc/ChangeLog
===================================================================
--- widgets/misc/ChangeLog	(revision 35737)
+++ widgets/misc/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-07-11  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #243241
+
+	* e-account-combo-box.c: (e_account_combo_box_set_active):
+	In case we do not have a default account, or it is disabled,
+	then pick the first enabled as default, if any.
+
 2008-07-07  Suman Manjunath  <msuman@novell.com>
 
 	** Fix for bug #370731 (bugzilla.novell.com)
Index: widgets/misc/e-account-combo-box.c
===================================================================
--- widgets/misc/e-account-combo-box.c	(revision 35737)
+++ widgets/misc/e-account-combo-box.c	(working copy)
@@ -417,10 +417,33 @@ e_account_combo_box_set_active (EAccount
 
 	/* NULL means select the default account. */
 	/* XXX EAccountList misuses const. */
-	if (account == NULL)
+	if (account == NULL) {
 		account = (EAccount *)
 			e_account_list_get_default (account_list);
 
+		if (!account || !account->enabled) {
+			/* we do not have a default account or it's disabled,
+			   thus choose at least first enabled, if any */
+			EIterator *aiter;
+
+			for (aiter = e_list_get_iterator ((EList *) account_list);
+			    e_iterator_is_valid (aiter);
+			    e_iterator_next (aiter)) {
+				EAccount *a = (EAccount *) e_iterator_get (aiter);
+
+				if (a && a->enabled) {
+					account = a;
+					break;
+				}
+			}
+
+			g_object_unref (aiter);
+		}
+	}
+
+	if (!account)
+		return FALSE;
+
 	/* Lookup the tree row reference for the account. */
 	reference = g_hash_table_lookup (combo_box->priv->index, account);
 	if (reference == NULL)
