MUTT-OAUTH2(1)

NAME
mutt-oauth2 - mutt-oauth2 v0.1.1

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

COMMANDS

  mutt-oauth2

Obtain and print a valid OAuth2 access token.

    mutt-oauth2 [OPTIONS]

Options

-a, --authorize
    Manually authorise new tokens.

-d, --debug
    Enable debug logging.

-t, --test
    Test authentication.

-u, --username <username>
    Keyring username.

-v, --verbose
    Enable verbose logging.

USAGE

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}

AUTHOR
Andrew Udvare <audvare@gmail.com>

COPYRIGHT
2025