💾 Archived View for thrig.me › tech › mutt-gmail.gmi captured on 2024-08-31 at 12:43:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-19)

-=-=-=-=-=-=-

Using mutt with Gmail

    $ pkg_info | grep mutt
    mutt-2.2.3v3-gpgme-sasl tty-based e-mail client
    $ pkg_info -L mutt | grep oauth
    /usr/local/share/examples/mutt/mutt_oauth2.py
    /usr/local/share/examples/mutt/mutt_oauth2.py.README

The OpenBSD mutt port includes a mutt_oauth2.py.README guide that will get you most of the way there. Also difficult is the google cloud interface (why are the CPU fans running to display it?) which already shows some variance with what is in the guide; an additional undocumented step was to add my email address yet another time as a test user.

Do not try devicecode; only authcode or localhostauthcode appear to work.

mutt_oauth2.py needs various modifications (make sure you get all of them); the "tokens" file must exist, so I made that a fully qualified path:

    set imap_user="FIXME@gmail.com"
    set folder="imaps://imap.gmail.com"
    set smtp_url="smtp://${imap_user}@smtp.gmail.com:587/"
    set imap_authenticators="oauthbearer:xoauth2"
    set imap_oauth_refresh_command="/home/FIXME/libexec/mutt_oauth2.py /home/FIXME/libexec/${imap_user}.tokens"
    set smtp_authenticators=${imap_authenticators}
    set smtp_oauth_refresh_command=${imap_oauth_refresh_command}

I would prefer to use fdm (or equivalent) as that would bring the mail local to the system and thus remove the sluggishness of IMAP, but that's an adventure for some other time.

Meanwhile, let's see if I can use this domain for email instead of le google.

Back to tech index

tags #mutt