mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #553] Why am I getting "401 Unauthorized" jmap response? #400
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @smitgd on GitHub (Feb 17, 2022).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/553
💬 Question
I can now see what is being sent by cypht and cyrus when I attempt to setup a jmap account. With the same server and userid/password it works fine with an IMAP account. But it appears that authentication fails when I put in the same userid and password and click save with JMAP:
I am running cypht and apache on a different host on local network than where the cyrus server resides (wally.dbnet.lan). I think I have enabled the "conversation db" as is required. But I don't think that would affect the basic authentication.
I tried to use the default cyrus-imap from fedora 34 since the version was new enough to support JMAP. However, it didn't work at all and after finally looking at "cyr_buildinfo" I see that jmap is not compiled into the rpm. So I had to build cyrus-imap from source.
@smitgd commented on GitHub (Feb 21, 2022):
After resolving the authentication issue in https://github.com/cyrusimap/cyrus-imapd/issues/3929 I was now getting 404 error on the url in cypht when clicking test. My error was I had setup the jmap account url as
http://server/jmap/instead of justhttp://server/@jasonmunro commented on GitHub (Feb 22, 2022):
@smitgd Glad you got this sorted and thanks for posting - it might help someone else with similar issues. I am not aware of many users using jmap yet so there are likely some rough edges :) Please let us know if you run into trouble!
@smitgd commented on GitHub (Feb 23, 2022):
@jasonmunro Thanks for the reply. Not sure why I had so must trouble getting it to work but I have pretty much zero experience using http and json based protocols with authentication requirements.
One thing I noticed is that the JMAP RFC says that it MUST only be sent with TLS (https). However Cyrus and Cypht also work with port 80 and unencrypted JMAP (http). Seems technically a violation of the RFC but definitely handy for debug.
@jasonmunro commented on GitHub (Feb 23, 2022):
Interesting observation! It seems reasonably to adhere to the RFC. However as a client in the server-client relationship we want to be flexible in what we accept (in the hopes that servers are inflexible in what they present). Sadly over the years I have coded many exceptions to the protocol rules to make Cypht work with more providers. As an example: https://github.com/jasonmunro/cypht/blob/master/modules/imap/hm-imap.php#L503 ("hashchildren" is invalid). We do accept plain text IMAP connections, consider a local IMAP server over localhost, there is really no reason for TLS. So for now I think we continue to accept port 80 JMAP. FYI you can get a limited amount of the IMAP conversation without sniffing packets by placing the following in the code:
You need to be in Cypht debug mode for this to work and of course the $imap object must be in scope. Could be helpful if you run into JMAP issues. Thanks again for the feedback!