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
2022-11-13 17:26:29 +13:00
.chglog Update changelog format 2022-09-03 19:20:51 +12:00
.github/workflows Use ${{ github.ref_name }} for workflow build tags 2022-10-16 12:12:28 +13:00
cmd Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
config Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
docs Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
sendmail Move utils to subfolder 2022-10-29 10:52:22 +13:00
server Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
smtpd Move utils to subfolder 2022-10-29 10:52:22 +13:00
storage Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
utils Move utils to subfolder 2022-10-29 10:52:22 +13: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.2.7 2022-10-31 22:15:24 +13:00
Dockerfile UI: Add about app modal with version update notification 2022-10-08 23:33:59 +13:00
esbuild.config.js Build: Switch to esbuild-sass-plugin 2022-09-16 14:59:28 +12:00
go.mod Libs: Update go modules 2022-10-29 10:22:12 +13:00
go.sum Libs: Update go modules 2022-10-29 10:22:12 +13:00
install.sh Update installation instructions 2022-09-14 12:11:52 +12: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 Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
package.json Feature: Message tags and auto-tagging 2022-11-13 17:26:29 +13:00
README.md Update README 2022-11-13 17:26:17 +13:00

Mailpit - email testing for developers

Tests Build status Docker builds CodeQL Go Report Card

Mailpit is a multi-platform email testing tool 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, raw source and MIME attachments including image thumbnails)
  • Advanced mail search (see wiki)
  • Real-time web UI updates using web sockets for new mail
  • Optional browser notifications for new mail (HTTPS 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
  • Can handle hundreds of thousands of emails
  • Optional SMTP with STARTTLS & SMTP authentication (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

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)

Or download a static binary from the releases. The mailpit binary can be placed in your $PATH, or simply run as ./mailpit. See mailpit -h for options, or see the wiki for additional information.

To build Mailpit from source see building from source.

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

Configuring sendmail

There are several different options available:

You can use mailpit sendmail as your sendmail configuration in php.ini:

sendmail_path = /usr/local/bin/mailpit sendmail

If Mailpit is found on the same host as sendmail, you can symlink the Mailpit binary to sendmail, eg: ln -s /usr/local/bin/mailpit /usr/sbin/sendmail (only if Mailpit is running on default 1025 port).

You can use your default system sendmail binary to route directly to port 1025 (configurable) by calling /usr/sbin/sendmail -S localhost:1025.

You can build a Mailpit-specific sendmail binary from source (see building from source).

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 severe performance issues, many of the modules are horribly out of date, and other than a few accepted MRs, it is not actively developed.

Initially I started trying 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) very poorly designed. It is over-engineered (split over 9 separate projects) and has too many unnecessary features for my purpose. It performs exceptionally poorly when dealing with large amounts of emails or processing any email with an attachment (a single email with a 3MB attachment can take over a minute to ingest). The API also transmits a lot of duplicate and unnecessary data on every message request for all web calls, and there is no HTTP compression.

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