Configure RoundCube on Debian 8 (Jessie) - Perfect Server Debian 8 (Apache, BIND, Dovecot, ISPConfig 3)

Debian 8 (Jessie) doesn't contain RoundCube in it's repositories. Why, I don't know :) . In ISPConfig3, Perfect Server, Debian 8, you get SquirrelMail, but I don't like how it looks. With some trouble setting it up, I managed to configure RoundCube on Debian 8 and make it wokring with ISPConfig3. Used many sources to make it work and decided to create this manual that you’re reading.

I presume that you have configured your server with Perfect Server Debian 8 (Apache, BIND, Dovecot, ISPConfig 3) configuraton . Also, password plugin and Sieve support didn’t worked immediately, so I explained in PART2 and 3 how it is fixed.

My server is on, so you change your IP during setup

NOTE: You do this on your own risk. Backup everything before changing configuration files or anything else on your server.

This manual consists from three parts:

  • PART 1 - Installing and configuring RoundCube to work with ISPConfig3.
  • PART 2 - Configure “password change” plugin for RoundCube.
  • PART 3 - ManageSieve server support

1. PART 1 - Installing and configuring RoundCube to work with ISPConfig3.

1.1. Existing webmail app

If you already have SquirrelMail (or any other webmail app), you need to disable it. You can uninstall it (apt-ger remove squirrelmail) or comment-out /webmail alias defined in squirrelmail.conf.

Personaly, I choose to rename a config file: mv /etc/apache2/conf-enabled/squirrelmail.conf /etc/apache2/conf-enabled/squirrelmail.conf.disabled

1.2. Creating a Remote User in ISPConfig3

ISPConfig3 plugins for RoundCube work over ISPConfig's API. If you want to use this API, you need the Remote User. Open ISPConfig web page and login. My ISPConfig server is located on URL: Creating a user: System > User Management > Remote Users and click on the Add new user button. Username: roundcube (you choose) Password: rmisproundcube (you choose). ... and enable the following functions: · Server functions · Client functions · Mail user functions · Mail alias functions · Mail spamfilter user functions · Mail spamfilter policy functions · Mail fetchmail functions · Mail spamfilter whitelist functions · Mail spamfilter blacklist functions · Mail user filter functions Then click on Save, on the bottom of the page.

1.3. Install TinyMCE & RoundCube

TinyMCE apt-get install tinymce

1.4. RoundCube

You can't install round RoundCube on Debian 8 using apt-get istall roundcube....

Instead, you must install it manually.

cd /tmp

Download latest RoundCube from At the moment of wtiting this manual, URL to the latest RoundCube is

Note: download COMPLETE package


tar xzvf roundcubemail-1.1.2-complete.tar.gz 

(extracted to /tmp/ roundcubemail-1.1.2) mkdir /usr/share/roundcube - (I created a roundcube directory where SquirrelMail is)

cp -r roundcubemail-1.1.2/. /usr/share/roundcube/

Open roundcube config file vim /etc/apache2/conf-enabled/roundcube.conf

NOTE – if file does not exists, create it:

touch /etc/apache2/conf-enabled/roundcube.conf
vim /etc/apache2/conf-enabled/roundcube.conf

Copy/Paste configuration bellow into that file:

# Uncomment them to use it or adapt them to your configuration
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /usr/share/roundcube
Alias /webmail /usr/share/roundcube
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
<Directory /usr/share/roundcube/>
  Options +FollowSymLinks
  DirectoryIndex index.php
  <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .:/usr/share/php
  # This is needed to parse /usr/share/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
# Protecting basic directories:
<Directory /usr/share/roundcube/config>
        Options -FollowSymLinks
        AllowOverride None
<Directory /usr/share/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
<Directory /usr/share/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all

Save and exit vim (Ctrl+C, :wq, Enter) :)

Restart Apache:

systemctl restart apache2.service 

## 1.5. CREATE DB FOR RoundCube

Open MySQL and create DB for RoundCube. Change database name(roundcubemail), username(your DB username) and password to values to match the one you want.

CREATE DATABASE roundcubemail;
GRANT ALL PRIVILEGES ON roundcubemail.* TO [email protected] IDENTIFIED BY 'password';

vim /etc/php5/apache/php.ini


; Defines the default timezone used by the date functions
;date.timezone =

Change and uncomment last line and add time zone.

; Defines the default timezone used by the date functions
date.timezone =”Europe/Sarajevo”

(go to to find the zone you need)

Save vim and exit. Restart Apache

systemctl restart apache2.service

Now, you should be able to open

(Again, this is my IP, use your own) You should see a lot of OK and a few NOT AVAILABLE (LDAP and available databases)

Configure RoundCube as you desire, based on your needs.

Press CREATE CONFIG on bottom of the 2nd page and follow the instructions.

NOTE: At the end of PHP configuration you need to add “?>” (without quotes), it's missing.

Press CONTINUE button to proceed. Correct any errors reported.

To me, it reported: Check if directories are writable- NOT OK

I solved it with:

chown www-data:www-data {/usr/share/roundcube/temp,/usr/share/roundcube/logs}

Check DB config Press INITIALIZE DATABASE button. Follow the instructions in a red square on the bottom of the page.


Create and open

vim /etc/roundcube/

… and enter line:

$rcmail_config['default_host'] = 'localhost';

NOTE: I was missing both directory “roundcube” and file “”. I created directory (/etc/roundcube) and file within that directory.

My configuration looks like this:

INSTALL ISPConfig3 PLUGIN for RoundCube

cd /tmp
git clone
cd /tmp/ispconfig3_roundcube/
mv ispconfig3_* /usr/share/roundcube/plugins
cd /usr/share/roundcube/plugins
mv ispconfig3_account/config/ ispconfig3_account/config/

After you complete everything, RoundCube should open from URL NOTE: Log in with the email address and password of an email account you created through ISPConfig

Open ispconfig3_account/config/ :

vim ispconfig3_account/config/

… and insert command bellow (or replace values in default configuration):

Change upper values to match your config... Next, configure jquerui plugin in the ISPConfig3 plugins:

vim /etc/roundcube/


// ----------------------------------
// ----------------------------------
// List of active plugins (in plugins/ directory)
//$rcmail_config['plugins'] = array();
$rcmail_config['plugins'] = array("jqueryui", "ispconfig3_account", "ispconfig3_autoreply", "ispconfig3_pass", "ispconfig3_spam", "ispconfig3_fetchmail", "ispconfig3_filter");

##2. PART 2 - Configure “password change” plugin for RoundCube

By default, “change password” plugin doesn't work.

2.1. Enable “change password” plugin

Go into /usr/share/roundcube/plugins/password and to

cp /usr/share/roundcube/plugins/password/ /usr/share/roundcube/plugins/password/

Open it:


Find line bellow and confirm that it is set to sql:

$config[‘password_driver’] = ‘sql';

If not, set it.

Edit the connector, so that the plugin knows on what database to run the function to change the user's password

NOTE: By default, you run function on dbispconfig. I had to create a new user that has access rights to this DB to modify required fields. I gave that user minimal rights. Then I entered username and password in configuration. I won’t go thru process of creating a user in MySQL (if you stuck here, buzz me :) ).

Find and edit this line:

$config[‘password_db_dsn’] = ‘mysql://username:[email protected]/databasename';

… where you change the username, password and databasename to your installation configuration.

2.2. Create DB function

You can connect to your MySQL and enter these commands or you can do it via PHPMyAdmin. If using PHPMyAdmin, click on dbispconfig database and then click SQL and paste this code and run it.

USE databasename; # Default: dbispconfig
CREATE FUNCTION update_passwd (pwd varchar(100), usr varchar(100)) RETURNS INT
UPDATE databasename.mail_user SET password=pwd WHERE login=usr LIMIT 1;

Where you change databasename according to your installation configuration

3. Part 3 - ManageSieve server support

Sieve support for Dovecot, allows users to filter incoming messages by writing scripts specified in the Sieve language (RFC 5228). The Pigeonhole ManageSieve service is used to manage a user's Sieve script collection. It has the following advantages over doing it directly via filesystem: The first step is to install the required packages, I assume you got a working set up with Dovecot as imap server, and a working mail client like Roundcube.

Filters are available in RoundCube and you can manipulate received messages the way you want.

3.1. Install the "dovecot-managesieved" package

apt-get install dovecot-managesieved

3.2. Configure Dovecot

Dovecot config files are located in /etc/dovecot/ and there we find dovecot.conf.

Open "/etc/dovecot/dovecot.conf" :

  vim /etc/dovecot/dovecot.conf

and edit it by adding the following things to it, and make sure that the settings match your system:

protocols = [...] sieve

plugin {
# ispconfig sieve script is loaded before anything else
# this way ispconfig sieve script can be edited by using sive protocol
# if you prefer to keep ispconfig sieve script hidden from using sive protocol
# change location eg. sieve_before = /var/vmail/%d/%n/ispconfig.sieve
sieve_before = /var/vmail/%d/%n/sieve/ispconfig.sieve
sieve_dir = /var/vmail/%d/%n/sieve/
sieve_extensions = +notify +imapflags
# the next to lines are optional but i use them so i show them
# a directory where global .sieve script can be found
sieve_global_dir = /var/vmail/sieve/global
# a global sieve script to use allways
sieve_global_path = /var/vmail/sieve/global/dovecot.sieve

service managesieve-login {
inet_listener sieve {
    # port to use for managesieve
    port = 4190
    process_min_avail = 10
    service_count = 1
    vsz_limit = 64 M

    protocol sieve {
    # Explicitly specify the SIEVE and NOTIFY capability reported by the server
    # before login. If left unassigned these will be reported dynamically
    # according to what the Sieve interpreter supports by default (after login this may differ depending on the user).
    # managesieve_notify_capability = mailto
    # managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave imapflags notify
    mail_max_userip_connections = 10
    managesieve_logout_format = bytes=%i/%o
    managesieve_max_compile_errors = 5
    managesieve_max_line_length = 65536
    protocol lda {
    # Make sure sieve i loaded..
    mail_plugins = [...] sieve [...]
    # in this log file all mails will be logged
    log_path = /var/log/sieve.log

Save the file and execute the following commands otherwise you will not receive any e-mails:

touch /var/log/sieve.log && chmod 666 /var/log/sieve.log

Restart Dovecot:

/etc/init.d/dovecot restart

3.3. Checking that dovecot started sieve server

You can check that your conf is working by running following command

netstat -a --numeric-ports | grep 4190

Output should look like bellow:

 tcp        0      0  *               LISTEN

That should be all!