Roundcube webmail

Roundcube is a full featured webmail with a nice interface.

RoundCube 0.8 showing its new skin

Upgrading to the latest 1.0.1 version

This time the usual upgrade configuration showed below failed, so I had to manually edit the default config file.

NB: you have to enable the pdo support to mysql compilng your php --with-pdo-mysql

The upgrade process is quite straightforward; you simply have to untar the package in a temporary directory, move the old folder to be upgraded and run the upgrade shell script. I suppose that roundcube has to be installed in the /usr/local/www/htdocs folder.

cd /usr/local/www/htdocs
tar xzf roundcubemail-1.0.1.tar.gz
# move new version folder to a temporary folder. We'll run the update from there
mv roundcubemail-1.0.1 rc-temp
# remove the symbolic link. We'll restore it later
rm roundcube
# move old version's folder to the new dir. We are going to overwrite it during the upgrade process..
cp -rp roundcubemail-1.0.0 roundcubemail-1.0.1
# restore the symolic link
ln -s roundcubemail-1.0.1 roundcube
# Ready to start the upgrade..
./rc-temp/bin/installto.sh /usr/local/www/htdocs/roundcube/

Follow the instructions. Be aware that this process requires that the php and rsync commands are in your PATH.

At the end you can erase the temporary folder and also the old installation folder:

rm -r rc-temp roundcubemail-1.0.0

Requirements

The basic requirements are:

* The Apache, Lighttpd, Cherokee or Hiawatha web server
* .htaccess support allowing overrides for DirectoryIndex
* PHP Version 5.2.1 or greater including
   - PCRE, DOM, JSON, XML, Session, Sockets (required)
   - PHP Data Objects (PDO) with driver for either MySQL, PostgreSQL or SQLite (required)
     Note: MySQL database driver requires PHP 5.3 or newer.
   - Libiconv, Zip (recommended)
   - Fileinfo, Mcrypt, mbstring (optional)
* PEAR packages distributed with Roundcube or external:
   - Mail_Mime 1.8.1 or newer
   - Mail_mimeDecode 1.5.5 or newer
   - Net_SMTP (latest from https://github.com/pear/Net_SMTP/)
   - Net_IDNA2 0.1.1 or newer
   - Auth_SASL 1.0.6 or newer
* php.ini options (see .htaccess file):
   - error_reporting E_ALL & ~E_NOTICE (or lower)
   - memory_limit > 16MB (increase as suitable to support large attachments)
   - file_uploads enabled (for attachment upload features)
   - session.auto_start disabled
   - zend.ze1_compatibility_mode disabled
   - suhosin.session.encrypt disabled
   - mbstring.func_overload disabled
   - magic_quotes_runtime disabled
   - magic_quotes_sybase disabled
* PHP compiled with OpenSSL to connect to IMAPS and to use the spell checker
* A MySQL (4.0.8 or newer), PostgreSQL, MS SQL Server (2005 or newer) database engine
  or SQLite support in PHP
* One of the above databases with permission to create tables
* An SMTP server (recommended) or PHP configured for mail delivery

I will show how install it in a Linux/Apache/MySQL/PHP + qmail environment.

php configuration

Here is a minimal php configuration which matches all the Rouncube's requirements above in my Slackware environment:

./configure \
        --with-mysql=/usr/local/mysql \
        --with-mysqli=/usr/local/mysql/bin/mysql_config \
        --with-pdo-mysql=/usr/local/mysql \
        --with-mcrypt \
        --enable-mbstring \
        --with-zlib \
        --with-bz2 \
        --enable-sockets \
        --with-openssl \
        --enable-intl \
        --prefix=/usr/local/php \
        --with-apxs2=/usr/local/apache/bin/apxs

Optional extensions

An additional recommended extension is now intl, which is bundled in PHP-5.3, and on my Slackware requires ICU headers and libraries. Infact during the configuration you can have this error:

checking for icu-config... no
checking for location of ICU headers and libraries... not found
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

Installing ICU

Configure, compile and install as usual:

cd /usr/local/src
wget http://download.icu-project.org/files/icu4c/4.8.1/icu4c-4_8_1-src.tgz
tar xzvf icu4c-4_8_1-src.tgz
cd icu
chown -R root.root .
cd source
./configure
make
make install

Enabling intl with php>=5.3

First of all install ICU, then configure php with --enable-intl

Enabling intl with php 5.2

Install using pecl:

/path/to/php/bin/pecl install intl

Installing Roundcube

Download the tarball from http://roundcube.net/download to your htdocs folder, untar and set the folders' priviledges:

cd /usr/local/www/htdocs
tar xzf roundcubemail-x.x.x.tar.gz
ln -s roundcubemail-x.x.x roundcube
cd roundcube
chown -R root.apache .
chmod -R o-rx .
chmod g+w logs temp

Create the mysql user and database; grant that user limited priviledges. If MySQL and Apache live in the same host, use localhost as [apache-IP] in the following example:

> /usr/local/mysql/bin/mysql -u root -p

CREATE USER 'roundcube'@'[apache-IP]' IDENTIFIED BY '***';
GRANT USAGE ON * . * TO 'roundcube'@'[apache-IP]' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

CREATE DATABASE IF NOT EXISTS `roundcube` /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'[apache-IP]';

Now point your browser to http://url-to-roundcube/installer/ and follow the instructions. I leave the setup options but the mysql interface (select mysqli if available in your http server). Don't forget to copy the database parameters and set the IMAP address IP. Set username_domain to your default_domain and it will be sufficient to log typing just the username.

Copy the files main.inc.php and db.inc.php to the config folder as explained. Now set the file privileges:

cd config
chown root.apache *
chmod o-r *

If all the tests are ok remove the installer folder as recommended and disable the installer:

$rcmail_config['enable_installer'] = false;

I suggest to enable these options; of course you have to adjust them to your local configuration, expecially the paths to programs and files:

// Automatically add this domain to user names for login
$rcmail_config['username_domain'] = 'yourdomain.net';
// default setting if preview pane is enabled
$rcmail_config['preview_pane'] = true;
// declaring the auth type speeds up the imap connection with 0.5 version!!
$rcmail_config['imap_auth_type'] = NULL;
// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
$rcmail_config['force_https'] = true;
// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
$config['des_key'] = '123456789123456789123456';
// Absolute path to a local mime.types mapping table file.
// This is used to derive mime-types from the filename extension or vice versa.
// Such a file is usually part of the apache webserver. If you don't find a file named mime.types on your system,
// download it from http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
$config['mime_types'] = '/absolute/path/to/apache/conf/mime.types';
// path to imagemagick identify binary
$config['im_identify_path'] = '/usr/local/bin/identify';
// path to imagemagick convert binary
$config['im_convert_path'] = '/usr/local/bin/convert';
// use this format for date display (date or strftime format)
$config['date_format'] = 'd-m-Y';
// automatically create the above listed default folders on first login
$config['create_default_folders'] = true;
// If true all folders will be checked for recent messages
$rcmail_config['check_all_folders'] = true;

Comments

Can't access just via webmail

Thank you for sharing this useful information with us.

I just updated my roundcube from v.0.9.5. to v.1.0.0, but now I can't access just via webmail, I need to also be accessed from Roundcube login page, so I'm logged in twice... Do you have any idea how can I fix it? 

Thank in advance!

Re: Can't access just via webmail

I can't be of any help without details. Btw if you followed the upgrade procedure at the top of this page I remember that it didn't worked for me and I had to manually upgrade RC


Thank you for reply, shell

Thank you for reply, shell script worked for me but I have to login twice and I can not solve the problem stems from, these are my details:

cPanel Version 11.42.1 (build 5)
Apache version 2.2.27
PHP version 5.4.26
MySQL version 5.5.36-cll
Architecture x86_64
Operating system linux
Mailserver: Courier

If you need I can give root password for WHM..

 

I don't have any experience

I don't have any experience of cpanel, sorry


Thanks anyway!

Thanks anyway!