Fastmail Wrapper for macOS

Uncategorized Apr 15, 2020

I keep looking through my archives of old, private coding projects – the ones that I built just for myself to solve a particular need – to see if I can find any that other folks might find useful. So, here’s another one I spent a few hours cleaning up recently.

Fastmail is the greatest email service in the world. (Fight me.) I assume they picked that name at random because it sounded nice and then kind of painted themselves into a corner and were forced to live up to it by making their IMAP backend literally the fastest email service I’ve ever used. If you think IMAP is just a broken and awful protocol (it is), then you’ve probably only ever tried Gmail’s horrible, bastardized implementation in recent years. Fastmail IMAP absolutely sings.

And their web interface (particularly the latest revision) is truly spectacular and also lives up to their name. It’s hands down one of the best non-trivial web apps I’ve ever had the pleasure of using.

So, despite primarily living in MailMate, I did build this simple macOS wrapper around a while back and occasionally do still use it over MailMate.

The app supports

  • Multiple Fastmail accounts.
  • Native macOS notifications (and sounds).
  • Customizable Dock icon badges.
  • Keyboard shortcuts (⌘1 – ⌘9) to quickly open specific accounts.
  • Never, ever does anything with your Fastmail credentials. The only network traffic is between the app and the Fastmail website.

It also has the dumbest macOS Preferences window ever for configuring your accounts because I’m too lazy to spend an evening doing it the right way.

I’d post screenshots showing what the app looks like, but I’m not going to because 1) it’s literally just inside a window and 2) I don’t want the internet to see my Inbox.

Instead, here’s the app’s Dock icon showing multiple unread badges.

Fastmail Dock icon

You can assign each account’s unread count to a specific corner of the Dock icon. If you assign multiple accounts to the same corner, their counts will be summed together and displayed.

The source code is available on GitHub, and I’ve also uploaded a Developer ID signed and notarized build if you just want to download and run the app.

Of note: the app monitors your inbox for new messages by injecting JavaScript into the webview. Early on I realized that if you navigate away from certain screens within, the JavaScript will break. (Obviously, because the DOM elements it’s looking for are no longer available.)

To fix this, I did the first and most incredibly hackish thing that came to mind, which is to keep a hidden webview open in the background that the app maintains control over and can parse for new messages.

I would like to fix this by doing smarter DOM scraping, but I don’t think it’s worth the effort because the HTML source can change at anytime.

Rather, if someone would like to tackle this feature for me, it would be amazing if the app just spoofed the website’s JMAP credentials and checked for new email the real way.

Anyway, I hope all you handsome Fastmail customers out there find this little project useful.