[Users] claws-mail with OAuth2 IMAP O365Q

Philippe Cara (TB) philippe.cara at vub.be
Fri Jan 12 12:02:29 UTC 2024


Hi Olaf,

I tried to tweak the URL for O365 (and I now remember trying that 
before). With one of the client IDs given 
cd9fedda-cb3b-4c55-add1-8d13d843f194
I get "Need admin approval", see https://imgur.com/a/NRyWmPS

With the other one 9e5f94bc-e8a4-4e73-b8be-63364c29d753
I get redirected to https://localhost/?code=0.AUgAqHxbaagtRUWi2k...very 
long string...&session_state=743f00b8-9f12-4350-8e57-67fe8b93ba18

but this fails with "Unable to connect

An error occurred during a connection to localhost..." in my browser.

So I guess editing oauth2.c and recompiling won't help either...

Maybe I will try the GMail solution later...

Thanks again for all help and (further) suggestions!

Philippe


On 12/01/2024 09:20, Olaf Hering wrote:
> Thu, 11 Jan 2024 22:08:24 +0100 "Philippe Cara (TB)" <philippe.cara at vub.be>:
> 
>> Thank you Olaf!
> 
> Sorry, I made two mistakes yesterday:
> 
> GMail works out of the box (with 4.2) if Claws Mail pretends do be Thunderbird. This can be done by using "406964657835-aq8lmia8j95dhl1a2bvharmfk3t1hgqj.apps.googleusercontent.com" as client_id, and "kSmqreRr0qwBWJgbf5Y-PjSU" as client_secret.
> 
> 
> O365 can not work with 4.2. The allowed Thunderbird redirect_url is 'https://localhost'. This means Claws Mail needs to have a HTTPS server on port 443. Even if it would listen on that port, which certificate would it present to the browser? I think Thunderbird will present a certificate to browsers which are automatically trusted. But, maybe the user needs to confirm that?
> 
> With an unmodified Claws Mail, I tried to tweak the URL and replaced 'http://127.0.0.1:8888' with 'https://localhost', which avoided the error on the remote side. But Claws Mail failed to extract the "authorization code", if I copy the URL into the "Authorization Code" text field.
> 
> In the end I returned to my copy of 3.19.0, which still works with O365, via copying the URLs to and from the browser.
> 
> 
> Olaf


More information about the Users mailing list