Index: mail/mail-config.c
===================================================================
--- mail/mail-config.c	(revision 36709)
+++ mail/mail-config.c	(working copy)
@@ -788,6 +788,8 @@ mail_config_get_account_by_source_url (c
 
 	g_return_val_if_fail (source_url != NULL, NULL);
 
+	g_debug ("%s(source_url=%s)", G_STRFUNC, source_url);
+
 	provider = camel_provider_get(source_url, NULL);
 	if (!provider)
 		return NULL;
@@ -796,6 +798,8 @@ mail_config_get_account_by_source_url (c
 	if (!source)
 		return NULL;
 
+	g_debug ("  As a CamelURL: %s", G_STRFUNC, camel_url_to_string (source, 0));
+
 	iter = e_list_get_iterator ((EList *) config->accounts);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
@@ -804,11 +808,14 @@ mail_config_get_account_by_source_url (c
 			CamelURL *url;
 
 			url = camel_url_new (account->source->url, NULL);
+			g_debug ("  Checking account '%s': %s",
+				account->name, camel_url_to_string (url, 0));
 			if (url && provider->url_equal (url, source)) {
 				camel_url_free (url);
 				camel_url_free (source);
 				g_object_unref (iter);
 
+				g_debug ("  Match found!");
 				return account;
 			}
 
@@ -819,6 +826,8 @@ mail_config_get_account_by_source_url (c
 		e_iterator_next (iter);
 	}
 
+	g_debug ("  No matching account found.");
+
 	g_object_unref (iter);
 
 	camel_url_free (source);
