Data privacy: how safe is your data in the cloud?

Webmail

Keep your emails private - setup your own webmail service.

roundcube

There's a lot you can do with ownCloud, but there is one important cloud service it does not touch and that's email. Of all the cloud services, the one that generates the most concerns over privacy is webmail in general and Gmail in particular. Your emails are transmitted and stored as plain text and Google openly admit that it reads your email in order to provide you with targeted advertising.

For non-confidential mail, this is acceptable to most people, but you can run your own webmail service if it doesn't. It gets better, you don't even need to change your email address or have a static Internet address as running your own SMTP server generally requires. Webmail programs do not have to run on the same system as the mail server, so you can install webmail on your own server and continue to use your current email address and server.

There are several webmail alternatives, two of the most popular are SquirrelMail and Roundcube, both are written in PHP and run on the usual LAMP stack. We will look at Roundcube here, but Squirrel mail is just as easy to set up and just as capable. It is quite feasible to run both.

They are only email clients after all and plenty of people have more than one email client installed. Both webmail services use IMAP to communicate with the mail server, which means the emails stay on the server, allowing you to also read the same email with a desktop or mobile email client as well.

IMAP has another advantage over the older POP3 protocol, beyond removing the need to download everything before reading, it stores information such as which emails you have read on the server, making it easy to switch between mail clients and still keep track of where you are up to.

Installing webmail

roundcube 3

Installing Roundcube is simple. You can either do it through your package manager or directly onto your server by downloading the tarball from www.roundcube.net. Unpack the tarball into the root of your web server. This creates a directory called roundcubemail-0.9.0 (for the current version). Either rename or symlink this to something more usable, like roundcube or even webmail.

Roundcube needs to write to files in its logs and temp directories, so make sure these are owned by the user running the web server, usually apache or www-data. Then run the installer by pointing your browser at http://address-of-server/roundcube/installer.

Make sure that none of the checks show Not OK. Missing optional modules are fine, and you only need one database available (Roundcube supports several database formats).

One important setting it checks is PHP's date.timezone option, which needs to be set in order for your mails to have the correct timestamp. If you are using a VPS rather than a local server, this should be set to the timezone for wherever the server is physically located. The setting is found in /etc/php5/apache2/php.ini and the line should be uncommented by removing the leading ; and then the timezone added.

You will usually find the correct timezone specification in /etc/timezone. You need to restart Apache after changing this, or any other PHP settings, with: sudo apachectrl restart

Setting things up

roundcube

Reload the installer and correct any further errors before proceeding. The next page sets up the configuration. If you are using your own webmail because of privacy concerns, you will probably want to disable the spell checker, because the default one sends the text to Google for checking!

You need to tell it about your database and, unless you are using SQLite, you need to set up the tables yourself. You can do this by running the mysql client as root and issuing these commands: