axllent/mailpit

By axllent

Updated 4 days ago

An email and SMTP testing tool with API for developers

Image
Databases & Storage
Networking
Developer Tools

100M+

Mailpit - email testing for developers

TestsBuild statusDocker buildsCodeQLGo Report Card

WebsiteDocumentationAPI

Mailpit is a small, fast, low memory, zero-dependency, multi-platform email testing tool & API for developers.

It acts as an SMTP server, provides a modern web interface to view & test captured emails, and includes an API for automated integration testing.

Mailpit

Features

  • Runs entirely from a single static binary or multi-architecture Docker images
  • Modern web UI with advanced mail search to view emails (formatted HTML, highlighted HTML source, text, headers, raw source, and MIME attachments including image thumbnails), including optional HTTPS & authentication
  • SMTP server with optional STARTTLS or SSL/TLS, authentication (including an "accept any" mode)
  • A REST API for integration testing
  • Real-time web UI updates using web sockets for new mail & optional browser notifications when new mail is received
  • Optional POP3 server to download captured message directly into your email client
  • HTML check to test & score mail client compatibility with HTML emails
  • Link check to test message links (HTML & text) & linked images
  • Spam check to test message "spamminess" using a running SpamAssassin server
  • Create screenshots of HTML messages via web UI
  • Mobile and tablet HTML preview toggle in desktop mode
  • Message tagging including manual tagging or automated tagging using filtering and "plus addressing"
  • SMTP relaying (message release) - relay messages via a different SMTP server including an optional allowlist of accepted recipients
  • SMTP forwarding - automatically forward messages via a different SMTP server to predefined email addresses
  • Fast message storing & processing - ingesting 100-200 emails per second over SMTP depending on CPU, network speed & email size, easily handling tens of thousands of emails, with automatic email pruning (by default keeping the most recent 500 emails)
  • Chaos feature to enable configurable SMTP errors to test application resilience
  • List-Unsubscribe syntax validation
  • Optional webhook for received messages

Running in docker

An basic example of running Mailpit within Docker:

docker run -d \
--name=mailpit \
--restart unless-stopped \
-p 8025:8025 \
-p 1025:1025 \
axllent/mailpit

You need to ensure you map the correct ports (default Web UI on 8025 and SMTP on 1025).

Setting Mailpit options

Refer to the website for a list of runtime options. Environment variables can be set using the -e flag when starting your docker container, for instance:

docker run -d \
--name=mailpit \
--restart unless-stopped \
-v /path/to/mailpit-data:/data \
-e MP_DATABASE=/data/mailpit.db \
-e MP_UI_AUTH_FILE=/data/authfile \
-e TZ=Europe/London \
-p 8025:8025 \
-p 1025:1025 \
axllent/mailpit

Docker Pull Command

docker pull axllent/mailpit