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 763430 - Show additional GAL Attributes in Contacts
Show additional GAL Attributes in Contacts
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Contacts (Global Address List)
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-03-10 03:39 UTC by Gerrit.Schmitz
Modified: 2016-03-14 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample Reply from our Exchange Server (3.36 KB, text/plain)
2016-03-10 05:27 UTC, Gerrit.Schmitz
Details

Description Gerrit.Schmitz 2016-03-10 03:39:43 UTC
Hi again,
along the same lines as 
https://bugzilla.gnome.org/show_bug.cgi?id=677224
I'd like to request additional attributes in the Contacts Editor for GAL results.

At the moment I can only see Full Name (taken from t:Contact -> t:DisplayName) as well as one email (taken from t:Mailbox -> t:EmailAddress).

Can you please add more fields like secondary email addresses (from t:Contact -> t:EmailAddresses), phone numbers (from t:Contact -> t:PhoneNumbers), nickname (from t:Mailbox -> t:Name), SIP address (actually from t:Contact -> t:EmailAddresses -> t:Entry Key="EmailAddress1" for me) or work address (t:Contact -> t:PhysicalAddresses -> t:Entry Key="Business").

Especially phone numbers would be practical for our softphone :-)

Thanks.
Comment 1 Gerrit.Schmitz 2016-03-10 05:27:16 UTC
Created attachment 323588 [details]
Sample Reply from our Exchange Server

I have censored my phone number to 5s and  some strings. Replacements start with #.
Comment 2 Milan Crha 2016-03-10 14:51:27 UTC
Thanks for a bug report. The ResolveNamesResponse is not always such chatty. If you configure the evolution-ews to use Offline Address Book (OAB URL on the Receiving Email tab, then check the "Cache offline address book" on the Receiving Options tab and pick the right one from the list), then you'll be:
a) presented with richer information
b) will be able to browse the GAL in the Contacts view, not only search
   for the contacts

I'm not closing this in favour of the above, I agree with your request.
Comment 3 Gerrit.Schmitz 2016-03-11 01:36:10 UTC
Hi Milan,
I have already set up my evo for this. Fetch URL autodiscovers: http://#oabHost/OAB/#someGuid/oab.xml
I'm able to open this xml just fine in my browser too. 

I tried to find the cache on my machine:
~/.cache/evolution/addressbook$ du -hs .
632K	.
The full address book referred to in the XML is more like 200M.

Which process is responsible for the caching? Maybe applying ESW_DEBUG to it will help find out what's going on.
Comment 4 Milan Crha 2016-03-11 07:11:24 UTC
The OAB URL is not enough to use the offline GAL, you should also enable that feature and pick the right GAL from the list of available GALs, as described in comment #2.

It's the evolution-addressbook-factory process where the GAL is downloaded. You can run it as this:

   $ EWS_DEBUG=2 /usr/libexec/evolution-addressbook-factory -w

You can also check ~/.cache/evolution/sources/ folder for a .source file which contains the GAL reference (it might have something like "Global Address List" included in it, without the quotes).

If your GAL is truly 200MB large, then I can imagine that the local copy of it can be a problem.

I'm working on the richer output from the ResolveNames for the next version right now.
Comment 5 Gerrit.Schmitz 2016-03-11 07:38:56 UTC
Hi Milan,
"Global Address List" is the only option when I click "Fetch List".

In the folder you specified, I find a few of these source files in a folder named
./1457442677.11335.1@#hostname/1457487872.20677.3@#hostname.source

#hostname being the hostname of my client. Two of these have
DisplayName=Global Address List
and are pretty much identical (except [Contacts Backend] IncludeMe=false). Another one is named {#guid}. I have been wondering about that entry as well for a while.
Could this be a problem?

I switched the adressbook factory to debug and will monitor the situation. I could already see it download the XML:
<?xml version="1.0" encoding="UTF-8"?>
<OAB>
	<OAL id='#guid' dn='/' name='\Global Address List'>
		<Full seq='3466' ver='32' size='46081462' uncompressedsize='253259915' SHA='5b683242d67ca3ea8b27ed53d434087054642c62'>
			#guid-data-3466.lzx
		</Full>
[...]

Looks like 200M unpacked to me. Network shouldn't be a problem. I just downloaded the lzx with more than 30M/s :-) Does evo persist this file on disk somewhere?

The AD Factory hasn't done anything in the last 10min since displaying that XML.
Comment 6 Milan Crha 2016-03-11 08:28:12 UTC
Yes, the offline GAL is stored in
   ~/.cache/evolution/addressbook/<gal-source-UID>
You should see some debug prints about the EWS GAL even when you only run the addressbook factory without that EWS_DEBUG exported. As you see the factory touching this OAB file I'd say you've it setup properly.

The IncludeMe is for Birthdays&Anniversaries calendar.

I made necessary changes in the code to read more detailed information from the ResolveNames response, if available:

Created commit ad0decd in ews master (3.19.92+)
Comment 7 Gerrit.Schmitz 2016-03-11 09:13:52 UTC
Hi Milan,
can I fix the duplicate GAL somehow? What would happen if I delete the whole folder?

Thanks for the commit. I presume this will be part of the next stable release (3.20) scheduled for 21st?

Best Regards
Gerrit
Comment 8 Milan Crha 2016-03-11 11:30:28 UTC
(In reply to Gerrit.Schmitz from comment #7)
> can I fix the duplicate GAL somehow? What would happen if I delete the whole
> folder?

Anything in the ~/.cache/evolution/ can be discarded, with an effect of the re-download of the remote content, eventually re-discovery of the sources. The only problem is that the folder is sort-of private folder of the evolution and evolution-data-server, thus you should play with it only when all other evolution processes (also those background, `ps ax | grep evolution`) are not running.

> I presume this will be part of the next stable release (3.20) scheduled
> for 21st?

Correct.
Comment 9 Gerrit.Schmitz 2016-03-14 01:42:05 UTC
Hi Milan,
still trying to find that
> will be able to browse the GAL in the Contacts view, not only search for the contacts
feature you were referring to.
I have cleaned out the addressbook following your instructions and collected the factory's stdout:
================================================================
Ewsgal: Fetching oal full details file 
Ewsgal: Downloading full gal 

(evolution-addressbook-factory-subprocess:21829): libebookbackend-WARNING **: Unable to update gal : 404 Not Found 

Ewsgal: Fetching oal full details file 
Ewsgal: Downloading full gal 
OAL file downloaded #localPath.lzx
OAL file decompressed #localPath/Global Address List-3472.oab 
Ewsgal: Removing old gal 
Ewsgal: Replacing old gal with new gal contents in db 
Total records is 475211 
GAL processing contacts, 1% complete (4753 added, 0 changed, 0 unchanged
[...]
GAL processing contacts, 100% complete (475211 added, 0 changed, 0 unchanged
GAL removing 0 contacts
GAL update completed successfully in 172620956 µs. Added: 475211, Changed: 0, Unchanged 0, Removed: 0
Ews gal: sync successful complete
================================================================
I do not spot any error messages here (except for the 404, but I suppose that  refers to the local folder missing). The only places I see full information in my Contacts tab is "Contacts" and "Skype for Business Contacts" for items I cpied there through Outlook and SfB. If I do the same with evolution I only see the restricted number of attributes.
Maybe you can attach a screenshot of that GAL Browser you mentioned?
Thanks
Gerrit
Comment 10 Gerrit.Schmitz 2016-03-14 05:12:24 UTC
Nvm.
I restarted my client for other patches and now "Global Address List" returns what seems to be the whole profile.
Thanks for your patience!
Comment 11 Milan Crha 2016-03-14 17:00:03 UTC
(In reply to Gerrit.Schmitz from comment #10)
> I restarted my client for other patches and now "Global Address List"
> returns what seems to be the whole profile.
> Thanks for your patience!

You are welcome. The "browser" is not a browser as such, I meant with that "can browse the address book", that you'll see the address book content in the same way as if it was an On This Computer address book.