Hi Giovanni!
On 26 January 2023 11:19:22 CET, Giovanni Biscuolo <g...@xelera.eu> wrote: >Timo Wilken <g...@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