Skip to main content

mutt-oauth2

Python versions PyPI - Version GitHub tag (with filter) License GitHub commits since latest release (by SemVer including pre-releases) CodeQL QA Tests Coverage Status Dependabot Documentation Status mypy uv pytest Ruff Downloads Stargazers pre-commit Prettier

@Tatsh Buy Me A Coffee Libera.Chat Mastodon Follow Patreon

This is an update of Alexander Perlis' script and conversion to a package. Instead of using GPG for token storage, this package uses Keyring.

Installation

Pip

pip install mutt-oauth2

Usage

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.
  -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:

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}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mutt_oauth2-0.2.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mutt_oauth2-0.2.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file mutt_oauth2-0.2.1.tar.gz.

File metadata

  • Download URL: mutt_oauth2-0.2.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mutt_oauth2-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2b6dbaeb5f99151be650e1eccb56a11fd7501f2071430935274f4eb9ba82d613
MD5 0f514a37167c2585a91f0753cc9a5f3a
BLAKE2b-256 b93fda2193c644561fe1490804a8c16769c450c251a5048804638ecf6c377819

See more details on using hashes here.

Provenance

The following attestation bundles were made for mutt_oauth2-0.2.1.tar.gz:

Publisher: publish.yml on Tatsh/mutt-oauth2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mutt_oauth2-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mutt_oauth2-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mutt_oauth2-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb816e790bca3e79d92a9d83ca5454b08273e4f08660774f0ab81277b541dbe
MD5 1334b0bb7d34c31031025153b505a552
BLAKE2b-256 276aad2df622a62b964e935a98580f0741eb4670145c6973d12f1a3b970116dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mutt_oauth2-0.2.1-py3-none-any.whl:

Publisher: publish.yml on Tatsh/mutt-oauth2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page