There is a new version of this tutorial available for Debian 8 (Jessie).

Using RoundCube Webmail With ISPConfig 3 On Debian Wheezy (Apache2)

This guide explains how to install the RoundCube webmail application on a Debian Wheezy server running ISPConfig and Apache2, and how to enable the ISPConfig 3 plugins for RoundCube so that users can perform actions like changing their email passwords from within RoundCube. Roundcube webmail is a browser-based multilingual IMAP client with an application-like user interface; it comes with functions like MIME support, address book, folder manipulation, message searching and spell checking.

I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

This tutorial assumes you are using Apache2 as the web server on your ISPConfig 3 server; this tutorial will not work for nginx. I'm going to install RoundCube from the Debian Wheezy repositories - it is a reasonably recent version (0.7.2.9 vs 0.9.1 (current stable version)).

RoundCube will be configured in such a way that it can be accessed from each vhost over the alias /webmail (e.g. http://www.example.com/webmail).

If you are already using another webmail application like SquirrelMail, make sure you disable it completely or at least the alias /webmail. If you have installed SquirrelMail as a Debian package, you can find the alias in /etc/apache2/conf.d/squirrelmail.conf; either comment out the alias to just disable the /webmail alias or comment out the whole file to disable SquirrelMail completely. Don't forget to restart Apache afterwards.

 

2 Creating A Remote User In ISPConfig

The ISPConfig 3 plugins for RoundCube work through ISPConfig's remote API. To use this API, we need a remote user. To create such a user, go to System > User Management > Remote Users and click on the Add new user button:

Provide a username and password for the user...

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

 

3 Installing RoundCube

We can install RoundCube as follows:

apt-get install roundcube roundcube-plugins roundcube-plugins-extra

You will see the following questions:

Configure database for roundcube with dbconfig-common? <-- Yes
Database type to be used by roundcube: <-- mysql
Password of the database's administrative user: <-- yourrootsqlpassword (the password of the MySQL root user)
MySQL application password for roundcube: <-- roundcubesqlpassword
Password confirmation: <-- roundcubesqlpassword

This will create a MySQL database called roundcube with the MySQL user roundcube and the password roundcubesqlpassword.

Next open /etc/apache2/conf.d/roundcube...

vi /etc/apache2/conf.d/roundcube

... and add the line Alias /webmail /var/lib/roundcube. In addition to that, add the PHP configuration to the <Directory /var/lib/roundcube/> section (I've highlighted the changes):

# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /var/lib/roundcube
Alias /webmail /var/lib/roundcube

# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
</Directory>

<Directory /var/lib/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
  </IfModule>

  # This is needed to parse /var/lib/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
</Directory>

# Protecting basic directories:
<Directory /var/lib/roundcube/config>
        Options -FollowSymLinks
        AllowOverride None
</Directory>

<Directory /var/lib/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>

<Directory /var/lib/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>

Restart Apache afterwards:

/etc/init.d/apache2 restart

 

4 Configuring RoundCube

Open /etc/roundcube/main.inc.php...

vi /etc/roundcube/main.inc.php

... and set $rcmail_config['default_host'] = 'localhost'; (or the hostname or IP address of your mail server if it is on a remote machine):

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

Otherwise RoundCube will ask for a hostname before each login which might overstrain your users - we want to make usage as easy as possible.

Next install the ISPConfig 3 plugins for RoundCube:

cd /tmp
git clone https://github.com/w2c/ispconfig3_roundcube.git
cd /tmp/ispconfig3_roundcube/
mv ispconfig3_* /var/lib/roundcube/plugins
cd /var/lib/roundcube/plugins
mv ispconfig3_account/config/config.inc.php.dist ispconfig3_account/config/config.inc.php

Open ispconfig3_account/config/config.inc.php...

vi ispconfig3_account/config/config.inc.php

... and fill in the login details of your ISPConfig remote user and the URL of the remote API - my ISPConfig installation runs on https://192.168.0.100:8080, so the URL of the remote API is https://192.168.0.100:8080/remote/:

<?php
$rcmail_config['identity_limit'] = false;
$rcmail_config['remote_soap_user'] = 'roundcube';
$rcmail_config['remote_soap_pass'] = 'Sw0wlytlRt3MY';
$rcmail_config['soap_url'] = 'https://192.168.0.100:8080/remote/';
?>

Finally open /etc/roundcube/main.inc.php again...

vi /etc/roundcube/main.inc.php

... and enable the jquerui plugin plus the ISPConfig 3 plugins...

[...]
// ----------------------------------
// PLUGINS
// ----------------------------------

// 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");
[...]

... and change the skin from default to classic (otherwise the ISPConfig 3 plugins will not work):

[...]
// skin name: folder from skins/
$rcmail_config['skin'] = 'classic';
[...]

That's it; now you can access RoundCube under the alias /webmail (e.g. www.example.com/webmail). Log in with the email address and password of an email account created through ISPConfig:

This is how RoundCube looks:

Under Settings > Account you can use the ISPconfig 3 plugins for RoundCube to modify your settings, for example...

... you can set a new password for your email account without using ISPConfig:

 

Share this page:

49 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

Everything works fine with Larry skin (tried yesterday after instalaltion of Roundcube 0.9.1.)

By: Anonymous

i can confirm this! everything works fine with larry's theme.

By: Edson



Shows the error when I log in roundcube

SERVICE CURRENTLY NOT AVAILABLE! Error No. [500]

/var/log/roundcube/errors

[30-Apr-2014 11:50:40 -0300]: PHP Error: Could not perform encryption; make sure Mcrypt is installed or lib/des.inc is available in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 752$

I'm using ubuntu -  https://www.howtoforge.com/perfect-server-ubuntu-14.04-apache2-php-mysql-pureftpd-bind-dovecot-ispconfig-3

any suggestions ??

By: Nad

Hello,

Same config, same error... still searching...

By: darkshadow

Hello,

are the plugins running with roundcube 1.0.1?

Because since Update i got SOAP ERROR . NOT FOUND

see:

http://www.howtoforge.de/forum/installation-und-konfiguration-7/roundcube-soap-error-8218/#post41119

By: Nad

ok, found the solution on https://bugs.launchpad.net/ubuntu/+source/php-mcrypt/+bug/1243568

Simply type: sudo php5enmod mcrypt

 

Thierry

By: Anonymous

And then do:

sudo service apache2 restart

Worked for me.

By: kraft

Have you HowTo for install Roundcube 0.9 + ISPConfig 3 ?

By: Power Cords

One year ago, I can remember that the theme of Roundcube was not so much good but later many improvements were made in the theme. The problem in using mail server with hosting is that often emails go to spam or junk box if emails are sent to Gmail, Hotmail or Yahoo.

By: Kralik

Hello,
plugins are loaded and displayed data.
When I set up an automatic reply, so an error occurs:
Soap Error: Could not connect to host:

Login and password are correct.

please help
Thomas

By: pallermo

I still have this problem!
Still no solution...looking wazzup. If I find - I will post answer. 

 

 

By: Gomez

Please i have the same error :

Soap Error: Error Fetching http headers

who can help me ???

By: murraybiscuit

looks like you haven't installed the apache headers module. if you're debian install running apache 2, run this on the command line: 

~$: a2enmod headers

By: pallermo

Sorry,
I am wrong...I have:
Soap Error: Error Fetching http headers

 Looking for soultion...

By: Anonymous

This happens when you have configured ISPConfig to use HTTPS instead of HTTP.  Go edit /var/lib/roundcube/plugins/ispconfig3_account/config/config.inc.php and change the soap_url to have 'https' instead of 'http'.

By:

Great job everything is correct 

By: Linksdsd

I just want to say thank you for the guide on Roundcube. 

 

By: Olivier

Hello, 

 Thank you for this "how to" is working very well for me. 

Regards, Olivier 

By: Abdullah

Danke für die ausführliche Anleitung. Jetzt kann ich wieder Roundcube bennutzen :)

By: Bjarne

Great guide thanks :)

Btw. I found no problems keeping the larry theme. 

 However the stable release of roundcube is rather outdated. To install 0.9.5 version I added to 

 /etc/apt/sources.list:

# Backports repository

deb http://ftp.debian.org/debian wheezy-backports main contrib non-free

Then run to install Roundcube 0.9.5

aptitude update

aptitude -t wheezy-backports install roundcube roundcube-plugins roundcube-plugins-extra

 

By:

Followed the above, but only to end up with a non working mailserver. The mails can not be received or delivered afterwards. Removing Roundcube will make the mailserver work again. Tried the installation procedure serveral times, ending up with the same problem.

Clues anyone?

By: Jay

Excellent series of guides! Here is a fix which will prevent identities from being changed or additional ones created by the email user.

change the 'identities_level' in /etc/roundcube/main.inc.php

// Set identities access level:
// 0 - many identities with possibility to edit all params
// 1 - many identities with possibility to edit all params but not email address
// 2 - one identity with possibility to edit all params
// 3 - one identity with possibility to edit all params but not email address
// 4 - one identity with possibility to edit only signature
$rcmail_config['identities_level'] = 3;

By:

Something wrong in line 2 - fixed (line 3)

Missing line 3? Unpac?

cd /tmp 

#(git clone https://github.com/w2c/ispconfig3_roundcube.git) wget clone https://github.com/w2c/ispconfig3_roundcube.git cd /tmp/ispconfig3_roundcube/ mv ispconfig3_* /var/lib/roundcube/plugins cd /var/lib/roundcube/plugins mv ispconfig3_account/config/config.inc.php.dist ispconfig3_account/config/config.inc.php

By:

Note: It appears as though google pagespeed might break the plugins with the additions it makes to url requests... anyone confirm ?

By: N3RVE

I just wanted to point out that with PHP-FPM selected under Sites in ISPConfig, I was getting a blank screen even after following the guide meticulously. After switching to FastCGI and restarting Apache, it worked! Thanks for the guide. 

By:

Same problem here.

I can access with serverIP/webmail but cannot access from mydomain.com/webmail because all my sites are with mod-PHP and they dont work with fastcgi.

What can i do?

 

 

 

 

By: Anonymous

It is a very good idea to write the modified instructions in red and in underline.

 In this maner, it is impossible to see différence between "spacing caracter" and "underscore caracter" ! very good idea !!!

By:

Edit : 

 i changed the line 132 & 143 (where it's about DateTimeZone) in ispconfig_autoreply.php to $dt->setTimeZone(new DateTimeZone($this->rcmail_inst->config->get('timezone')));

It is working fine right now.

Hello,

I followed this great tutorial, everything is working fine except the autoreply, it loads nothing,

I've got this on the log : 

 tunmails.com:80 197.15.84.92 - - [29/Nov/2014:16:27:40 +0100] "GET /roundcube/?_task=settings&_action=plugin.ispconfig3_autoreply&_framed=1 HTTP/1.1" 500 484 "http://www.tunmails.com/roundcube/?_task=settings&_action=plugin.ispconfig3_account" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0"

 Any idea ?

 

Thanks

 

By: byman64

I installed roundcube using this tutoria. It was great, all worked and works fine.

 Now I would like upgrade roundcube from 0.9x to 1.x ?

Any idea how to  do it? 

 

By: nikolaosp

I would also love to learn how to upgrade to version 1.04 as 0,7 looks very outdated.

Thanks for your amazing work btw!

By: jacobg830

Awesome, Roundcube is WAY easier to use than Squirrelmail :)

 

Thanks for the guide.

By: ZEUFACK Arnel

Very Great!!thanx very much!!..

By: ispconfig newbie

if you have problem with autoreply plugin (not showing)

PHP Fatal error:  Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (1)' in /var/lib/roundcube/plugins/ispconfig3_autoreply/ispconfig3_autoreply.php:132

then check your timezone settings in /etc/roundcube/main.inc.php

// use this timezone to display date/time$rcmail_config['timezone'] = 'auto';

and set it to your correct timezone, eg:

$rcmail_config['timezone'] = 'Europe/Berlin';

By: inside83

THANK YOU!!!

By: ilko

I followed this tutorial (but on Debian 8) ... I got to broken Apache and the following message: 

 

service apache2 status

? apache2.service - LSB: Apache2 web server

   Loaded: loaded (/etc/init.d/apache2)

   Active: failed (Result: exit-code) since Sat 2015-06-20 06:13:00 EEST; 5min ago

  Process: 566 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

 

Jun 20 06:12:59 mammy100 apache2[566]: Starting web server: apache2 failed!

Jun 20 06:12:59 mammy100 apache2[566]: The apache2 configtest failed. ... (...).

Jun 20 06:12:59 mammy100 apache2[566]: Output of config test was:

Jun 20 06:12:59 mammy100 apache2[566]: apache2: Syntax error on line 216 of...ry

Jun 20 06:12:59 mammy100 apache2[566]: Action 'configtest' failed.

Jun 20 06:12:59 mammy100 apache2[566]: The Apache error log may have more i...n.

Jun 20 06:13:00 mammy100 systemd[1]: apache2.service: control process exite...=1

Jun 20 06:13:00 mammy100 systemd[1]: Failed to start LSB: Apache2 web server.

Jun 20 06:13:00 mammy100 systemd[1]: Unit apache2.service entered failed state.

Hint: Some lines were ellipsized, use -l to show in full.

I will be starting it all over again (without roundcube), however I would like to ask is it possible to make the Perfect server tutorials using roundcube, horde or any other webmail as squirellmail does not have HTML based text redactor (I rememmber it had a module for this, but it is such a pain to make it work). So Horde or roundube soon ?

By: vk1003

hi

I did exactly the same things and endded up having SOAP error : badrequest for the password change.. am i missing anything else to do.

By: orfi

works like a charm .

2 minor observations :  https access is neede if your access to 8080 is secure , and option 3 ( identities rights ) 

 

thank you again for your GREAT work 

By: nicolas

everything installed, and user created, config file in the right place, https activated, port 8080, .htaccess to allow the /remote folder ok, but still in error "wrong username & password" i've tried with different remote users, passwords… checked right, look at apache console … nothing. well I am stuck, any idea ? any ispconfig resync ? refresh ? thank

By: alex_popa_81

This is great but I really need to upgrade to version 1.1..... PLEASE HELP ME!

By: Thomas CARTER

Hi, My clients complained of a 5MB attachement limit. After upping the limits in php.ini and Postfix as described in various forums I eventually found /etc/roundcube/htaccess also has a limitation :

php_value       upload_max_filesize     5M

php_value       post_max_size           6M

I upped these to 25M and 30M and all was well.

 

 

By: Thomas CARTER

Last comment on  upload_max_filesize, signed Thomas CARTER

By: luckymeerza

Firstly i read wrong page of roundcube installation on ispconfig3 for nginx ,i thought there are no apache version so i removed and purged the roundcube packages. when i realized after 10 minutes i found this pages, so reinstall the roundcube for the 2nd time but unfortunately there are no dialog box or configuration page like the first time i installed roundcube. can you guys help me on this issue. thanks

By: Chag

Hi,

Just installed latest ispconfig. Seems to work more or less. I have a strange behavior on emails. The emails are received but I don't see them in the webmail. Tried squirrelmail and roundcube, same thing.

However, when I look in the server, I can see the messages in the /var/spool/mail/[user] file

Chag

By: vikozo

Hello

getting and sendig Mails are working

but going to the config part and to konto it says : Soap Error: Could not connect to host

By: Hacaro

Hi all, all works fine except the settings, if i click on settimg button it give me a 500 error please someone can help me to understand ? 

Thanks in advance 

By: Edijs Zatevahins

Hi do there is tutorial how to do add password plugin and other to IspConfig 3.1 Debian 9 ? We have Roundcube 1.2.3 there.

Ussing this tutorial not working. 

By: Edijs Zatevahins

Done

https://kentechnote.blogspot.com/2014/05/ispconfig-3-roundcube-mail-10-password.html

+

https://www.howtoforge.com/community/threads/how-to-setup-the-plugin-change-password-of-roundcube-with-ispconfig3.40068/

By: till

It is highly recommended to not use that method as you bypass ISPConfig, your method will fail in larger setups and password corruption will occur or the password change will not take effect at all. Instead of using this plugin, just install the ISPConfig Roundcube plugin which contains a password changer that does the password change the correct way by using the ISPConfig remote API. The ISPConfig RoundCube plugin does not depend on a specific OS version, so you can use it with Debian 9 as well.

By: Kwesi

I have installed ispconfig on an Ubuntu 20.04 vps server and it runs on an nginx 1.18.0 server. I have successfully created a site with ssl and also an email. But on the Email Mailbox, when I try to click the https://IP:8080/mail/webmailer.php?id=1 link associated with an email account, I get a 404 Not Found page.

Could it be that I need to do some configuration on the server? Could it be that I need to do something on ispconfig?

I am quite new with ispconfig and obviously confused on what next to do to resolve this, and will appreciate any help to resolve this asap.