Catches mail and serves it through a dream
open sourceMITself-hostablefree
MailCatcher is a Ruby gem that runs a simple SMTP server on port 1025 which catches every message sent to it and shows it in a web interface on port 1080: HTML, plain text and source views, attachments, and messages that appear instantly over WebSockets. A catchmail command stands in for sendmail for PHP, and a JSON API (/messages and each message's parts) lets tests fetch what was sent. Samuel Cochran has maintained it since 2010; it's MIT licensed, installed with gem install mailcatcher (not in an app's Gemfile) or run from its Docker image. The README says it's a development tool, not a mail service.
Ways to install
Package managers
Problems it solves
- catch every email our Rails app sends in development so none go to real people
- look at the signup email's HTML in a browser while developing, without a real inbox
- a fake SMTP server for local development of a PHP app that uses mail()
- download the raw email our app sent to check its headers and attachments
- fetch sent emails as JSON in an integration test
- a local mail catcher for Django development
Features
- SMTP server that catches all mail (default port 1025)
- web interface (default port 1080) with HTML, plain text and source views
- attachments listed and downloadable; original message downloadable
- new mail shown instantly over WebSockets
- catchmail sendmail replacement for PHP
- JSON API: /messages and each message's HTML, plain text, parts and source
- options for SMTP and HTTP addresses and ports, message limit and HTTP path prefix
- runs as a background daemon or in the foreground
- keyboard navigation between messages
- Docker image sj26/mailcatcher
Limitations
- Doesn't fully support UTF-8 sent raw over SMTP: the mail library must encode messages2
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
Alternatives
The same job
These do what MailCatcher does.
