On 02.02.21 08:50, Aleksander Machniak wrote:
What do you mean expose? Are you up to a JMAP server or client?
Thanks for your quick reply! We want Roundcube to act as a JMAP server over a REST API for syncing contacts and calendars.
It probably makes sense to give some more background here: We at audriga specialize in the field of data portability. In the context of a European initiative called NGI DAPSI we are working on extending groupware applications w.r.t. portability.
Currently, there is no API available to sync PIM data to or from Roundcube. However, that is exactly what would be necessary for a well-working migration to/from Roundcube. This is why our current focus is on PIM data and not on mail. Instead of using the good old CaxDAV standards we chose the upcoming JMAP standard. More specifically JMAP for Contacts and JMAP for Calendars. We believe that JMAP has the potential to replace CalDAV/CardDAV once it has finished standardization. Also, JMAP covers additional data, such as Signatures or Out-of-office-replies which might be useful to access by clients.
By adding a server-side JMAP API to Roundcube, JMAP-capable clients such as https://github.com/iNPUTmice/lttrs-android could be able to sync contact/calendar/settings data with Roundcube once support for this feature has been added.
We have already built a first PoC with which we are able to read and write contact data. However, we currently duplicated quite a lot of code of the index.php for this and we would love some insight into how to refine our first PoC. Maybe this could even be something that you could see incorporated into the RC core?
Yes, plugin is the way to go, but a lot of core changes might be needed.
If it was for replacing IMAP store with JMAP store for mail, I'd suggest using undocumented storage_driver option. This would require writing a storage handler class that inherits from rcube_storage. By default rcube_imap is doing this. Of course this will be only a start. The core is not really prepared to work with different engine. All data structures are imap-based and not really standardized.
Thanks for clarifying. I will keep that in mind. We want to focus with our first implementation on contact/calendar, but it is certainly good to know how support for JMAP for Mail could be added in the future.
If you're up to using JMAP server as a source of contacts or calendar, then it would be separate plugins, I suppose. They could use/require the common "jmap_storage" plugin you create. For contacts this should be reasonably easy. For calendar you'd have to integrate into an existing calendar plugin (I assume) which will require some changes in that plugin's code.
The plugin API is certainly something we would like to use. When implementing this as a Roundcube plugin we are currently unsure about:
clients to talk to. Maybe by registering a custom action and using a basic auth header somehow? I was unable to find plugins that add a REST API to Roundcube, which is supposed to be used from outside Roundcube.
seem to implement the client side only.
Regards,
Joris