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 792411 - Use GetUserPhoto to lookup sender's photo
Use GetUserPhoto to lookup sender's photo
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Contacts (Global Address List)
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-01-10 18:41 UTC by Paul Stejskal
Modified: 2018-01-18 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Stejskal 2018-01-10 18:41:28 UTC
https://mail.gnome.org/archives/evolution-list/2016-March/msg00138.html

The GetUserPhoto field is a simple field and should be integrable into Evolution's contact photos very easy and also using the "Face" header field.

This commit: https://git.gnome.org/browse/evolution-ews/commit/?id=a36e18ae1b was supposed to implement it but as of Ubuntu 17.10 it doesn't work. I'm not too familiar if that commit got merged or not, but it should be easy to implement.
Comment 1 Milan Crha 2018-01-11 13:07:59 UTC
Thanks for a bug report. This information is slightly different from the one in more recent (sub)thread:
https://mail.gnome.org/archives/evolution-list/2018-January/msg00074.html

What I understood from the latest thread is that you'd like to use GetUserPhoto to populate photo of a sender, like the Face header.

I didn't think of the [offline] Global Address List (GAL) content for it. I've two reasons for it:
a) the offline GAL already contains that information, thus it would be
   redundant to also try with GetUserPhoto (the commit you reference
   landed for 3.19.90, thus it's in your sources for sure)
b) the GetUserPhoto can slow things down significantly, imagine a GAL with
   10.000 contacts, evolution-ews asking for each single of them whether
   there's a photo for it.

You may verify that you use offline GAL, in mail account Properties->Receiving Options->and at the bottom is an option to use offline GAL, "Fetch List" of GALs and pick one of them to use (most servers have configured only one GAL, I'd guess). After such change you might restart the addressbook factory subprocess for the EWS account, which you can do (by restarting also all background processes of evolution and evolution itself) when you run in a terminal:

   $ evolution --force-shutdown

Then run evolution again. To verify that you use offline GAL just go to the Contact view and there select the GAL under your EWS account. If you'll see the information about contacts without a need to search for anything, then you likely use the offline GAL. The offline GAL usually provides more information than the ResolveNames result, including photos, if they are set on the contacts.

I'll left this bug report to implement the GetUserPhoto for a lookup of a sender "Face" image for the message preview only.
Comment 2 Paul Stejskal 2018-01-11 16:25:59 UTC
So yes, offline GAL is working. There are just no pictures. I've complete killed off each process (not in the manner you discussed, but did a ps aux | grep evo, then kill pid pid pid pid...) so I know it has taken effect. I've also rebooted. Looking up contacts or using the face plugin neither shows the pictures. 

This is functionality Outlook has and is one more thing to bring to feature parity with Outlook.
Comment 3 Milan Crha 2018-01-11 18:15:16 UTC
While playing with a change for this, the GetUserPhoto is supported in Exchange 2013 and newer servers, I realized that I also do not see user photos in my offline GAL for a 2013 server, while the photos are returned from the GetUserPhoto operation. That might be some change on the server side, because I see photos for offline GAL contacts in a 2010 server, that they do not include images in the GAL, or they use a different property.

I still cannot imagine to ask 10K times the server to give me a photo of a user after updating the GAL (and 10K is a pretty low number, I know there are companies with 100K+ contacts in the GAL).

That looks like we've two issues here. The first is the offline GAL doesn't contain (or evo-ews doesn't extract from it) user photo. And the second, the GetUserPhoto operation can be used to get user photo from an Exchange server.
Comment 4 Milan Crha 2018-01-11 18:47:42 UTC
I made the below change for the second part of this bug. I'll close the bug too, it'll be better to not mix the two things together. Though I also looked into the GAL content (as returned by the server and decoded on the EWS side) and if I didn't overlook anything, then the GAL doesn't have images included. I see them in my own address book, but not in GAL. I'll try to check one more thing tomorrow, but it seems, on the first look, that we are out of luck with images in offline GAL. I'll update this bug report with my further findings.

Created commit 4785f63 in ews master (3.27.90+)
Comment 5 Milan Crha 2018-01-11 18:51:22 UTC
(In reply to Milan Crha from comment #4)
> I'll update this bug report with my further findings.

Ah, this was quick. Looking into the .oab file in the local evolution-ews cache, it really doesn't contain any contact photos. Thus the above change will add photos at least in the message preview.
Comment 6 Paul Stejskal 2018-01-15 15:13:07 UTC
Should I file another bug for the contact photos?
Comment 7 Milan Crha 2018-01-15 17:41:30 UTC
I suppose you mean contact photos in (offline) GAL. Well, if the server doesn't provide them (and it truly doesn't with the offline address book), then I'm not in favour of using GetUserPhoto for each single contact in GAL. As I said above, there are companies with thousands of contacts in the GAL, thus trying to get the photo for each of them would be time and bandwidth consuming and with a proper policy settings on the server it (the server) can ban the users due to "too much activity" (see bug #784058).
Comment 8 Paul Stejskal 2018-01-15 17:44:17 UTC
Hmm. How does Outlook do it? Would we need to be able to query the GAL and sync the Offline GAL?

Would it be possible to provide a lookup say via LDAP? My company has that in their AD servers (we use O365 for e-mail).
Comment 9 David Woodhouse 2018-01-15 18:10:02 UTC
Perhaps this should be done on the evolution side along the same lines as the gravatar module?
Comment 10 Milan Crha 2018-01-15 18:14:57 UTC
(In reply to Paul Stejskal from comment #8)
> How does Outlook do it?

Yes, that's a very good question, for which I do not have answer, unfortunately. I've also quite old Outlook, thus cannot test/debug it here.

> Would it be possible to provide a lookup say via LDAP?

You can configure LDAP book if you know the parameters. It can live beside EWS or anything else.

> Perhaps this should be done on the evolution side along the same lines as
> the gravatar module?

That's exactly what I did (see comment #4). That doesn't populate the photo in the local GAL cache, of course.
Comment 11 Paul Stejskal 2018-01-15 18:26:25 UTC
I'm a little confused? If I understand correctly, GAL and Offline GAL are two different things, the key difference being offline stored locally, or online, where it queries the server.
Comment 12 Milan Crha 2018-01-15 18:33:13 UTC
Yes, that's correct. The Online GAL uses ResolveNames, which doesn't provide that many information as offline GAL, neither as regular contacts. Did you mean to download also picture when using online GAL? Note that online GAL requires searching to work.
Comment 13 Paul Stejskal 2018-01-15 18:34:05 UTC
Yes I did mean searching.
Comment 14 Milan Crha 2018-01-15 18:39:37 UTC
Ah, I see, that's my fault then. I'm sorry about that. You can file a new bug for it, then it'll be investigated and discussed there what can be done with it (like when the search returns 100 contacts, should each of them be queried also for the user photo? It'll slow things down significantly). Thanks.
Comment 15 Joakim Tjernlund 2018-01-18 17:33:50 UTC
Could we have this for evo 3.26 too? I really like to se some photos now
and waiting for 3.27 to appear here is too long.
Comment 16 Paul Stejskal 2018-01-18 17:38:25 UTC
Submitted bug https://bugzilla.gnome.org/show_bug.cgi?id=792653 for contacts. My vote was to pull a picture up if a contact is clicked in the search, not before. Seems the most reasonable compromise to me.
Comment 17 Milan Crha 2018-01-18 17:45:27 UTC
(In reply to Joakim Tjernlund from comment #15)
> Could we have this for evo 3.26 too? I really like to se some photos now
> and waiting for 3.27 to appear here is too long.

The change cannot be backported, it uses new ESimpleAsyncResult API provided by Evolution. Even if not, then I would hesitate to do it in the stable sources, because it requires some testing first (in some real environment, not only in my test environment) and breaking the code just before (almost) the last stable release is not a good idea.

(In reply to Paul Stejskal from comment #16)
> Submitted bug https://bugzilla.gnome.org/show_bug.cgi?id=792653 for
> contacts.

Thanks.