mutt-oauth2
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}
Metadata
Release files for mutt-oauth2 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mutt_oauth2-0.2.1.tar.gz | 17.7 kB | With provenance | Details for mutt_oauth2-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mutt_oauth2-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for mutt_oauth2-0.2.1-py3-none-any.whl |
Total release size: 30.0 kB
Release files / mutt_oauth2-0.2.1.tar.gz
| Download URL | mutt_oauth2-0.2.1.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b6dbaeb5f99151be650e1eccb56a11fd7501f2071430935274f4eb9ba82d613
|
|
BLAKE2b-256 checksum How to use checksums |
b93fda2193c644561fe1490804a8c16769c450c251a5048804638ecf6c377819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.
Transparency logRelease files / mutt_oauth2-0.2.1-py3-none-any.whl
| Download URL | mutt_oauth2-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb816e790bca3e79d92a9d83ca5454b08273e4f08660774f0ab81277b541dbe
|
|
BLAKE2b-256 checksum How to use checksums |
276aad2df622a62b964e935a98580f0741eb4670145c6973d12f1a3b970116dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.
Transparency logSecurity for mutt-oauth2 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mutt_oauth2-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.