mailpit

command module
v1.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 5 Imported by: 0

README

Mailpit - email testing for developers

CI Tests status CI build status CI Docker build status Code quality Go Report Card
Latest release Docker pulls

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 was originally inspired by MailHog which is no longer maintained and hasn't seen active development or security updates for a few years now.

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
  • 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)
  • List-Unsubscribe syntax validation
  • Optional webhook for received messages

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 package managers

  • Mac: brew install mailpit (to run automatically in the background: brew services start mailpit)
  • Arch Linux: available in the AUR as mailpit
  • FreeBSD: pkg 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 be extracted and copied to your $PATH, or simply run as ./mailpit.

Docker

See Docker instructions for 386, amd64 & arm64 images.

Compile from source

To build Mailpit from source, see Building from source.

Usage

Run mailpit -h to see options. More information can be seen in the docs.

If installed using homebrew, you may run brew services start mailpit to always run mailpit automatically.

Testing Mailpit

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

Configuring sendmail

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd is the main application
Package cmd is the main application
Package config handles the application configuration
Package config handles the application configuration
internal
auth
Package auth handles the web UI and SMTP authentication
Package auth handles the web UI and SMTP authentication
html2text
Package html2text is a simple library to convert HTML to plain text
Package html2text is a simple library to convert HTML to plain text
htmlcheck
Package htmlcheck is used for parsing HTML and returning HTML compatibility errors and warnings
Package htmlcheck is used for parsing HTML and returning HTML compatibility errors and warnings
linkcheck
Package linkcheck handles message links checking
Package linkcheck handles message links checking
logger
Package logger handles the logging
Package logger handles the logging
pop3client
Package pop3client is borrowed directly from https://github.com/knadh/go-pop3 to reduce dependencies.
Package pop3client is borrowed directly from https://github.com/knadh/go-pop3 to reduce dependencies.
spamassassin
Package spamassassin will return results from either a SpamAssassin server or Postmark's public API depending on configuration
Package spamassassin will return results from either a SpamAssassin server or Postmark's public API depending on configuration
spamassassin/postmark
Package postmark uses the free https://spamcheck.postmarkapp.com/ See https://spamcheck.postmarkapp.com/doc/ for more details.
Package postmark uses the free https://spamcheck.postmarkapp.com/ See https://spamcheck.postmarkapp.com/doc/ for more details.
spamassassin/spamc
Package spamc provides a client for the SpamAssassin spamd protocol.
Package spamc provides a client for the SpamAssassin spamd protocol.
stats
Package stats stores and returns Mailpit statistics
Package stats stores and returns Mailpit statistics
storage
Package storage handles all database actions
Package storage handles all database actions
tools
Package tools provides various methods for various things
Package tools provides various methods for various things
updater
package Updater checks and downloads new versions
package Updater checks and downloads new versions
cmd
Package cmd is the sendmail cli
Package cmd is the sendmail cli
Package server is the HTTP daemon
Package server is the HTTP daemon
apiv1
Package apiv1 handles all the API responses
Package apiv1 handles all the API responses
handlers
Package handlers contains a specific handlers
Package handlers contains a specific handlers
pop3
Package pop3 is a simple POP3 server for Mailpit.
Package pop3 is a simple POP3 server for Mailpit.
smtpd
Package smtpd implements a basic SMTP server.
Package smtpd implements a basic SMTP server.
webhook
Package webhook will optionally call a preconfigured endpoint
Package webhook will optionally call a preconfigured endpoint
websockets
Package websockets is used to broadcast messages to connected clients
Package websockets is used to broadcast messages to connected clients

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL