Crates.io | tiny-mailcatcher |
lib.rs | tiny-mailcatcher |
version | 0.9.3 |
source | src |
created_at | 2021-07-26 17:16:15.497579 |
updated_at | 2022-01-12 13:37:44.280305 |
description | A tiny MailCatcher clone |
homepage | |
repository | https://github.com/pevdh/tiny-mailcatcher |
max_upload_size | |
id | 427534 |
size | 87,326 |
Tiny MailCatcher is a tiny (<6 MB) drop-in MailCatcher replacement optimized for size and speed. It's meant to be run in a resource constrained environment, such as a CI system, or as part of an automated test suite.
Some features that the original MailCatcher has were omitted: Tiny MailCatcher does not have an HTML + JavaScript UI and it does not publish a WebSocket endpoint at /messages (yet). If you need either of these features I strongly recommend installing the original MailCatcher.
When Tiny MailCatcher is running any emails sent to port 1025 (configurable) can be accessed and analysed via a REST API. This is useful in a test suite when asserting that certain emails are or are not sent.
The documentation at https://mailcatcher.me/ also applies to Tiny MailCatcher.
In short:
GET/DELETE http://localhost:1080/messages
retrieves/deletes all messagesGET http://localhost:1080/messages/:id
retrieve a single message in JSON formatGET http://localhost:1080/messages/:id.source
retrieve the message sourceGET http://localhost:1080/messages/:id.html
retrieve the HTML version of this messageGET http://localhost:1080/messages/:id.eml
retrieve the EML version of this messageGET http://localhost:1080/messages/:id.plain
retrieve the text/plain version of this messageDELETE http://localhost:1080/messages/:id
delete a messageGET http://localhost:1080/messages/:id/parts/:cid
retrieve attachments by content IDUsing Cargo:
cargo install tiny-mailcatcher
There is also a tiny (~5MB) Docker image available:
docker run -d -p 1080:80 -p 1025:25 pevdh/tiny-mailcatcher:latest
USAGE:
tiny-mailcatcher [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--http-port <http-port> [default: 1080]
--ip <ip> [default: 127.0.0.1]
--smtp-port <smtp-port> [default: 1025]