contributed by < linD026
>
kernel-tools
Source code
Tutorial
Reference : mutt/contrib/mutt_oauth2.py.README
Go to console.developers.google.com, and create a new project. The name doesn't
matter and could be "mutt registration project".
Edit the client_id
(and client_secret
if there is one) into the
mutt_oauth2.py
script.
NOTE
It needs to add the account to the Test user
( at "OAuth consent screen::Test users"").
Otherwise, we cannot get the code in next step.
First, we set Name and Email. We can simply set Name as "My mutt_oauth2 token store" and let the email empty. It will generate:
mutt_oauth2.py needs Python >= 3.7 to work.
After that, edit mutt_oauth2.py
:
YOUR_GPG_IDENTITY
client_id
client_secret
Then, export GPG_TTY=$(tty)
.
Now, we can excute the script:
Here is the first command, it will generate the tokens file.
Select google
, authcode
, and paste the code from the website.
When finished the command, it will have the access and refresh tokens.
access token will be expired.
So it needs the refresh token to get the access token.
For the debugging.
It will return the access token.
Then done. We can use Mutt to access gmail.
NOTE
To fix the mutt cannot execute every reboot.
You needs to specific the path:
For how to read emails in Mutt, see
help
( press?
).
Like<
and>
can scroll up and down one line,/
for searching the word,q
for quit.
c
and ?
, then choose the Gmail
, All Mail
or other IMAP that have your email.g
for group reply (reply all).v
to open the attachments and s
to save.Set application password to imap_pass
.
You can set the password in https://myaccount.google.com/security .
Then, here you go. :)
NOTE
With Homebrew, you need to add following setting to avoid No authenticators available
problem.
From https://github.com/Homebrew/legacy-homebrew/issues/33419