Complete Virtual Mail Server/Web Access

Introduction
One heavily used function of E-mail, is webmail access. Some users use it solely as their access, others use it as backup or when their own system is not available. There are several options available, with and  being the most common once. Squirrelmail can be used if bandwith is a huge issue, roundcube is recommended otherwise and the focus of this article.

Installing roundcube
Roudcube can store its configuration in a database. Things like local addressbook, identities etc. Here there are several options available. Use a local, per vhost based SQlite storage pool, use a postgres/mysql database per vhost or have all vhosts share the same database. There can be advantages for any of the above options. If webmail, for various domains, is on the same host as the imap server, then using one database for all domains is fine and can be an advantage. It could be desided that each domain, each vhost gets its own webmail interface (different skin and plugins) where all users could still log in. Meaning in the event of one of the vhosts webmail being broken, they can still access their e-mail normally using a different vhost. Whether the users settings 'live' in all vhosts or not, is based on the imap server. Roundcube bases its user id on the mail_host e.g. the imap server and thus when using localhost the user 'profile' is identical everywhere.

After choosing the appropiate USEflags, roundcube should be emerged.

This only installs roundcube to the host, but not into the vhost.

using Postgres
Unless there is some serious security concern, only one database user is required to access all databases used by roundcube.

Roundcube will also need a database. Different names will have to be chosen when using different databases per domain.

Finally, load the initial database into postgres.

Configuring roundcube
Configuring roundcube is as simple as editing two configuration files in /var/www/webmail.example.com/htdocs/roundcube/config/.

To access the database only this line really needs to be changed. It is quite self explanatory.

Here are the essential changes listed required for roundcube operation. More can be done to personalize the setup.

Starting with roundcube version 0.6, Roundcube needs wants to have the fully qualified names for the default storage folders, such as Trash, Drafts etc.

Testing roundcube
Log into webmail via http://webmail.example.com/ and the test mailbox should show. Also sending mail should be working normally.