[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mbsync with XOAUTH2 SASL mechanism
From: |
Timo Wilken |
Subject: |
Re: mbsync with XOAUTH2 SASL mechanism |
Date: |
Thu, 26 Jan 2023 19:15:24 +0100 |
User-agent: |
K-9 Mail for Android |
Hi Giovanni!
On 26 January 2023 11:19:22 CET, Giovanni Biscuolo <g@xelera.eu> wrote:
>Timo Wilken <guix@twilken.net> writes:
>> Instead, I ended up "borrowing" Thunderbird's client key and secret,
>> which has worked fine so far.
>
>thanks for sharing this trick!
>
>this adds a big dependency in our software stack, but it works, so why
>not! :-)
Just to be clear: I did not install Thunderbird. I do not run Thunderbird. I
only copy-pasted the client key from its source code into my own scripts. See
below for details.
>a couple questions:
>
>- have you tried getmail6 with the mentioned howto?
No, I have not, sorry.
>- to refresh the tokens do you have to periodically run Thunderbird?
No, I do not run Thunderbird. I use neomutt to read my mail, and specifically
for XOAUTH2 I use the "mutt_oauth2.py" script that comes with neomutt:
https://github.com/neomutt/neomutt/blob/main/contrib/oauth2/mutt_oauth2.py
This script handles everything XOAUTH2-related, including refreshing tokens
when needed. I just call it with its --client-id and --client-secret parameters
(among other params; I am on my phone at the moment and cannot look up the full
invocation I use), using the values I got from Thunderbirds source code.
(See also the neomutt documentation:
https://neomutt.org/guide/optionalfeatures#6-%C2%A0oauthbearer-and-xoauth2-support)
Perhaps you can adapt this script to your usecase.
Cheers,
Timo