james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphaël Ouazana-Sustowski <raphael.ouaz...@linagora.com>
Subject Implementation of JMAP protocol in James
Date Mon, 23 Nov 2015 13:55:26 GMT
Hi,

JMAP is a transport-agnostic, stateless JSON-based API for synchronising 
a mail client with a mail server [1].

As some of you may know we are working on implementing JMAP in James. We 
are in the early stage of architecting the code.

The current specification [2] supports only HTTP(S) protocol as 
transport. So first step is to add a module serving HTTP(S) requests in 
James.
We are pretty advanced in this topic. You can have a look at the 
following PR:
https://github.com/linagora/james-project/pull/40
The minimal feature set of this server is:
- serving HTTP(S) requests with port configuration (allowing random port 
for tests)
- servlet mapping
- filter mapping

We are embedding Jetty for this. Configuration can be done either in 
Java:
Configuration.builder()
   .port(5000)
   .serve("/foo")
     .with(Ok200.class)
   .serve("/bar")
     .with(Bad400.class)
.build()

or with an XML configuration:
<httpservers>
     <httpserver>
         <port fixed="5000"/>
         <mappings>
             <mapping>
                 <path>/foo</path>
                 <servlet>org.apache.james.http.jetty.Ok200</servlet>
             </mapping>
             <mapping>
                 <path>/bar</path>
                 <servlet>org.apache.james.http.jetty.Bad400</servlet>
             </mapping>
         </mappings>
     </httpserver>
</httpservers>

Note that this HTTP Server could also be used for other James features, 
like:
- exposing metrics
- exposing Hystix dashboard

Once this HTTP(S) server is in place, we can use it for serving JMAP 
requests.
You can already have a look on our work-in-progress feature branch [3], 
already providing Authentication support and a first JMAP request, 
getMailboxes.
The implementation of the protocol is done in server/protocols/jmap [4] 
while data storage is in server/data/data-jmap [5].
Each JMAP request can be handled by a Method, such as GetMailboxesMethod 
in server/protocols/jmap/src/main/java/org/apache/james/jmap/methods 
[6].
JMAP Module is then integrated by default in the cassandra-guice module, 
allowing to launch James with Cassandra backend and JMAP support with a 
simple configuration.
It stays of course possible to use JMAP with any supported James 
backend.

Now that we have some working stuff, we are requesting your advice on 
what we have done, and more precisely on the following points:
- What do you think about using James to serve HTTP(S) requests?
- What do you think of our way of integrating an HTTP(S) server in 
James?
- What do you think about supporting JMAP into James?
- What do you think of our way of integrating JMAP in James?

Regards,
Raphaël Ouazana.

[1] http://jmap.io/index.html
[2] http://jmap.io/spec.html
[3] https://github.com/linagora/james-project/tree/jmap
[4] 
https://github.com/linagora/james-project/tree/jmap/server/protocols/jmap
[5] 
https://github.com/linagora/james-project/tree/jmap/server/data/data-jmap
[6] 
https://github.com/linagora/james-project/tree/jmap/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message