[evolution] Use SRV records for configuration lookup



commit a6bf868a6af703b59cc9c7131628bb23f3cfa1b1
Author: Milan Crha <mcrha redhat com>
Date:   Fri Aug 4 10:07:01 2017 +0200

    Use SRV records for configuration lookup
    
    These are marked as incomplete, because the SRV record contains only
    host name and port, thus all the other values being set are just a guess.
    The change also makes prefer complete lookup results over those incomplete.

 po/POTFILES.in                                     |    1 +
 src/e-util/e-config-lookup-result-simple.c         |  104 ++++++--
 src/e-util/e-config-lookup-result-simple.h         |    1 +
 src/e-util/e-config-lookup-result.c                |   30 ++-
 src/e-util/e-config-lookup-result.h                |    2 +
 src/mail/e-mail-autoconfig.c                       |    1 +
 src/mail/e-mail-config-assistant.c                 |   25 ++-
 src/mail/e-mail-config-service-backend.c           |   21 +-
 src/mail/e-mail-config-service-backend.h           |    9 +-
 src/mail/e-mail-config-service-page.c              |   11 +-
 src/mail/e-mail-config-service-page.h              |    3 +-
 src/modules/config-lookup/CMakeLists.txt           |    2 +
 src/modules/config-lookup/config-lookup.c          |    2 +
 src/modules/config-lookup/e-gnome-config-lookup.c  |    2 -
 src/modules/config-lookup/e-srv-config-lookup.c    |  300 ++++++++++++++++++++
 src/modules/config-lookup/e-srv-config-lookup.h    |   29 ++
 .../mail-config/e-mail-config-remote-accounts.c    |   10 +-
 .../mail-config/e-mail-config-smtp-backend.c       |    5 +-
 18 files changed, 509 insertions(+), 49 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b8d6340..d0d411d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -439,6 +439,7 @@ src/modules/calendar/e-task-shell-view.c
 src/modules/calendar/e-task-shell-view-private.c
 src/modules/composer-to-meeting/e-composer-to-meeting.c
 src/modules/composer-to-meeting/e-meeting-to-composer.c
+src/modules/config-lookup/e-srv-config-lookup.c
 src/modules/itip-formatter/e-mail-formatter-itip.c
 src/modules/itip-formatter/itip-view.c
 src/modules/itip-formatter/org-gnome-itip-formatter.error.xml
diff --git a/src/e-util/e-config-lookup-result-simple.c b/src/e-util/e-config-lookup-result-simple.c
index 4c49129..af60006 100644
--- a/src/e-util/e-config-lookup-result-simple.c
+++ b/src/e-util/e-config-lookup-result-simple.c
@@ -42,6 +42,7 @@
 struct _EConfigLookupResultSimplePrivate {
        EConfigLookupResultKind kind;
        gint priority;
+       gboolean is_complete;
        gchar *protocol;
        gchar *display_name;
        gchar *description;
@@ -52,6 +53,7 @@ enum {
        PROP_0,
        PROP_KIND,
        PROP_PRIORITY,
+       PROP_IS_COMPLETE,
        PROP_PROTOCOL,
        PROP_DISPLAY_NAME,
        PROP_DESCRIPTION
@@ -114,6 +116,14 @@ config_lookup_result_simple_get_priority (EConfigLookupResult *lookup_result)
        return E_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)->priv->priority;
 }
 
+static gboolean
+config_lookup_result_simple_get_is_complete (EConfigLookupResult *lookup_result)
+{
+       g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result), FALSE);
+
+       return E_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)->priv->is_complete;
+}
+
 static const gchar *
 config_lookup_result_simple_get_protocol (EConfigLookupResult *lookup_result)
 {
@@ -155,16 +165,26 @@ config_lookup_result_simple_configure_source (EConfigLookupResult *lookup_result
 
        for (link = result_simple->priv->values; link; link = g_slist_next (link)) {
                ValueData *vd = link->data;
-               gpointer extension;
+               gpointer object;
 
                if (!vd)
                        return FALSE;
 
-               extension = e_source_get_extension (source, vd->extension_name);
-               g_warn_if_fail (extension != NULL);
+               if (vd->extension_name && *vd->extension_name) {
+                       object = e_source_get_extension (source, vd->extension_name);
+
+                       /* Special-case the ESourceCamel extension, where the properties
+                          reference the CamelSettings object, not the extension itself. */
+                       if (object && E_IS_SOURCE_CAMEL (object))
+                               object = e_source_camel_get_settings (object);
+               } else {
+                       object = source;
+               }
+
+               g_warn_if_fail (object != NULL);
 
-               if (extension)
-                       g_object_set_property (extension, vd->property_name, &vd->value);
+               if (object)
+                       g_object_set_property (object, vd->property_name, &vd->value);
        }
 
        return TRUE;
@@ -206,6 +226,15 @@ config_lookup_result_simple_set_priority (EConfigLookupResultSimple *result_simp
 }
 
 static void
+config_lookup_result_simple_set_is_complete (EConfigLookupResultSimple *result_simple,
+                                            gboolean is_complete)
+{
+       g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (result_simple));
+
+       result_simple->priv->is_complete = is_complete;
+}
+
+static void
 config_lookup_result_simple_set_string (EConfigLookupResultSimple *result_simple,
                                        const gchar *value,
                                        gchar **destination)
@@ -236,6 +265,11 @@ config_lookup_result_simple_set_property (GObject *object,
                                result_simple, g_value_get_int (value));
                        return;
 
+               case PROP_IS_COMPLETE:
+                       config_lookup_result_simple_set_is_complete (
+                               result_simple, g_value_get_boolean (value));
+                       return;
+
                case PROP_PROTOCOL:
                        config_lookup_result_simple_set_string (
                                result_simple, g_value_get_string (value),
@@ -279,6 +313,13 @@ config_lookup_result_simple_get_property (GObject *object,
                                E_CONFIG_LOOKUP_RESULT (object)));
                        return;
 
+               case PROP_IS_COMPLETE:
+                       g_value_set_boolean (
+                               value,
+                               config_lookup_result_simple_get_is_complete (
+                               E_CONFIG_LOOKUP_RESULT (object)));
+                       return;
+
                case PROP_PROTOCOL:
                        g_value_set_string (
                                value,
@@ -372,6 +413,26 @@ e_config_lookup_result_simple_class_init (EConfigLookupResultSimpleClass *klass)
                        G_PARAM_STATIC_STRINGS));
 
        /**
+        * EConfigLookupResultSimple:is-complete:
+        *
+        * Whether the #EConfigLookupResult is complete, that is, whether it doesn't
+        * require any further user interaction.
+        *
+        * Since: 3.26
+        **/
+       g_object_class_install_property (
+               object_class,
+               PROP_IS_COMPLETE,
+               g_param_spec_boolean (
+                       "is-complete",
+                       "Is Complete",
+                       NULL,
+                       FALSE,
+                       G_PARAM_READWRITE |
+                       G_PARAM_CONSTRUCT_ONLY |
+                       G_PARAM_STATIC_STRINGS));
+
+       /**
         * EConfigLookupResultSimple:protocol:
         *
         * The protocol name for the #EConfigLookupResult.
@@ -434,6 +495,7 @@ e_config_lookup_result_simple_result_init (EConfigLookupResultInterface *iface)
 {
        iface->get_kind = config_lookup_result_simple_get_kind;
        iface->get_priority = config_lookup_result_simple_get_priority;
+       iface->get_is_complete = config_lookup_result_simple_get_is_complete;
        iface->get_protocol = config_lookup_result_simple_get_protocol;
        iface->get_display_name = config_lookup_result_simple_get_display_name;
        iface->get_description = config_lookup_result_simple_get_description;
@@ -450,6 +512,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple)
  * e_config_lookup_result_simple_new:
  * @kind: a kind of the result, one of #EConfigLookupResultKind
  * @priority: a priority of the result
+ * @is_complete: whether the result is complete
  * @protocol: (nullable): protocol name of the result, or %NULL
  * @display_name: display name of the result
  * @description: description of the result
@@ -463,6 +526,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple)
 EConfigLookupResult *
 e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
                                   gint priority,
+                                  gboolean is_complete,
                                   const gchar *protocol,
                                   const gchar *display_name,
                                   const gchar *description)
@@ -474,6 +538,7 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
        return g_object_new (E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE,
                "kind", kind,
                "priority", priority,
+               "is-complete", is_complete,
                "protocol", protocol,
                "display-name", display_name,
                "description", description,
@@ -483,13 +548,13 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
 /**
  * e_config_lookup_result_simple_add_value:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to be set
  *
  * Adds a value to be stored into an #ESource when e_config_lookup_result_configure_source().
  * is called. The @value is identified as a property named @property_name in an extension
- * named @extension_name.
+ * named @extension_name, or in the #ESource itself, when @extension_name is %NULL.
  *
  * In case multiple values are stored for the same extension and property,
  * then the first is saved.
@@ -505,7 +570,6 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result,
        EConfigLookupResultSimple *result_simple;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
        g_return_if_fail (value != NULL);
 
@@ -518,7 +582,7 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_boolean:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -536,7 +600,6 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -551,7 +614,7 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_int:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -569,7 +632,6 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -584,7 +646,7 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_uint:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -602,7 +664,6 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -617,7 +678,7 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_int64:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -635,7 +696,6 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -650,7 +710,7 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_uint64:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -668,7 +728,6 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -683,7 +742,7 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_double:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -701,7 +760,6 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -716,7 +774,7 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_string:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @value: value to set
  *
@@ -734,7 +792,6 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
@@ -749,7 +806,7 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result,
 /**
  * e_config_lookup_result_simple_add_enum:
  * @lookup_result: an #EConfigLookupResultSimple
- * @extension_name: extension name
+ * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
  * @property_name: property name within the extension
  * @enum_type: a #GType of the enum
  * @value: value to set
@@ -769,7 +826,6 @@ e_config_lookup_result_simple_add_enum (EConfigLookupResult *lookup_result,
        GValue gvalue;
 
        g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
-       g_return_if_fail (extension_name != NULL);
        g_return_if_fail (property_name != NULL);
 
        memset (&gvalue, 0, sizeof (GValue));
diff --git a/src/e-util/e-config-lookup-result-simple.h b/src/e-util/e-config-lookup-result-simple.h
index 3eaf0de..1942204 100644
--- a/src/e-util/e-config-lookup-result-simple.h
+++ b/src/e-util/e-config-lookup-result-simple.h
@@ -76,6 +76,7 @@ GType         e_config_lookup_result_simple_get_type  (void) G_GNUC_CONST;
 EConfigLookupResult *
                e_config_lookup_result_simple_new       (EConfigLookupResultKind kind,
                                                         gint priority,
+                                                        gboolean is_complete,
                                                         const gchar *protocol,
                                                         const gchar *display_name,
                                                         const gchar *description);
diff --git a/src/e-util/e-config-lookup-result.c b/src/e-util/e-config-lookup-result.c
index 2c8b6db..04e2a7b 100644
--- a/src/e-util/e-config-lookup-result.c
+++ b/src/e-util/e-config-lookup-result.c
@@ -42,6 +42,7 @@ e_config_lookup_result_default_init (EConfigLookupResultInterface *iface)
 {
        iface->get_kind = NULL;
        iface->get_priority = NULL;
+       iface->get_is_complete = NULL;
        iface->get_protocol = NULL;
        iface->get_display_name = NULL;
        iface->get_description = NULL;
@@ -93,6 +94,29 @@ e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result)
 }
 
 /**
+ * e_config_lookup_result_get_is_complete:
+ * @lookup_result: an #EConfigLookupResult
+ *
+ * Returns: whether the result is complete, that is, whether it doesn't require
+ *    any further user interaction
+ *
+ * Since: 3.26
+ **/
+gboolean
+e_config_lookup_result_get_is_complete (EConfigLookupResult *lookup_result)
+{
+       EConfigLookupResultInterface *iface;
+
+       g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), FALSE);
+
+       iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
+       g_return_val_if_fail (iface != NULL, FALSE);
+       g_return_val_if_fail (iface->get_is_complete != NULL, FALSE);
+
+       return iface->get_is_complete (lookup_result);
+}
+
+/**
  * e_config_lookup_result_get_protocol:
  * @lookup_result: an #EConfigLookupResult
  *
@@ -194,7 +218,8 @@ e_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
  * when @lookup_result_a is before @lookup_result_b, 0 when they are the same
  * and value greater than 0, when @lookup_result_a is after @lookup_result_b.
  *
- * The comparison is done on kind, priority and display name values, in this order.
+ * The comparison is done on kind, is-complete, priority and display name values,
+ * in this order.
  *
  * Returns: strcmp()-like value, what the position between @lookup_result_a and
  *    @lookup_result_b is.
@@ -217,6 +242,9 @@ e_config_lookup_result_compare (gconstpointer lookup_result_a,
        res = e_config_lookup_result_get_kind (lra) - e_config_lookup_result_get_kind (lrb);
 
        if (!res)
+               res = (e_config_lookup_result_get_is_complete (lra) ? -1 : 0) - 
(e_config_lookup_result_get_is_complete (lrb) ? -1 : 0);
+
+       if (!res)
                res = e_config_lookup_result_get_priority (lra) - e_config_lookup_result_get_priority (lrb);
 
        if (!res) {
diff --git a/src/e-util/e-config-lookup-result.h b/src/e-util/e-config-lookup-result.h
index 56b8c82..e7e7b6f 100644
--- a/src/e-util/e-config-lookup-result.h
+++ b/src/e-util/e-config-lookup-result.h
@@ -60,6 +60,7 @@ struct _EConfigLookupResultInterface {
        EConfigLookupResultKind
                        (* get_kind)                    (EConfigLookupResult *lookup_result);
        gint            (* get_priority)                (EConfigLookupResult *lookup_result);
+       gboolean        (* get_is_complete)             (EConfigLookupResult *lookup_result);
        const gchar *   (* get_protocol)                (EConfigLookupResult *lookup_result);
        const gchar *   (* get_display_name)            (EConfigLookupResult *lookup_result);
        const gchar *   (* get_description)             (EConfigLookupResult *lookup_result);
@@ -71,6 +72,7 @@ GType         e_config_lookup_result_get_type         (void);
 EConfigLookupResultKind
                e_config_lookup_result_get_kind         (EConfigLookupResult *lookup_result);
 gint           e_config_lookup_result_get_priority     (EConfigLookupResult *lookup_result);
+gboolean       e_config_lookup_result_get_is_complete  (EConfigLookupResult *lookup_result);
 const gchar *  e_config_lookup_result_get_protocol     (EConfigLookupResult *lookup_result);
 const gchar *  e_config_lookup_result_get_display_name (EConfigLookupResult *lookup_result);
 const gchar *  e_config_lookup_result_get_description  (EConfigLookupResult *lookup_result);
diff --git a/src/mail/e-mail-autoconfig.c b/src/mail/e-mail-autoconfig.c
index 62cee6b..4640a44 100644
--- a/src/mail/e-mail-autoconfig.c
+++ b/src/mail/e-mail-autoconfig.c
@@ -585,6 +585,7 @@ e_mail_config_lookup_result_new (EConfigLookupResultKind kind,
        mail_result = g_object_new (E_TYPE_MAIL_CONFIG_LOOKUP_RESULT,
                "kind", kind,
                "priority", priority,
+               "is-complete", TRUE,
                "protocol", protocol,
                "display-name", display_name,
                "description", description,
diff --git a/src/mail/e-mail-config-assistant.c b/src/mail/e-mail-config-assistant.c
index 35c049e..bbe52ff 100644
--- a/src/mail/e-mail-config-assistant.c
+++ b/src/mail/e-mail-config-assistant.c
@@ -290,8 +290,9 @@ mail_config_assistant_config_lookup_run_cb (GObject *source_object,
 {
        EMailConfigAssistantPrivate *priv;
        ConfigLookupContext *context;
-       gint n_pages, ii;
+       gint n_pages, ii, complete = 0;
        gboolean any_configured = FALSE;
+       gboolean is_complete;
 
        context = (ConfigLookupContext *) user_data;
 
@@ -299,21 +300,37 @@ mail_config_assistant_config_lookup_run_cb (GObject *source_object,
 
        e_config_lookup_run_finish (E_CONFIG_LOOKUP (source_object), result);
 
-       if (e_mail_config_service_page_auto_configure (priv->receiving_page, context->config_lookup)) {
+       is_complete = FALSE;
+
+       if (e_mail_config_service_page_auto_configure (priv->receiving_page, context->config_lookup, 
&is_complete)) {
                any_configured = TRUE;
                /* Add the page to the visited pages hash table to
                 * prevent calling e_mail_config_page_setup_defaults(). */
                g_hash_table_add (priv->visited_pages, priv->receiving_page);
+
+               if (is_complete)
+                       complete++;
        }
 
-       if (e_mail_config_service_page_auto_configure (priv->sending_page, context->config_lookup)) {
+       is_complete = FALSE;
+
+       if (e_mail_config_service_page_auto_configure (priv->sending_page, context->config_lookup, 
&is_complete)) {
                any_configured = TRUE;
                /* Add the page to the visited pages hash table to
                 * prevent calling e_mail_config_page_setup_defaults(). */
                g_hash_table_add (priv->visited_pages, priv->sending_page);
+
+               if (is_complete)
+                       complete++;
        }
 
-       if (!any_configured) {
+       if (!any_configured || complete != 2) {
+               if (any_configured) {
+                       /* Set the initial display name to the email address
+                        * given so the user can just click past the Summary page. */
+                       e_source_set_display_name (priv->identity_source, context->email_address);
+               }
+
                gtk_assistant_next_page (context->assistant);
                goto exit;
        }
diff --git a/src/mail/e-mail-config-service-backend.c b/src/mail/e-mail-config-service-backend.c
index 1508784..6854c38 100644
--- a/src/mail/e-mail-config-service-backend.c
+++ b/src/mail/e-mail-config-service-backend.c
@@ -187,7 +187,8 @@ mail_config_service_backend_setup_defaults (EMailConfigServiceBackend *backend)
 static gboolean
 mail_config_service_backend_auto_configure (EMailConfigServiceBackend *backend,
                                            EConfigLookup *config_lookup,
-                                           gint *out_priority)
+                                           gint *out_priority,
+                                           gboolean *out_is_complete)
 {
        return FALSE;
 }
@@ -480,7 +481,8 @@ e_mail_config_service_backend_setup_defaults (EMailConfigServiceBackend *backend
 gboolean
 e_mail_config_service_backend_auto_configure (EMailConfigServiceBackend *backend,
                                              EConfigLookup *config_lookup,
-                                             gint *out_priority)
+                                             gint *out_priority,
+                                             gboolean *out_is_complete)
 {
        EMailConfigServiceBackendClass *class;
 
@@ -490,7 +492,7 @@ e_mail_config_service_backend_auto_configure (EMailConfigServiceBackend *backend
        class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
        g_return_val_if_fail (class->auto_configure != NULL, FALSE);
 
-       return class->auto_configure (backend, config_lookup, out_priority);
+       return class->auto_configure (backend, config_lookup, out_priority, out_is_complete);
 }
 
 gboolean
@@ -527,6 +529,7 @@ e_mail_config_service_backend_commit_changes (EMailConfigServiceBackend *backend
  * @protocol: (nullable): optional protocol name, or %NULL
  * @source: (nullable): optioanl #ESource to configure, or %NULL
  * @out_priority: (out) (nullable): priority of the chosen lookup result
+ * @out_is_complete: (out) (nullable): whether the config is complete
  *
  * Finds a config lookup result for the given @kind and @protocol and
  * configures the @source with it. The @out_priority is set to the priority
@@ -545,7 +548,8 @@ e_mail_config_service_backend_auto_configure_for_kind (EMailConfigServiceBackend
                                                       EConfigLookupResultKind kind,
                                                       const gchar *protocol,
                                                       ESource *source,
-                                                      gint *out_priority)
+                                                      gint *out_priority,
+                                                      gboolean *out_is_complete)
 {
        EMailConfigServiceBackendClass *klass;
        GSList *results;
@@ -571,8 +575,13 @@ e_mail_config_service_backend_auto_configure_for_kind (EMailConfigServiceBackend
 
                changed = e_config_lookup_result_configure_source (lookup_result, source);
 
-               if (changed && out_priority)
-                       *out_priority = e_config_lookup_result_get_priority (lookup_result);
+               if (changed) {
+                       if (out_priority)
+                               *out_priority = e_config_lookup_result_get_priority (lookup_result);
+
+                       if (out_is_complete)
+                               *out_is_complete = e_config_lookup_result_get_is_complete (lookup_result);
+               }
        }
 
        g_slist_free_full (results, g_object_unref);
diff --git a/src/mail/e-mail-config-service-backend.h b/src/mail/e-mail-config-service-backend.h
index f869c76..44d3552 100644
--- a/src/mail/e-mail-config-service-backend.h
+++ b/src/mail/e-mail-config-service-backend.h
@@ -73,7 +73,8 @@ struct _EMailConfigServiceBackendClass {
        gboolean        (*auto_configure)
                                        (EMailConfigServiceBackend *backend,
                                         EConfigLookup *config_lookup,
-                                        gint *out_priority);
+                                        gint *out_priority,
+                                        gboolean *out_is_complete);
        gboolean        (*check_complete)
                                        (EMailConfigServiceBackend *backend);
        void            (*commit_changes)
@@ -109,7 +110,8 @@ void                e_mail_config_service_backend_setup_defaults
 gboolean       e_mail_config_service_backend_auto_configure
                                        (EMailConfigServiceBackend *backend,
                                         EConfigLookup *config_lookup,
-                                        gint *out_priority);
+                                        gint *out_priority,
+                                        gboolean *out_is_complete);
 gboolean       e_mail_config_service_backend_check_complete
                                        (EMailConfigServiceBackend *backend);
 void           e_mail_config_service_backend_commit_changes
@@ -120,7 +122,8 @@ gboolean    e_mail_config_service_backend_auto_configure_for_kind
                                         EConfigLookupResultKind kind,
                                         const gchar *protocol,
                                         ESource *source,
-                                        gint *out_priority);
+                                        gint *out_priority,
+                                        gboolean *out_is_complete);
 
 G_END_DECLS
 
diff --git a/src/mail/e-mail-config-service-page.c b/src/mail/e-mail-config-service-page.c
index 6eaf401..0b1fd2d 100644
--- a/src/mail/e-mail-config-service-page.c
+++ b/src/mail/e-mail-config-service-page.c
@@ -894,10 +894,12 @@ e_mail_config_service_page_lookup_backend (EMailConfigServicePage *page,
 
 gboolean
 e_mail_config_service_page_auto_configure (EMailConfigServicePage *page,
-                                           EConfigLookup *config_lookup)
+                                          EConfigLookup *config_lookup,
+                                          gboolean *out_is_complete)
 {
        EMailConfigServiceBackend *select_backend = NULL;
        gint selected_priority = G_MAXINT;
+       gboolean selected_is_complete = FALSE;
        gboolean any_configured = FALSE;
        guint ii;
 
@@ -909,14 +911,16 @@ e_mail_config_service_page_auto_configure (EMailConfigServicePage *page,
                Candidate *candidate;
                gboolean configured;
                gint priority = G_MAXINT;
+               gboolean is_complete = FALSE;
 
                candidate = page->priv->candidates->pdata[ii];
                backend = candidate->backend;
 
-               configured = e_mail_config_service_backend_auto_configure (backend, config_lookup, &priority);
+               configured = e_mail_config_service_backend_auto_configure (backend, config_lookup, &priority, 
&is_complete);
 
                if (configured && priority < selected_priority) {
                        selected_priority = priority;
+                       selected_is_complete = is_complete;
                        select_backend = backend;
                }
 
@@ -926,6 +930,9 @@ e_mail_config_service_page_auto_configure (EMailConfigServicePage *page,
        if (select_backend)
                e_mail_config_service_page_set_active_backend (page, select_backend);
 
+       if (out_is_complete)
+               *out_is_complete = selected_is_complete;
+
        return any_configured;
 }
 
diff --git a/src/mail/e-mail-config-service-page.h b/src/mail/e-mail-config-service-page.h
index 2603331..9f13c7a 100644
--- a/src/mail/e-mail-config-service-page.h
+++ b/src/mail/e-mail-config-service-page.h
@@ -93,7 +93,8 @@ EMailConfigServiceBackend *
                                                 const gchar *backend_name);
 gboolean       e_mail_config_service_page_auto_configure
                                                (EMailConfigServicePage *page,
-                                                EConfigLookup *config_lookup);
+                                                EConfigLookup *config_lookup,
+                                                gboolean *out_is_complete);
 
 G_END_DECLS
 
diff --git a/src/modules/config-lookup/CMakeLists.txt b/src/modules/config-lookup/CMakeLists.txt
index 37261ee..cbf3abb 100644
--- a/src/modules/config-lookup/CMakeLists.txt
+++ b/src/modules/config-lookup/CMakeLists.txt
@@ -6,6 +6,8 @@ set(sources
        config-lookup.c
        e-gnome-config-lookup.c
        e-gnome-config-lookup.h
+       e-srv-config-lookup.c
+       e-srv-config-lookup.h
 )
 set(extra_defines)
 set(extra_cflags)
diff --git a/src/modules/config-lookup/config-lookup.c b/src/modules/config-lookup/config-lookup.c
index 96ec875..3d3895c 100644
--- a/src/modules/config-lookup/config-lookup.c
+++ b/src/modules/config-lookup/config-lookup.c
@@ -21,6 +21,7 @@
 #include <glib-object.h>
 
 #include "e-gnome-config-lookup.h"
+#include "e-srv-config-lookup.h"
 
 /* Module Entry Points */
 void e_module_load (GTypeModule *type_module);
@@ -30,6 +31,7 @@ G_MODULE_EXPORT void
 e_module_load (GTypeModule *type_module)
 {
        e_gnome_config_lookup_type_register (type_module);
+       e_srv_config_lookup_type_register (type_module);
 }
 
 G_MODULE_EXPORT void
diff --git a/src/modules/config-lookup/e-gnome-config-lookup.c 
b/src/modules/config-lookup/e-gnome-config-lookup.c
index ed0d11f..3567773 100644
--- a/src/modules/config-lookup/e-gnome-config-lookup.c
+++ b/src/modules/config-lookup/e-gnome-config-lookup.c
@@ -17,8 +17,6 @@
 
 #include "evolution-config.h"
 
-#include <glib/gi18n-lib.h>
-
 #include "mail/e-mail-autoconfig.h"
 #include "e-util/e-util.h"
 
diff --git a/src/modules/config-lookup/e-srv-config-lookup.c b/src/modules/config-lookup/e-srv-config-lookup.c
new file mode 100644
index 0000000..7e81d4d
--- /dev/null
+++ b/src/modules/config-lookup/e-srv-config-lookup.c
@@ -0,0 +1,300 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "evolution-config.h"
+
+#include <string.h>
+#include <gio/gio.h>
+#include <glib/gi18n-lib.h>
+
+#include "e-util/e-util.h"
+
+#include "e-srv-config-lookup.h"
+
+/* Standard GObject macros */
+#define E_TYPE_SRV_CONFIG_LOOKUP \
+       (e_srv_config_lookup_get_type ())
+#define E_SRV_CONFIG_LOOKUP(obj) \
+       (G_TYPE_CHECK_INSTANCE_CAST \
+       ((obj), E_TYPE_SRV_CONFIG_LOOKUP, ESrvConfigLookup))
+#define E_SRV_CONFIG_LOOKUP_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_CAST \
+       ((cls), E_TYPE_SRV_CONFIG_LOOKUP, ESrvConfigLookupClass))
+#define E_IS_SRV_CONFIG_LOOKUP(obj) \
+       (G_TYPE_CHECK_INSTANCE_TYPE \
+       ((obj), E_TYPE_SRV_CONFIG_LOOKUP))
+#define E_IS_SRV_CONFIG_LOOKUP_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_TYPE \
+       ((cls), E_TYPE_SRV_CONFIG_LOOKUP))
+#define E_SRV_CONFIG_LOOKUP_GET_CLASS(obj) \
+       (G_TYPE_INSTANCE_GET_CLASS \
+       ((obj), E_TYPE_SRV_CONFIG_LOOKUP, ESrvConfigLookupClass))
+
+#define PRIORITY_OFFSET 100
+#define PRIORITY_DEFAULT E_CONFIG_LOOKUP_RESULT_PRIORITY_IMAP
+
+typedef struct _ESrvConfigLookup ESrvConfigLookup;
+typedef struct _ESrvConfigLookupClass ESrvConfigLookupClass;
+
+struct _ESrvConfigLookup {
+       EExtension parent;
+};
+
+struct _ESrvConfigLookupClass {
+       EExtensionClass parent_class;
+};
+
+GType e_srv_config_lookup_get_type (void) G_GNUC_CONST;
+
+G_DEFINE_DYNAMIC_TYPE (ESrvConfigLookup, e_srv_config_lookup, E_TYPE_EXTENSION)
+
+static void
+srv_config_lookup_domain_sync (EConfigLookup *config_lookup,
+                              const gchar *email_address,
+                              const gchar *domain,
+                              GCancellable *cancellable)
+{
+       struct _services {
+               const gchar *gio_protocol;
+               EConfigLookupResultKind kind;
+               const gchar *evo_protocol;
+               const gchar *display_name;
+               gint priority_base;
+       } known_services[] = {
+               { "imaps",      E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE,  "imapx",   _("IMAP server"),    
E_CONFIG_LOOKUP_RESULT_PRIORITY_IMAP },
+               { "imap",       E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE,  "imapx",   _("IMAP server"),    
E_CONFIG_LOOKUP_RESULT_PRIORITY_IMAP + PRIORITY_OFFSET / 2 },
+               { "pop3s",      E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE,  "pop",     _("POP3 server"),    
E_CONFIG_LOOKUP_RESULT_PRIORITY_POP3 },
+               { "pop3",       E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE,  "pop",     _("POP3 server"),    
E_CONFIG_LOOKUP_RESULT_PRIORITY_POP3 + PRIORITY_OFFSET / 2 },
+               { "submission", E_CONFIG_LOOKUP_RESULT_MAIL_SEND,     "smtp",    _("SMTP server"),    
E_CONFIG_LOOKUP_RESULT_PRIORITY_SMTP },
+               { "caldavs",    E_CONFIG_LOOKUP_RESULT_COLLECTION,    "caldav",  _("CalDAV server"),  
PRIORITY_DEFAULT },
+               { "caldav",     E_CONFIG_LOOKUP_RESULT_COLLECTION,    "caldav",  _("CalDAV server"),  
PRIORITY_DEFAULT + PRIORITY_OFFSET / 2 },
+               { "carddavs",   E_CONFIG_LOOKUP_RESULT_COLLECTION,    "carddav", _("CardDAV server"), 
PRIORITY_DEFAULT },
+               { "carddav",    E_CONFIG_LOOKUP_RESULT_COLLECTION,    "carddav", _("CardDAV server"), 
PRIORITY_DEFAULT + PRIORITY_OFFSET / 2 },
+               { "ldaps",      E_CONFIG_LOOKUP_RESULT_ADDRESS_BOOK,  "ldap",    _("LDAP server"),    
PRIORITY_DEFAULT },
+               { "ldap",       E_CONFIG_LOOKUP_RESULT_ADDRESS_BOOK,  "ldap",    _("LDAP server"),    
PRIORITY_DEFAULT + PRIORITY_OFFSET / 2 }
+       };
+
+       GResolver *resolver;
+       gint ii;
+       gboolean success = TRUE;
+
+       g_return_if_fail (E_IS_CONFIG_LOOKUP (config_lookup));
+
+       if (!domain || !*domain)
+               return;
+
+       resolver = g_resolver_get_default ();
+
+       for (ii = 0; success && ii < G_N_ELEMENTS (known_services); ii++) {
+               GList *targets;
+               GError *local_error = NULL;
+
+               targets = g_resolver_lookup_service (resolver, known_services[ii].gio_protocol, "tcp", 
domain, cancellable, &local_error);
+
+               if (local_error) {
+                       if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+                               g_clear_error (&local_error);
+                               break;
+                       }
+                       g_clear_error (&local_error);
+               } else {
+                       GList *link;
+                       gint index = 0;
+
+                       targets = g_srv_target_list_sort (targets);
+
+                       for (link = targets; link; index++, link = g_list_next (link)) {
+                               EConfigLookupResult *lookup_result;
+                               GSrvTarget *target = link->data;
+                               const gchar *hostname;
+                               gchar *description;
+
+                               if (!target)
+                                       continue;
+
+                               hostname = g_srv_target_get_hostname (target);
+                               if (!hostname || !*hostname)
+                                       continue;
+
+                               description = g_strdup_printf ("%s:%d", hostname, g_srv_target_get_port 
(target));
+
+                               lookup_result = e_config_lookup_result_simple_new (known_services[ii].kind,
+                                       known_services[ii].priority_base - PRIORITY_OFFSET,
+                                       FALSE,
+                                       known_services[ii].evo_protocol,
+                                       known_services[ii].display_name,
+                                       description);
+
+                               g_free (description);
+
+                               if (known_services[ii].kind == E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE ||
+                                   known_services[ii].kind == E_CONFIG_LOOKUP_RESULT_MAIL_SEND) {
+                                       CamelNetworkSecurityMethod security_method;
+                                       const gchar *extension_name;
+
+                                       extension_name = e_source_camel_get_extension_name 
(known_services[ii].evo_protocol);
+
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
extension_name, "host", hostname);
+                                       e_config_lookup_result_simple_add_uint (lookup_result, 
extension_name, "port", g_srv_target_get_port (target));
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
extension_name, "user", email_address);
+
+                                       if (g_str_has_suffix (known_services[ii].gio_protocol, "s"))
+                                               security_method = 
CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT;
+                                       else
+                                               security_method = 
CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT;
+
+                                       e_config_lookup_result_simple_add_enum (lookup_result, 
extension_name, "security-method",
+                                               CAMEL_TYPE_NETWORK_SECURITY_METHOD, security_method);
+
+                                       if (known_services[ii].kind == E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE)
+                                               extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+                                       else
+                                               extension_name = E_SOURCE_EXTENSION_MAIL_TRANSPORT;
+
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
extension_name,
+                                               "backend-name", known_services[ii].evo_protocol);
+                               } else if (known_services[ii].kind == E_CONFIG_LOOKUP_RESULT_COLLECTION) {
+                                       gboolean is_calendar = g_str_equal (known_services[ii].evo_protocol, 
"caldav");
+                                       gchar *url;
+
+                                       url = g_strdup_printf ("%s://%s:%d",
+                                               g_str_has_suffix (known_services[ii].gio_protocol, "s") ? 
"https" : "http",
+                                               hostname, g_srv_target_get_port (target));
+
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
E_SOURCE_EXTENSION_COLLECTION,
+                                               "backend-name", "webdav");
+
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
E_SOURCE_EXTENSION_COLLECTION,
+                                               is_calendar ? "calendar-url" : "contacts-url", url);
+
+                                       g_free (url);
+                               } else if (known_services[ii].kind == E_CONFIG_LOOKUP_RESULT_ADDRESS_BOOK) {
+                                       ESourceLDAPSecurity security;
+
+                                       e_config_lookup_result_simple_add_string (lookup_result, NULL, 
"parent", "ldap-stub");
+                                       e_config_lookup_result_simple_add_string (lookup_result, 
E_SOURCE_EXTENSION_AUTHENTICATION, "host", hostname);
+                                       e_config_lookup_result_simple_add_uint (lookup_result, 
E_SOURCE_EXTENSION_AUTHENTICATION, "port", g_srv_target_get_port (target));
+
+                                       if (g_str_equal (known_services[ii].gio_protocol, "ldaps"))
+                                               security = E_SOURCE_LDAP_SECURITY_LDAPS;
+                                       else
+                                               security = E_SOURCE_LDAP_SECURITY_NONE;
+
+                                       e_config_lookup_result_simple_add_enum (lookup_result,
+                                               E_SOURCE_EXTENSION_LDAP_BACKEND, "security-method",
+                                               E_TYPE_SOURCE_LDAP_SECURITY, security);
+                               } else {
+                                       g_warn_if_reached ();
+                               }
+
+                               e_config_lookup_add_result (config_lookup, lookup_result);
+                       }
+
+                       g_list_free_full (targets, (GDestroyNotify) g_srv_target_free);
+               }
+       }
+
+       g_object_unref (resolver);
+}
+
+static void
+srv_config_lookup_thread (EConfigLookup *config_lookup,
+                         const ENamedParameters *params,
+                         gpointer user_data,
+                         GCancellable *cancellable)
+{
+       const gchar *email_address;
+       gchar *domain;
+
+       g_return_if_fail (E_IS_CONFIG_LOOKUP (config_lookup));
+       g_return_if_fail (params != NULL);
+
+       email_address = e_named_parameters_get (params, E_CONFIG_LOOKUP_PARAM_EMAIL_ADDRESS);
+
+       if (!email_address || !*email_address)
+               return;
+
+       domain = strchr (email_address, '@');
+       if (!domain)
+               return;
+
+       domain = g_strdup (domain + 1);
+
+       srv_config_lookup_domain_sync (config_lookup, email_address, domain, cancellable);
+
+       g_free (domain);
+}
+
+static void
+srv_config_lookup_run_cb (EConfigLookup *config_lookup,
+                         const ENamedParameters *params,
+                         EActivity *activity,
+                         gpointer user_data)
+{
+       g_return_if_fail (E_IS_CONFIG_LOOKUP (config_lookup));
+       g_return_if_fail (E_IS_SRV_CONFIG_LOOKUP (user_data));
+       g_return_if_fail (E_IS_ACTIVITY (activity));
+
+       e_config_lookup_create_thread (config_lookup, params, activity,
+               srv_config_lookup_thread, NULL, NULL);
+}
+
+static void
+srv_config_lookup_constructed (GObject *object)
+{
+       EConfigLookup *config_lookup;
+
+       /* Chain up to parent's method. */
+       G_OBJECT_CLASS (e_srv_config_lookup_parent_class)->constructed (object);
+
+       config_lookup = E_CONFIG_LOOKUP (e_extension_get_extensible (E_EXTENSION (object)));
+
+       g_signal_connect (config_lookup, "run",
+               G_CALLBACK (srv_config_lookup_run_cb), object);
+}
+
+static void
+e_srv_config_lookup_class_init (ESrvConfigLookupClass *class)
+{
+       GObjectClass *object_class;
+       EExtensionClass *extension_class;
+
+       object_class = G_OBJECT_CLASS (class);
+       object_class->constructed = srv_config_lookup_constructed;
+
+       extension_class = E_EXTENSION_CLASS (class);
+       extension_class->extensible_type = E_TYPE_CONFIG_LOOKUP;
+}
+
+static void
+e_srv_config_lookup_class_finalize (ESrvConfigLookupClass *class)
+{
+}
+
+static void
+e_srv_config_lookup_init (ESrvConfigLookup *extension)
+{
+}
+
+void
+e_srv_config_lookup_type_register (GTypeModule *type_module)
+{
+       /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
+        *     function, so we have to wrap it with a public function in
+        *     order to register types from a separate compilation unit. */
+       e_srv_config_lookup_register_type (type_module);
+}
diff --git a/src/modules/config-lookup/e-srv-config-lookup.h b/src/modules/config-lookup/e-srv-config-lookup.h
new file mode 100644
index 0000000..e82961c
--- /dev/null
+++ b/src/modules/config-lookup/e-srv-config-lookup.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef E_SRV_CONFIG_LOOKUP_H
+#define E_SRV_CONFIG_LOOKUP_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+void e_srv_config_lookup_type_register (GTypeModule *type_module);
+
+G_END_DECLS
+
+#endif /* E_SRV_CONFIG_LOOKUP_H */
diff --git a/src/modules/mail-config/e-mail-config-remote-accounts.c 
b/src/modules/mail-config/e-mail-config-remote-accounts.c
index faeb5c3..f79d5c6 100644
--- a/src/modules/mail-config/e-mail-config-remote-accounts.c
+++ b/src/modules/mail-config/e-mail-config-remote-accounts.c
@@ -487,10 +487,11 @@ e_mail_config_remote_backend_init (EMailConfigRemoteBackend *backend)
 static gboolean
 mail_config_pop_backend_auto_configure (EMailConfigServiceBackend *backend,
                                        EConfigLookup *config_lookup,
-                                       gint *out_priority)
+                                       gint *out_priority,
+                                       gboolean *out_is_complete)
 {
        return e_mail_config_service_backend_auto_configure_for_kind (backend, config_lookup,
-               E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE, NULL, NULL, out_priority);
+               E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE, NULL, NULL, out_priority, out_is_complete);
 }
 
 static void
@@ -535,10 +536,11 @@ e_mail_config_nntp_backend_init (EMailConfigRemoteBackend *backend)
 static gboolean
 mail_config_imapx_backend_auto_configure (EMailConfigServiceBackend *backend,
                                          EConfigLookup *config_lookup,
-                                         gint *out_priority)
+                                         gint *out_priority,
+                                         gboolean *out_is_complete)
 {
        return e_mail_config_service_backend_auto_configure_for_kind (backend, config_lookup,
-               E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE, NULL, NULL, out_priority);
+               E_CONFIG_LOOKUP_RESULT_MAIL_RECEIVE, NULL, NULL, out_priority, out_is_complete);
 }
 
 static void
diff --git a/src/modules/mail-config/e-mail-config-smtp-backend.c 
b/src/modules/mail-config/e-mail-config-smtp-backend.c
index a96d76d..f74ae2f 100644
--- a/src/modules/mail-config/e-mail-config-smtp-backend.c
+++ b/src/modules/mail-config/e-mail-config-smtp-backend.c
@@ -386,14 +386,15 @@ mail_config_smtp_backend_insert_widgets (EMailConfigServiceBackend *backend,
 static gboolean
 mail_config_smtp_backend_auto_configure (EMailConfigServiceBackend *backend,
                                         EConfigLookup *config_lookup,
-                                        gint *out_priority)
+                                        gint *out_priority,
+                                        gboolean *out_is_complete)
 {
        EMailConfigSmtpBackendPrivate *priv;
        CamelSettings *settings;
        const gchar *mechanism;
 
        if (!e_mail_config_service_backend_auto_configure_for_kind (backend, config_lookup,
-               E_CONFIG_LOOKUP_RESULT_MAIL_SEND, NULL, NULL, out_priority))
+               E_CONFIG_LOOKUP_RESULT_MAIL_SEND, NULL, NULL, out_priority, out_is_complete))
                return FALSE;
 
        /* XXX Need to set the authentication widgets to match the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]