mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 21:15:56 +03:00
[GH-ISSUE #776] Review the whole process/code/documentation for Cypht to work for Google and Microsoft's email offerings. (was: Error Ocurred when attempting gmail oauth2 setup) #474
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#474
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 @Terramoto on GitHub (Sep 29, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/776
Originally assigned to: @christer77 on GitHub.
I'm running the docker version, i've:
The file is detected during the config_gen.php, i then proceed to the interface:
I've notice the redirect URL sends two scopes:
?state=nux_authorization&code=(Authorization-Code)&scope=https://mail.google.com/%20https://www.googleapis.com/auth/contacts
I've tried removing the second scope and this time i got the "Error Ocurred" message but it didn't signed me off....
@marclaporte commented on GitHub (Oct 2, 2023):
Thank you @Terramoto for this report.
Can you try with debug mode activated as per https://cypht.org/install.html ?
Thanks!
@Terramoto commented on GitHub (Oct 2, 2023):
I'm afraid it doesn't seem to work, i'm using the docker version provided in the README:
https://hub.docker.com/r/sailfrog/cypht-docker
I've tried to set the display_errors on in the PHP.ini file but that hasn't made much of a difference.
@marclaporte commented on GitHub (Oct 2, 2023):
@rodriguezny How can we activate errors in Cypht Docker?
@rodriguezny commented on GitHub (Oct 3, 2023):
@Terramoto did you try to visualize the container log ?
@Terramoto commented on GitHub (Oct 4, 2023):
@rodriguezny Yes, i'm afraid it was only showing the access logs, as in POST GET requests and response codes.
I went to check this morning and found there's a php.ini-development in
/usr/local/etc/php/, replaced the existing with it and after attempting to add the account i'm now getting the following Notice but no errors:@rodriguezny commented on GitHub (Oct 4, 2023):
Thanks @Terramoto for the report.
The notices are due to php version, no need to be worried about that, but the log doesn't show the error that causes the "error occurred" message when attempting gmail auth2 message.
Adding a Gmail account seems broken or there is an issue we need to fix. Give us some time to investigate on the issue on cypht without docker and cypht docker version, will come back to you later.
Did you try to setup gmail auth2 on cypht outside docker (no docker version) ? If no, you can try it and provide us feedback waiting for us to come back to you with the fix/solution ?
@marclaporte commented on GitHub (Oct 4, 2023):
For the record: https://github.com/cypht-org/cypht/wiki/OAUTH2-over-IMAP
@rodriguezny commented on GitHub (Oct 4, 2023):
Thank you @marclaporte !
@Terramoto commented on GitHub (Oct 5, 2023):
I've managed to enable some logging:
It looks like the cause is:
[17] => HTTP header fingerprint check failedgithub.com/cypht-org/cypht@c240489ec6/lib/session_base.php (L42)I've disabled fingerprint in h3m.ini, now i get the following:
How to enable debug:
github.com/cypht-org/cypht@c240489ec6/index.php (L18)@Terramoto commented on GitHub (Oct 6, 2023):
I'm reopening this issue because i had been told previously the docker image was not properly maintained, so i started from fresh.
Unfortunately, after dealing with other issues where the login was failing because open_basedir wasn't allowing the sqlite2 file access. I've managed to sort this how and get to the point of configuring the oauth2 again.
The issue with Oauth2 repeats on this new setup, a normal imap account works. What i'm noticing with this one is that the authorization token takes a while, after signing in to the webmail, and this seems to be because it's calling sendmail.
@apezio commented on GitHub (Oct 20, 2023):
I had an issue - Google would redirect me back to Cypht after I approved oauth2 access, BUT the Cypht webpage was only showing a login page even though I had been logged in moments ago. If i entered my username/pass and logged in, the oauth2 (gmail) account would not have been added to Cypht.
After many identical failures, i noticed when I was redirect back to Cypht after authorizing access in Gmail, I would be at the login prompt but the URL in my browser address bar was obviously an approval of some sort. So I copied the URL and instead of logging into Cypht I just hit back on my browser a few times until I was back in Cypht (still logged in!) and pasted the URL into my address bar. Hitting enter would finish adding Gmail to Cypht, success at last!
I believe when adding my oauth2 app at google, i used my Cypht install URL (https://webmail.domain.tld/) as the redirect_uri (i have never understood if this is redirect_uri or redirect_urL) and I think the issue is related. Nothing mentions which URL to use.
Another note - if you don't add the redirect_uri when creating the oath2 app/auth at Google, but instead add it later, it doesn't work. It only works (for me) when you add it during the original oauth creation process even though it allows you to add one later. It could be that it would eventually work - there is a delay of some sort.
@marclaporte commented on GitHub (Nov 4, 2023):
@kambereBr Please review the whole process/code/documentation for Cypht to work for Google and Microsoft's email offerings.
Here is the current documentation: https://github.com/cypht-org/cypht/wiki/OAUTH2-over-IMAP
It states:
"Next you need to edit the modules/imap/oauth2.ini file, and move it to the "app_data_dir" as defined in your hm3.ini file."
"Now re-run the config_gen.php script which will find your oauth2.ini file and combine it into the site settings."
This is too complicated. Please explore a way for users to do this via the web interface (like for IMAP accounts). FYI, Henock is working on a revamp of the whole setup process (Making it easier to set up IMAP, SMTP and connect them together) so you should be in touch with him to converge efforts. Ref: https://avan.tech/item81120 (internal link, sorry if you don't have access).
First make it work with the standard installation procedure. Once this is working well, please revisit the Docker install with @rodriguezny
Thanks!
@kambereBr commented on GitHub (Nov 5, 2023):
@marclaporte, Noted. Thank you!
@marclaporte commented on GitHub (Jan 19, 2024):
https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html
@marclaporte commented on GitHub (Aug 9, 2024):
@christer77 You closed this. Is it simple now?
The https://github.com/cypht-org/cypht/wiki/OAUTH2-over-IMAP is still too complicated (ex.: re-run the config_gen.php) and it's still mentioning hm3.ini (which no longer exists in Cypht 2+)
I suggest you take a non geeky friend or family member and ask them to set this up, while you watch.
@marclaporte commented on GitHub (Nov 4, 2024):
From: https://gitter.im/cypht-org/community

@marclaporte commented on GitHub (Nov 15, 2024):
Related issue: https://github.com/cypht-org/cypht/issues/1351
@marclaporte commented on GitHub (Jan 24, 2025):
@Bienvenumoringa @christer77 https://github.com/cypht-org/cypht/issues/1429
@marclaporte commented on GitHub (May 7, 2025):
@Bienvenumoringa @christer77 https://github.com/cypht-org/cypht/issues/1505
@marclaporte commented on GitHub (Sep 5, 2025):
Related: [Feature] Add support for Microsoft Graph, which replaces Microsoft Exchange Web Services (EWS): https://github.com/cypht-org/cypht/issues/1659
@marclaporte commented on GitHub (Sep 5, 2025):
Next steps:
Review all wiki pages and web pages about Google and Microsoft's email offerings, and review/converge the info. There could be others, but I see:
Then, review cypht.org as a new user, and add info/links wherever a new user should find it. At least:
https://www.cypht.org/features/
I had already done one:
github.com/cypht-org/cypht@365ae0b057@christer77 commented on GitHub (Sep 16, 2025):
https://github.com/cypht-org/cypht/wiki/OAUTH2-over-IMAP/defbee28ec421777295b9f07dc14d0518e905e72
@marclaporte commented on GitHub (Jan 28, 2026):
Related: https://github.com/cypht-org/cypht/issues/1846