June 29th, 2008How To Install RoundCube on a MidPhase Server
It’s amazing how something as simple as a printer can change our opinion on a technology but, in the case of webmail, this is exactly what’s happened.
Webmail has been relatively popular for half-a-dozen years. Hotmail, Yahoo!Mail and GMail have all enjoyed huge levels of success due to their simplicity and accessibility. As the internet became available in more places, people benefited from the ability to send, read and access their email from almost any location around the world. No longer was it necessary to carry around a notebook, or configure an email client such as Outlook or Thunderbird to access a POP3 or IMAP account somewhere. Within 30 seconds of creating an account with one of the big three providers, people would be emailing their friends and gleefully receiving spam.
But I didn’t like it. Not only was it possible for someone to look over our shoulder and grab our login information, but this required an incredible amount of trust on the part of the email providers. They will keep a copy of every email we’ve sent or received. If we were developing a new technology or otherwise passing along sensitive information via email (just because it shouldn’t be done, doesn’t mean it isn’t), then these organizations could theoretically take it and put the technology to use before anyone else.
Perhaps I’m just a little too paranoid.
However, for this reason, I’ve often preferred to use an email client such as Microsoft Outlook to handle my emailing and scheduling needs. It’s always worked well with my PDAs, whether Palm or Windows Mobile based, and the only disk space limitations I would face would be the amount of hard disk I have available on my PCs. That said, this is no longer a viable option … I need to send emails from work, now. Rather than start up a GMail account or make use of Hotmail, though, I’d much rather install a webmail application on my web server, where it could be used not only by me, but several people who also have email accounts with me.
Before this intro gets too much longer, I should mention that I do often send email via my HP iPaq. However, now that I am taking on new roles with my employer, I need to send and receive attachments through my email account. This just isn’t very workable with my PDA, which requires me to go outside to “borrow” a nearby hotel’s open WiFi connection. To that end, I needed to install a webmail client that was both versatile and easy to use. I’ve worked with SquirrelMail and Horde in the past, but nothing was quite so fun to work with as RoundCube.
The RoundCube Webmail Project
RoundCube is a browser-based IMAP webmail client with great multi-lingual support and an application-like interface. Like most full-featured email clients, it has support for MIME, spell checking, an address book, folders, message searching and more. The application is written in PHP and, like many other PHP-based applications, requires a MySQL database. What’s really nice is that the interface is fully customizable, and can be redesigned with standard XHTML and CSS2.
Although still in beta, the application is pretty stable. Rarely have I ever had a problem with it and, when I have, it was usually a small minor thing like having a “Message Cannot be Moved” message when organizing my archives. This would usually be resolved by a simple refresh of the screen.
Currently, RoundCube is at version 0.2 Alpha 1 but, I should mention, this version will not work on MidPhase severs unless you can modify the php.ini file. The issue seems to be with the “magic_quotes_gpc” setting, as MidPhase has this set at 1 by default. Unfortunately, RoundCube needs this to be set at 0.
Luckily, there are ways to get around this. In my case, I used a previous release of RoundCube. Version 0.1 to be exact. SourceForge has the previous releases, or you can download the version I had used from my server here.
Now the easy part … create a subdomain called “roundcube” or whatever you’d like, and upload the files. I wouldn’t use the names of “mail” or “webmail”, though. mail.yoursite.com is used as the mail server, and webmail.yoursite.com could be filtered out by commercial filtering programs. This is the case with my employer, so I went with roundcube.j2fi.net.
You’ll need to create a MySQL database, and you can call this whatever you’d like. It would also be a good idea to create a new login and grant it full access to the new database.
Next, open the db.inc.php.dist file in the config folder, and enter your database information. Be sure to save this as db.inc.php afterwards, otherwise you’ll receive an error. The same is said for the main.inc.php file. Although it’s not absolutely necessary, you may want to update the main.inc file for your preferences as well.
From here you’ll want to create the MySQL data tables (this is not an automatic process … yet). The code to create the tables is found in the SQL directory. Open the file that best describes your database (in the case of MidPhase users, it would be the mysql5.initial.sql file) and run that code against your new database. This can be done either in phpMyAdmin or something better like Query Browser.
Be sure to make sure that you have a “logs” and “temp” directory in your webmail directory, and these directories are writable. RoundCube uses these two directories quite a bit, and you won’t get very far without being able to write to these places. That said, you don’t want to grant full access to these directories (or the “config” directory) as this could be a security risk. Instead, be sure that the directories have 755 permissions.
One thing I should also mention is the default maximum file size for attachments. This is controlled through the .htaccess file and is set to 2 Meg by default. You can increase this to whatever size is necessary. I’ve pushed it right up to 25 and have not yet run into a problem. That said, I’m not sure if you’d want to put this number *too* high, as there are very few email servers that’ll handle messages of this size.
Once all of this is done, you’ll be able to visit roundcube.site.com/installer/ (or just roundcube.site.com if you’re using version 0.1) and follow the on-screen prompts.
I’ll admit that the first time I had installed this application, it was a little tricky. However, now that it’s all set and in place, I’m quite happy to have made the small jump. I’m now in the process of moving over every email I’ve received since 1997 to my private webmail account, and this will likely spell the end for Microsoft Outlook on my machine. It’s been fun while it’s lasted, but carrying my notebook everywhere is just not an option anymore.
I’ll be sure to update this post for future releases of RoundCube.
Have you installed RoundCube or another webmail client on your web server? Did you run into any unexpected problems?















































I prefer webmail clients simply because the email is stored at one location where I can access it from any computer I happen to have access to. The only client I ever tried installing is SquirrelMail and it seems to work quite well, however, perhaps you could assist me with making it do a few things that my settings currently don’t
I don’t even remember what I had to do to install and configure it :S Oh well, it works and I don’t really have any complaints so I guess I’ll just keep using it.
I have to thank you for this instruction, Jason.
I had installed it onto my domain at http://looboo.com.vn/mail - without your help, I would gave up!
Now, I don’t know how to create a mailbox (is it mail program subjects for multiple mailbox usage?) or I don’t even know what is my login name!!!
Hope you will reply me!
Thank you in advance, Jason!
Regards!
Dear Jason,
Thank you very much Jason, your help was very useful! I now can log in to my email accounts, and roundcube is working so far so good.
At first, I thought Roundcube could let people to create and manage their mailbox personally, which means they can “sign-up” for a mailbox with the name they like at our server (@ourserver.com), then they can use that mailbox from everywhere (just like Hotmail or Yahoo Mail).
If Roundcube just do the “checking-mail” part, so what makes it better than other mail systems?