Mailpit or a hosted email testing service? Local development, CI, and shared staging
The short answer
| Situation | Good fit |
|---|---|
| Development on your own machine | Mailpit |
| CI (GitHub Actions and the like), sending and receiving inside the same job as the app | Either Mailpit or MailBrew |
| Staging or test environments shared by a team | MailBrew (with Mailpit, you provide the hosting and access control yourself) |
| Checking that email actually arrives through an external sending service such as SendGrid or Amazon SES | MailBrew (with Mailpit, you provide an internet-facing server, an MX record, and port 25 yourself) |
Mailpit is a very good tool for running locally. If you are unsure, start with Mailpit locally and move only the parts that cause trouble to a hosted service.
What Mailpit is
Mailpit describes itself on its official site as "a small, fast, low memory, zero-dependency, multi-platform email testing tool & API for developers" (mailpit.axllent.org). It runs as an SMTP server that catches email, shows messages in a web interface, and has an API for automated testing. It runs as a single binary or a Docker image.
According to the official documentation (Runtime options, checked on November 17, 2026), by default:
- SMTP listens on port 1025 and the web interface on port 8025
- It stores up to 500 messages (
--max) - Messages are stored in a temporary file that is deleted when Mailpit exits (
--databasesets a location) - Basic authentication for the web interface and API is enabled by pointing it at a password file (
--ui-auth-file)
Mailpit is enough for local development and CI
For development on your own machine, point your app's SMTP host at localhost:1025 and you can look at every email you send in the browser. Nothing leaves your machine.
In CI, run Mailpit in the same job as your app (a service container in GitHub Actions) and read email through Mailpit's API from your tests. When the job ends, Mailpit goes away with it, so there is nothing to clean up.
What MailBrew adds in CI is that your test code can wait for email even when the app runs outside CI (on staging, for example), and that it has APIs for extracting one-time passwords and links. If both the app and the inbox live inside CI, either choice works.
Shared staging means more to set up
If you use Mailpit for a staging environment your team shares, or a test environment you show to customers, you need to decide on and provide:
- A server to host Mailpit, and someone to look after it
- A way to limit who can open the web interface and API (who holds the basic authentication password)
- Where emails are kept and for how long
Staging emails contain one-time passwords and password reset links. If Mailpit is reachable from outside, you cannot skip these three.
In MailBrew, email is separated by company, and member roles decide which screens and actions each person can use (including a role that only sees the inbox). Required two-factor authentication, IP restrictions, and audit logs are also available ("Access control for test inboxes"). Emails are kept for your plan's retention period and deleted after that.
Mail sent through an external service never reaches a local Mailpit
If production sends through a service such as SendGrid or Amazon SES, you may want staging to use the same path, so the template and sending settings are tested too. In that case the email travels across the internet to the recipient's mail server (MX), so a Mailpit on your machine or inside your network cannot receive it. To receive it with Mailpit, you would host it on an internet-facing server, point an MX record at it, and open port 25.
MailBrew addresses under *.mailbrew.dev receive email from the internet. Send from your sending service to an address on your company's subdomain (for example [email protected]) and it arrives by the same path as any other recipient, ready to read through the API or the dashboard. Your company needs at least one active API key.
Summary
- Mailpit is enough for local development and for tests where both the app and the inbox run inside CI
- Using Mailpit for shared staging means providing hosting, access control, and retention yourself
- To check that email really arrives through an external sending service, you need an inbox that receives email from the internet
To keep staging email away from real recipients, see "Keep staging emails away from real recipients".