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: Need to make it an error to enable JMAP without conversations #2627

Closed
jasonmunro opened this issue Jan 14, 2019 · 3 comments
Closed
Labels
3.2 affects 3.2 jmap affects the jmap implementation

Comments

@jasonmunro
Copy link

Hello!
I'm working on adding JMAP support to my webmail client and running into a problem trying to use Email/get. Surely I'm doing something incorrectly here, if anyone can point me in the right direction it would be much appreciated!

I'm running a git checkout of Cyrus-imapd from last Friday, coupled with the SASL auth daemon from Debian unstable. I have a functional user account and IMAP access is working fine. I used my client to copy 3 message from another account into my Cyrus INBOX (so IMAP APPEND) and can interact with them normally over IMAP. However when I attempt to use Email/query followed by Email/get, query returns 3 ids, but no details are returned from get, and the ids are always in "notFound".

Email/query request:

POST /jmap/ HTTP/1.1
Host: localhost:8080
User-Agent: hm3
Authorization: Basic ...
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Accept: application/json
Content-Length: 294

{"using":["urn:ietf:params:jmap:core","urn:ietf:params:jmap:mail"],"methodCalls":[["Email\/query",{"accountId":"testuser","filter":{"inMailbox":"77125b4f-d681-457f-b50e-3e1089e12d2e"},"sort":[{"property":"receivedAt","isAscending":false}],"position":0,"limit":50,"calculateTotal":true},"gmp"]]}

Email/query response:

HTTP/1.1 200 OK
Date: Mon, 14 Jan 2019 22:25:16 GMT
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Content-Length: 406

{"methodResponses":[["Email/query",{"filter":{"inMailbox":"77125b4f-d681-457f-b50e-3e1089e12d2e"},"sort":[{"property":"receivedAt","isAscending":false}],"queryState":"0:0","canCalculateChanges":true,"position":0,"total":3,"ids":["M4acc72ada8f71b88d8cbea69","M87a8f1e3237f8af3baaa3b83","M8c46aaf0eec94d087e123d3e"],"collapseThreads":false,"isCached":false,"accountId":"testuser"},"gmp"]],"sessionState":"0"}

Email/get request using the ids from query:

POST /jmap/ HTTP/1.1
Host: localhost:8080
User-Agent: hm3
Authorization: Basic ...
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Accept: application/json
Content-Length: 274

{"using":["urn:ietf:params:jmap:core","urn:ietf:params:jmap:mail"],"methodCalls":[["Email\/get",{"accountId":"testuser","ids":["M4acc72ada8f71b88d8cbea69","M87a8f1e3237f8af3baaa3b83","M8c46aaf0eec94d087e123d3e"],"properties":["subject"],"bodyProperties":["partId"]},"gml"]]}

Email/get response with notFound:

HTTP/1.1 200 OK
Date: Mon, 14 Jan 2019 22:26:48 GMT
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Content-Length: 204

{"methodResponses":[["Email/get",{"state":"0","list":[],"notFound":["M4acc72ada8f71b88d8cbea69","M87a8f1e3237f8af3baaa3b83","M8c46aaf0eec94d087e123d3e"],"accountId":"testuser"},"gml"]],"sessionState":"0"}

Syslog has the following when this occurs:

Jan 14 16:28:44 shop cyrus/http[609]: jmap: Email/get(M4acc72ada8f71b88d8cbea69): Item does not exist
Jan 14 16:28:44 shop cyrus/http[609]: jmap: Email/get(M87a8f1e3237f8af3baaa3b83): Item does not exist
Jan 14 16:28:44 shop cyrus/http[609]: jmap: Email/get(M8c46aaf0eec94d087e123d3e): Item does not exist

Any help is appreciated! Thank you for your time.

@brong
Copy link
Member

brong commented Jan 15, 2019 via email

@jasonmunro
Copy link
Author

Do you have conversations enabled? It's required for JMAP but we may not have set up the sanity tests correctly.

I did not, thanks for the suggestion. I enabled it, cleared out the existing test messages, copied in some new ones, and voila, it's working great now. THANK YOU!

@brong
Copy link
Member

brong commented Jan 15, 2019 via email

@brong brong added the jmap affects the jmap implementation label Feb 13, 2019
@brong brong changed the title JMAP: Message ids always returning in "notFound" for Email/get JMAP: Need to make it an error to enable JMAP without conversations Feb 13, 2019
@brong brong added the 3.2 affects 3.2 label Apr 12, 2019
@elliefm elliefm closed this as completed in cc30ba7 Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2 affects 3.2 jmap affects the jmap implementation
Projects
None yet
Development

No branches or pull requests

2 participants