Skip to content

rustmailapp/rustmail

RustMail

RustMail

A fast, feature-rich SMTP mail catcher built in Rust.
Single binary. Persistent storage. Modern UI. CI-ready.

CI License

~7 MB binary · 28 KB JS gzipped · zero runtime dependencies

RustMail UI

Inspired by MailHog and MailCrab

Install

brew install rustmailapp/rustmail/rustmail

Or with Docker:

docker run -p 1025:1025 -p 8025:8025 -e RUSTMAIL_BIND=0.0.0.0 ghcr.io/rustmailapp/rustmail:latest

Or from source:

git clone https://github.com/rustmailapp/rustmail
cd rustmail && make build

Quick Start

rustmail

Point your app's SMTP at localhost:1025, then open localhost:8025. Emails show up in real time.

Features

Core

  • Persistent storage — SQLite-backed, emails survive restarts (or --ephemeral for CI)
  • Full-text search — FTS5 across subject, body, sender, and recipients
  • Real-time updates — WebSocket pushes new emails to the UI instantly
  • Modern UI — dark-mode-first, looks and feels like a real email client

CI/CD

  • REST assertion endpointsGET /api/v1/assert/count?min=1&subject=Welcome
  • CLI assert moderustmail assert --min-count=2 --subject="Welcome" --timeout=30s
  • GitHub Action — two-step start + assert, works on Linux and macOS runners
  • Ephemeral mode — in-memory DB for test pipelines, no cleanup needed

Advanced

  • DKIM/SPF/DMARC/ARC display — parses authentication headers, color-coded status badges (no other local catcher does this)
  • Webhook notifications — fire-and-forget POST on new email via --webhook-url
  • Email release — forward captured emails to a real SMTP server
  • Export — download as EML or JSON

Developer Experience

  • Keyboard shortcutsj/k navigate, d delete, D clear all, / search, Esc close
  • Dark/light theme — toggle with localStorage persistence
  • Flexible config — CLI flags, RUSTMAIL_* env vars, or TOML config file
  • Retention policies--retention (hours) and --max-messages with automatic enforcement

GitHub Action

- name: Start RustMail
  uses: rustmailapp/rustmail-action@v1

- name: Run tests (your app sends emails to localhost:1025)
  run: npm test

- name: Assert emails were sent
  uses: rustmailapp/rustmail-action@v1
  with:
    mode: assert
    assert-count: 1
    assert-subject: "Welcome"

Documentation

Full docs at docs.rustmail.app (source):

License

Licensed under either of:

at your option.

About

A self-hosted SMTP mail catcher with web UI, REST API, and CI assertions

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors