Mail Story 2: RoundCube

In the previous "Mail Story" post, I explained how to quickly install a mail server on Debian.

Sometimes I want to check my emails but I don't have my own computer with me, only an access to an other computer connected to the internet. So I need a webmail. For that purpose I use RoundCube, it's an AJAX webmail written in PHP, using IMAP to retrieve emails and SMTP to send them.

Roundcube

Installation

In Debian, RoundCube seems not to be a very popular package, or maybe Debian people thinks the project is still too young. In fact, there is no RoundCube package for the current stable release of Debian. In "testing" there is RoundCube 0.1.1, and 0.2~stable in "unstable". Current official release is 0.2.1.

So lets install the "unstable" package (which is quite stable as far as I know ;-)).

First you need to add unstable repositories to APT if it's not done already. Edit /etc/apt/sources.list and add the following lines (replace ftp.fr.debian.org with your closest mirror):

deb http://ftp.fr.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ unstable main contrib non-free

Then tell APT to keep using stable packages by default (currently the stable release is called "lenny", so set the value accordingly with your system), edit /etc/apt/apt.conf.d/70debconf and add:

(…)
APT::Default-Release "lenny";

It's time to retrieve the list of unstable packages:

$ sudo apt-get update

Install RoundCube (RoundCube needs a database, it works with MySQL, PostgreSQL and SQLite, select the one you prefer, here I'm going to use SQLite):

$ sudo apt-get install roundcube
-> Configure database for roundcube with dbconfig-common? Yes
-> Database type to be used by roundcube: sqlite

Configuration

RoundCube should be accessible at http://mailserver.example.com/roundcube/. If it's not the case, you may need to uncomment the two Alias directives at the beginning of /etc/roundcube/apache.conf (don't forget to reload apache configuration before checking if it works).

Now edit /etc/roundcube/main.inc.php. Each parameter has a quite explicit comment, read them. Things you may want to change:

# (…)
$rcmail_config['enable_caching'] = FALSE;
$rcmail_config['default_host'] = 'ssl://localhost:993';
$rcmail_config['default_port'] = 993;
$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 587;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['create_default_folders'] = TRUE;
# (…)

You should now be able to login, read and send emails.

Misc

In the parameters I changed, there is create_default_folder set to TRUE. This in order to have the default IMAP folders always here (INBOX, Drafts, Sent, Junk and Trash). By default they are all protected, so they can't be removed.

But there is no real convention on those folder names. For instance, by default Apple Mail use some different directory names. But you can tell Apple Mail to use the ones you want. First you need to select the directory ("Mailbox" in Apple Mail):

Mail.app

And then associate it with the right meaning:

Mail.app

For other IMAP clients, see the respective documentation. For instance, here is how to change the trash folder on Thunderbird.

If you have an iPhone, you only need to synchronize it again, the iPhone uses Mail.app configuration (don't forget to check Mail Accounts in Info/Advanced/Replace information on this iPhone: in iTunes before synchronizing).

Note: since I wrote this post, Debian's RoundCube unstable package has been updated to version 0.2.1 but testing package is still version 0.1.1.

Mail Stories posts

Comments Add one by sending me an email.