ews_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
					   EConfigLookup *config_lookup,
					   ESource *source)
{
	ESource *other_source;
	ESourceAuthentication *src_authentication_extension;
	ESourceMailAccount *mail_account_extension;
	ESourceMailTransport *mail_transport_extension;

	g_return_val_if_fail (E_IS_EWS_CONFIG_LOOKUP_RESULT (lookup_result), FALSE);
	g_return_val_if_fail (E_IS_CONFIG_LOOKUP (config_lookup), FALSE);

	/* Chain up to parent's method. */
	if (!E_CONFIG_LOOKUP_RESULT_SIMPLE_CLASS (e_ews_config_lookup_result_parent_class)->configure_source (lookup_result, config_lookup, source))
		return FALSE;

	src_authentication_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_AUTHENTICATION);

	other_source = e_config_lookup_get_source (config_lookup, E_CONFIG_LOOKUP_SOURCE_MAIL_ACCOUNT);
	mail_account_extension = e_source_get_extension (other_source, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
	ews_config_lookup_result_copy_authentication (src_authentication_extension, other_source);
	e_source_backend_set_backend_name (E_SOURCE_BACKEND (mail_account_extension), "ews");

	other_source = e_config_lookup_get_source (config_lookup, E_CONFIG_LOOKUP_SOURCE_MAIL_TRANSPORT);
	mail_transport_extension = e_source_get_extension (other_source, E_SOURCE_EXTENSION_MAIL_TRANSPORT);
	ews_config_lookup_result_copy_authentication (src_authentication_extension, other_source);
	e_source_backend_set_backend_name (E_SOURCE_BACKEND (mail_transport_extension), "ews");

	return TRUE;
}
ews_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
					   EConfigLookup *config_lookup,
					   ESource *source)
{
	ESource *other_source;
	ESourceAuthentication *src_authentication_extension;
	ESourceMailAccount *mail_account_extension;
	ESourceMailTransport *mail_transport_extension;

	g_return_val_if_fail (E_IS_EWS_CONFIG_LOOKUP_RESULT (lookup_result), FALSE);
	g_return_val_if_fail (E_IS_CONFIG_LOOKUP (config_lookup), FALSE);

	 
	if (!E_CONFIG_LOOKUP_RESULT_SIMPLE_CLASS (e_ews_config_lookup_result_parent_class)->configure_source (lookup_result, config_lookup, source))
		return FALSE;

	src_authentication_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_AUTHENTICATION);

	other_source = e_config_lookup_get_source (config_lookup, E_CONFIG_LOOKUP_SOURCE_MAIL_ACCOUNT);
	mail_account_extension = e_source_get_extension (other_source, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
	ews_config_lookup_result_copy_authentication (src_authentication_extension, other_source);
	e_source_backend_set_backend_name (E_SOURCE_BACKEND (mail_account_extension), "ews");

	other_source = e_config_lookup_get_source (config_lookup, E_CONFIG_LOOKUP_SOURCE_MAIL_TRANSPORT);
	mail_transport_extension = e_source_get_extension (other_source, E_SOURCE_EXTENSION_MAIL_TRANSPORT);
	ews_config_lookup_result_copy_authentication (src_authentication_extension, other_source);
	e_source_backend_set_backend_name (E_SOURCE_BACKEND (mail_transport_extension), "ews");

	return TRUE;
}