Skip to content

rustmailapp/rustmail

RustMail

RustMail

A fast, self-hosted SMTP mail catcher for development and testing.
Capture outbound email, inspect it in a modern UI, and assert on it in CI.

CI Docker Pulls Latest Release License

Documentation · API Reference · Docker Hub

RustMail Web UI

Quick Start

docker run -p 1025:1025 -p 8025:8025 smyile/rustmail:latest

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

Docker Compose

services:
  rustmail:
    image: smyile/rustmail:latest
    ports:
      - "1025:1025"
      - "8025:8025"
    volumes:
      - rustmail-data:/data
    restart: unless-stopped

volumes:
  rustmail-data:

Install

Homebrew

brew install rustmailapp/rustmail/rustmail

Arch Linux (AUR)

yay -S rustmail-bin

From Source

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

Pre-built Binaries

Download from GitHub Releases — Linux (x86_64, aarch64, armv7 — glibc + musl), macOS (Intel + Apple Silicon), and multi-arch Docker images.

Features

Persistent storage SQLite-backed, emails survive restarts. --ephemeral for CI.
Full-text search FTS5 across subject, body, sender, and recipients.
Real-time UI WebSocket push — new email appears instantly. Dark/light mode, keyboard shortcuts.
CI-native REST assertion endpoints, CLI assert mode, and a first-party GitHub Action.
Single binary Frontend embedded at compile time. ~7 MB, zero runtime dependencies.
Auth header display Parses DKIM, SPF, DMARC, and ARC headers with color-coded status badges.
Webhooks Fire-and-forget POST on every new message.
Email release Forward captured emails to a real SMTP server.
Optional STARTTLS Advertised on the normal SMTP port when both --smtp-tls-cert and --smtp-tls-key are configured.
Export Download any email as EML or JSON.
Retention policies Auto-purge by age (--retention) or count (--max-messages).
TUI Optional terminal UI client for Neovim and headless workflows.

GitHub Action

- uses: rustmailapp/rustmail-action@v1

- run: npm test  # your app sends emails to localhost:1025

- uses: rustmailapp/rustmail-action@v1
  with:
    mode: assert
    assert-count: 1
    assert-subject: "Welcome"

CLI Assert Mode

Run as an ephemeral mail catcher that exits with a status code — for CI without the GitHub Action:

rustmail assert --min-count=2 --subject="Welcome" --timeout=30s

Configuration

Configure via CLI flags, RUSTMAIL_* environment variables, or a TOML config file:

rustmail serve --bind 0.0.0.0 --smtp-port 2525 --http-port 9025
rustmail serve --retention 24 --max-messages 1000
rustmail serve --webhook-url https://hooks.example.com/email
rustmail serve --smtp-tls-cert ./certs/localhost.pem --smtp-tls-key ./certs/localhost-key.pem

STARTTLS is optional and uses the same SMTP port via explicit upgrade. RustMail advertises STARTTLS only when both the certificate and private key are configured.

See the full configuration reference.

TUI

RustMail TUI

A terminal UI that connects to a running RustMail instance. Also available as a Neovim plugin.

Documentation

Full docs at docs.rustmail.app:

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