Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/murtaza-u/muttoauth
Google OAuth2 authorization script for Mutt E-mail client
https://github.com/murtaza-u/muttoauth
access-token email-client gmail google mutt neomutt oauth2 refresh-token
Last synced: about 2 months ago
JSON representation
Google OAuth2 authorization script for Mutt E-mail client
- Host: GitHub
- URL: https://github.com/murtaza-u/muttoauth
- Owner: murtaza-u
- License: apache-2.0
- Created: 2022-06-26T06:19:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T19:02:14.000Z (about 2 years ago)
- Last Synced: 2024-11-05T10:50:06.609Z (3 months ago)
- Topics: access-token, email-client, gmail, google, mutt, neomutt, oauth2, refresh-token
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `muttoauth2`
> Google `OAuth2` authorization script for Mutt E-mail client
## Prerequisite
* Create a [Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects)
* Configure [OAuth consent screen](https://developers.google.com/workspace/guides/configure-oauth-consent)
* Enable [Gmail API](https://console.cloud.google.com/apis/library/gmail.googleapis.com)
* [Create](https://developers.google.com/workspace/guides/create-credentials#oauth-client-id)
OAuth `client id` and `client secret`## Edit `muttoauth`
```bash
# client id
id="*********************************************.apps.googleusercontent.com"# client secret
secret="***********************************"# gpg key id(gpg --list-secret-keys --keyid-format LONG)
keyid="****************"
```* Set `id` equal to client id
* Set `secret` equal to client secret
* Get `gpg` key id```bash
gpg --list-secret-keys --keyid-format LONGsec rsa4096/{keyid} 2022-06-06 [SC]
```* Set `keyid` equal to `gpg` key id
## Check for missing dependencies
```bash
muttoauth -d[x] curl
[ ] jq
[x] gpg
[x] shred
```## Authorize
```bash
muttoauth -a /save/to/tkn_fileOpen this URL in a web browser
Copy the authorization code and paste it below
https://accounts.google.com/o/oauth2/auth?client_id=*********************************************.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://mail.google.com/&response_type=code
Authorization Code: *********************************************
```## Configure Mutt to use `OAuth2`
```diff
set imap_user = "[email protected]"
set smtp_url = "smtps://[email protected]@smtp.gmail.com:465"-set my_pass = "`pass show email`"
-set imap_pass = $my_pass
-set smtp_pass = $my_pass
+set imap_authenticators="oauthbearer"
+set imap_oauth_refresh_command = "muttoauth -r /path/to/tkn_file"
+set smtp_authenticators=${imap_authenticators}
+set smtp_oauth_refresh_command=${imap_oauth_refresh_command}
```