explaingit

zephyraoss/haitatsu

13GoAudience · ops devopsComplexity · 4/5Setup · hard

TLDR

A self-hosted email server written in Go that ships as a single binary, handling SMTP and IMAP with PostgreSQL for metadata and S3-compatible storage for messages, designed to embed in platform backends.

Mindmap

mindmap
  root((Haitatsu))
    What it does
      Receive SMTP mail
      Serve IMAP to clients
      Platform mailbox REST API
    Storage
      PostgreSQL metadata
      S3 message bodies
      Stateless binary
    Access
      IMAP for end users
      REST API for backends
      App password auth
    Features
      TLS and STARTTLS
      ACME auto certs
      Pkl config hot reload
    Tech Stack
      Go single binary
      PostgreSQL
      S3 MinIO
      Docker Compose
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add per-user mailboxes to a SaaS platform backend using a REST API without managing a complex mail stack.

USE CASE 2

Receive and store inbound email programmatically so your backend service can read and process messages via API calls.

USE CASE 3

Let users connect standard email clients like Thunderbird via IMAP to mailboxes hosted on your own infrastructure.

Tech stack

GoPostgreSQLS3MinIODockerPkl

Getting it running

Difficulty · hard Time to first run · 1h+

Requires PostgreSQL and S3-compatible object storage such as MinIO, the included Docker Compose setup is the recommended starting point.

No license information is provided in this repository.

In plain English

Haitatsu is a self-hosted email server written in Go that ships as a single executable. It is designed to slot into a platform or application backend rather than act as a standalone mail service for individuals. The goal is to give developers a way to add mailbox functionality to their own products without standing up a complex multi-component mail stack. The server handles incoming mail over SMTP and makes messages available to email clients through IMAP. Outgoing mail to external addresses goes through a relay rather than being sent directly, which keeps the server's footprint focused on receiving and storing messages. Connections support TLS, including a STARTTLS submission mode, and automatic certificate provisioning via ACME is built in. For storage, Haitatsu splits metadata from message content. PostgreSQL holds metadata such as mailbox state, flags, and folder structures, while message bodies go to S3-compatible object storage such as MinIO. This means the binary itself stays stateless and the data lives in systems that operators are likely already running. End users do not interact with the REST API. They connect from a regular email client using IMAP and SMTP with app passwords specific to their account. Backend services connect via the REST API using a configured service token to create and manage mailboxes, read messages, or perform administrative tasks. This separation keeps user credentials simple while giving platform code full programmatic control. Configuration is written in a file using the Pkl configuration language, which supports hot reloading so settings can be updated without restarting the server. The project includes a Docker Compose setup for local development with tasks for building the binary, starting the full stack, and resetting volumes.

Copy-paste prompts

Prompt 1
I want to embed Haitatsu into my platform to give each user a dedicated mailbox. Walk me through the Docker Compose setup and how I call the REST API to create a mailbox for a new user.
Prompt 2
Using Haitatsu, how do I enable TLS and configure automatic ACME certificate provisioning for my domain so IMAP and SMTP connections are encrypted?
Prompt 3
I need to update Haitatsu configuration without restarting the server. How does Pkl hot reload work and which settings can be changed live while the server is running?
Open on GitHub → Explain another repo

← zephyraoss on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.