joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.33k stars 74 forks source link

XOAUTH2 via external command #150

Closed paulgessinger closed 9 months ago

paulgessinger commented 1 year ago

My work recently moved to Exchange Online which requires the use of XAUTH2 for authentication.

I suspect it would be possible to use something like oauth2ms to retrieve authentication tokens that could be used in this case.

Is this something that could be investigated?

joeyates commented 1 year ago

Hi @paulgessinger

Thanks for opening the issue.

Using XOAUTH2 tokens in imap-backup looks interesting. The setup system could accept an access token as an alternative to a password. I wouldn't integrate the process of actually fetching the client access token, that, as you say would be done by an external command.

The problem with OAuth (with Microsoft Exchange, GMail and other providers) is that they require each individual user to act as though they had a custom application. If this "heavy lifting" is done elsewhere (e.g. with oauth2ms) then the additional complexity in imap-backup would be limited.

As always, Pull Requests are welcome 😀, otherwise, I'll have a look into this myself sooner or later.

joeyates commented 9 months ago

Hi @paulgessinger

I've opted to recommend email-oauth2-proxy in the README for these cases.

thucke commented 8 months ago

Hi @joeyates

I'm trying to get OAuth2 working with the local proxy recommended. Unfortunately I do not find the right config to getting connected unencrypted.

Any hints?

Thanks Thomas

joeyates commented 8 months ago

@thucke I've written a blog post about it. Hope that helps!