JMAP incompatible with Stalwart server #192
Labels
No Label
IMAP
JMAP
Maildir
Retired
User Experience
User Interface
bsd
bug
contacts
currently worked on
documentation
duplicate
easy
enhancement
help wanted
invalid
linux-gnu
macos
mbox
notmuch
question
security
wishlist
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: meli/meli#192
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
A new JMAP compatible mail server called Stalwart has recently been made public, but it seems to not be compatible with the meli JMAP implementation.
When I start meli it just says "loading... : JobRequest::Watch".
The server is very easy to set up and test, and seems to be one of the few open source mail servers taking JMAP seriously, so support would be great.
Thanks heaps for the error report! I had time to setup stalwart today and do some investigating.
This behavior is a combination of many bugs (doh):
ErrorKind
which doesn't alert the frontend that it should stop retrying; this is just bad design in the codeThe last one was very unexpected. The spec https://jmap.io/spec-mail.html#mailboxes says this is allowed if the account is marked as personal, which stalwart does but
meli
does not check.I'll push a stream of fixes in the next few days.
Looks like I fixed this specific issue but there's still work for painless JMAP use in general.
Thank you very much for working on this! Your issue definitely fixes the loading JobRequest::Watch message, however for me it still says
offline: Account is uninitialized
. I'll await your further patches and see if they fix the issue though.@rudihorn I will add some more error reporting on the JMAP connection code and ping you here when I push it.
@rudihorn hey, I added some jmap error prints in
jmap-status-and-connect-retry-wip
branch. Could you see if it shows any readable error? Otherwise, if you are comfortable with applying a tiny patch that adds some debug prints to stderr, can you apply this (copy text, save asname.patch
, and in the root directory of the git repository rungit apply path/to/name.patch
)To run with debug prints on, build and run like this:
which will redirect the standard error output stream (
stderr
) to the filemeli-stderr.log
. Otherwise it will all get printed in the terminal and mess the display up.Hey @epilys I'm more than happy to do this as soon as I am back from Holiday. Will send you this some time later this week.
Good, no problem! Until then, if anyone else is facing the same issue, can you post details about the stalwart setup? (port, using tls y/n) Because in my default stalwart setup I can connect to it.
@epilys
Okay so I did a little bit of testing, the first issue seems to be that the meli code tries to construct a URI, but is missing a scheme. Setting the
server_hostname
tohttps://<url>
fixes this issue. It would be nice if theserver_hostname
could be made completely optional though. Ideally a better solution might be to introduce an optionalserver_url
and then remove theserver_hostname
andserver_port
options.This somewhat works and shows up the mailboxes and allows me to somewhat browse through mail. There is however an error message
missing field 'accountId' at line 1 column 178
. I'm also facing issues where if I try scrolling down messages, it goes back up to the first message.Edit: the accountId error seems to only be for some mailboxes, possibly larger ones.
That makes complete sense! I copied the configuration flags from IMAP when I started implementing JMAP, and it was a mistake. I will make the change.
Ok, as a next step I will try to return a more helpful error when JSON deserialization fails from the response of the server. I will also try to setup a stalwart instance and copy a bunch of mail in so I'm not testing it empty.
@rudihorn pushed in
0ef4dde9
55ed9624
If you have the time to check it out again... In the meantime I will try to reproduce this. 🙃
The
server_url
field now works great and my suspicion of the large mailbox was correct. When trying to open larger mailboxes I get the error:The scrolling resetting itself seems to have gone away, but I will still keep an eye on this to see if it comes back. When I open an email it still only shows the header and no body. There is no error message. I can maybe see if I can debug what is going on there unless you have any specific ideas of what it could be?
The mail server provides its limitations, both in the capabilities section as well as for each account e.g.:
Nice! The mailbox fetch request size should have been updated when I converted them to use batches instead of fetching all emails. JMAP was unused and unupdated. I will push a fix on this soon.
Thanks a lot for your help and patience @rudihorn
Sounds like the request to get the email never completes for some reason.
WIP here, untested properly yet
#158