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

zhsj/sasl-xoauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"