1
0
mirror of https://github.com/axllent/mailpit.git synced 2024-12-26 22:56:43 +02:00
An email and SMTP testing tool with API for developers
Go to file
2023-05-26 22:59:20 +12:00
.chglog Update git-chglog format 2023-03-10 14:52:35 +13:00
.github Bump wangyoucao577/go-release-action from 1.37 to 1.38 2023-05-04 21:55:18 +12:00
cmd Feature: Add -S short flag for sendmail --smtp-addr 2023-05-05 15:23:51 +12:00
config Feature: Add allowlist to filter recipients before relaying messages (#109) 2023-05-05 15:28:00 +12:00
docs API: Include Reply-To in message summary (including Web UI) 2023-04-01 17:05:18 +13:00
sendmail Feature: Add -S short flag for sendmail --smtp-addr 2023-05-05 15:23:51 +12:00
server Minor UI / CLI updates 2023-05-23 16:07:05 +12:00
storage Bugfix: Fix Date display when message doesn't contain a Date header 2023-05-05 16:49:59 +12:00
utils Minor UI / CLI updates 2023-05-23 16:07:05 +12:00
.dockerignore Feature:: Add multi-arch docker image 2022-08-04 22:51:20 +12:00
.gitignore feature: Switch backend storage to use SQLite 2022-08-30 22:42:43 +12:00
CHANGELOG.md Release v1.6.10 2023-05-18 10:55:59 +12:00
Dockerfile Docker: Expose default ports (1025/tcp 8025/tcp) 2023-03-09 15:49:47 +13:00
esbuild.config.mjs Feature: OpenAPI / Swagger schema 2023-03-31 18:44:08 +13:00
go.mod Libs: Update Go modules 2023-05-26 22:59:20 +12:00
go.sum Libs: Update Go modules 2023-05-26 22:59:20 +12:00
install.sh Fix typo 2023-01-14 00:31:03 +13:00
LICENSE First commit 2022-07-29 23:23:08 +12:00
main.go Fix: Normalize running binary name detection (Windows) 2022-09-21 15:56:20 +12:00
package-lock.json Libs: Update node modules 2023-05-18 10:53:12 +12:00
package.json Feature: OpenAPI / Swagger schema 2023-03-31 18:44:08 +13:00
README.md Update README 2023-05-23 16:07:34 +12:00

Mailpit - email testing for developers

Tests Build status Docker builds CodeQL Go Report Card

Mailpit is a multi-platform email testing tool & API for developers.

It acts as both an SMTP server, and provides a web interface to view all captured emails.

Mailpit is inspired by MailHog, but much, much faster.

Mailpit

Features

  • Runs entirely from a single binary, no installation required
  • SMTP server (default 0.0.0.0:1025)
  • Web UI to view emails (formatted HTML, highlighted HTML source, text, headers, raw source and MIME attachments including image thumbnails)
  • Mobile and tablet HTML preview toggle in desktop mode
  • Advanced mail search (see wiki)
  • Message tagging (see wiki)
  • Real-time web UI updates using web sockets for new mail
  • Optional browser notifications for new mail (HTTPS and localhost only)
  • Configurable automatic email pruning (default keeps the most recent 500 emails)
  • Email storage either in a temporary or persistent database (see wiki)
  • Fast SMTP processing & storing - approximately 70-100 emails per second depending on CPU, network speed & email size, easily handling tens of thousands of emails
  • SMTP relaying / message release - relay messages via a different SMTP server including an optional allowlist of accepted recipients (see wiki)
  • Optional SMTP with STARTTLS & SMTP authentication, including an "accept anything" mode (see wiki)
  • Optional HTTPS for web UI (see wiki)
  • Optional basic authentication for web UI (see wiki)
  • A simple REST API (see docs)
  • Multi-architecture Docker images

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 Brew (Mac)

Add the repository to your taps with brew tap axllent/apps, and then install Mailpit with brew install mailpit.

Install via bash script (Linux & Mac)

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

sudo bash < <(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 extracted and copied to your $PATH, or simply run as ./mailpit.

Docker

See Docker instructions.

Compile from source

To build Mailpit from source see building from source.

Testing Mailpit

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

Configuring sendmail

Mailpit's SMTP server (by 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 a SMTP server is sendmail, used by many applications including PHP. Mailpit can also act as substitute for sendmail. For instructions of how to set this up, please refer to the sendmail documentation.

Why rewrite MailHog?

I had been using MailHog for a few years to intercept and test emails generated from several projects. MailHog has a number of performance issues, many of the frontend and Go modules are horribly out of date, and it is not actively developed.

Initially I tried to upgrade a fork of MailHog (both the UI as well as the HTTP server & API), but soon discovered that it is (with all due respect to its authors) poorly designed. It is in my opinion over-engineered (split over 9 separate projects), and performs very poorly when dealing with large amounts of emails or processing emails with an attachments (a single email with a 3MB attachment can take over a minute to ingest). Finally, the API transmits a lot of duplicate and unnecessary data on every browser request, and there is no HTTP compression.

In order to improve it I felt it needed to be completely rewritten, and so Mailpit was born.