mailpit README

The project's README from github.com/axllent/mailpit. As one markdown file: README.md.

Mailpit - email testing for developers

CI Tests status CI build status CI Docker build status Code quality Go Report Card
Latest release Docker pulls

Website • Documentation • API


Mailpit is a small, fast, low memory, zero-dependency, multi-platform email testing tool & API for developers.

It acts as an SMTP server, provides a modern web interface to view & test captured emails, and includes an API for automated integration testing.

Mailpit was originally inspired by MailHog which is no longer maintained and hasn't seen active development or security updates for a few years now.

Mailpit

Features

Installation

The Mailpit web UI listens by default on http://0.0.0.0:8025 and the SMTP port on 0.0.0.0:1025.

Mailpit runs as a single binary and can be installed in different ways:

Install via package managers

Install via script (Linux & Mac)

Linux & Mac users can install it directly to /usr/local/bin/mailpit with:

sudo sh < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh)

You can also change the install path to something else by setting the INSTALL_PATH environment, for example:

sudo INSTALL_PATH=/usr/bin sh < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh)

Download static binary (Windows, Linux and Mac)

Static binaries can always be found on the releases. The mailpit binary can be extracted and copied to your $PATH, or simply run as ./mailpit.

Docker

See Docker instructions for 386, amd64 & arm64 images.

Compile from source

To build Mailpit from source, see Building from source.

Usage

Run mailpit -h to see options. More information can be seen in the docs.

If installed using homebrew, you may run brew services start mailpit to always run mailpit automatically.

Testing Mailpit

Please refer to the documentation on how to easily test email delivery to Mailpit.

Configuring sendmail

Mailpit's SMTP server (default on port 1025), so you will likely need to configure your sending application to deliver mail via that port. A common MTA (Mail Transfer Agent) that delivers system emails to an SMTP server is sendmail, used by many applications, including PHP. Mailpit can also act as substitute for sendmail. For instructions on how to set this up, please refer to the sendmail documentation.


For team features, multiple inboxes, and a hosted setup, try Mailtrap, our friendly companion.

mailpit (axllent/mailpit)

Searching Database…

10.7K ·GitHub
What is this?Mailpit is a small, fast, low-memory email testing tool and API for developers. It acts as a local SMTP server that captures every message your app sends, shows them in a web UI, and offers a REST API for automated integration testing.
So is this a hosted service I sign up for, or something I run myself?You run it yourself: it ships as a single static binary or multi-architecture Docker image that starts an SMTP server, a web UI and a REST API wherever you launch it. No accounts or external services are involved.
How do I get it running?On macOS run brew install mailpit (brew services start mailpit to keep it running in the background); on Linux/Mac a one-line install script puts it in /usr/local/bin. Static binaries for Windows/Linux/Mac are on the releases page, and Docker images (386/amd64/arm64) exist too.
How much do I need to change in my app to route its mail through it?Just point your application's SMTP settings at Mailpit, which listens on 0.0.0.0:1025 by default. If your app sends via sendmail, Mailpit can act as a sendmail substitute instead. The binary itself is zero-dependency.
How much mail can it hold before messages start disappearing?It ingests 200-300 emails per second and easily handles tens of thousands, but storage is pruned automatically — by default only the most recent 500 emails are kept. You can adjust pruning by volume or message age.
What can I do with a captured email in the web UI?Inspect it as formatted HTML, highlighted HTML source, plain text, headers or raw source, with MIME attachments and image thumbnails. There's advanced mail search, manual or automated message tagging, HTML screenshots and a mobile/tablet preview toggle, plus an HTML check that scores mail-client compatibility, a link check, and a spam check via a running SpamAssassin server.
Can it be part of automated integration tests?Yes — Mailpit ships a REST API built for automated integration testing, and new mail appears in real time via web sockets. You can also set an optional webhook to fire when a message is received, and enable the chaos feature to inject configurable SMTP errors so you can test how your application handles failures.
Can I get captured messages into a real inbox or another server?Yes. SMTP relaying lets you release messages via a different SMTP server, with an optional allowlist of accepted recipients; SMTP forwarding automatically sends copies to predefined addresses. Alternatively, enable the optional POP3 server and download captured mail straight into your email client.
Why use this instead of MailHog?Mailpit was originally inspired by MailHog, which the README notes is no longer maintained and hasn't seen active development or security updates for a few years. Mailpit is the actively developed alternative: one zero-dependency binary ingesting 200-300 emails per second.
What are similar projects?sentio, go-swagger, MailHog, swag, gopeed, kubo, hurl, wuzz
Creator
axllent
Size
3.6 MB
Stars
10.7K
Age
4y
Commits · 90 Days