Install and setup RoundCube WebMail
From OpenFSG
|
Got your FSG-3 running your own email domain? Good for you! Since it runs web services too, webmail is a logical extension - get your email anywhere you like, without needing an email client.
Why RoundCube?
- I evaluated several webmail packages, looking for a good balance between lightweight performance-loading and a good feature set with a decent UI. RoundCube seemed to tick all the boxes. There may be something better out there, or not, I don't really care as this does everything I need.
- RoundCube is based around PHP4 (Note: Starting February 5, 2008, RoundCube is transitioning to PHP5, so take care to download a release that still requires PHP4 only: version 0.2 is scheduled to make use of PHP5, hence version 0.1.1 is probably the latest one that works with PHP4) and MySQL, so the FSG should have everything we need to support this. I would imagine that the DT and NDP would likewise be happy, but since I don't have those to play with... Note that this HOWTO is ONLY aimed at getting webmail support running on the FSG-3, supporting the local mail services. This is NOT a generic webmail-how-to.
Let's get busy!
- First, fire up a SSH session to your FSG, su to root and browse to your website directory - in my case /home/website. Then download the source tarball from http://www.roundcube.net/?p=downloads and unpack (takes a few minutes, go make a cuppa). You'll probably want to rename the resultant directory from the RSI-inducing one to something like "webmail".
- Next cd to the /config directory under that one and fire up your favourite text editor, aimed at "main.inc.php.dist".
- Find the line containing "$rcmail_config['enable_caching'] = TRUE;" and change that TRUE to a FALSE - we don't want the webmail app to cache any data, as it is already local and we'd just be duplicating things.
- Now find "$rcmail_config['default_host'] = ' ';" and enter the name of your mail host - "localhost" will probably work in most cases: "$rcmail_config['default_host'] = 'localhost';". It is possible to support multiple mail domains/hosts, please refer to the wiki entry at http://trac.roundcube.net/wiki/Howto_Install for that.
- Next you need to set the SMTP user and password to pick up the logged-in user's details, so browse down that file a bit and set:
- $rcmail_config['smtp_user'] = '%u';
- $rcmail_config['smtp_pass'] = '%p';
- And save this file as "main.inc.php".
- Now edit file "db.inc.php.dist", and find the entry (near the top) "$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';". The format of this string is storage-type://username:password@server/database so you can probably leave most of it alone and just change the password part to something more secure. Remember what it is, you'll need it in a second. Save this file as "db.inc.php".
- Go to the web admin interface of your FSG, and into the SQL admin pages. Create a new database. Taking our data from the line "$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';" in db.inc.php, the new database would be called "roundcubemail". Go back to the main phpMyAdmin page, and click on "Privileges", then "Add a new User". The user name will be "roundcube" from our example and the password "pass" (but of course you changed that to something better, right)? Don't bother setting any Global privileges, just enter user name and password then press "Go". On the next page, scroll down to the section "Database-specific privileges", pick the roundcubemail database and click "Go" again, then tick all the privilege boxes and press "Go" once more. Now press the SQL button on the left-hand side of the phpMyAdmin page (next to the Home button), and paste in the contents of the file /SQL/mysql.initial.sql (=file located relative to RoundCube installation path) and execute it. This builds the initial empty data tables.
Now what?
If all went as planned.... you're done! Surf to your webmail directory (probably something like http://192.168.1.1/webmail) and log in. Once you're happy this all works, you can start digging around in the config files (make backups first!) and tweaking settings. Exposing your HTTP services to the WAN allows you to access your shiny new webmail from anywhere, but be aware of the security risks. Think about only allowing HTTPS (to prevent sniffing), and use a nice long secure password on email accounts.
You'll probably also want to turn on the message preview pane. For some reason this is hidden in obscure settings, you'll find detailed (but nice 'n simple) instructions at http://roundcubeforum.net/forum/index.php?topic=2280.msg9170#msg9170
And while you're enjoying that nice warm glow of getting something a little tricky to work, why not tackle the spam problem too? Setup SpamAssassin anti-spam

