Mailsnag is a tiny, dockerized fake email service for local development. It's useful for testing email notifications during development without spamming action users!
docker run -d -p 2525:2525 -p 3333:3333 --name mailsnag ghcr.io/alekangelov/mailsnag
version: "3"
services:
mailsnag:
image: ghcr.io/alekangelov/mailsnag:latest
ports:
# access the smtp server at localhost:2525
- 2525:2525
# access the web ui at http://localhost:3333
- 3333:3333
environment:
- SMTP_HOST=0.0.0.0
- SMTP_PORT=2525
- SMTP_AUTH_REQUIRED=false
- SMTP_USERNAME=email
- SMTP_PASSWORD=password
- SERVER_HOST=localhost
- SERVER_PORT=3333
The frontend is a static Vite SPA that is served by the backend. It's written in TypeScript and uses TailwindCSS for styling, UI library is React.
The backend is a service written in Go that runs two servers. One is an SMTP service, running on port 2525 or whatever else you've picked as SMTP_PORT in env. The other is an HTTP server that serves the frontend and provides an API for fetching emails. The realtime updates are done via Server Sent Events. The backend uses NO database, it's just an in-memory store.
- Node.js (v18+) - For the front end
- Go (v1.21+) - For the backend
- Docker (v20.10+) - For running the app in a container
- Docker Compose (v1.29+) - For running the app in a container
- Make (v4.3+) - For running the Makefile
# Clone the repo
git clone
# Change into the directory
cd mailsnag
# Run both the backend dev server and the frontend one
make dev
# Run only the backend dev server
make dev.server
# Run only the frontend dev server
make dev.client
Absolutely no PR template! Just make sure you didn't mess anything up, even the tinyest PRs are welcome!
MIT, but look at license.md for more info. Basically you can do whatever you want with this, even sell it. I think? I'm not a lawyer.