Wednesday 25th June 2008
RoundCube Mail is a very nice webmail application with an application-like interface (as opposed to a website). It's also packaged up as an RPM for Fedora, which should in theory make installation simple. Unfortunately the roundcubemail-README.fedora in the package only describes why there is no SQLite support in the package rather than how to actually get the application up and running from scratch. The upstream INSTALL file is only slightly more helpful as some of the files have been moved around (quite rightly) in the package to make it FHS-compliant, and the installer application isn't packaged.
So here are the steps I took to installing it on my own system, which has a local IMAP server already running (I was installing the package primarily to support my wife being able to read her mail from work). I chose to use MySQL for the database backend.
Firstly, install the software:
# yum install roundcubemail mysql-server php-mysql php-mbstring php-xml
mysql-server and php-mysql are required to use the MySQL backend
php-mbstring and php-xml are missing dependencies that will be added in an update (Bug #451652)
Edit /etc/php.ini and set the error reporting level and timezone:
error_reporting = E_ALL & ~E_NOTICE date.timezone = "Europe/London"
You may also want to increase the upload_max_filesize value if you want to be able to handle larger attachments.
If you're not a current MySQL user, you'll need to set up the MySQL server. Let's say we're going to set the MySQL root user's password to "xy22y" (replace goalkeeper.city-fan.org with your own hostname):
# chkconfig mysqld on # service mysqld start Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h goalkeeper.city-fan.org password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com [ OK ] Starting MySQL: [ OK ] # /usr/bin/mysqladmin -u root password 'xy22y' # /usr/bin/mysqladmin -u root -h goalkeeper.city-fan.org password 'xy22y' # service mysqld restart Stopping MySQL: [ OK ] Starting MySQL: [ OK ] #
The next step is to set up the roundcubemail database that the application will use. The MySQL username will be roundcube and we'll set its password to be "cool-php-app":
# mysql -u root --password=xy22y Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.0.51a Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY 'cool-php-app'; Query OK, 0 rows affected (0.00 sec) mysql> QUIT Bye # mysql -u root --password=xy22y roundcubemail < /usr/share/doc/roundcubemail-0.2/SQL/mysql5.initial.sql #
Edit /etc/httpd/conf.d/roundcubemail.conf to allow access from the Internet:
# # Round Cube Webmail is a browser-based multilingual IMAP client # Alias /roundcubemail /usr/share/roundcubemail <Directory /usr/share/roundcubemail/> Order allow,deny Allow from all </Directory>
The Alias line sets the base URL that the application will appear at on your web server. You may wish to change it from /roundcubemail (i.e. http://your.host.name/roundcubemail/) to (say) /mail or /webmail or even /my-private-mail-app.
Edit the $rcmail_config['db_dsnw'] entry in /etc/roundcubemail/db.inc.php to change the password from "pass" to "cool-php-app".
Edit /etc/roundcubemail/main.inc.php to configure your IMAP server:
$rcmail_config['default_host'] = 'localhost'; $rcmail_config['mail_domain'] = 'your.mail.domain'; $rcmail_config['log_dir'] = '/var/log/roundcubemail/'; $rcmail_config['log_logins'] = true;
Set SELinux booleans to support PHP applications connecting to IMAP servers and sending mail:
# setsebool -P httpd_builtin_scripting=1 httpd_can_network_connect=1 httpd_can_sendmail=1
Restart the web server:
# service httpd restart
That should do it, and you should be able to access your mail at http://your.host.name/roundcubemail/
It's a good idea to run /usr/bin/mysql_secure_installation to improve the security of your MySQL server. It is safe to do this after setting up other databases; it's an interactive script and won't damage the roundcubemail setup.