Mutt and CMU Email

All mail clients suck. This one just sucks less.

Michael Elkins, c. 1995

This whole story is a little silly, but I figured I would put this up here so that anyone else who wants to use Mutt to check CMU email will not have to go in several pointless circles like I did.

A little while back I thought that it’d be cool to try out Mutt for my email needs. There are a few hoops to jump through in order to integrate Mutt with Gmail (and Google keeps on changing what they want, so guides that worked five years ago might not work now). Fortunately, these hiccups are well-documented, so I was eventually able to configure my personal Gmail account to work splendidly with Mutt by just following the steps in the Mutt release notes. In summary, this just involved:

  1. Setting up a Google Cloud project to generate an OAuth client ID.
  2. Using a questionably-maintained Python 2 script and a web browser to generate a token for Mutt.
  3. Configuring Mutt to use this token for authentication when connecting to Google’s IMAP and SMTP servers.

This was nice, but I actually use my university email account1 much more than I use my personal account, so it’d be nice to get this working with my Andrew account. Andrew email is done through Gmail, so in theory the steps are the same. However, the university administrators have disabled certain features in the Google Cloud Console, particularly creating projects.

Several other authentication methods that worked with my personal Gmail but not with my Andrew email included:

Because of these constraints, I actually struggled with getting Mutt to work with my Andrew email for a while. In the end, I realized that the solution was embarrassingly simple3; the entire difficulty arose from my conceptual misunderstanding of how this authentication worked. In fact, you do not need to set up the OAuth client ID from the account you wish to use; it can be any unrelated account, although it should be one that you trust, since you are granting it permission to read all of your email. In my case, I obviously trust my personal email account, so I can just use the client ID generated from my personal account’s Google Cloud project with my Andrew account.

Anyway, this whole setup has been working splendidly for me, and I’ve stopped using the Gmail web client and GNOME Evolution for my emails. I have caved in a bit in reading HTML email; I just set my mailcap to render those through Lynx.

Checking my university mail in Mutt

I do someday want to move away from Google for email, even on the server side. (Of course, this won’t happen as long as my university email account remains my primary one.) I’ve seriously considered just spending $5 a month for Fastmail, but I’m a stingy undergrad. Of course, there’s always the option of getting a cheap server off of Craigslist and just running a mail server from my apartment.

  1. CMU Computing Services names many things “Andrew” after the school’s two benefactors, Andrew Carnegie and Andrew Mellon.↩︎

  2. Instead, CMU’s two-factor authentication is done through Duo. I found this out because apparently two-factor authentication is required for university employees, including teaching assistants.↩︎

  3. There are probably also more complicated ways to configure this, like using fetchmail or procmail, but I’m not that hardcore.↩︎