Global address book in Roundcube
To create a global address book in Roundcube, download and enable Roundcube Webmail GlobalAddressbook.
Download, unzip, and move the files to the Roundcube plugins directory:
wget -q "https://github.com/johndoh/roundcube-globaladdressbook/archive/refs/heads/master.zip" -O /tmp/plugin.zip && \
unzip -q /tmp/plugin.zip -d /tmp && \
mv /tmp/roundcube-globaladdressbook-master /usr/share/roundcube/plugins/globaladdressbook && \
rm -f /tmp/plugin.zipwget -q "https://github.com/johndoh/roundcube-globaladdressbook/archive/refs/heads/master.zip" -O /tmp/plugin.zip && \
unzip -q /tmp/plugin.zip -d /tmp && \
mv /tmp/roundcube-globaladdressbook-master /usr/share/roundcubemail/plugins/globaladdressbook && \
rm -f /tmp/plugin.zipRename the configuration file template:
mv /usr/share/roundcube/plugins/globaladdressbook/config.inc.php.dist /usr/share/roundcube/plugins/globaladdressbook/config.inc.phpmv /usr/share/roundcubemail/plugins/globaladdressbook/config.inc.php.dist /usr/share/roundcubemail/plugins/globaladdressbook/config.inc.phpNext, you can configure the address book as desired: book name, access rights, groups, and so on.
Add the plugin name to the list in the Roundcube configuration file /etc/roundcube/config.inc.php (/etc/roundcubemail/config.inc.php for RHEL-based systems):
$config['plugins'] = array(
'autologin',
'globaladdressbook',
);In the ispmanager 6 panel
If you're using Roundcube from the ispmanager 6 panel, make some changes to the plugin, specifically replace the str_contains function with its classic equivalent, strpos. This plugin is written for PHP 8, while Roundcube in ispmanager 6 uses PHP 7.4.
To do this, run the following commands:
sed -i '166s/(str_contains($username, '\''@'\'')/(strpos($username, '\''@'\'') !== false/g' /usr/share/roundcube/plugins/globaladdressbook/globaladdressbook.php
sed -i '254s/(str_contains($str, '\''%i'\''))/(strpos($str, '\''%i'\'') !== false)/g' /usr/share/roundcube/plugins/globaladdressbook/globaladdressbook.phpsed -i '166s/(str_contains($username, '\''@'\'')/(strpos($username, '\''@'\'') !== false/g' /usr/share/roundcubemail/plugins/globaladdressbook/globaladdressbook.php
sed -i '254s/(str_contains($str, '\''%i'\''))/(strpos($str, '\''%i'\'') !== false)/g' /usr/share/roundcubemail/plugins/globaladdressbook/globaladdressbook.php