User Tools

Site Tools



We chose RoundCube after trying a bunch of other webmail applications. Here are some that we tried:

  • Bongo (formerly Hula) - could not get it to install
  • SquirrelMail - old UI is hard to work with
  • Horde (IMP) - complicated setup, does too much
  • Zimbra - too integrated with email servers

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.
# Download and unpack the software.
wget$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_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
sudo sh -c 'cat >>/root/.pgpass' <<EOF

And then set up that particular site to use RoundCube.

# Configure the site to use RoundCube.
cd /var/www/
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

  • Make sure all the requirements are met.
    • Try to enable as many of the optional items as well.
  • Click NEXT.
  • In General Configuration:
    • product_name = BoochTek Webmail
    • CHECK ip_check
    • CHECK Cache messages in local database
  • In Database Setup:
    • Database type = PgSQL
    • Database server = localhost
    • Database name = $ROUNDCUBE_POSTGRESQL_DB (from above)
    • Database user = $ROUNDCUBE_POSTGRESQL_USER (from above)
    • Database password = $ROUNDCUBE_POSTGRESQL_PASSWORD (from above)
  • In IMAP Settings:
    • default_host = ssl:/\/
    • port = 993 (for IMAPS)
    • username_domain =
    • CHECK auto_create_user (allows automatic use for any IMAP user on our system)
  • In SMTP Settings:
    • smtp_server = localhost
    • smtp_port = 25
    • smtp_user/smtp_pass = (blank)
  • In Display settings & user prefs:
    • pagesize = 12
    • UNCHECK prefer_html
    • CHECK preview_pane
    • draft_autosave = 3 min
  • Click on CREATE CONFIG button.
  • Save the 2 config files.
    • Save the files in /var/www/ with names of and
  • Edit /var/www/ to change the imap_auth_type setting to LOGIN.
    • NOTE: This is likely only necessary for access.
  • Hit the CONTINUE button.
  • The next page will test the config to see if everything is OK.
  • The DB Schema will show as NOT OK (Database not initialized)
  • Click on the Initialize database button.
  • Now the DB Schema should show as OK, along with DB Write and DB Time.
  • Next, skip down to the Test SMTP config section.
  • Enter a sender and recipient, then click the Send test email button.
  • The page should come back with SMTP send: OK.
  • Next, skip down to the Test IMAP config section.
  • Enter login info for an account on the IMAP server and click Check login.
  • The page should come back with IMAP connect: OK.

Don't leave the DB password world-readable:

sudo chmod 640 config/

Additional configuration can be done in the /var/www/ file.

Remove the link to the installation directory from our webmail instance:

sudo rm /var/www/

Upgrading (OBSOLETE)

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/
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/
svn info

Then update to the latest revision:

cd /var/www/
sudo svn up
svn info

Check the config files, to add any new parameters:

cd /var/www/
diff -u roundcubemail/config/ roundcubemail/config/ 
diff -u roundcubemail/config/ roundcubemail/config/ 

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/


Browse to 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.

build/webmail.txt · Last modified: 2014/09/03 14:09 by Admin