Setting up Gmail on aerc

A few days ago, I committed to CMU and got my university email: I made an alias,, and if anyone wants to email my uni email I’d strongly prefer if you emailed that alias because come on, dennisc2 is probably the least sexy email address possible. I mean, why’d they have to put a number in my email?

Anyway, the Gmail web client is a disaster, so I wanted to get my CMU email on aerc. And since CMU uses Google Suites, the problem essentially reduced to getting Gmail to work on aerc.


TL;DR follow the commit message for the aerc patch that introduced aerc support. However, note that the token endpoint — when URL-escaped— is now instead.


Now that you have all the information you need, go to aerc’s accounts.conf and create a new entry with the following source:

source = imaps+oauthbearer://{username}:{refresh_token} \

The outgoing entry is identical: just replace imaps with smtps and with and you’re good to go. Full example:

outgoing = smtps+oauthbearer://{username}:{refresh_token} \