After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664116 - "Fetch URL" doesn't always work
"Fetch URL" doesn't always work
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Miscellaneous / EWS Core
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-11-15 15:29 UTC by Milan Crha
Modified: 2011-12-01 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed ews patch (6.67 KB, patch)
2011-11-15 16:04 UTC, Milan Crha
reviewed Details | Review
proposed ews patch ][ (8.40 KB, patch)
2011-11-23 10:36 UTC, Milan Crha
none Details | Review
proposed ews patch ]I[ (8.74 KB, patch)
2011-11-24 17:41 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2011-11-15 15:29:23 UTC
For cases where email domain doesn't match server's host name the fetch URL and whole autodiscover doesn't work. What is usually done when user enters
   user@email.com
is that the autodiscover gets
   email.com
and tries to construct the autodiscover URL from it, but, for example, mine server doesn't use email.com, but server.com there. Since the EWS prefills the Host URL, I suggest to use that host name instead, and if that fails then check with email.com domain name.
Comment 1 Milan Crha 2011-11-15 16:04:03 UTC
Created attachment 201452 [details] [review]
proposed ews patch

for evolution-ews;

This may do it, same as cover the case where user name is not the same as an email.
Comment 2 Marko Myllynen 2011-11-16 11:15:26 UTC
Thanks for the patch, I can confirm it solves the issue for me.
Comment 3 Chenthill P 2011-11-23 08:54:47 UTC
Review of attachment 201452 [details] [review]:

::: src/server/e-ews-connection.c
@@ +1266,3 @@
+		url1 = g_strdup_printf ("https://%s/autodiscover/autodiscover.xml", domain);
+		url2 = g_strdup_printf ("https://autodiscover.%s/autodiscover/autodiscover.xml", domain);
+	}

This fails to work if I use the pre-filled  uri (where server is exchange.com) and my actual server was the domain part of the email id. It would be nice if you can change the code to execute both cases if the first case fails.

And return back the error if both cases fail.
Comment 4 Milan Crha 2011-11-23 10:36:03 UTC
Created attachment 201981 [details] [review]
proposed ews patch ][

for evolution-ews;

Is this working better? It invokes 4 requests in parallel, instead of two.
Comment 5 Pablo Saavedra 2011-11-24 14:00:05 UTC
Since you are already on it, for the particular case of my company, the autodiscover only works if http is used instead of https. Do you think I should ask our sysadmin to change that or is something that EWS should support?

Thanks.
Comment 6 Milan Crha 2011-11-24 16:58:59 UTC
Hmm, interesting idea. When you click the fetch URL button then both Host URL and OAB URL are populated with received values, thus what about using the protocol from the Host URL as filled before you click the Fetch URL button? It might not be that obvious, especially when it's prefilled with https now, but I believe it's better than doing 8 requests in parallel.
Comment 7 Pablo Saavedra 2011-11-24 17:26:36 UTC
If you create a patch for that I can give it a try using my setup. Right now I hardcoded the protocol to http to make it work.
Comment 8 Milan Crha 2011-11-24 17:41:33 UTC
Created attachment 202078 [details] [review]
proposed ews patch ]I[

for evolution-ews;

Updated patch, to use autodiscover method based on the method from Host URL. Might not be that great, though, because imagine your private information is transferred over the network insecurely. We can move back to patch ][ if needed, there is no other change than this one in this patch.
Comment 9 Chenthill P 2011-12-01 08:11:08 UTC
Comment on attachment 202078 [details] [review]
proposed ews patch ]I[

Looks good. Better to pick-up the protocol from the uri. Since https:// is set as the default, I hope the user would be aware of what he is doing while changing it. Please commit the patch.
Comment 10 Milan Crha 2011-12-01 09:55:19 UTC
Created commit 68a53eb in ews master (3.3.3+)