We chose RoundCube after trying a bunch of other webmail applications. Here are some that we tried:
RoundCube is well supported, with a good development community and a rich set of plugins.
First we install the software on the system. We install it into /usr/local/share
, so multiple sites can share the installation.
# Install some (optional) prerequisites. sudo apt-get install php5-mcrypt php5-intl # Set the version we're going to install. ROUNDCUBE_VERSION='0.8.4' # Download and unpack the software. wget http://sourceforge.net/projects/roundcubemail/files/roundcubemail/$ROUNDCUBE_VERSION/roundcubemail-$ROUNDCUBE_VERSION.tar.gz/download -O roundcubemail-$ROUNDCUBE_VERSION.tar.gz tar xfz roundcubemail-$ROUNDCUBE_VERSION.tar.gz # Fix up a path issue in the installer. sed -i roundcubemail-$ROUNDCUBE_VERSION/installer/index.php -e "s|^define('INSTALL_PATH', .*);$|define('INSTALL_PATH', \$_SERVER['DOCUMENT_ROOT'].'/');|" # Install the software. sudo mkdir -p /usr/local/share/roundcube/$ROUNDCUBE_VERSION sudo cp -R roundcubemail-$ROUNDCUBE_VERSION/{.htaccess,*} /usr/local/share/roundcube/$ROUNDCUBE_VERSION # Clean up after ourselves. rm roundcubemail-$ROUNDCUBE_VERSION.tar.gz rm -rf roundcubemail-$ROUNDCUBE_VERSION
Then we set up the database for a particular instance.
ROUNDCUBE_POSTGRESQL_DB='webmail_boochtek' ROUNDCUBE_POSTGRESQL_USER="roundcube_$(openssl rand 3 -base64 | tr '+/' '-_')" ROUNDCUBE_POSTGRESQL_PASSWORD="$(openssl rand 15 -base64 | tr '+/' '-_')" sudo sudo -u postgres createuser -SDR $ROUNDCUBE_POSTGRESQL_USER sudo sudo -u postgres createdb --owner $ROUNDCUBE_POSTGRESQL_USER $ROUNDCUBE_POSTGRESQL_DB # NOTE: We have to wrap the username in quotes, because SQL will downcase everything outside of quotes. sudo sudo -u postgres sh -c "psql $ROUNDCUBE_POSTGRESQL_DB" <<EOF ALTER USER "$ROUNDCUBE_POSTGRESQL_USER" WITH ENCRYPTED PASSWORD '$ROUNDCUBE_POSTGRESQL_PASSWORD'; EOF sudo sh -c 'cat >>/root/.pgpass' <<EOF localhost:5432:$ROUNDCUBE_POSTGRESQL_DB:$ROUNDCUBE_POSTGRESQL_USER:$ROUNDCUBE_POSTGRESQL_PASSWORD EOF
And then set up that particular site to use RoundCube.
# Configure the site to use RoundCube. cd /var/www/webmail.boochtek.com sudo mkdir {public,config,temp,logs} sudo chown -R www-data:www-data . (cd public; sudo ln -s ../{config,temp,logs} .) sudo cp /usr/local/share/roundcube/$ROUNDCUBE_VERSION/config/* config/ sudo ln -s /usr/local/share/roundcube/$ROUNDCUBE_VERSION/config/.htaccess config/.htaccess sudo ln -s /usr/local/share/roundcube/$ROUNDCUBE_VERSION/temp/.htaccess temp/.htaccess sudo ln -s /usr/local/share/roundcube/$ROUNDCUBE_VERSION/logs/.htaccess logs/.htaccess sudo ln -s /usr/local/share/roundcube/$ROUNDCUBE_VERSION/{.htaccess,index.php,installer,plugins,program,robots.txt,skins,SQL} public/
Browse to http://webmail.boochtek.com/installer/
.
NEXT
.General Configuration
:Database Setup
:IMAP Settings
:SMTP Settings
:Display settings & user prefs
:CREATE CONFIG
button./var/www/webmail.boochtek.com/config/
with names of main.inc.php
and db.inc.php
/var/www/webmail.boochtek.com/config/main.inc.php
to change the imap_auth_type
setting to LOGIN
.CONTINUE
button.NOT OK (Database not initialized)
Initialize database
button.OK
, along with DB Write and DB Time.Test SMTP config
section.Send test email
button.SMTP send: OK
.Test IMAP config
section.Check login
.IMAP connect: OK
.Don't leave the DB password world-readable:
sudo chmod 640 config/db.inc.php
Additional configuration can be done in the /var/www/webmail.craigbuchek.com/config/main.inc.php
file.
Remove the link to the installation directory from our webmail instance:
sudo rm /var/www/webmail.boochtek.com/public/installer
NOTE: It is highly recommended to ensure that nobody is logged into the webmail system when upgrading.
First, make a backup of the current version, just in case.
cd /var/www/webmail.boochtek.com sudo cp -a roundcubemail roundcubemail.backup-`date +'%Y%m%d'`
Since we're using Subversion to download the code, we can simply pull the latest revision. First, check the current revision info:
cd /var/www/webmail.boochtek.com svn info
Then update to the latest revision:
cd /var/www/webmail.boochtek.com sudo svn up svn info
Check the config files, to add any new parameters:
cd /var/www/webmail.boochtek.com diff -u roundcubemail/config/db.inc.php roundcubemail/config/db.inc.php.dist diff -u roundcubemail/config/main.inc.php roundcubemail/config/main.inc.php.dist
Change anything necessary in the config files, then check the installation by browsing to /installer/
.
Once everything checks out, remove the unnecessary files again:
cd /var/www/webmail.boochtek.com/public sudo rm -rf installer/ README INSTALL UPGRADING LICENSE CHANGELOG
Browse to http://webmail.boochtek.com/
.
Log in with credentials against the IMAP(S) server.
Do we want to log to syslog? That would make log rotation work better, but I'm not sure we need to log at all, except when troubleshooting.
There are a lot of plugins we'd like to install and use.