Search form

Google Contacts via ActiveSync

Synchronizing Google Contacts via SyncML works, but is limited quite a bit by Google's incomplete vCard support. For example, birthday information does not sync because BDAY is not supported by Google's SyncML implementation. Using ActiveSync as protocol works better. This time the protocol and not so much its implementation are the limiting factor: ActiveSync only supports one cell phone number per contact. It does not distinguish between work and private email addresses and only syncs a limited number of them.

SyncEvolution supports ActiveSync in combination with activesyncd. activesyncd can provide access to email, contacts and events. This HOWTO focuses on the usage for contact syncing with Google.

Installation

Binaries of activesyncd and the SyncEvolution backend using it are provided as separate packages on syncevolution.org. In contrast to the normal SyncEvolution bundle packages, a Linux distribution like Debian Wheezy with Evolution 3.4 is required to run these binaries.

To install the .deb packages, add the "experimental" repository and run

Replace "john.doe@gmail.com" with your own email address at Google. It must be the main email address for the Google account, not some foreign email address added to it. Using the email address as account name in gconf is a convention in activesyncd; some other string could also be used.

activesyncd will run ssh-askpass to request a password the first time it needs it, then store the password in GNOME keyring for later use. If that password becomes invalid, activesyncd will ask again.

This creates a so-called "target configuration" that can be used to access the data in Google in a local sync where the other side is a local database. See the command line documentation for an explanation of these concepts.

To synchronize contacts, a second configuration, called "sync configuration" is needed:

This uses the default database for "addressbook" in the default context. See the KDE Wiki page for an explanation how that can be changed prior (or after) setting up this sync configuration. The name of the sync configuration ("google-eas") was chose so that it is identical to the context name in the target configuration. This is not required, the real
link between the two configs is defined by the syncURL property.

Accessing and synchronizing data

The command for running an actual sync is the same as for all sync configurations. The GTK UI can also be used to trigger the sync.

$ syncevolution google-eas

Google adds photo data to contacts that it recognizes. This photo data is sent to the client in future syncs.

Known Limitations

The ActiveSync data model is limited to the following fields per contact:

phone numbers: two home, two work, one cell, one home fax, one work fax, one car phone, one radio

addresses:

one home, one work, one other

the "PO box" part of an address is not supported

three email addresses without type information

three instance messaging handles (without type, and activesyncd does not support that yet)

birthday and anniversary (as UTC date + time, not just the date)

web page

nickname

pager

role (aka title)

photo

manager, assistant, spouse

company, department, office location

"file as" string

categories

ActiveSync does not have:

explicit full name

extended URL information:

blog (X-EVOLUTION-BLOG-URL)

calendar (CALURI)

free-busy (FBURL)

video chat (X-EVOLUTION-VIDEO-URL)

flag whether recipient wants HTML email (X-MOZILLA-HTML)

ordering of phone or email addresses (X-EVOLUTION-UI-SLOT)

Google's implementation has some restrictions not seen with Exchange:

The "file as" string is overwritten.

Photo data gets re-encoded on the server. Photos which are too large (for example, 640 pixels wide) can be stored, but are not shown by the Google web API.

Categories are lost.

Only the date part of a birthday or anniversary seems to be stored; this is similar to how Evolution works. ActiveSync forces both Google and SyncEvolution (resp. activesyncd) to add a time. SyncEvolution adds 00:00, as if the person was born on midnight UTC. It strips that time from incoming contacts and keeps other times. Google returns such contacts with a different time added to it, which can shift the date away from the right date.

Syncing will try to map all local data to these fields as good as it can. In some cases, for example phone numbers and addresses, this implies throwing away some type information. At the moment, SyncEvolution has no workaround for modified or lost information and will use the updated resp. cleared values when importing an updated contact from Google.

"refresh from local" and uploading many contacts is slow. The slowness is caused by inefficient use of the ActiveSync protocol (each change is a separate request) and will be addressed in future SyncEvolution releases (by batching changes in one request).

While talking to Google via ActiveSync, there is often no visible progress report. For example, a slow sync starts by downloading all contacts. That can take a while without even explaining that this operation is currently happening. Need to add more INFO messages to SyncEvolution.

In the Google web UI, deleted contacts (regardless whether they were deleted during an incremental or refresh sync) are still visible as "other contacts". They can be removed in the web UI.

Because a target config uses state information tied to the activesyncd account config, it is not possible to use multiple sync configurations with the same target. For the same reason, the command line --export operation on a target configuration breaks incremental syncing. Only use it when prepared to do a refresh or slow sync.

Dumping the entire content of the Google address book before and after a sync (dumpData and printChanges properties in the target config) is not possible. There are several reasons: during an incremental sync, the server only sends changes. It can be asked to start over and send all changes, but then the incremental sync no longer works. Requesting individual, unchanged contacts is supported by the ActiveSync protocol and activesyncd, but not implemented by Google.

Troubleshooting

If activesyncd fails to start, then missing libraries might be the reason. Check that "ldd /usr/libexec/activesyncd" does not mention any missing libraries.

For similar reasons the SyncEvolution ActiveSync backend, syncactivesync.so, might fail to work. Check with

$ SYNCEVOLUTION_DEBUG=1 syncevolution --daemon=no --version

To check whether your data was uploaded correctly to the server and what kind of data might get lost when replacing local data with the server's copy, export the data to a file and run synccompare so that it ignores some known issues (like FN = full name and X-EVOLUTION-UI-SLOT):

Beware that this will break incremental syncing, be prepared for a slow or refresh sync.

I can successfully install and below are my syncevolution version and backend command output. Then I try to use gconftool per describe in this document, somehow I cannot find
/apps/activesyncd/accounts folder and fail when I execute below commands.

Is anyone can help to advice what I missing or any guide that can help me to sync with an ActiveSync server(hotmail), I appreciate for the Help, Thanks.

james@ubuntu:~$ syncevolution backend=?
'backend=?'
Specifies the SyncEvolution backend and thus the
data which is synchronized by this source. Each
backend may support multiple databases (see 'database'
.......
.......
Currently active::

Hi.
I have figured out the gconftool issue(sorry for my previous mis-configure for gconftool)
Somehow, I try with below command, but it seem fail to sync with hotmail.com. (I just replace https://m.google.com to https://m.hotmail.com and also google-eas change to hotmail-eas)

It show "Unsupported version header in the request", is that relative to that hotmail is run on EAS protocol 14.0?

Can you comment what EAS protocol of activesyncd is current running? (12.0, 12.1, 14.0 or 14.1?)
or advice what additional step in order to sync with Hotmail? Thanks a lot!!!