[Users] claws-mail with OAuth2 IMAP O365Q

David Fletcher David at megapico.co.uk
Fri Jan 12 12:18:51 UTC 2024


Hi Philippe,

The code you need is in that URL that said it could not connect.

> 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

Just copy the 0.AUgAqHxbaagtRUWi2k...very long string part into the
authorisation box on Claws Mail's Oauth2 account configuration box.

The redirect aims to do this automatically by redirecting your browser so
that code arrives at a listening port on localhost. But you can enter
the code manually from the URL too. Then the authorisation process
should complete.

In a similar way the request sent to the server to start this
authorisation process includes the redirect URI in the string, so you
can change it there rather than recompiling the whole program. From the
Copy Code button in the Oauth2 configuration screen you should find the
code looks something like this:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=12345&redirect_uri=http%3A%2F%2F127.0.0.1%3A8888&response_type=code&scope=offline_access%20https%3A%2F%2Foutlook.office.com%2FIMAP.AccessAsUser.All%20https%3A%2F%2Foutlook.office.com%2FPOP.AccessAsUser.All%20https%3A%2F%2Foutlook.office.com%2FSMTP.Send&tenant=common&response_mode=query

Just change the redirect URI to whatever you need, ensuring it is still
in the correct format using %3A%2F%2F for :// . However, it seems like
you're past this stage now and can just enter the code from the
0.AUgAqHxbaagtRUWi2k...very long string.

Best wishes, David.


More information about the Users mailing list