TiloBox
Back to directory
Mailpit project preview

Mailpit

Mailpit is an email and SMTP testing service for development environments.

LicenseMIT
GitHub stars10.2k
Last commit1 weeks ago
Tags5 topics
GoEmail TestingSmtpApiDocker
Overview

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.

Guided learning

Learn Mailpit by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 3 sections
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.

bash
1brew install mailpit

For 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.

bash
1sudo 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.

bash
1docker run -d \
2--restart unless-stopped \
3--name=mailpit \
4-p 8025:8025 \
5-p 1025:1025 \
6axllent/mailpit

Configuring 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.

Mailpit FAQs

Mailpit is listed as a Developer Tools tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

Mailpit is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

Mailpit is listed as an alternative to MailHog. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.