<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maksim Ramzaev</title>
    <description>The latest articles on DEV Community by Maksim Ramzaev (@maxramas).</description>
    <link>https://dev.to/maxramas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4010684%2F5a3d1d75-3e8d-4096-a159-0a5185ffe650.jpg</url>
      <title>DEV Community: Maksim Ramzaev</title>
      <link>https://dev.to/maxramas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxramas"/>
    <language>en</language>
    <item>
      <title>Building a Self-Hosted Email Client That Decouples the UI from IMAP</title>
      <dc:creator>Maksim Ramzaev</dc:creator>
      <pubDate>Wed, 01 Jul 2026 09:48:09 +0000</pubDate>
      <link>https://dev.to/maxramas/building-a-self-hosted-email-client-that-decouples-the-ui-from-imap-4bcn</link>
      <guid>https://dev.to/maxramas/building-a-self-hosted-email-client-that-decouples-the-ui-from-imap-4bcn</guid>
      <description>&lt;p&gt;&lt;em&gt;Full disclosure: I'm the developer of RMS Mail. This is my own project, not a recommendation of someone else's tool.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem that started it all
&lt;/h2&gt;

&lt;p&gt;A few months ago I ran into a stupid problem.&lt;/p&gt;

&lt;p&gt;My Mac only has a 512GB SSD, while I have around twenty email accounts with years of archived mail. Buying a larger Mac or external storage felt like the wrong solution. Storage on a VPS is dramatically cheaper, so I started looking for a self-hosted mail client.&lt;/p&gt;

&lt;p&gt;I've been a sysadmin for 15+ years and currently run my own hosting business — about a dozen servers, mine and clients'. So I went through the usual self-hosted options: Roundcube, SnappyMail, Stalwart, the rest of the list. Most felt like software from another era. The newer ones required surprisingly heavy infrastructure, and almost all of them had the same architectural habit — IMAP sits at the center of the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real bottleneck wasn't storage
&lt;/h2&gt;

&lt;p&gt;Then I realized storage wasn't actually the problem.&lt;/p&gt;

&lt;p&gt;The real bottleneck was architecture — every search, every bulk operation, every folder switch depended on a remote mail server. The UI wasn't slow because JavaScript was slow. It was slow because every action waited for IMAP.&lt;/p&gt;

&lt;p&gt;Instead of optimizing that model, I built a different one.&lt;/p&gt;

&lt;h2&gt;
  
  
  IMAP as a sync layer, not the backbone
&lt;/h2&gt;

&lt;p&gt;RMS Mail treats IMAP as a synchronization layer. The UI never queries IMAP directly. Mail syncs into a local database where indexing, full-text search, threading, and bulk operations happen independently of the mail server. IMAP's only job is keeping data in sync; the application handles everything else.&lt;/p&gt;

&lt;p&gt;In practice: searching large archives, moving thousands of messages, and background sync all happen against the local index, with no IMAP round-trip in the critical path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Go&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Next.js&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt;: SQLite (single-mailbox edition) or PostgreSQL + Redis + Asynq (multi-account/heavy workloads)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution&lt;/strong&gt;: Docker images — ~73MB frontend, ~19MB backend&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Runtime memory footprint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single-mailbox edition (SQLite, no Postgres/Redis): ~90MB total&lt;/li&gt;
&lt;li&gt;Multi-account/Postgres-backed editions: ~370–700MB, mostly Postgres being Postgres&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Three editions, one architecture
&lt;/h2&gt;

&lt;p&gt;Self-hosted means different things depending on who's running it, so RMS Mail ships as three editions on the same core:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mono&lt;/strong&gt; (free) — A modern Roundcube replacement. Multi-user webmail for a single domain: each person logs into their own account. SQLite, no external dependencies, starts in under a minute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mono Pro&lt;/strong&gt; (paid) — Same multi-user model as Mono, scaled up with Postgres, Redis, and Asynq for heavy, long-term workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unified&lt;/strong&gt; (freemium) — A genuinely different model: not multi-user, but multi-account for a single person. One workspace, many mailboxes — built for managing ~20 accounts myself, with a combined inbox and project groups.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Optional AI features
&lt;/h2&gt;

&lt;p&gt;Since this tends to be the first thing self-hosted/privacy-focused folks ask about: RMS Mail includes optional summarization, categorization, translation (45 languages), and a chat interface that can drive the app's processes in plain text. There's also a Telegram integration (control your inbox from chat) and an MCP integration (control it from your IDE).&lt;/p&gt;

&lt;p&gt;All of it is opt-in — bring your own API key (9 providers supported) or point it at a local Ollama instance. A single environment variable strips every AI-related code path and UI element if you don't want it at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  On the source code
&lt;/h2&gt;

&lt;p&gt;Worth being upfront about: the source is closed. All three editions ship as Docker images, not as public repositories. I know that's a harder sell in self-hosted circles specifically, where open source is often the default expectation — happy to discuss the reasoning, or hear whether that's a dealbreaker for people who'd otherwise want this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where things stand
&lt;/h2&gt;

&lt;p&gt;The project is a few months old and actively developed — 11 releases so far, all three editions at stable status. Current priorities: core stability, multi-gigabyte mailbox performance, low-latency search, and infrastructure reliability.&lt;/p&gt;

&lt;p&gt;Repo (deployment files, Docker Compose configs, documentation): &lt;a href="https://github.com/max-ramas/rms-mail-public" rel="noopener noreferrer"&gt;github.com/max-ramas/rms-mail-public&lt;/a&gt;&lt;br&gt;
Product page: &lt;a href="https://rms-ds.com/en/products/rms-mail" rel="noopener noreferrer"&gt;rms-ds.com/en/products/rms-mail&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd especially like feedback from people managing large mailboxes or running self-hosted infrastructure themselves. If you think I solved something the wrong way, I want to hear why.&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
