Install and configure RoundCube Webmail on IIS
RoundCube Webmail is an web based IMAP client that uses AJAX to provide a drag and drop interface that operates very much like a regular desktop application. RoundCube is Open Source and PHP based using a MySQL or Postgres database for data storage with a presentation layer that is fully skinnable using XHTML and CSS 2. Feature wise RoundCube includes things such as multilingual support, MIME support, personal address book, folder management, message searching and spell checking just to name a few. I've been using RoundCube for several years now to access my personal email from all corners of the globe, and I absolutely swear by it which is why I've decided to write this install guide for IIS.
RoundCube Webmail Requirements
There are a few things you'll need first in order to be able to use RoundCube in your IIS environment;
- Email server with IMAP service (required) and SMTP service (recommended). I recommend using hMailServer for this which is an Open Source Email server developed for Windows, and can be installed by following my guide on setting up your own email server with hMailServer
- MySQL or PostgreSQL database engine, or the SQLite extension for PHP. I recommend using MySQL as it is used by many other web applications you may use down the line, and can be installed by following my guide on how to install and configure MySQL 5 on Windows.
- Finally, you must have PHP installed on IIS which can be done by following my guide on installing PHP 5 on IIS in 5 simple steps. In addition you may wish to enable these PECL extensions which can be done by following my guide on enabling PHP PECL extensions for Windows;
- OpenSSL (recommended)
- FileInfo (optional)
- Multibyte/mbstring (optional)
- Mcrypt (optional)
While you're at it you best ensure these php.ini directives are set correctly ;
- error_reporting E_ALL & ~E_NOTICE (or lower)
- file_uploads on (for attachment upload features)
- session.auto_start needs to be off
- magic_quotes_gpc off
Running the RoundCube Webmail Installer
The installation of RoundCube used to be a totally manual task, however now they have included a handy installer which not only verifies your environment but also allows you to create your configuration files. You will however still need to manually create a MySQL user and database and ensure that your MySQL user is assigned the approporate priviledges to your RoundCube database. You can use something like PHPMyAdmin to perform this function, or you can look at creating a MySQL user as well as creating a MySQL database and assigning MySQL permissions all from the command line using the MySQL command line client.
Once you have downloaded RoundCube and configured it for use in IIS, the next thing to do is open your web browser and point it to the installer in your RoundCube installation. For example, if your RoundCube installation was located at;
You would direct your web browser to;
The first stage of this installer will verify your environment. If anything is picked up here, go back and ensure that all the prerequisites are met as detailed above. The second stage of the installer creates your configuration file, however in most cases you will only need to be enter values for the following;
- Database server
- Database name
- Database user name
- Database password
- IMAP host(s)
- SMTP host
You will also need to ensure the directories specified in the temp_dir and log_dir fields are writable by the IUSR_MACHINENAME user account which is used by IIS for anonymous web access. Once you have entered all your configuration values, press the create button and the installer will display two read only text fields populated with the contents you need to copy and paste into two new configuration files. First, navigate to the config directory in your RoundCube installation on your server and create two files; one called main.inc.php and the other called db.inc.php. Simply copy the contents from the first read only text field in the installer and using your favourite text editor (notepad will do) paste it into main.inc.php, and then do the same again with the second text field into db.inc.php. Save the files so your changes become effective.
The third and final step in the installer is to test your configuration files. Click the continue button underneath the read only text fields and the installer will go ahead and verify your configuration file settings. This will test to make sure both main.inc.php and db.inc.php are present, as well as ensuring that the temp and log file directory you specified in step one are writeable by the server. The installer should also test you database settings and you should see that while the DSN is listed as ok, the DB Schema is listed as not initialised. This is perfectly fine, and just means the RoundCube Webmail database has not yet been populated. Simply press the initialise database button, and if you have set your MySQL privileges correctly it should populate the database. Once you have done this you can also test your SMTP and IMAP settings by sending a test email and connecting to an IMAP account. When you are happy that everything is working, be sure to delete the entire installer directory from your server.
That is it for this article, so hopefully by this stage you have a fully functioning IMAP webmail client using RoundCube Webmail. If you have any feedback or comments about this article, please feel free to post a comment below. If you have specific questions regarding the configuration of your environment then please feel free to start a thread in our forums.