RoundCube Webmail Project LogoIt’s amazing how the little things can make all the difference in the world when we’re going from one system to another.

Last week I made the leap from Microsoft Outlook, which had been my primary email client for over seven years, to a self-hosted web-based solution called RoundCube. All in all the conversion has been pretty painless, but one area that needed a little work was the Contact page. By default, there are only four fields on the Contact page: Display Name, First Name, Last Name, and Email.

Suffice to say, this isn’t very much help if you have lots of contacts and want to store such useful pieces of information as Company Name, Phone Number or Address. Luckily, this can be easily fixed with just a simple modification to your database and a few other files.

Before getting too far, I’d like to give credit to the people at RoundCubeForum.net. I managed to find this quick little modification and quickly put it to use on my site.

That done and out of the way, let’s take a quick look at the Contact Form before any modifications are made:

RoundCube Contacts List (Before)

As you can see, it’s not too much to look at. It’s true that this will get the job done, however, there just isn’t much space available for useful information. While the developers that have worked hard to make RoundCube what it is, I’m at a loss to explain why they might have limited their contact list to such a simplistic set of data. Heck, considering what Hotmail, Yahoo! Mail and GMail give us, one would think the coding gurus responsible for this application would have ample sources of “inspiration”.

RoundCube Contacts List (After)

That said, after making some minor changes, this is what you’ll be greeted with when adding or editing a contact (click to enlarge).

This is pretty sexy, if I do say so myself.

Not only do we get the option to enter lots of extra information about each person, we also get the option to set someone as a “Global Contact”. This is something that I’m quite excited to see, as it means that an address found in my personal email account can be accessed by other accounts (such as my CarbonBlog, or day-job related email accounts). This will be a great time saver … so long as nobody else asks for webmail access to their accounts.

For this reason alone, I wouldn’t recommend making every contact in your list global. Instead, if you’re going to let other people access email accounts you’ve created for them through RoundCube, you might just want to make your own contact address global and call it “Admin”. This way, if anyone has a question or problem, they can just type in “Admin” and you’ll get that message.

Making the Changes

So, what had to change in order for these sexy fields to make their appearance? One data table and a few application files.

The Database:

Using Query Browser, PHPmyAdmin, or whatever method you prefer to access or modify your database, run the following ALTER statements against your RoundCube database. This will add the 15 new fields to your database:

ALTER TABLE `contacts` ADD `global_contact` TINYINT(1) NOT NULL default ‘0′;
ALTER TABLE `contacts` ADD `firm` VARCHAR(128) NOT NULL ;
ALTER TABLE `contacts` ADD `position` VARCHAR(50) NOT NULL ;
ALTER TABLE `contacts` ADD `p_tel` VARCHAR(30) NOT NULL ;
ALTER TABLE `contacts` ADD `p_fax` VARCHAR(30) NOT NULL ;
ALTER TABLE `contacts` ADD `p_mob` VARCHAR(20) NOT NULL ;
ALTER TABLE `contacts` ADD `p_address` TEXT NOT NULL;
ALTER TABLE `contacts` ADD `w_tel` VARCHAR(20) NOT NULL ;
ALTER TABLE `contacts` ADD `w_fax` VARCHAR(20) NOT NULL ;
ALTER TABLE `contacts` ADD `w_mob` VARCHAR(20) NOT NULL ;
ALTER TABLE `contacts` ADD `w_address` TEXT NOT NULL;
ALTER TABLE `contacts` ADD `notice` TEXT NOT NULL;
ALTER TABLE `contacts` ADD `email2` VARCHAR(128) NOT NULL ;
ALTER TABLE `contacts` ADD `email3` VARCHAR(128) NOT NULL ;
ALTER TABLE `contacts` ADD `email4` VARCHAR(128) NOT NULL ;

Once that’s done, you’ll need to make some modifications to some core files of your installation. The following files will need to be modified:

/program/include/rcube_contacts.inc
/program/include/main.inc
/program/localization/en_US/label.inc
/program/steps/mail/compose.inc
/program/steps/addressbook/edit.inc
/program/steps/addressbook/show.inc
/program/steps/addressbook/save.inc
/skins/default/templates/addressbook.html

Be sure to follow the instructions on the RoundCubeForum thread word for word, and I guarantee you won’t have an issue. Be sure to look out for that duplicate “global_contact” error that’s reported pretty quick, though. That said, I can say with confidence that you will have no issues with the changes. Of course this won’t stop me from making things a little easier for some of you.

If you run RoundCube 0.1 RC2, I’ve made the modified files available at the bottom of this post. All you’ll need to do is upload them against your server and over-write the existing files. Don’t forget to update your database before copying these files over, and be sure to have a backup. These files work perfectly on my server, but I’d hate for you to hit an unexpected snag and not have the option to go back.

All in all, this is one of the better modifications I’ve made to RoundCube. It will make the software that much more valuable to me, and this will put yet another nail in Outlook’s coffin. The next challenge, though, will be to integrate a calendar application and have my PDA syncronize it’s data accordingly. I think that’ll be the next project after Embink is out in Alpha or Beta, though :)
Are you using RoundCube? Have you modified it in any way? I’d love to hear what some other people have done with this webmail application.

Download the eight files here