[evolution] I#642 - Prefer https:// when fetching server's autoconfig/config-v1.1.xml



commit d5568eb40b135f5b6becd2ca6308c3a9855c6fb0
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 15 11:00:22 2019 +0200

    I#642 - Prefer https:// when fetching server's autoconfig/config-v1.1.xml
    
    Closes https://gitlab.gnome.org/GNOME/evolution/issues/642

 src/mail/e-mail-autoconfig.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/mail/e-mail-autoconfig.c b/src/mail/e-mail-autoconfig.c
index ea27ed7db5..d495ea42f2 100644
--- a/src/mail/e-mail-autoconfig.c
+++ b/src/mail/e-mail-autoconfig.c
@@ -510,6 +510,12 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig,
                        (GDestroyNotify) g_object_unref);
 
        /* First try user configuration in autoconfig.$DOMAIN URL and ignore error */
+       if (!success && ((error && !*error && !g_cancellable_set_error_if_cancelled (cancellable, error)) || 
!g_cancellable_is_cancelled (cancellable))) {
+               uri = g_strconcat ("https://autoconfig.";, domain, "/mail/config-v1.1.xml?emailaddress=" 
FAKE_EVOLUTION_USER_STRING "%40", domain, "&emailmd5=", emailmd5, NULL);
+               success = mail_autoconfig_lookup_uri_sync (autoconfig, uri, soup_session, cancellable, NULL);
+               g_free (uri);
+       }
+
        if (!success && ((error && !*error && !g_cancellable_set_error_if_cancelled (cancellable, error)) || 
!g_cancellable_is_cancelled (cancellable))) {
                uri = g_strconcat ("http://autoconfig.";, domain, "/mail/config-v1.1.xml?emailaddress=" 
FAKE_EVOLUTION_USER_STRING "%40", domain, "&emailmd5=", emailmd5, NULL);
                success = mail_autoconfig_lookup_uri_sync (autoconfig, uri, soup_session, cancellable, NULL);
@@ -517,6 +523,12 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig,
        }
 
        /* Then with $DOMAIN/.well-known/autoconfig/ and ignore error */
+       if (!success && ((error && !*error && !g_cancellable_set_error_if_cancelled (cancellable, error)) || 
!g_cancellable_is_cancelled (cancellable))) {
+               uri = g_strconcat ("https://";, domain, 
"/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=" FAKE_EVOLUTION_USER_STRING "%40", domain, 
"&emailmd5=", emailmd5, NULL);
+               success = mail_autoconfig_lookup_uri_sync (autoconfig, uri, soup_session, cancellable, NULL);
+               g_free (uri);
+       }
+
        if (!success && ((error && !*error && !g_cancellable_set_error_if_cancelled (cancellable, error)) || 
!g_cancellable_is_cancelled (cancellable))) {
                uri = g_strconcat ("http://";, domain, 
"/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=" FAKE_EVOLUTION_USER_STRING "%40", domain, 
"&emailmd5=", emailmd5, NULL);
                success = mail_autoconfig_lookup_uri_sync (autoconfig, uri, soup_session, cancellable, NULL);


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