A lightweight, cross-platform fake SMTP server for email testing and development.
- π Lightweight & Fast - Single binary (~8MB) with zero dependencies
- π Cross-platform - Windows, macOS (Intel/Apple Silicon), Linux (x64/ARM64)
- π§ SMTP Server - Receive emails on any port (default: 2525)
- π₯οΈ Web Interface - Modern React-based UI for viewing emails
- β‘ Real-time Updates - WebSocket integration for instant notifications
- πΎ Persistent Storage - BoltDB embedded database (no CGO required)
- π³ Docker Ready - Pre-built Docker/Podman images (30MB)
- π§Ή Auto Cleanup - Automatically clears test emails on shutdown
- π Daemon Mode - Run in background with custom logging
- π§ Flexible Config - Command-line flags and environment variables
| Platform | Architecture | Size |
|---|---|---|
| macOS | Apple Silicon (M1/M2/M3) | 8.3MB |
| macOS | Intel | 8.8MB |
| Linux | x64 | 8.6MB |
| Linux | ARM64 | 8.1MB |
| Windows | x64 | 8.9MB |
# macOS
chmod +x mailcatch-darwin-arm64
./mailcatch-darwin-arm64
# Linux
chmod +x mailcatch-linux-amd64
./mailcatch-linux-amd64
# Windows
mailcatch-windows-amd64.exe# Quick start
docker run -p 2525:2525 -p 8080:8080 mailcatch:latest
# With persistent storage
docker run -p 2525:2525 -p 8080:8080 \
-v ./data:/app/data \
-v ./logs:/app/logs \
mailcatch:latest
# Podman (same commands)
podman run -p 2525:2525 -p 8080:8080 mailcatch:latest
# Podman + Systemd (rootless, recommended)
./scripts/setup-podman-systemd.sh- π Web UI: http://localhost:8080
- π§ SMTP: localhost:2525
./mailcatch [OPTIONS]
Options:
--smtp-port=2525 SMTP server port
--http-port=8080 Web UI port
--db-path=./data/emails.db Database file path
--log-path=/tmp/mailcatch.log Log file path
--clear-on-shutdown=true Clear emails on shutdown
--daemon=false Run in background mode
--help Show helpexport SMTP_PORT=1025
export HTTP_PORT=3000
export LOG_PATH=/var/log/mailcatch.log
export CLEAR_ON_SHUTDOWN=false
export DAEMON=true# Basic usage
./mailcatch
# Custom ports
./mailcatch --smtp-port=1025 --http-port=3000
# Background mode
./mailcatch --daemon --log-path=/var/log/mailcatch.log
# Keep emails between restarts
./mailcatch --clear-on-shutdown=falseimport smtplib
from email.mime.text import MIMEText
msg = MIMEText("Hello from MailCatch!")
msg['Subject'] = 'Test Email'
msg['From'] = '[email protected]'
msg['To'] = '[email protected]'
with smtplib.SMTP('localhost', 2525) as server:
server.send_message(msg)
print("Email sent!")const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransporter({
host: 'localhost',
port: 2525,
secure: false,
auth: false
});
transporter.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Test Email',
text: 'Hello from Node.js!'
});telnet localhost 2525
# Commands:
HELO localhost
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Subject: Test Email
This is a test!
.
QUITversion: '3.8'
services:
mailcatch:
image: mailcatch:latest
ports:
- "2525:2525"
- "8080:8080"
volumes:
- ./data:/app/data
- ./logs:/app/logs
environment:
- CLEAR_ON_SHUTDOWN=true
restart: unless-stoppedRun: docker-compose up -d
Using rootless containers with systemd service management:
# Quick setup
./scripts/setup-podman-systemd.sh
# Custom configuration
./scripts/setup-podman-systemd.sh --smtp-port 1025 --web-port 3000
# Enable boot startup
sudo loginctl enable-linger $USERDetailed documentation: PODMAN_SYSTEMD.md
GET /api/emails- List emailsGET /api/emails/:id- Get email detailsDELETE /api/emails/:id- Delete emailDELETE /api/emails- Clear all emailsGET /api/stats- Server statistics
const ws = new WebSocket('ws://localhost:8080/ws');
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.type === 'new_email') {
console.log('New email:', message.data);
}
};# Check port usage
lsof -i :2525
netstat -tulpn | grep 2525
# Use different port
./mailcatch --smtp-port=1025# Make executable
chmod +x mailcatch-*
# Fix Docker volumes
sudo chown -R 1000:1000 ./data ./logs# Clear database
rm -f data/emails.bolt
# Check logs
tail -f /tmp/mailcatch.logMIT License - see LICENSE file for details.
If MailCatch has been helpful for your development workflow, please consider supporting its development:
- β Star this repository on GitHub
- π Report bugs and request features
- π€ Contribute code - see CONTRIBUTING.md
- π’ Share with your team and community
Your support helps maintain and improve MailCatch for the entire community!
π Star this project if it helped you!