×
×

Install Roundcube webmail to Plesk 11 server.

Back

Installing Roundcube on Plesk

Install Roundcube Webmail on plesk 10.X/11 

NOTE:  Plesk 11.5x includes Horde 6.x and Roundcube webmail services.
 
 

This does not update/conflict or change any of plesks default configurations!
 

You should be able to copy and paste all commands as the setup is quite easy.

# mkdir /var/www/roundcube
# cd /var/www/roundcube
# wget roundcube install from http://roundcube.net/download
# tar -xvzf roundcubemail-version.tar.gz
# chown -R apache.apache logs temp
# chmod 777 logs temp

You can create any database name/username you want


# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
mysql> create database roundcubedb;
mysql> grant all privileges on roundcubedb.* to roundcubeuser@localhost identified by 'PASSWORD';
mysql> FLUSH PRIVILEGES;
mysql> exit
# mysql roundcubedb < SQL/mysql.initial.sql -uadmin -p`cat /etc/psa/.psa.shadow`
# cp config/db.inc.php.dist config/db.inc.php
# cp config/main.inc.php.dist config/main.inc.php

Connecting roundcube to its database


# vi config/db.inc.php
:/db_dsnw

Change the below to the password you created above



$rcmail_config['db_dsnw'] = 'mysql://roundcubeuser:PASSWORD@localhost/roundcubedb';

Create the below httpd.conf


# vi /etc/httpd/conf.d/roundcube.conf (or /etc/apache2/conf.d/roundcube.conf)

ServerName webmail
ServerAlias webmail.*
DocumentRoot /var/www/roundcube
<Directory "/var/www/roundcube">

Restart apache.

This will load over the top of Atmail and horde, if not disable both horde and AtMail

 

You need to change the below otherwise you have to type in the domain each time you login



# vi config/main.inc.php
$rcmail_config['default_host'] = NULL; to $rcmail_config['default_host'] = 'localhost';

I also change the following as i noticed some issues with folders not working properly on IMAP



//$rcmail_config['create_default_folders'] = false;
$rcmail_config['create_default_folders'] = true;

If you want to run the installer to test everything works you can change the following, i dont bother though



# vi config/main.inc.php:/enable_installer
$rcmail_config['enable_installer'] = true;

Netsonic Professional Admin Services

 

Enabling password change


# cp plugins/password/config.inc.php.dist plugins/password/config.inc.php
# vi plugins/password/config.inc.php

Change first line to $rcmail_config['password_driver'] = 'poppassd';

:wq
# vi config/main.inc.php
(find plugin):/'plugins'

Change it to $rcmail_config['plugins'] = array('password')
Now when you login, go to settings. You can now update the password!

Other settings that can help!

Set the following so emails always used Html not plain text

# vi config/main.inc.php
:/htmleditor
// 0 - never, 1 - always, 2 - on reply to HTML message only
$rcmail_config['htmleditor'] = 1;

Some common install bugs

 

Log in issue (instantly fails) Change the line main.inc.php the following Line from "null" to "plain"

# vi main.inc.php
:/imap_auth_type
$rcmail_config['imap_auth_type'] = plain;

Issue with Roundcube, settings page displays white.

# vi /etc/php.ini
:/date.timezone = "xxxxxx"

where xxxxxx is an aproprate timezone.
I updated mine to date.timezone = "Chicago" and my settings page now works

If you find you are having issues with moving items to other folders/deleting/emails aren't displaying in sent, they the following

//$rcmail_config['drafts_mbox'] = 'Drafts';
$rcmail_config['drafts_mbox'] = 'INBOX.Drafts';
 
//$rcmail_config['junk_mbox'] = 'Junk';
$rcmail_config['drafts_mbox'] = 'INBOX.Junk';
 
//$rcmail_config['sent_mbox'] = 'Sent';
$rcmail_config['drafts_mbox'] = 'INBOX.Sent';
 
//$rcmail_config['trash_mbox'] = 'Trash';
$rcmail_config['drafts_mbox'] = 'INBOX.Trash';
 
//$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
$rcmail_config['default_imap_folders'] = array('INBOX', 'INBOX.Drafts', 'INBOX.Sent', 'INBOX.Junk', 'INBOX.Trash')

Different ways to setup roundcube.

Setting up the httpd conf for roundcube, i prefer doing it this way rather then removing AtMail or Horde. You can set it up as a default webmail(depending on what you have setup) I have a domain i use for testing/domain alias which you can add to the Webmail URL to Home>Tools & Settings>Webmail Services>Register Additional Webmail (enter the URL)

# vi /etc/httpd/conf.d/roundcube.conf

ServerName webmail
ServerAlias roundcube.*
DocumentRoot /var/www/roundcube
<Directory "/var/www/roundcube">

If you want roundcube to be default webmail. go into plesk and disable both horde and Atmail. Then update the above to

# vi /etc/httpd/conf.d/roundcube.conf

ServerName webmail
ServerAlias webmail.*
DocumentRoot /var/www/roundcube
<Directory "/var/www/roundcube">




If this step is done, you dont need to add the DNS below. 

However you do need a httpd restart for this to take affect

 

If you want to add dns records to all the domains on your hosting you can run this script

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -Ns -e "select name from domains" | xargs -I {} /usr/local/psa/bin/./dns --add {} -a roundcube -ip SERVER_IP

Also add an entry into your plesk DNS template, so any newly added domains will have this dns record automatically. Now you should be able to using roundcube on any domain with the "http://roundcube.domain.com"

Also i have setup, when this was not setup any resolving/wildcard dns would display roundcube

vi /etc/httpd/conf.d/default.conf

ServerName default
ServerAlias default.*
DocumentRoot /var/www/vhosts/default/htdocs
<Directory "/var/www/vhosts/default/htdocs">

Setup webmail in plesk

 

Insert the webmail into plesks DB

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
INSERT INTO `psa`.`Webmails` (`id`, `product_id`, `name`, `version`, `release`, `docroot`, `enabled`) VALUES ('3', 'roundcube', 'Roundcube', '0.8.6', 'Release 0.8.6', '/var/www/roundcube', 'true');

(This is a little buggy, it has worked on some of my servers.. On others roundcube shows over the top of both atmail and horde, which isnt too bad really)

RESTART APACHE!

 

You can now add the webmail in Plesk mail settings and add it to service plans!