JMAP — an open protocol will replace IMAP for email exchange.

At the beginning of the month on Hacker News there was a lively discussion about the JMAP protocol, developed under the guidance of the IETF.We decided to discuss why it was needed and how it works.

JMAP — an open protocol will replace IMAP for email exchange.
/ PxHere / PD

What doesn't IMAP provide?

Protocol IMAP was introduced in 1986. Many aspects described in the standard are no longer relevant today. For example, the protocol can return the number of lines in an email and checksums, MD5 but this functionality is hardly used in modern email clients.

Another issue relates to traffic consumption. With IMAP, emails are stored on the server and periodically synchronized with local clients. If, for some reason, the local copy on the user's device becomes corrupted, the entire email has to be synchronized again. In today's world, where thousands of mobile devices can connect to the server, this approach leads to increased traffic and computational resource usage.

Challenges arise not only with the protocol itself but also with the email clients that work with it. Since IMAP's creation, it has undergone numerous revisions — the current version today is IMAP4. Additionally, there are many optional extensions for it — on the web, has been published there are ninety RFCs with enhancements. One of the most recent is RFC8514,introduced in 2019.

At the same time, many companies offer their proprietary solutions that aim to simplify working with IMAP or even replace it entirely: Gmail, Outlook., NylasAs a result, it turns out that existing email clients only support some of the available features. This variety leads to market segmentation.

Moreover, a modern email client should not only forward messages but also be able to work with contacts and synchronize with a calendar, says Sergey Belkin, head of development at the IaaS provider. 1cloud.ruToday, third-party protocols like LDAP, CardDAV and CalDAVare used for these purposes. This approach complicates firewall configuration in corporate networks and opens new vectors for cyberattacks.

JMAP is designed to address the identified issues. It is being developed by specialists from FastMail under the guidance of the Internet Engineering Task Force (IETF). The protocol operates over HTTPS, utilizes JSON (which is why it is suitable not only for email exchange but also for addressing a range of tasks in the cloud), and simplifies email management in mobile systems. In addition to processing emails, JMAP also provides the ability to connect extensions for managing contacts and a calendar-planner.

Features of the New Protocol

JMAP is a stateless protocol and does not require a constant connection to the mail server. This feature simplifies operation in unstable mobile networks and helps save battery life on devices.

An email in JMAP is presented in a JSON structure. It contains all the information from the message RFC5322 (Internet Message Format), which may be needed by mail applications. According to the developers, this approach should simplify client creation, as the server will handle potential complexities (related to MIME, reading headers, and encoding).

To interact with the server, the client uses an API. It does this by forming an authenticated POST request, the properties of which are described in the JMAP session object. The request is in application/json format and consists of a single JSON request object. The server also generates a single response object.

In the specification (in section 3) the authors provide the following example with a request:

{
  "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
  "methodCalls": [
    [ "method1", {
      "arg1": "arg1data",
      "arg2": "arg2data"
    }, "c1" ],
    [ "method2", {
      "arg1": "arg1data"
    }, "c2" ],
    [ "method3", {}, "c3" ]
  ]
}

Below is an example of a response that the server will generate:

{
  "methodResponses": [
    [ "method1", {
      "arg1": 3,
      "arg2": "foo"
    }, "c1" ],
    [ "method2", {
      "isBlah": true
    }, "c2" ],
    [ "anotherResponseFromMethod2", {
      "data": 10,
      "yetmoredata": "Hello"
    }, "c2"],
    [ "error", {
      "type":"unknownMethod"
    }, "c3" ]
  ],
  "sessionState": "75128aab4b1b"
}

The full specification of JMAP with implementation examples can be found on the official website the project page. There, the authors have also provided a description of the specifications for JMAP Contacts and JMAP Calendars — which are focused on working with calendars and contact lists. According to words the authors, Contacts and Calendars have been separated into distinct documents so they can be developed and standardized independently of the 'core'. The source codes for JMAP are available at GitHub repository.

JMAP — an open protocol will replace IMAP for email exchange.
/ PxHere / PD

Prospects

Although the official work on the standard is not yet complete, it is already being implemented in production environments. For example, the creators of the open mail server Cyrus IMAP have implemented its JMAP version. Developers from FastMail was released created a server framework for the new protocol in Perl, while the authors of JMAP presented proxy server.

It is expected that in the future, more projects based on JMAP will emerge. For instance, there is some likelihood that developers from Open-Xchange, who are creating an IMAP server for Linux systems, will transition to the new protocol. Participants from the community strongly urge them to move away from IMAP, which has formed around the company's tools.

Developers from IETF and FastMail state that more and more users see the need for a new open standard for messaging. The authors of JMAP hope that in the future, more companies will start adopting this protocol.

Our additional resources and sources:

JMAP — an open protocol will replace IMAP for email exchange. How to check cookies for GDPR compliance — a new open tool will help

JMAP — an open protocol will replace IMAP for email exchange. How to Save Costs with an Application Programming Interface
JMAP — an open protocol will replace IMAP for email exchange. DevOps in a Cloud Service Based on 1cloud.ru
JMAP — an open protocol will replace IMAP for email exchange. Evolution of the cloud architecture 1cloud

JMAP — an open protocol will replace IMAP for email exchange. Potential attacks on HTTPS and ways to protect against them
JMAP — an open protocol will replace IMAP for email exchange. How to secure a server on the internet: the experience of 1cloud.ru
JMAP — an open protocol will replace IMAP for email exchange. A brief guide: what is Continuous Integration

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster