Roundcube Webmail Client

Introduction to Roundcube

This is a series of articles I will be writing on how to setup an effective small web server solution that you can use for hosting for medium number of clients while having a reasonable amount of administrative time. In this segment, I am introducing the Roundcube Webmail Client as a extremely viable solution for webmail for smaller hosters. I had perviously run Squirrelmail as well as the facelift version called Nutsmail on my server. The latter 2 solutions offer a huge variety of plugins and customization but have very much aged relative to newer webmail solutions such as GMail and Yahoo Mail.

Overview

Roundcube webmail is a browser-based multilingual IMAP client with an application-like user interface. It provides full functionality you expect from an e-mail client, including MIME support, address book, folder manipulation, message searching and spell checking.

Released features include:

  • Available in 65 languages
  • Drag-&-drop message management
  • Full support for MIME and HTML messages
  • Sophisticated privacy protection
  • Compose messages with attachments
  • Multiple sender identities
  • Find-as-you-type address book integration
  • Richtext/HTML message composing
  • Forwarding messages with attachments
  • Searching messages and contacts
  • Spell checking
  • IMAP folder management
  • Support for external SMTP server
  • Built-in caching for fast mailbox access
  • Unlimited users and messages
  • Template system for custom skins
  • Plug-in API for flexible exensions

Planned features include:

  • Full featured address book based on VCard standard
  • Support for PGP and S/MIME encryption
  • IDNA support
  • Threaded message listing
  • Keyboard shortcuts
  • Attachment previews
  • Import/export functions
  • Admin interface

Server requirements are:

  • Apache or Lighttpd webserver
  • PHP Version 5.2.1 or greater
  • MySQL, PostgreSQL, SQLite or MSSQL database
  • An IMAP server which supports IMAP4 rev1
  • An SMTP server (recommended) or PHP configured for mail delivery

Installation

For my server, I actually run the SVN version of the system. I have had no issue with the daily updates and have found them extremely robust and error free. The only caveat is that you need to check the CHANGELOG often as well as ensure that you are importing the latest configuration options into main.inc.php.

To get started, you need to pull down the most recent code as such:

svn checkout https://svn.roundcube.net/trunk
A  svn.roundcube.net/trunk
A  svn.roundcube.net/trunk/roundcubemail
A  svn.roundcube.net/trunk/roundcubemail/SQL
...

I suggest you run that in your main webserver folder such that you end up with a folder call svn.roundcube.net. After that, rename the folder to roundcube as such:

mv svn.roundcube.net roundcube

Directory Permissions

RoundCube needs to save some temp files and it also writes logs. Therefore make sure that the following directories (and the files within) are writable for the webserver:

  • temp
  • logs

Execute the following command to do this:

sudo chown -R www:www temp logs

Database Configuration

Next thing we need to do is decide what database backend we'll use. The most common is MySQL but others are PostgreSQL and SQLite. So once you decide, create a database with any name you want and grant privileges to a separate database user. It's recommended not to use an existing user or root.

With MySQL you can set up the database by issuing the following commands:

CREATE DATABASE roundcubemail;
GRANT ALL PRIVILEGES ON roundcubemail.* TO username@localhost IDENTIFIED BY 'password';

(of course you have to replace the database, username and password accordingly)

See the INSTALL file for information about setting up PostgreSQL or SQLite

If you are using MySQL, be sure to flush the users privileges when you add a new user or you will get a database connection error:

FLUSH PRIVILEGES;

Configuring RoundCube

After uploading the files point your browser to http://url-to-roundcube/installer/ to start the install wizzard. The first page shows some requirements and by clicking "START INSTALLATION" the installer checks your webserver if everythng is there. In case you see some red NOT OK messages, you need to install or enable something. Follow the links or find out more by searching the http://www.php.net website.

Once your webserver is ready to run RoundCube you can start creating the config files on the next step. Click "NEXT" to get there. Get through the form and change the settings according to your needs. Don't forget to enter the database credentials within the "Database Setup" section. All the config parameter are described with a few words.

When finished the configuration hit the "CREATE CONFIG" button at the bottom of the page. You now get two text boxes on top of your browser window. Copy the contents and put them into two files within the config directory of your RoundCube installation. Name them main.inc.php and db.inc.php as stated above the text boxes.

Finally click "CONTINUE" and get to the last step of the install process. Now your configuration is being verified tested against your webserver. Click the "Initialize database" button in you're requested to in order to create the necessary tables in your database.

If there are no red NOT OK messages, you can also try to send a mail in order to test the SMTP settings.

Last but not least you have to remove the whole installer directory from the webserver. If this remains active it can expose the configuration including passwords.

Conclusion

You should now have a running Roundcube installation. I am running the Dovecot IMAP server as my back end. I have configured in the Sieve and ManageSieve plugins. You can read information about configuring the backend at Setting up Dovecot IMAP Server.

At this point, you can browse to your website such as http://yourwebsite.com/roundcube and you will be presented with a login screen: