mutt-oauth2


Namemutt-oauth2 JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://tatsh.github.io/mutt-oauth2/
SummaryPackaged, maintained version of contributed mutt_oauth2.py script.
upload_time2025-07-30 23:28:38
maintainerNone
docs_urlNone
authorAndrew Udvare
requires_python<3.14,>=3.10
licenseMIT
keywords email gmail mutt outlook
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mutt-oauth2

[![Python versions](https://img.shields.io/pypi/pyversions/mutt-oauth2.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)
[![PyPI - Version](https://img.shields.io/pypi/v/mutt-oauth2)](https://pypi.org/project/mutt-oauth2/)
[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/mutt-oauth2)](https://github.com/Tatsh/mutt-oauth2/tags)
[![License](https://img.shields.io/github/license/Tatsh/mutt-oauth2)](https://github.com/Tatsh/mutt-oauth2/blob/master/LICENSE.txt)
[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/mutt-oauth2/v0.1.1/master)](https://github.com/Tatsh/mutt-oauth2/compare/v0.1.1...master)
[![QA](https://github.com/Tatsh/mutt-oauth2/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/mutt-oauth2/actions/workflows/qa.yml)
[![Tests](https://github.com/Tatsh/mutt-oauth2/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/mutt-oauth2/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/Tatsh/mutt-oauth2/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/mutt-oauth2?branch=master)
[![Documentation Status](https://readthedocs.org/projects/mutt-oauth2/badge/?version=latest)](https://mutt-oauth2.readthedocs.org/?badge=latest)
[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pydocstyle](https://img.shields.io/badge/pydocstyle-enabled-AD4CD3)](http://www.pydocstyle.org/en/stable/)
[![pytest](https://img.shields.io/badge/pytest-zz?logo=Pytest&labelColor=black&color=black)](https://docs.pytest.org/en/stable/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Downloads](https://static.pepy.tech/badge/mutt-oauth2/month)](https://pepy.tech/project/mutt-oauth2)
[![Stargazers](https://img.shields.io/github/stars/Tatsh/mutt-oauth2?logo=github&style=flat)](https://github.com/Tatsh/mutt-oauth2/stargazers)

[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Ddid%3Aplc%3Auq42idtvuccnmtl57nsucz72%26query%3D%24.followersCount%26style%3Dsocial%26logo%3Dbluesky%26label%3DFollow%2520%40Tatsh&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40Tatsh)](https://bsky.app/profile/Tatsh.bsky.social)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social&style=social)](https://hostux.social/@Tatsh)

This is an update of [Alexander Perlis' script](https://github.com/muttmua/mutt/blob/master/contrib/mutt_oauth2.py)
and conversion to a package. Instead of using GPG for token storage, this package uses Keyring.

## Installation

### Pip

```shell
pip install mutt-oauth2
```

## Usage

```plain
Usage: mutt-oauth2 [OPTIONS]

  Obtain and print a valid OAuth2 access token.

Options:
  -a, --authorize      Manually authorise new tokens.
  -d, --debug          Enable debug logging.
  -t, --test           Test authentication.
  -u, --username TEXT  Keyring username.
  -v, --verbose        Enable verbose logging.
  -h, --help           Show this message and exit.
```

Start by calling `mutt-oauth2 -a`. Be sure to have your client ID and and client secret available.

### Scopes required

| Provider  | Scopes                                                              |
| --------- | ------------------------------------------------------------------- |
| Gmail     | Gmail API                                                           |
| Microsoft | offline_access IMAP.AccessAsUser.All POP.AccessAsUser.All SMTP.Send |

To support other accounts, use the `--username` argument with a unique string such as the account
email address.

Test the script with the `--test` argument.

### mutt configuration

Add the following to `muttrc`:

```plain
set imap_authenticators="oauthbearer:xoauth2"
set imap_oauth_refresh_command="/path/to/mutt-oauth2"
set smtp_authenticators=${imap_authenticators}
set smtp_oauth_refresh_command=${imap_oauth_refresh_command}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://tatsh.github.io/mutt-oauth2/",
    "name": "mutt-oauth2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10",
    "maintainer_email": null,
    "keywords": "email, gmail, mutt, outlook",
    "author": "Andrew Udvare",
    "author_email": "audvare@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e7/a7/d16bbead414435082fbed35f9dd7b73b74a6baf42eb19e43cbd62016fe7c/mutt_oauth2-0.1.1.tar.gz",
    "platform": null,
    "description": "# mutt-oauth2\n\n[![Python versions](https://img.shields.io/pypi/pyversions/mutt-oauth2.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)\n[![PyPI - Version](https://img.shields.io/pypi/v/mutt-oauth2)](https://pypi.org/project/mutt-oauth2/)\n[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/mutt-oauth2)](https://github.com/Tatsh/mutt-oauth2/tags)\n[![License](https://img.shields.io/github/license/Tatsh/mutt-oauth2)](https://github.com/Tatsh/mutt-oauth2/blob/master/LICENSE.txt)\n[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/mutt-oauth2/v0.1.1/master)](https://github.com/Tatsh/mutt-oauth2/compare/v0.1.1...master)\n[![QA](https://github.com/Tatsh/mutt-oauth2/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/mutt-oauth2/actions/workflows/qa.yml)\n[![Tests](https://github.com/Tatsh/mutt-oauth2/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/mutt-oauth2/actions/workflows/tests.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Tatsh/mutt-oauth2/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/mutt-oauth2?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/mutt-oauth2/badge/?version=latest)](https://mutt-oauth2.readthedocs.org/?badge=latest)\n[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![pydocstyle](https://img.shields.io/badge/pydocstyle-enabled-AD4CD3)](http://www.pydocstyle.org/en/stable/)\n[![pytest](https://img.shields.io/badge/pytest-zz?logo=Pytest&labelColor=black&color=black)](https://docs.pytest.org/en/stable/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Downloads](https://static.pepy.tech/badge/mutt-oauth2/month)](https://pepy.tech/project/mutt-oauth2)\n[![Stargazers](https://img.shields.io/github/stars/Tatsh/mutt-oauth2?logo=github&style=flat)](https://github.com/Tatsh/mutt-oauth2/stargazers)\n\n[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Ddid%3Aplc%3Auq42idtvuccnmtl57nsucz72%26query%3D%24.followersCount%26style%3Dsocial%26logo%3Dbluesky%26label%3DFollow%2520%40Tatsh&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40Tatsh)](https://bsky.app/profile/Tatsh.bsky.social)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social&style=social)](https://hostux.social/@Tatsh)\n\nThis is an update of [Alexander Perlis' script](https://github.com/muttmua/mutt/blob/master/contrib/mutt_oauth2.py)\nand conversion to a package. Instead of using GPG for token storage, this package uses Keyring.\n\n## Installation\n\n### Pip\n\n```shell\npip install mutt-oauth2\n```\n\n## Usage\n\n```plain\nUsage: mutt-oauth2 [OPTIONS]\n\n  Obtain and print a valid OAuth2 access token.\n\nOptions:\n  -a, --authorize      Manually authorise new tokens.\n  -d, --debug          Enable debug logging.\n  -t, --test           Test authentication.\n  -u, --username TEXT  Keyring username.\n  -v, --verbose        Enable verbose logging.\n  -h, --help           Show this message and exit.\n```\n\nStart by calling `mutt-oauth2 -a`. Be sure to have your client ID and and client secret available.\n\n### Scopes required\n\n| Provider  | Scopes                                                              |\n| --------- | ------------------------------------------------------------------- |\n| Gmail     | Gmail API                                                           |\n| Microsoft | offline_access IMAP.AccessAsUser.All POP.AccessAsUser.All SMTP.Send |\n\nTo support other accounts, use the `--username` argument with a unique string such as the account\nemail address.\n\nTest the script with the `--test` argument.\n\n### mutt configuration\n\nAdd the following to `muttrc`:\n\n```plain\nset imap_authenticators=\"oauthbearer:xoauth2\"\nset imap_oauth_refresh_command=\"/path/to/mutt-oauth2\"\nset smtp_authenticators=${imap_authenticators}\nset smtp_oauth_refresh_command=${imap_oauth_refresh_command}\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Packaged, maintained version of contributed mutt_oauth2.py script.",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://mutt-oauth2.readthedocs.org",
        "Homepage": "https://tatsh.github.io/mutt-oauth2/",
        "Issues": "https://github.com/Tatsh/mutt-oauth2/issues",
        "Repository": "https://github.com/Tatsh/mutt-oauth2"
    },
    "split_keywords": [
        "email",
        " gmail",
        " mutt",
        " outlook"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f590668632c79aa2c302618d887069e112c96e1df5568ce24e818350b98ada2b",
                "md5": "7fd03c16a69c618f34de99e3717943d2",
                "sha256": "b18c52b1e231e61612982158ada416c656d3c348a633cc93521ed7df4bc06369"
            },
            "downloads": -1,
            "filename": "mutt_oauth2-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7fd03c16a69c618f34de99e3717943d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10",
            "size": 10685,
            "upload_time": "2025-07-30T23:28:37",
            "upload_time_iso_8601": "2025-07-30T23:28:37.443852Z",
            "url": "https://files.pythonhosted.org/packages/f5/90/668632c79aa2c302618d887069e112c96e1df5568ce24e818350b98ada2b/mutt_oauth2-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7a7d16bbead414435082fbed35f9dd7b73b74a6baf42eb19e43cbd62016fe7c",
                "md5": "fdd66f4e66db1cfa8cb7f69a23904e27",
                "sha256": "1defa486639e918cf1924c75b350d4261cec2d36dbab9fa290b7c8ca7c3dfcb4"
            },
            "downloads": -1,
            "filename": "mutt_oauth2-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fdd66f4e66db1cfa8cb7f69a23904e27",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10",
            "size": 15685,
            "upload_time": "2025-07-30T23:28:38",
            "upload_time_iso_8601": "2025-07-30T23:28:38.556777Z",
            "url": "https://files.pythonhosted.org/packages/e7/a7/d16bbead414435082fbed35f9dd7b73b74a6baf42eb19e43cbd62016fe7c/mutt_oauth2-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 23:28:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Tatsh",
    "github_project": "mutt-oauth2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mutt-oauth2"
}
        
Elapsed time: 0.95164s