RoundCube Calendar Plugin Installation Guide (updated.. again)

petersconsult

Verified User
Joined
Sep 10, 2021
Messages
69
Hello all,

i just thought i'd give an A-Z summary of my installation of the RoundCube Caledar Plugin (as discussed here and here)

So.. it's been a real adventure.. this is going to be a very, very, very long post..

Basically, i started by following with the instructions found here..
But, as has been found in the posts linked above, there was a huge bug (and a few small ones) that took a lot of sleuthing to resolve.

So, i figured i'd post the whole thing here, to spare anyone the headaches i ran into..

So, to start with, i pretty much followed the instructions from the posts linked above:

Note that the trailing backslashes are so you can copy-paste the entire block of code in your terminal. Also, this all assumes root privileges; add 'sudo' as needed
Also, any time you see 'killall lsphp; ' that's only for LiteSpeed; if you're using something else (Apache), skip it!


The first step is to temporarily edit the file:
/etc/dnf/dnf.conf

and temporarily remove this from the 'exclude' line, then save the file (we'll add it back when we're done):
php*

Next, we install some stuff, make a backup of your Roundcube db, and do the install:
Code:
dnf install libldb-dev* openldap-dev* php-ldap php-cli php-json php-zip wget unzip epel-release; \
cd /tmp; \
git clone https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git; \
cd /var/www/html/roundcube/plugins/; \
cp -r /tmp/roundcubemail-plugins-kolab/plugins/calendar ./; \
cp -r /tmp/roundcubemail-plugins-kolab/plugins/libcalendaring ./; \
cp -r /tmp/roundcubemail-plugins-kolab/plugins/libkolab ./; \
cd calendar; \
cp config.inc.php.dist config.inc.php; \
mysqldump -u da_admin -p`sed -n -e 's/passwd=//p' /usr/local/directadmin/conf/mysql.conf` da_roundcube > /var/www/html/roundcube/da_roundcubeBK.sql; \
mysql -u da_admin -p`sed -n -e 's/passwd=//p' /usr/local/directadmin/conf/mysql.conf` da_roundcube < /var/www/html/roundcube/plugins/calendar/drivers/database/SQL/mysql.initial.sql; \
mysql -u da_admin -p`sed -n -e 's/passwd=//p' /usr/local/directadmin/conf/mysql.conf` da_roundcube < /var/www/html/roundcube/plugins/calendar/drivers/kolab/SQL/mysql.initial.sql; \
mysql -u da_admin -p`sed -n -e 's/passwd=//p' /usr/local/directadmin/conf/mysql.conf` da_roundcube < /var/www/html/roundcube/SQL/mysql.initial.sql;


Next, we add the mention ‘calendar’, to the roundcube config file with your favorite editor; if you've not yet created a custom config for RoundCube, do this, otherwise, skip this step:
Code:
mkdir /usr/local/directadmin/custombuild/custom/roundcube; \
cp /var/www/html/roundcube/config/config.inc.php /usr/local/directadmin/custombuild/custom/roundcube/;


Next we edit the file:
/usr/local/directadmin/custombuild/custom/roundcube/config.inc.php

and change this (basically adding the line 'calendar',):
Code:
$config['plugins'] = [
    'password',
    'archive',
    'zipdownload',
];

To this:
Code:
$config['plugins'] = [
    'password',
    'archive',
    'zipdownload',
    'calendar',
];


Next, check if these 2 files exist:
/usr/lib/libldap.so
/usr/lib/liblber.so

If they don't exist, do this:
Code:
ln -s /usr/lib64/libldap.so /usr/lib/libldap.so; \
ln -s /usr/lib64/liblber.so /usr/lib/liblber.so;


Next, If you've not yet created a custom config for your version of php, do this, otherwise, skip this step -- replace the numbers behind php to match your version:
Code:
mkdir /usr/local/directadmin/custombuild/custom/php; \
cp /usr/local/directadmin/custombuild/configure/php/configure.php74 /usr/local/directadmin/custombuild/custom/php/;

This created the file:
/usr/local/directadmin/custombuild/custom/php/configure.php74

Next edit that file to add the following lines -- Make sure there is a trailing backslash \ at the end of every line except the last one!!:
--with-ldap=/usr \
--with-ldap-sasl=/usr

Next, we install more stuff, and rebuild php.. This will take about 10 minutes..:
Code:
cd /tmp/; \
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm;  \
dnf --enablerepo=remi install php-sabre-vobject-3*; \
/usr/local/directadmin/custombuild/build php -n;


We're done installing php-related stuff, so it's time to re-add the mention:
php*
to the 'exclude' line in the file:
/etc/dnf/dnf.conf


Next, we install Composer:
Code:
cd /tmp; \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer;


Next, a new step to create a hook to be run after CustomBuild intervenes (such as after a DirectAdmin or CustomBuild update):
Code:
mkdir /usr/local/directadmin/custombuild/custom/hooks; \
mkdir /usr/local/directadmin/custombuild/custom/hooks/roundcube; \
mkdir /usr/local/directadmin/custombuild/custom/hooks/roundcube/post; \
cd /usr/local/directadmin/custombuild/custom/hooks/roundcube/post/ ;\
touch ./FixSabre.sh; \
echo '#!/bin/sh' > ./FixSabre.sh; \
echo 'cd /var/www/html/roundcube/; ' >> ./FixSabre.sh; \
echo 'composer require -n "sabre/vobject" "~3.3.3"; ' >> ./FixSabre.sh; \
echo 'killall lsphp; ' >> ./FixSabre.sh; \
/usr/local/directadmin/custombuild/build roundcube; \
mkdir /root/rc-post-update/; \
cp -r /var/www/html/roundcube/plugins/calendar /root/rc-post-update/; \
cp -r /var/www/html/roundcube/plugins/lib* /root/rc-post-update/; \
touch ./zFixCal.sh; \
echo '#!/bin/sh' >> ./zFixCal.sh; \
echo 'cd /var/www/html/roundcube/plugins/; ' >> ./zFixCal.sh; \
echo 'cp -r /root/rc-post-update/calendar ./; ' >> ./zFixCal.sh; \
echo 'cp -r /root/rc-post-update/lib* ./; ' >> ./zFixCal.sh; \
echo '/usr/local/directadmin/custombuild/build roundcube; ' >> ./zFixCal.sh;


There is one more thing to do, which is to build the Calendar css file..
This was a major headache, because, even after installing all the appropriate ruby components, less kept failing with an error..

i copied everything to my Mac, where i built the css file; i'm including it here to save you the aggravation..
The file is called libkolab.min.css.zip, you need to copy it to the following folder, and unzip it (See Addendum 2 if you wish to build it yourself):
/var/www/html/roundcube/plugins/libkolab/skins/elastic/

so that you get:
/var/www/html/roundcube/plugins/libkolab/skins/elastic/libkolab.min.css


Finally, we build RoundCube, and, just for fun, rewrite_confs:
Code:
/usr/local/directadmin/custombuild/build rewrite_confs; \
/usr/local/directadmin/custombuild/build roundcube;


All Done!!!

i sincerely hope this helps!!





Addendum 1:
Here is the problem i kept running into before installing the remi repo, php-sabre, running composer, and rebuilding php..
Basically, it looked like everything worked; the calendar looked fine, but opening individual emails resulted in a 500 error..
See the screenshot for an example..
RC-Mod-screenie.jpg


Addendum 2:
If you wish to build the file libkolab.min.css yourself, this is the command:
Code:
lessc -x /var/www/html/roundcube/plugins/libkolab/skins/elastic/libkolab.less > /var/www/html/roundcube/plugins/libkolab/skins/elastic/libkolab.min.css

But This will most likely not work since you likely don't have the less gem installed, so you'll probably need to do the following -- but this did not work for me!! So do with it what you will:
Code:
yum install rubygems gcc-c++ ruby-devel; \
gem install less; \
gem install therubyracer;


Addendum 3:
2022-07-04: just updated the guide with a couple corrections of typos and omissions..
2022-08-16: the Never-Ending Story....
2023-11-20: added a backup of the plugin files in the root folder to have them automatically copied after each update..
Sorry..
 

Attachments

  • libkolab.min.css.zip
    19.3 KB · Views: 49
Last edited:
First of all, thank you for the detailed guide. It was very helpful!

If you're not using the sabre/dav library for anything else, I would suggest changing "composer require sabre/dav" to "composer require sabre/vobject:^3.5".
Sabre/dav includes sabre/vobject:4.X which breaks the import in the calendar. More details here:
 
omg..
This is never-ending..

So, i've been running into problems again with this..
More specifically, the 'Oops' page keeps showing up again..

the temporary workaround seems to be to change this part:
composer require "sabre/vobject" "~3.3.3"

and not to rebuild Roundcube..
Rebuilding Roundcube breaks everything all over again..

i'll figure out what's going on, but i need some time..
 
Last edited:
OK!!
i got it..
i fixed the issue by creating a hook into CustomBuild..
i'm going to edit the original post, but here's what i did:

Code:
mkdir /usr/local/directadmin/custombuild/custom/hooks; \
mkdir /usr/local/directadmin/custombuild/custom/hooks/roundcube; \
mkdir /usr/local/directadmin/custombuild/custom/hooks/roundcube/post; \
cd /usr/local/directadmin/custombuild/custom/hooks/roundcube/post/ ;\
touch ./FixSabre.sh; \
echo '#!/bin/sh' > ./FixSabre.sh; \
echo 'cd /var/www/html/roundcube/; ' >> ./FixSabre.sh; \
echo 'composer require -n "sabre/vobject" "~3.3.3"; ' >> ./FixSabre.sh; \
echo 'killall lsphp; ' >> ./FixSabre.sh;

Which means that every time you rebuild RoundCube, Sabre will run after that..
Also, beware the last line, it's only needed for LiteSpeed
 
Hello

I always get an error when I want to read a message.

capture_erreur_webmail4.png

>When I make this order :

lessc -x /var/www/html/roundcube/plugins/libkolab/skins/elastic/libkolab.less > /var/www/html/roundcube/plugins/libkolab/skins/elastic/libkolab.min.css
Skipped data-uri embedding of ../images/corner-handle.svg because file not found
Skipped data-uri embedding of ../images/download.svg because file not found
Skipped data-uri embedding of ../images/eye.svg because file not found
The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.

Is when I want to export my calendar to outlook :


capture_erreur_webmail2.png

Mz
 

Attachments

  • RC-Mod-screenie.jpeg
    RC-Mod-screenie.jpeg
    135.3 KB · Views: 9
Hello There,

i did not succeed in building the libkolab.min.css file directly on the server, i had to build it on my mac, that's why i included it in the attachments in my post..
maybe just try the one i provided,,

Make sure that you read the entire post carefully, and make sure that you use the correct version of
php-sabre-vobject-3*

i suggest that you reproduce each step in my post: it's up to date, so it should work..
What system is your server running? centos? ubuntu?
which web server? Apache? nginx? LiteSpeed?
 
Hello

Apache server,
OS , Debian 11

How do you synchronize to Calendar on Mac or Outlook on PC?

Mz
 
Last edited:
I'm really not sure how the calendars are synchronized; i think it's through CalDav..
but i have no idea how it works beyond that..
 
Just a quick update, i modified the instructions to add a backup of the plugin files in the root folder to have them automatically copied after each update..
indeed, each update to round cube requires that the calendar plugin files be copied, so i added a file in the hooks that should do that automatically..
not tested yet, will adjust as needed..

this is what i added:
Code:
mkdir /root/rc-post-update/; \
cp -r /var/www/html/roundcube/plugins/calendar /root/rc-post-update/; \
cp -r /var/www/html/roundcube/plugins/lib* /root/rc-post-update/; \
touch ./zFixCal.sh; \
echo '#!/bin/sh' >> ./zFixCal.sh; \
echo 'cd /var/www/html/roundcube/plugins/; ' >> ./zFixCal.sh; \
echo 'cp -r /root/rc-post-update/calendar ./; ' >> ./zFixCal.sh; \
echo 'cp -r /root/rc-post-update/lib* ./; ' >> ./zFixCal.sh; \
echo '/usr/local/directadmin/custombuild/build roundcube; ' >> ./zFixCal.sh;
 
Back
Top