On 03.02.2021 08:40, Joris Baum wrote:
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?
I understand why you'd like to make it a core feature, but this is not a mail client feature and I don't see it there.
The plugin API is certainly something we would like to use. When implementing this as a Roundcube plugin we are currently unsure about:
- How to open up and authenticate against a REST endpoint for JMAP
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.
I'm afraid the plugin API is not prepared for this use-case. The first hook that is executed in a request is the 'startup' hook. You may try to use it to hijack the request to implement your service.
Plugins are loaded before the session is started, output classes loaded, etc. So, technicly you could put a code outside of the plugin class (but still in the plugin file) to make it executed as soon as possible, but this is really a hack.