Re: Getmail OAUTH gmail failure

Pieter van Oostrum <[email protected]> Sat, 12 Mar 2022 13:25:27 +0100
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
Gary Schmidt <[email protected]> writes:

> Getmail has been happily pulling stuff down from gmail using OAUTH for, oh,
> a week or so, and it's just started doing this:
>
> External password program "/opt/local/bin/getmail-gmail-xoauth-tokens"
> wrote to stderr: Traceback (most recent call last):
>   File "/opt/local/bin/getmail-gmail-xoauth-tokens", line 115, in <module>
>     sys.stdout.write("%s" % auth.token())
>   File "/opt/local/bin/getmail-gmail-xoauth-tokens", line 93, in token
>     self.refresh_tokens()
>   File "/opt/local/bin/getmail-gmail-xoauth-tokens", line 89, in
> refresh_tokens
>     self.update_config(d)
>   File "/opt/local/bin/getmail-gmail-xoauth-tokens", line 65, in
> update_config
>     self.data['access_token'] = d['access_token']
> KeyError: 'access_token'GMAILACCOUNT-rc: operation error (External password
> program error (exited 1))
>
> Is it google being google, or have I forgotten to do something important??
>
>>From the rc file:
> password_command = ("/opt/local/bin/getmail-gmail-xoauth-tokens",
> "/home/USERNAME/.getmail/GMAILACCOUNT.json")
>
Could it be that the access-token has expired? I have looked into the code of getmail-gmail-xoauth-tokens and I got the impression that it doesn't do a refres of the token, wnen it expires. It probably will give an error message, but if you run getmail in the background you may not see this.
-- 
Pieter van Oostrum <[email protected]>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]