How to connect RoundCube to a Calendar

Background

[Update 03 July 2023 – Please see the comments of this post before starting this journey. Connecting RoundCube to a calendar server is super challenging and a lot of information is outdated and doesn’t work.]

RoundCube is excellent Webmail but doesn’t have a calender – something people used to Outlook may require.

Fortunately the makers of RoundCube, namely Kolab, have an excellent Calendar plugin for their webmail.

Just one problem – it doesn’t come with instructions and it’s rather technical to install.

Fortunately by the Magic of Google and some blood, sweat, and tears, we were able to get it working. To follow these instructions you need to be a fairly confident sysadmin that knows how to navigate a file system and edit configuration files. How to turn on PHP error logging. Where to find those log files.

Most of the instructions were taken from anther outdated article here, modified to bring it up to date with 2021. Also we’re using Ubuntu not CentOS for this guide, although doing in on CentOS should be fairly similar.

If you’re not technical enough, you could just purchase the plugin from RoundCube plus or Kolab. See references for one possible solution.

Prerequisites

  • You have to know where Roundcube is installed. E.g.: /home/example.com/public_html/webmail
  • If your web server isn’t reporting PHP errors, you’re in for the long haul. If this procedure doesn’t work then you might get a 500 error and if the normal Apache/NGINX log doesn’t spit out the exact message you have a problem. Fixing PHP not logging errors is outside of the scope of this article but we’ve left advanced users one tip later in this article.
  • You need to know how to retrieve your MySQL credentials from the existing Roundcube
  • Elastic Skin must be selected in RoundCube
  • `apt install node-less` for the lessc compiler
  • Compiling of less assets
  • Removing of Dark mode switch in the less asset.
  • Adding a config for Calendar in the main include.

Instructions

Here are the instructions

apt install git php-sabre-*
cd /tmp
git clone https://git.kolab.org/diffusion/RPK/
[find your webmail installation] or [cd /usr/share/roundcube/plugins]
cp -r /tmp/RPK/plugins/calendar .
cp -r /tmp/RPK/plugins/libcalendaring .
cp -r /tmp/RPK/plugins/libkolab .
cd calendar [your actual new folder]
cp config.inc.php.dist config.inc.php

Edit config.inc.php to fit your needs but when we did it all defaults were good.

Config.php (in Main installation)

You have to calendar after copying the three directories as specified above:

// List of active plugins (in plugins/ directory)
$config['plugins'] = array('virtuser_file',
   'archive',
   'zipdownload',
   'calendar',
);

Edit the file mysql.initial.sql and the line that import system change to single backtick system single backtick

mysql -u root -pYOURPASSWORD roundcubedb < drivers/database/SQL/mysq.initial.sql

Caveats

Error 500

Well sorry 500 is server error so you need more granular logging. Enable PHP ini for errors. This worked for us:

ini_set('display_errors',1)

We added this to calendar.php init() function which allowed us to see that libkolab wasn’t present. So we modified the original instructions from that site to include libkolab

Patching?

The source article it refers to patching libcalendaring but to us it looked like it’s a more modern version of PHP and not needed.

Caveats

Unable to find CALDAV Url? You are not alone!

https://www.roundcubeforum.net/index.php?topic=29222.0

This most like indicates that you don’t have a CALDAV server, like WHM, who uses Apple’s CALDAV server, long ago deprecated.

Distorted Layout

Even though the calendar works, for some reason none of the list of calendar’s are showing. Please leave us a comment if you know how to fix this.

References

As per the comments on this post, please give this library a go:

Older References

Share this article

9 thoughts on “How to connect RoundCube to a Calendar”

  1. Thanks for this article.
    I don’t use any database with roundcube.
    Is there a way to do so with calendar plugin?

    1. Eugène van der Merwe

      Hi @Nathan,

      I spent many hours trying to get it working. It’s too complicated. So far our ideas are:

      – Use Outlook instead (expensive)
      – Use Google Workspace
      – Use Kopano
      – Use WHM (but still lots of extra work)

  2. Eugene-
    I feel for you, there is no valid reason it should be this bad other than neglect. Well, I found this article after digging through layers of issues, attempted upgrades, etc., now pouring through the code and have this to say: The existing solution is a kludge at best, and built upon layers of ancient ones. While it is pretty straight-forward to extend the built-in addressbook and get cardDAV up and running with the roundcube/carddav plugin, architecture of the DAV extensions to the calendar extensions are profoundly different. One such major difference is the complete lack of configuration U/I for server and calendar URL that roundcube/carddav has from the start. In the caldav extension, the config is global, with few terse directives allowing only minimal variable substitution in the URI creation, and if you use a backend server such as radicale where calendar hashes are long and complicated you are completely out of luck. Maybe if I get some (maybe a lot) of spare time I can fork this crusty mess and patch the user config piece of cardDAV into it and make it ‘work out of the box’ on v1.6 of Roundcube like it should, at the expense of just making the mess of code even more of a mess.

  3. Eugène van der Merwe

    Hi there G. Wustenstein,

    Yep I really wish this was easier. It seems that the people who have the technology, e.g. Microsoft and Google, still don’t work well together on these issues. Since this article was written I’ve done one successful implementation of Kopano where I was about to loose the client because they urgently needed calendar sharing. However, I still have legacy infrastructure, e.g. Virtualmin, which has beautiful Roundcube but no calendars. Basically every day I’m waiting for that dreaded call of a client asking me why they can’t see their calendar on their phone and on their PC.

    With WHM I’ve since discovered it requires massive memory to work:
    > This plugin requires a minimum of 7 GB of RAM and 4 CPU cores.
    Also the instructions on setting it up makes one want to weep:
    https://docs.cpanel.net/knowledge-base/webmail/how-to-set-up-calendars-and-contacts/
    FYI the WHM solution is also based on Z-Push which is similar to what Kopano uses.

    Bit by bit we’re solving this problem but I can see how this is going to drag out for years.

  4. Thank you, thank you, thank you.
    Just used this as the starting point to get myself a working calendar on Roundcube, next target is to access the calendar from Outlook/mail client in addition to web interface.
    In case it helps anyone else
    Ubuntu 22.04.1 LTS, PHP 8.1, Roundcube 1.6.0
    I had a historic $config[‘db_prefix’] = ‘rndcb_’; in my roundcube config, as a consequence browsing to my calendar after the mysql import left my [find your webmail installation]/logs/errors.log filling up with entries like:
    DB Error: [1146] Table ’roundcubedb.rndcb_calendars’ doesn’t exist (SQL Query: SELECT *, `calendar_id` AS id FROM `rndcb_calendars` WHERE …

    Using phpmyadmin table operations to rename the tables (`rndcb_calendars`, `rndcb_events`
    `rndcb_attachments` , `rndcb_itipinvitations`) changes the errors to:

    DB Error: [1452] Cannot add or update a child row: a foreign key constraint fails (`roundcubedb`.`rndcb_calendars`, CONSTRAINT `fk_calendars_user_id` …

    Again, phpmyadmin (table -> structure -> relationships) on `rndcb_calendars`, and `rndcb_itipinvitations` to drop the relationship and then alter to point to the correct table (in my case `rndcb_users` rather than the default `users`) and I can add calendars and create events.

    My layout does not appear distorted and I can see both my calendars in the list and in the dropdowns. as I said I’m using Roundcube 1.6.0 with the Elastic Skin.

    About to have a go at sharing a “Family Calendar” and seeing if I can access from phone/Outlook – if I have any joy I’ll let you know.

    1. Eugène van der Merwe

      @martin,

      Thank you so much! This is totally incredible work. Such a mission but you’ve gotten a lot further than I did already. Keep us posted!

      1. @EUGÈNE

        I followed instructions from this article, but the maximum I got – is a working “local” calendar, without any support of CalDav.

        Fortunately, I found this project: https://github.com/JodliDev/calendar.
        I installed the plugin from there (following instructions from README.md) and now I have a fully working Calendar connected to my CalDav server and working without issues.

        I hope this helps.

        1. Eugène van der Merwe

          @Alexander,

          I had a quick scan of that Github library and it seems like this is the way to go. It’s a 10 year old library that has very recent updates, so everything seems very legitimate. I also like that they explain in detail the same problem we have been experiencing. Thanks a lot for the link! For now I’ve updated the article also to refer to your comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top