Tools 4 min read 839 words

Stalwart now speaks Exchange

ES
Stalwart now speaks Exchange

Hermit crabs don’t have a shell of their own: they use whatever ones they find, and when theirs gets too small they look for another. The tricky moment is the move, because while they switch from one to the other they’re exposed. And if there’s no shell their size on the beach, well, they have to stay in the old one, even if it pinches.

Something similar happens with Exchange in many companies: it has been the default mail server for twenty years, Outlook talks to it in its own language, and getting out of there without anybody noticing anything on their computer or phone was, until now, quite complicated. That’s why it caught my attention that Stalwart 1.2.0 presents itself outright as an Exchange replacement.

What Stalwart is

Stalwart is an open source mail and collaboration server, written in Rust, that already spoke the standard protocols: IMAP, JMAP, CalDAV and CardDAV, with mail rules in Sieve. So far, just another modern mail server. What version 1.2.0 adds are Microsoft’s protocols, which are what make Outlook behave like Outlook:

ProtocolWhat forClients
MAPI over HTTPMail, calendars, contacts, tasks, notes, global address list, shared mailboxes, delegates, rulesClassic Outlook for Windows, cached and online mode
Exchange Web Services (EWS)Mail, calendars, contacts, tasks, free/busy, out of officeOutlook for Mac, Apple Mail, Calendar and Contacts on macOS, Thunderbird, Evolution, eM Client
Exchange ActiveSyncMail, calendars, contacts, tasks, push, meeting responsesNative mail apps on iPhone, iPad and Android
AutodiscoverAutomatic setup with just email and passwordAll of the above

All of that is served on the same HTTPS port as JMAP and the web interface, and on the same accounts: a user can have Outlook at work over MAPI, their phone over ActiveSync and Thunderbird at home over IMAP, and they all see the same mailbox and the same calendar.

flowchart LR
    A["Outlook for Windows"] -->|MAPI| S[("Stalwart")]
    B["Outlook Mac · Apple Mail · Thunderbird"] -->|EWS| S
    C["iPhone · Android"] -->|ActiveSync| S
    D["Other clients"] -->|IMAP · JMAP · CalDAV| S

What I like about the design is how it translates Exchange concepts into standard ones. Outlook rules are stored as server-side rules that run in Sieve at delivery time, delegates and folder permissions become regular Stalwart shares, and properties only Exchange understands are stored separately as metadata, only when an Exchange client writes them. In other words, Exchange is one more way in, not the data model of the whole server.

What it doesn’t do

Here you have to be honest, and the announcement itself is:

  • No public folders, no archive mailboxes, no mobile device management.
  • No NTLM or Kerberos: clients sign in with a password, an app password or OAuth. In a company where everything is tied to Active Directory, this matters.
  • No RPC over HTTP, so Outlook 2010 and earlier are left out.
  • The new Outlook for Windows doesn’t work, and the authors advise against using it with any self-hosted server because IMAP connections go through Microsoft’s cloud.
  • Outlook for iOS and Android requires a hybrid setup with Exchange Online, so on phones they recommend the native apps.

For migration they have Vandelay, which imports from on-premises Exchange over EWS and from Microsoft 365 over Microsoft Graph (OneDrive files included), copies the accounts into Stalwart over JMAP, and the move is completed by changing the MX records and the client settings.

Why now

The timing isn’t a coincidence. According to the announcement, Exchange 2016 and 2019 went out of support in October 2025, the paid Extended Security Updates ended in October this year, and the only supported on-premises version, Exchange Server Subscription Edition, won’t get any more major versions. Meanwhile, Microsoft is pushing towards Exchange Online and has started switching off EWS in the cloud, which should disappear completely in April 2027. Microsoft hasn’t announced the end of Exchange Server, but it doesn’t take much imagination to see where it’s heading.

On top of that there’s data sovereignty, which carries more and more weight in Europe: some organisations want (or have) to know where their email is and who can read it. A couple of weeks ago I wrote about how Outlook.com started rejecting mail from domains without DMARC without telling anyone, and it’s another reminder of what depending on a single provider’s decisions means.

The new shell

Exchange support is in the Community edition, under the AGPL licence, in its own Rust module that can be left out at build time, and it comes disabled by default: you have to switch it on deliberately. I think that’s a good way to do it, because whoever doesn’t need it doesn’t have to carry it.

I don’t think this will empty Exchange servers overnight, and the limitations above rule out many large companies. But for a medium-sized organisation that uses Outlook because it’s what there is, not because of public folders, there’s now a shell its size on the beach. And the move, which was the scariest part, can be done without users having to learn anything new.