SynMail

A self-hostable mail platform

Type
Product
Built with
Python
Source
Private repository
Productprivate repo
SM
FastAPIReactReact Router

Overview

A self-hostable mail platform: a FastAPI API with a bundled React single-page app, plus its own SMTP receiver, with external Postgres and S3-compatible object storage.

Core features

A first-run setup wizard that creates the administrator; domain management with DNS record guidance and verification (SPF, DKIM, EHLO) and one-click copy for each record; sending and receiving with attachments, backed by S3 object storage; DKIM signing; rich-text composition; theme support; password reset; and migrations that run before the app starts.

Architecture

Two images built from one Dockerfile — the API (with the React app compiled in a Node stage and served at /cdn) and the SMTP MTA (aiosmtpd). The app is stateless: DKIM keys and TLS certificates live on S3 with per-pod caches, so no shared volume is required. It ships Docker Compose, a Dokploy compose file, and GitHub Actions workflows that test the code and publish both images to GHCR.

Frameworks, tools & libraries

The stack behind it

Frameworks

  • FastAPI
  • React
  • React Router
  • Tailwind CSS
  • shadcn/ui

Tools & infrastructure

  • PostgreSQL (Neon)
  • S3-compatible storage
  • Docker Compose
  • Dokploy
  • GitHub Actions + GHCR
  • Alembic

Libraries

  • SQLAlchemy
  • aiosmtpd
  • dkimpy
  • pyspf
  • dnspython
  • aioboto3
  • Pydantic
  • Radix UI
  • react-quill

Skills applied

What I brought to it

  1. 01

    Email infrastructure: SMTP receiving, DKIM, SPF and DNS verification

  2. 02

    Stateless service design with S3-backed state

  3. 03

    Containerised deployment with Docker Compose and Dokploy

  4. 04

    CI publishing of container images

  5. 05

    Async Python with FastAPI and SQLAlchemy

  6. 06

    Single-page-app build embedded in an API image

Languages

What it's written in

  • Python~54 files

    API, SMTP receiver and migrations

  • JavaScript~47 files

    React app

Next project

SynTest

Catch API regressions before production