IMAP OAUTHBEARER patch

Brandon Long blong at fiction.net
Wed Jun 27 00:02:11 UTC 2018


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="blong42 at 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="blong42 at 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://blong42@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 <kevin at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mutt.org/pipermail/mutt-dev/attachments/20180626/9394c991/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mutt.patch-20180626.bl.imap-oauthbearer.1
Type: application/octet-stream
Size: 16119 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-dev/attachments/20180626/9394c991/attachment-0001.obj>


More information about the Mutt-dev mailing list