Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMAP support #1550

Closed
jkaberg opened this issue Apr 18, 2024 · 7 comments
Closed

JMAP support #1550

jkaberg opened this issue Apr 18, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@jkaberg
Copy link

jkaberg commented Apr 18, 2024

Is your feature request related to a problem? Please describe.
I'm considering self-hosting mail for privacy - and I'm considering the Stalwart mail server for this purpose with snappymail as an frontend. However seeing as the IETF is pushing for JMAP I was wondering if this is something you've considered? (yes I know - Stalwart supports IMAP/SMTP)

Describe the solution you'd like
Implement support for the JMAP specification

@the-djmaze
Copy link
Owner

the-djmaze commented Apr 18, 2024

JMAP is partially implemented.
I've noticed that JMAP is lacking many features that SnappyMail is using.
Therefore JMAP is still not considered as drop-in alternative for IMAP, and is therefore not supported.

@the-djmaze the-djmaze added the documentation Improvements or additions to documentation label Apr 18, 2024
@marclaporte
Copy link

I've noticed that JMAP is lacking many features that SnappyMail is using.

Can you please share a few examples?

JMAP is an open standard. We can all work together to make it better.

Thanks!

@mdecimus
Copy link

JMAP is partially implemented.

This is incorrect, JMAP is a published IETF standard.

I've noticed that JMAP is lacking many features that SnappyMail is using.

Also incorrect, in fact JMAP offers more capabilities and is more flexible that IMAPrev2. It also supports E-mail Submissions, replacing SMTP for client email submissions.

@the-djmaze
Copy link
Owner

Where does JMAP define sorting and threading?
Where does JMAP define quota handling?
Where does JMAP define correct handling of all ACL features?
Where does JMAP define handling of virtual and alias mailboxes?
And there are many more...

@mdecimus
Copy link

Where does JMAP define sorting

Here: RFC8621 - Section 4.4.2

and threading?

Here: RFC8621 - Section 3

Where does JMAP define quota handling?

Here: RFC9425

Where does JMAP define correct handling of all ACL features?

In this draft.

Where does JMAP define handling of virtual and alias mailboxes?

IMAP does not define handling of virtual and alias mailboxes either. Some servers support virtual/alias mailboxes through the METADATA extension but this is not standard.

And there are many more...

There are many examples of fully-functional mail clients utilizing the JMAP protocol. In fact, Fastmail operates its entire infrastructure on JMAP, demonstrating its full viability.

While it's fair to argue that JMAP may not offer significant advantages over IMAP from an end-user perspective, stating that JMAP is only partially implemented or incomplete is inaccurate.

@the-djmaze
Copy link
Owner

Where does JMAP define sorting

Here: RFC8621 - Section 4.4.2

The following values for the "property" field on the Comparator object SHOULD be supported for sorting

So how do we know if they are supported?
Is there a capabilities system?

IMAP does not define handling of virtual and alias mailboxes either. Some servers support virtual/alias mailboxes through the METADATA extension but this is not standard.

IMAP has 3 types of namespaces:

  1. Personal Namespace(s)
  2. Other Users' Namespace(s)
  3. Shared Namespace(s)

SnappyMail handles them and the demo has:

{
	"namespaces": {
		"@Object": "Object/Namespaces",
		"personal": [
			{
				"prefix": "",
				"delimiter": ".",
			},
			{
				"prefix": "virtual.",
				"delimiter": ".",
			}
		],
		"users": [
			{
				"prefix": "shared/",
				"delimiter": "/",
			}
		],
		"shared": []
	}
}

virtual. is a non-existing mailbox and virtual.All exists.

stating that JMAP is only partially implemented or incomplete is inaccurate.

Take a look here:

public function jsonSerialize()
{
$selectable = $this->Selectable();
$result = array(
'@Object' => 'Object/Folder',
'name' => $this->Name(),
'fullName' => $this->FullName,
'delimiter' => (string) $this->sDelimiter,
'attributes' => $this->aAttributes,
'metadata' => $this->aMetadata,
'uidNext' => $this->UIDNEXT,
// https://datatracker.ietf.org/doc/html/rfc8621#section-2
'totalEmails' => $this->MESSAGES,
'unreadEmails' => $this->UNSEEN,
'id' => $this->MAILBOXID,
'size' => $this->SIZE,
'role' => $this->Role(),
/*
'rights' => $this->myRights,
'myRights' => $this->myRights ?: [
'mayReadItems' => $selectable,
'mayAddItems' => $selectable,
'mayRemoveItems' => $selectable,
'maySetSeen' => $selectable,
'maySetKeywords' => $selectable,
'mayCreateChild' => $selectable,
'mayRename' => $selectable,
'mayDelete' => $selectable,
'maySubmit' => $selectable
]
*/
);

There you can see only a few parts are JMAP.
JMAP does not understand ACL properly, nor does it support delimiter, attributes metadata.
I'm not here to argue what is there and what not.
JMAP will just not happen until JMAP servers can tell what they support and what not (like IMAP CAPABILITY)

@mdecimus
Copy link

The following values for the "property" field on the Comparator object SHOULD be supported for sorting

So how do we know if they are supported? Is there a capabilities system?

Yes, the JMAP Session Resource lists the servers capabilities as well as other information.

IMAP has 3 types of namespaces:

IMAP namespaces are mapped to regular JMAP folders in most JMAP servers. In any case, namespaces are not needed to have a functional mail client. For example, Gmail, the most widely used webmail client, does not use namespaces and users don't even notice it.

There you can see only a few parts are JMAP. JMAP does not understand ACL properly,

The ACL property is an IMAP thing, JMAP uses the Sharing extension linked in a previous comment.

nor does it support delimiter, attributes metadata.

They are not supported because those are IMAP specific mechanisms that JMAP does not need. And, most importantly, it is perfectly possible to have a fully functional mail client without those extensions.

I'm not here to argue what is there and what not. JMAP will just not happen until JMAP servers can tell what they support and what not (like IMAP CAPABILITY)

As mentioned above, they do support listing capabilities.

In any case, I am not trying to convince you to implement JMAP, it's your product after all. What I just wanted to point out is that JMAP is a mature protocol and it is incorrect to say that it can't be implemented because it lacks features.

If you have some time, I suggest that you read the JMAP Core, JMAP Mail, JMAP Quotas and JMAP for Sieve Scripts specifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants