{"id":18259428,"url":"https://github.com/murtaza-u/muttoauth","last_synced_at":"2025-04-08T23:38:59.910Z","repository":{"id":103795326,"uuid":"507493946","full_name":"murtaza-u/muttoauth","owner":"murtaza-u","description":"Google OAuth2 authorization script for Mutt E-mail client","archived":false,"fork":false,"pushed_at":"2022-11-09T19:02:14.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T18:26:17.260Z","etag":null,"topics":["access-token","email-client","gmail","google","mutt","neomutt","oauth2","refresh-token"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/murtaza-u.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-26T06:19:15.000Z","updated_at":"2022-11-09T17:38:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd06b195-b72a-45c4-af46-cd923629630b","html_url":"https://github.com/murtaza-u/muttoauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murtaza-u%2Fmuttoauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murtaza-u%2Fmuttoauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murtaza-u%2Fmuttoauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murtaza-u%2Fmuttoauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murtaza-u","download_url":"https://codeload.github.com/murtaza-u/muttoauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947822,"owners_count":21023058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-token","email-client","gmail","google","mutt","neomutt","oauth2","refresh-token"],"created_at":"2024-11-05T10:38:07.669Z","updated_at":"2025-04-08T23:38:59.888Z","avatar_url":"https://github.com/murtaza-u.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `muttoauth2`\n\n\u003e Google `OAuth2` authorization script for Mutt E-mail client\n\n## Prerequisite\n\n* Create a [Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects)\n* Configure [OAuth consent screen](https://developers.google.com/workspace/guides/configure-oauth-consent)\n* Enable [Gmail API](https://console.cloud.google.com/apis/library/gmail.googleapis.com)\n* [Create](https://developers.google.com/workspace/guides/create-credentials#oauth-client-id)\n  OAuth `client id` and `client secret`\n\n## Edit `muttoauth`\n\n```bash\n# client id\nid=\"*********************************************.apps.googleusercontent.com\"\n\n# client secret\nsecret=\"***********************************\"\n\n# gpg key id(gpg --list-secret-keys --keyid-format LONG)\nkeyid=\"****************\"\n```\n\n* Set `id` equal to client id\n* Set `secret` equal to client secret\n* Get `gpg` key id\n\n```bash\ngpg --list-secret-keys --keyid-format LONG\n\nsec   rsa4096/{keyid} 2022-06-06 [SC]\n```\n\n* Set `keyid` equal to `gpg` key id\n\n## Check for missing dependencies\n\n```bash\nmuttoauth -d\n\n[x] curl\n[ ] jq\n[x] gpg\n[x] shred\n```\n\n## Authorize\n\n```bash\nmuttoauth -a /save/to/tkn_file\n\nOpen this URL in a web browser\nCopy the authorization code and paste it below\nhttps://accounts.google.com/o/oauth2/auth?client_id=*********************************************.apps.googleusercontent.com\u0026redirect_uri=urn:ietf:wg:oauth:2.0:oob\u0026scope=https://mail.google.com/\u0026response_type=code\nAuthorization Code: *********************************************\n```\n\n## Configure Mutt to use `OAuth2`\n\n```diff\n set imap_user = \"test@gmail.com\"\n set smtp_url = \"smtps://test@gmail.com@smtp.gmail.com:465\"\n\n-set my_pass = \"`pass show email`\"\n-set imap_pass = $my_pass\n-set smtp_pass = $my_pass\n+set imap_authenticators=\"oauthbearer\"\n+set imap_oauth_refresh_command = \"muttoauth -r /path/to/tkn_file\"\n+set smtp_authenticators=${imap_authenticators}\n+set smtp_oauth_refresh_command=${imap_oauth_refresh_command}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurtaza-u%2Fmuttoauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurtaza-u%2Fmuttoauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurtaza-u%2Fmuttoauth/lists"}