Adding Google Contacts to Roundcube Webmail

 

This article describes the necessary steps to integrate one's Google-based address book to the Roundcube web-based IMAP client.

For people who tend to keep their personal information like contacts data in one self-managed place, it must seem rather lame to store those data at Google's. Yet, there are virtually no free open source address books out there that could do what Google offers: full bidirectional sync with basically all mobile devices and support for major protocols. Therefore, using Google as storage for contacts data seems appropriate for the time being. Also, the integration with Google's Calendar works like a charm. But that's for another article.

Download of Google Contacts plugin

The necessary plugin can be retrieved from the following website: http://sourceforge.net/projects/roundcubegoogle/files/. It is supposed to be stored in Roundcube's plugins folder, where it is unpacked by:

tar xzf google_contacts-.tar.gz

There is a config file alongside with the archive. It's options do not need customization for general needs.

Creating the database table

In the plugin's SQL-subfolder there is a file called mysql.initial.sql. After creating a new table called google_contacts in your Roundcube's database, import the file mysql.initial.sql into the new table.

Installation of Zend package

The Google Contacts plugin needs the Zend GData APIs for it to work. Download the most recent version from http://framework.zend.com/download/webservices and place it into Roundcube's program/libs folder. After unpacking the according archive, a folder called ZendGdata-<version_number> should be there. In order to have Roundcube finding the relevant libs, create a symbolic link in program/libs as follows:

ln -s ZendGdata-1.11.10/library/Zend .

Configure Google Contacts access

If all went right there should be a new option in a user's Roundcube settings. Under the section "Address Book" it is now possible to enter one's Google account name and password. The next access to the user's address book in Roundcube will trigger the sync with Google's address book so that all existing contacts will be available.

Leave a comment ?

11 Comments.

  1. There is one bug: The programm is missing a column ‘words’ in the field list of the table google_contacts. After inserting this column the programm works fine.
    The same bug is in the contacts field list, so you are not able to import vCards.

  2. Got most of this setup but I’m having problems with the ZendGdata part I think. How does one create a symbolic link? Thanks.

  3. I too think I’ve hit a wall with the Zend part, it’t probably because I’m on shared hosting with cPanel. Any idea’s how to get around this?

  4. Doh, forgot to enable it in RC’s global config!

  5. Do you have a solution for Google error: “User is over quota”? I know that exponential backoff solves the problem – but how?

  6. Is there any support for contact groups? It does not seem to be syncing my contact groups from Google Contacts…

  7. This HowTo is outdated and not working like this anymore.
    Starting with the link for Zend, which is a 404.
    So which Zend to take?
    I took: Zend Framework 1.12 full (recommended)
    You need to sign up for an account there to download the free Libraries.
    I created the symbolic link, although it is not written in the Installation howto on the plugin site.

    Now I have Google Contacts in my addressbook settings.
    But it is not working, I get all the time some Server errors (forbidden), which is maybe not related to the plugin.
    I have to find out.
    Anyway, the wrong authentification did one bad thing:
    It deactivated my real google account, I have to reset a new password now, grrr.

    Don’t forget to set the rights (chown) to the webserver ;)

  8. This is great – just what I needed. However, it takes a long time to load the page each time I log in. Is there anyway to fire off the sync process manually with a button, or possibly automatically at login, rather than at the first time the Google Contacts address book is clicked?

    Thanks for the hard work!

  9. The link to the Zend Gdata API is broken. You might want to use this: http://framework.zend.com/downloads/latest

    Unfortunately syncing doesn’t work so well with many contacts. I got “Expected response code 200, got 503 Temporary problem – please try again later and consider using batch operations. The user is over quota.” when i click on the google addressbook. Maybe you can add some throttling to enable sycing for many contacts.

  10. If it does not work with the addressbook, simply call http://www.google.com/accounts/DisplayUnlockCaptcha and then try again. Worksforme.

  11. This is now entirely dead due to api deprecation.

    Technically, it was supposed to die on April 20, 2015, but they left it working for an extra month.

    https://developers.google.com/identity/protocols/AuthForInstalledApps?csw=1

Leave a Comment