Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: peter4220 on August 26, 2023, 01:41:28 PM

Title: Calendar plugin recommendation
Post by: peter4220 on August 26, 2023, 01:41:28 PM
Hi there

I have installed Roundcube 1.6.2 and the CardDAV plugin and it works well with Nextcloud.

I also want to install a CalDAV plugin, but I can't get some of them to work. I have tried with:
They all fail with different kinds of failure.

Is there a recommendation and an installation guide that works :-)

It all runs on an Ubuntu Jammy 22.04 which is fully updated
Title: Re: Calendar plugin recommendation
Post by: eMarcus on March 26, 2024, 10:59:27 AM
Hi,

I would have exactly the very same question.

I tried tried the texxasrulez/calendar plugin, but the installation fails with a dependency error:


Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
                                                                                                                                                                                             
  Problem 1                                                                                                                                                                                   
    - Root composer.json requires texxasrulez/calendar ~0.0.7.0 -> satisfiable by texxasrulez/calendar[0.0.7].                                                                               
    - texxasrulez/calendar 0.0.7 requires roundcube/plugin-installer ~0.1.6 -> found roundcube/plugin-installer[0.1.6, ..., 0.1.10] but it conflicts with your root composer.json require (~0.
3.1).                                                                                                                                                                                         
                                                                                                                                                                                             
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.                                                   


I am wondering if I can just downgrade the plugin-installer, or if I would break anything (0.3.1 -> 0.1.6 sounds a bit much of a downgrade...)

Could anyone comment on that, or advise me to another CALDAV plugin?

Thanks
Marcus.
Title: Re: Calendar plugin recommendation
Post by: SKaero on March 26, 2024, 05:08:27 PM
Looks like its a long standing issue with the plugin https://github.com/texxasrulez/calendar/issues/22
Title: Re: Calendar plugin recommendation
Post by: andreashaerter on April 02, 2024, 09:07:15 PM
Do not use these outdated plugins, they are all broken and/or unmaintained.

However, the active and well maintained https://git.kolab.org/diffusion/RPK/browse/master/plugins/calendar/ (https://git.kolab.org/diffusion/RPK/browse/master/plugins/calendar/) works perfectly fine with SabreDAV / Nextcloud and DAViCal with a little patch of kolab_dav_client.php. They only have a small error in URL parsing, leading to line-break-chars in different parts of the URL, so the request sent to the server are send wrongly. This is the only thing preventing the plugin to properly communicate with most CalDAV servers. I am going to prepare an upstream patch as well as a blog posting about the setup within the next days.
Title: Re: Calendar plugin recommendation
Post by: eMarcus on April 07, 2024, 02:42:29 PM
Hi,

Thanks very much and please let us know, when the patch is available!

Thanks,
Marcus.
Title: Re: Calendar plugin recommendation
Post by: Moeppi on April 14, 2024, 05:56:08 AM
Hi Andreas (andreashaerter),

Im also very interested in your workthrough on how to get Roundcube working with the calendar plugin from kolab and CalDAV integration.

In my case I have tried the calendar plugin of Roundcube+, but thats not the same. With their calendar plugin they turn Roundcube itself into a CalDAV server (where external calendar clients can connect to (read/write)). But I only want to connect Roundcube to an external CalDAV calendar, at the side of my mail provider.

So, Im also waiting and will be happy about your recommendations or better a little HowTo, on how to get things working :D .

Thanks in advance, Moeppi
Title: Re: Calendar plugin recommendation
Post by: hbsimon on May 13, 2024, 11:19:54 PM
Hi,

I am too interested to get a Calendar plugin with caldav working.

I have currently roundcube webmail with the carddav plugin connecting to the iCloud addressbook working, the addressbook is updating both way fine and all other mail function are working, including managesieve.

I tried to install with composer some of the calendar plugins but all failed. My installation is on MacOS with php 8.2 (installed using MacPorts). My questions are:
What are the minimum pre-requisites and in what sequence do I have to install them?
Are there any more detailed information available on the install and configuration process?

Regards,
Horst
Title: Re: Calendar plugin recommendation
Post by: internethering on September 05, 2024, 06:43:55 AM
There is no patch needed at the moment. My steps to get it working:

cd /var/www/html/roundcubemail
git clone https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git
cd /var/www/html/roundcubemail/roundcubemail-plugins-kolab
cp -a /var/www/html/roundcubemail/roundcubemail-plugins-kolab/calendar /var/www/html/roundcubemail/plugins
cp -a /var/www/html/roundcubemail/roundcubemail-plugins-kolab/libcalendaring /var/www/html/roundcubemail/plugins
cp -a /var/www/html/roundcubemail/roundcubemail-plugins-kolab/libkolab /var/www/html/roundcubemail/plugins

enabled these three plugins in /var/www/html/roundcubemail/config/config.inc.php
integrated the /var/www/html/roundcubemail/plugins/libkolab/SQL/mysql.initial.sql

copied /var/www/html/roundcubemail/plugins/config.inc.php.dist to /var/www/html/roundcubemail/plugins/config.inc.php and edited:

$config['calendar_caldav_server'] = "https://<nextcloud_url>/remote.php/dav";
$config['calendar_caldav_url'] = 'https://<nextcloud_url>/remote.php/dav/calendars/%u/%n';

so, now it works, but the elastic skin is failing. so I followed the steps of https://git.kolab.org/T4247#75894 (https://git.kolab.org/T4247#75894)

cd /var/www/html/roundcubemail/roundcubemail-plugins-kolab
git checkout dev/elastic
npm install less
ln -s /var/www/html/roundcubemail/skins /var/www/html/roundcubemail/roundcubemail-plugins-kolab/
edited less-build.sh so its using ./node_modules/less/bin/lessc

./less-build.sh
cp plugins/libkolab/skins/elastic/libkolab.min.css /var/www/html/roundcubemail/plugins/libkolab/skins/elastic/libkolab.css

voila: working calender with nextcloud
Title: Re: Calendar plugin recommendation
Post by: doktoil-makresh on September 06, 2024, 09:07:01 AM
Hi,

First of all, thank you for sharing your guide to allow Caldav usage in RC.
I installed everything but the elastic skin patch (I'm currently using Larry)

I've a personnal nextcloud instance running, so I've adapted the URL like this:
$config['calendar_caldav_server'] = "https://mynextcloud.instance.org/remote.php/dav";
$config['calendar_caldav_url'] = 'https://mynextcloud.instance.org/remote.php/dav/principals/%u';

Please note my nextcloud password is different than my IMAP's password.

I can see the calendar icon in RC, but I can't see my CalDAV calendar into it, neither add it.
Same in Settings/Calendar menu.

Is there something I missed somewhere?
Title: Re: Calendar plugin recommendation
Post by: alpianon on May 14, 2025, 07:09:45 PM
Quote from: andreashaerter on April 02, 2024, 09:07:15 PMDo not use these outdated plugins, they are all broken and/or unmaintained.

However, the active and well maintained https://git.kolab.org/diffusion/RPK/browse/master/plugins/calendar/ (https://git.kolab.org/diffusion/RPK/browse/master/plugins/calendar/) works perfectly fine with SabreDAV / Nextcloud and DAViCal with a little patch of [tt]kolab_dav_client.php[/tt]. They only have a small error in URL parsing, leading to line-break-chars in different parts of the URL, so the request sent to the server are send wrongly. This is the only thing preventing the plugin to properly communicate with most CalDAV servers. I am going to prepare an upstream patch as well as a blog posting about the setup within the next days.

Hi,

I managed to successfully install calendar and address book plugins and configure them to use a caldav/cardav server (in my case, Davical).

There was an issue, already mentioned by @andreashaerter above, that led to incorrect parsing of caldav server's xml responses, when such responses were pretty formatted. I reported the issue (https://git.kolab.org/T8424), which was promptly resolved by Kolab's team. So now everything is working as expected.

These are the steps to make it work:

cd /usr/local/share
git clone https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git
cd roundcubemail-plugins-kolab/
nano composer.json

I put the following content:

{
    "require": {
        "roundcube/plugin-installer": "^0.3.2",
        "kolab/libkolab": "3.6.0",
        "kolab/libcalendaring": "3.6.0",
        "kolab/calendar": "3.6.0",
        "kolab/kolab_addressbook": "3.6.0"
    },
    "repositories": [
        {
            "type": "path",
            "url": "plugins/libkolab"
        },
        {
            "type": "path",
            "url": "plugins/libcalendaring"
        },
        {
            "type": "path",
            "url": "plugins/calendar"
        },
        {
            "type": "path",
            "url": "plugins/kolab_addressbook"
        }

    ],
    "config": {
        "allow-plugins": {
            "roundcube/plugin-installer": true
        }
    }
}

Then I built the required css for Elastic theme:

apt install npm
npm install -g less
npm install -g less-plugin-clean-css
ln -s /var/lib/roundcube/skins .
./less-build.sh
cd plugins/libkolab/skins/elastic
ln -s libkolab.min.css libkolab.css

Then I created links to plugins (I have installed Roundcube as a debian package, so it is found at /var/lib/roundcube/; different installation methods may install it in different locations)


cd /var/lib/roundcube/
ln -s /usr/local/share/roundcubemail-plugins-kolab/composer.json .
ln -s /usr/local/share/roundcubemail-plugins-kolab/plugins/{calendar,kolab_addressbook,libcalendaring,libkolab} plugins/

then I copied and edited the calendar configuration file:

cd /var/lib/roundcube/plugins/calendar/
cp config.inc.php.dist config.inc.php
nano config.inc.php

I edited the following parameters (they work with Davical, you may need to change the caldav server and caldav url settings according to your specific server type and configuration):

$config['calendar_driver'] = "caldav";
$config['calendar_caldav_server'] = "https://<server_domain_name>/davical/caldav.php";
$config['calendar_caldav_url'] = "https://<server_domain_name>/davical/caldav.php/%u/%n";

Then I copied and edited the addressbook configuration file:

cd /var/lib/roundcube/plugins/kolab_addressbook/
cp config.inc.php.dist config.inc.php
nano config.inc.php

and I changed the following parameters (same as above: they work for Davical, you may need to change them depending on your server type and configuration):

$config['kolab_addressbook_driver'] = "carddav";
$config['kolab_addressbook_carddav_server'] = "https://<server_domain_name>/davical/caldav.php";
$config['kolab_addressbook_prio'] = 1;
$config['kolab_addressbook_carddav_url'] = "https://<server_domain_name>/davical/caldav.php/%u/%n";

Finally, I installed the plugins:

cd /var/lib/roundcube/
curl -s https://getcomposer.org/installer | php
php composer.phar install -n

To make Davical work correctly, I had to manually apply the patch of this MR (https://gitlab.com/davical-project/awl/-/merge_requests/40), which at the time I'm writing this, has not been merged yet (it was a bug of Davical/AWL, not of Roundcube/Kolab).

Now everything seems to work smoothly.
Title: Re: Calendar plugin recommendation
Post by: alpianon on May 14, 2025, 07:21:07 PM
I forgot one thing: to make Davical (or any other caldav server) work with Kolab's calendar plugin, calendar user and password must be the same as the email account.

A simple way to automatically have that in Davical is enabling IMAP autentication.

I did that by editing /etc/davical/config.php as follows:

<?php
//  $c->domain_name = "";
  
$c->sysabbr     'DAViCal';
  
$c->admin_email 'postmaster@<server_domain_name>';
  
$c->system_name "DAViCal Server";
  
$c->enable_row_linking true;
  
$c->authenticate_hook['call'] = 'IMAP_PAM_check';
  
$c->authenticate_hook['config'] = array(
      
'imap_url'   => '{127.0.0.1:993/imap/ssl/novalidate-cert}'
      
// https://stackoverflow.com/a/72376387/3855992
    
);
  include(
'drivers_imap_pam.php');

  
$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app';
?>