emersion / hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
MIT License
1.63k stars 126 forks source link

Unable to login to ProtonMail via hydroxide #252

Closed ghost closed 1 year ago

ghost commented 1 year ago

$ hydroxide auth user Password: 2023/05/10 21:49:03 request failed: POST https://mail.proton.me/api/auth/info: [5003] This web page is out of date, please refresh the page to continue using it 2023/05/10 21:49:03 [5003] This web page is out of date, please refresh the page to continue using it

and

Password: 2023/05/10 22:19:45 request failed: POST https://mail.proton.me/api/auth: [9001] For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/abuse 2023/05/10 22:19:45 [9001] For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/abuse

I get this error with both aur and github sources

recanman commented 1 year ago

I fixed this by adding the following in protonmail/protonmail.go (comment out the current user-agent line, around line 120):

req.Header.Set("User-Agent", "Ubuntu_20.04")
req.Header.Set("x-pm-appversion", "Other")

I used password authentication and I got the bridge password.

ghost commented 1 year ago

Okay, adding req.Header.Set("x-pm-appversion", "Other") on line 123 of ./protonmail/protonmail.go got me the bridge password after using go build ./cmd/hydroxide/main.go and ./main auth user and providing the user's password

ghost commented 1 year ago

Include git commit of this update and update aur package to include this maybe...