Mailpit
Mailpit is an email and SMTP testing service for development environments.
Why consider Mailpit?
Mailpit is a fast, zero-dependency SMTP server and web interface designed to capture and inspect outbound emails during local development and integration testing.
Learn Mailpit by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
The Role of an Intercepting SMTP Server
When developers build applications that send outbound emails—such as password resets, welcome messages, or invoice receipts—they need a reliable method to test those messages before deploying to production. Routing test emails through a live provider often results in accidental messages reaching real users or requires configuring temporary inboxes. Mailpit acts as a localized SMTP server designed to capture all outbound mail during development, preventing anything from actually being sent over the internet.
Originally inspired by the now-unmaintained MailHog project, Mailpit intercepts messages and provides a modern web interface to view the captured emails. According to the official documentation, the tool can ingest 100 to 200 emails per second over SMTP, which is more than enough for typical integration testing scenarios. To prevent memory issues over time, it includes automatic email pruning that, by default, keeps only the most recent 500 emails.
Installation Approaches for Developers
Because Mailpit is compiled as a static binary, it is straightforward to run across different operating systems. For Mac developers who prefer using package managers, Homebrew is the easiest method.
brew install mailpitFor engineers working on Linux or macOS systems who want to install the binary directly without Homebrew, an official installation script downloads the binary into the local system path.
sudo sh < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh)For teams that rely on containerized workflows, Mailpit provides Docker images that support multiple architectures, including amd64 and arm64. The container exposes the necessary ports to the host machine.
docker run -d \--restart unless-stopped \--name=mailpit \-p 8025:8025 \-p 1025:1025 \axllent/mailpitConfiguring the Application and Analyzing Messages
Once Mailpit is running, the application under development must be configured to point to it instead of a live provider like SendGrid or Postmark. By default, the Mailpit SMTP server listens on port 1025. You can configure your application's mailer to use localhost and port 1025, with authentication disabled or configured to accept any credentials, as Mailpit does not require strict authentication for local testing.
As the application generates messages, Mailpit intercepts them. Developers can open a browser and navigate to the web UI, which listens on port 8025 by default. The interface provides advanced message viewing capabilities to inspect exactly what the end user will see. You can analyze the formatted HTML, check the highlighted HTML source, view the raw source, and inspect MIME attachments. The UI even generates image thumbnails for attachments, making it easy to confirm that assets are rendering properly in the payload.
Using Mailpit ensures that developers have a verifiable, self-contained environment to validate email formatting and delivery logic, all without the risk of spamming actual inboxes.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.