Exchange with Mailspring using DavMail

Kobi Rosenstein
2 min readMay 3, 2020

An adventure in getting my work email account on linux, the way I Want it.

This post is kinda sorta a logical continuation to one of my recent posts, where I talk about using linux as a modern and powerful daily-driver desktop OS in 2020.

I mentioned Mailspring, the Email client I use to replace Outlook. There is only one really big issue with Mailspring so far, but it’s a dealbreaker. Mailspring does not yet support Microsoft Exchange email accounts.

Enter Me. My company recently shifted to working with exchange, and I got a new email address, using Exchange. I have access through Outlook Web. But Lo and Behold, when I went to add the new account in Mailspring like I do with my gmail accounts, it simply did not work. I tried the Office 365. I tried the Outlook.com. But no dice. A quick google search led to me Mailspring’s github, where the folks say Exchange support has been on the roadmap since 2017.

The easy solution is to simply connect using IMAP and SMTP. The problem in my case was that the boys down in IT didn’t know anything about it, least of all how to grant access and the details I would need to connect.

There are a few email apps on linux that do support exchange. Hiri was built for exchange and does support it very well, but it ONLY supports exchange, aside from being paid. No good for me. Evolution is supposed to support exchange but I couldn’t manage to authenticate. Anyway, I don’t like the UI in Evolution and the main reason I use linux and not Mac, or *shudder* windows, is so that I can have EVERYTHING exactly the way I want it. Thunderbird has a really bad and dated ui.

So, I turned to my good old friend google and found DavMail.

Davmail is a small program that runs on your desktop and connects to Exchange. Then it forwards that through localhost with custom ports, allowing you to connect with imap using the client of your choice.

After configuring Davmail, Mailspring could connect with IMAP like a charm.

The important configuration is in davmail to use the correct owa server. It looks something like this:

https://mail.companyname.com/owa/

In Mailspring, you connect to localhost as your imap server, then select your custom ports that davmail is using. Make sure the SSL field is set to none on both IMAP and SMTP.

--

--

Kobi Rosenstein

Linux infrastructure guy. This blog chronicles my “gotcha” moments — Each post contains an answer I would have like to have found when trawling google.