Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Latest commit

 

History

History
37 lines (24 loc) · 801 Bytes

README.md

File metadata and controls

37 lines (24 loc) · 801 Bytes

SASL XOAUTH2

Build

Go https://console.developers.google.com/ (Credentials -> Create credentials -> OAuth client ID). Then obtain a pair of OAuth2 ID & secret.

Build dependency: libsasl2-dev.

make build CLIENTID=YOUR_CLIENT_ID CLIENTSECRET=YOUR_CLIENT_SECRET

Install

sudo make install

Use

Use Mutt to login GMail IMAP/SMTP with OAuth2.

First run ./sasl-xoauth2 to obtain a token, then set it as a password in muttrc, like:

set folder      = "imaps://imap.gmail.com/"

set imap_user   = "example@gmail.com"
set imap_pass   = "token"

set smtp_url = "smtps://$imap_user:$imap_pass@smtp.gmail.com"

# set imap_authenticators="XOAUTH2"
set smtp_authenticators="XOAUTH2"