Overview
- This document is only valid for cPanel & WHM version 11.46 through 56. Customizations that use this method will not function in cPanel & WHM version 58 and later, because these versions ship Roundcube as an RPM.
- Because cPanel, L.L.C. doesn’t develop Roundcube, cPanel Technical Support can’t help with customization.
- To customize Roundcube for cPanel & WHM version 58 and later, read our How to Build and Install Custom RPMs documentation.
- cPanel, L.L.C. does not support Roundcube user experience customizations.
You can update and customize the Roundcube webmail application.
Path and filenames for the database
The SQLite database uses the following path and filename, where username represents a cPanel account username and domain represents a domain name:
/home/username/etc/domain/username.rcube.db
Additionally, the database applies the following naming conventions, where username represents a cPanel account username:
| Filename | Description | Example |
|---|---|---|
/home/username/etc/domain/username.rcube.db.unixtimestamp |
A backup file with a Unix timestamp. | username.rcube.db.1495814375 |
/home/username/etc/domain/username.rcube.db.latest |
A symlink to the latest Roundcube backup. | username.rcube.db.latest |
/home/username/etc/domain/username.rcube.db.YYYYMMDDHHMMSS.sqlite2 |
A SQLite v2 backup file. | username.rcube.db.20170523105040.sqlite2 |
Roundcube updates
Because the /usr/local/cpanel/bin/update-roundcube script only retains the last four backups, continuous execution of the /usr/local/cpanel/bin/update-roundcube script may result in data loss. We strongly recommend that you maintain external backups and avoid continuous backups of non-operational Roundcube installations.
The method that cPanel & WHM uses to update Roundcube affects your customizations. cPanel & WHM uses the following process to update Roundcube:
-
The system runs the
/scripts/upcpscript to update cPanel & WHM. -
The
/scripts/upcpscript runs the/usr/local/cpanel/install/webmailscript.Note:During this step, the script will check for custom Roundcube tarballs. For more information, read the Where to save a custom Roundcube tarball installation section.
-
The
/usr/local/cpanel/install/webmailscript executes the/usr/local/cpanel/bin/update-roundcubescript. -
The
/usr/local/cpanel/bin/update-roundcubescript runs the following command to remove the current Roundcube installation:rm -rf /usr/local/cpanel/base/3rdparty/roundcube -
The
/usr/local/cpanel/bin/update-roundcubescript extracts the appropriate source tarball to the/usr/local/cpanel/base/3rdparty/directory.Note:During this step, the
/usr/local/cpanel/bin/update-roundcubescript checks for the existence of the/var/cpanel/roundcube/installfile and performs one of the following actions:- If the
/var/cpanel/roundcube/installis not an executable file, the file’s contents print to theSTDOUTfile and Roundcube continues with the installation procedure of the normal cPanel & WHM configuration. -
If the
/var/cpanel/roundcube/installis an executable file, the/usr/local/cpanel/bin/update-roundcubescript executes this file and then terminates the script.- This bypasses cPanel & WHM’s manipulation of the Roundcube configuration files.
- If the file successfully executes, steps 5 through 9 of the installation procedure do not occur.
- If the
-
The
/usr/local/cpanel/bin/update-roundcubescript changes the ownership of the Roundcube installation to therootuser and thewheelgroup. -
The
/usr/local/cpanel/bin/update-roundcubescript checks for the existence of the/var/cpanel/roundcube/install file. -
The
/usr/local/cpanel/bin/update-roundcubescript extracts MySQL® configuration values from the system settings. -
The
/usr/local/cpanel/bin/update-roundcubescript backs up Roundcube’s MySQL database to the/var/cpanel/roundcube/roundcube.backup.sql.currenttimestampfile, wherecurrenttimestamprepresents the time at which the script ran.Note:The
/var/cpanel/roundcube/directory only retains the four most recent copies of the Roundcube database backup. -
The
/usr/local/cpanel/bin/update-roundcubescript drops the Roundcube database from MySQL. -
The
/usr/local/cpanel/bin/update-roundcubescript updates Roundcube’s configuration files and MySQL files with the server’s settings. -
The
/usr/local/cpanel/bin/update-roundcubescript recreates Roundcube’s database from the MySQL files. -
The
/usr/local/cpanel/bin/update-roundcubescript reloads the previous Roundcube database backup and finishes the update.
Install a customized instance of Roundcube
There are many ways that you can customize Roundcube. For example, you can make simple configuration changes or completely replace the Roundcube tarball.
For instructions on how to customize Roundcube, read the Roundcube wiki.
Where to save a custom Roundcube tarball
During step 2 of the Roundcube update installation procedure, the /usr/local/cpanel/bin/update-roundcube script checks for custom Roundcube tarballs. If any of these tarball files exist, cPanel & WHM uses them instead of the cPanel-provided tarball.
If the script locates multiple tarballs, it uses them in the following order, where RCUBE_VERSION represents the Roundcube version number:
/var/cpanel/roundcube/roundcube-RCUBE_VERSION-local.tar.gz— Use this location for a compressed tarball that you want to apply to a specific Roundcube version./var/cpanel/roundcube/roundcube-RCUBE_VERSION-local.tar— Use this location for an uncompressed tarball that you want to apply to a specific Roundcube version./var/cpanel/roundcube/roundcube-local.tar.gz— Use this location for a compressed tarball that you want to apply to Roundcube, regardless of version./var/cpanel/roundcube/roundcube-local.tar— Use this location for an uncompressed tarball that you want to apply to Roundcube, regardless of version.
Example
For example, cPanel & WHM uses the /var/cpanel/roundcube/roundcube-0.4-local.tar.gz file if the following statements are true:
- The
/var/cpanel/roundcube/roundcube-local.tarand/var/cpanel/roundcube/roundcube-0.4-local.tar.gzfiles exist. - The
/var/cpanel/roundcube/roundcube-0.4-local.tar.gzfile matches the version number that the /usr/local/cpanel/bin/update-roundcubescript specifies.
- The value that
RCUBE_VERSIONrepresents in these locations must match theRCUBE_VERSIONvariable that the/usr/local/cpanel/bin/update-roundcubescript defines. For example, if theRCUBE_VERSIONparameter is version 0.4 in the/usr/local/cpanel/bin/update-roundcubescript, you must save your custom tarball as theroundcube-0.4-local.tar.gzfilename. - These tarballs must extract to the
/usr/local/cpanel/base/3rdparty/roundcube/directory.
Where to store a custom overlay file
The overlay tarball allows you to customize specific attributes of Roundcube, such as the use of an overlay to change graphics, themes, or plugins. It can also contain one image file.
The overlay does not require a complete Roundcube distribution. It only requires the components that you wish to modify, because cPanel & WHM will overlay it onto the Roundcube installation. However, the overlay requires a directory structure that matches the /usr/local/cpanel/base/3rdparty/roundcube directory structure and begins with the roundcube name.
After you determine which tarball to use for the source installation and extract it, the /usr/local/cpanel/bin/update-roundcube script checks for the following directories. If the script locates multiple tarballs, it uses them in the following order, where RCUBE_VERSION represents a Roundcube version number:
-
/var/cpanel/roundcube/overlay.RCUBE_VERSION.tar.gz— Use this location for a compressed overlay that you want to apply to a specific Roundcube version. -
/var/cpanel/roundcube/overlay.tar.gz— Use this location for a compressed overlay that you want to apply to Roundcube, regardless of version. -
/var/cpanel/roundcube/overlay.RCUBE_VERSION.tar— Use this location for an uncompressed overlay that you want to apply to a specific Roundcube version. -
/var/cpanel/roundcube/overlay.tar— Use this location for an uncompressed overlay that you want to apply to Roundcube, regardless of version.
The value of the RCUBE_VERSION variable must match the version number that the /usr/local/cpanel/bin/update-roundcube script specifies.