Ok, this patch updates the current head to have
(imap|pop|smtp)_oauth_refresh_command, consolidates the code for executing
the commands and generating the oauthbearer sasl token, and adds support or
oauthbearer for pop.

muttrc would look like:
set imap_authenticators="oauthbearer"
set imap_user="blon...@gmail.com"
set imap_oauth_refresh_command="oauth2.py --user=USER --client_id=
CLIENTID.apps.googleusercontent.com --client_secret=CLIENT_SECRET
--token_only --refresh_token=REFRESH_TOKEN"

set pop_authenticators="oauthbearer"
set pop_user="blon...@gmail.com"
set pop_host=pops://pop.gmail.com:995
set pop_oauth_refresh_command="oauth2.py --user=USER --client_id=
CLIENTID.apps.googleusercontent.com --client_secret=CLIENT_SECRET
--token_only --refresh_token=REFRESH_TOKEN"

set smtp_authenticators="oauthbearer"
set smtp_url="smtps://blon...@gmail.com@smtp.gmail.com:465"
set smtp_oauth_refresh_command="oauth2.py --user=USER --client_id=
CLIENTID.apps.googleusercontent.com --client_secret=CLIENT_SECRET
--token_only --refresh_token=REFRESH_TOKEN"

On Mon, Jun 18, 2018 at 7:42 PM Kevin J. McCarthy <ke...@8t8.us> wrote:

> On Mon, Jun 18, 2018 at 03:41:11PM -0700, Brandon Long wrote:
> > I'm not sure of a good solution to this.  One solution would be a
> mechanism
> > for delayed evaluation of the config options, the other would require
> > more advanced support of OAUTH2, where we would have separate config
> > entries for the various bits
> > [...]
>
> > As for changes to the config handling, I could add new
> > smtp_oauth_token_command/imap_oauth_token_command config vars, and do the
> > evaluation in-line with that, that's probably the cleanest way to handle
> > this as specific to this issue and not try for larger changes.
>
> If I understand correctly, the quick and clean fix is to add the
> [smtp|imap]_oauth_token_command.  Assuming that obviates the first
> paragraph (embedding the https fetch, json support etc, or adding
> dynamic config options), I think that's the best idea.
>
> --
> Kevin J. McCarthy
> GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
>

Attachment: mutt.patch-20180626.bl.imap-oauthbearer.1
Description: Binary data

Reply via email to