Skip to main content
coreydaley.dev
Docs menu

Getting started

Features

  • Email: SMTP server, SendGrid v3 API stub, web UI, REST API, WebSocket live updates, search, tagging, POP3 server
  • SMS: Twilio-compatible HTTP ingest, SMS inbox with read/unread tracking, live WebSocket updates
  • Webhook capture: a dedicated HTTP server that captures any incoming request on any path and method and displays it in the UI, useful for inspecting your app’s outbound webhook calls in development
  • Delivery callbacks: signed SMS status callbacks and SendGrid-style email event webhooks, with magic numbers and scenario triggers for the failure branches
  • Shared: multi-arch Docker image, optional HTTP basic auth, Prometheus metrics

Ports

PortProtocolPurpose
1025SMTPEmail ingest (mirrors port 25)
1110POP3POP3 server (optional)
8025HTTPWeb UI and management API
8100HTTPSendGrid v3 Mail Send stub, POST /v3/mail/send
8200HTTPSMS ingest, Twilio-compatible
8300HTTPWebhook capture, accepts any request on any path and method

Quick start

# Docker
docker run -p 1025:1025 -p 8025:8025 -p 8100:8100 -p 8200:8200 -p 8300:8300 ghcr.io/coreydaley/messagepit

# From source
make run

Open http://localhost:8025 in your browser.

The SendGrid stub binds to 127.0.0.1:8100 (loopback only) by default. Inside Docker, add -e MP_SENDGRID_BIND_ADDR=0.0.0.0:8100 so the published port reaches it. See Configuration.

Docker

Images are published to the GitHub Container Registry for each tagged release:

docker pull ghcr.io/coreydaley/messagepit:latest

The image is built for linux/amd64 and linux/arm64. Besides latest, each release is tagged with its version (for example 1.3.0) and its minor series (1.3).

Docker Compose example

The example below enables full delivery callback support for both SMS and email. The extra_hosts entry is required on Linux so host.docker.internal resolves to the host machine (Docker Desktop handles this automatically on Mac and Windows).

services:
  messagepit:
    image: ghcr.io/coreydaley/messagepit:latest
    restart: always
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      - "1025:1025"   # SMTP
      - "8025:8025"   # Web UI
      - "8100:8100"   # SendGrid v3 Mail Send stub
      - "8200:8200"   # SMS ingest (Twilio-compatible)
      - "8300:8300"   # Webhook capture
    environment:
      # SendGrid v3 stub — must match SENDGRID_API_KEY in your app
      MP_SENDGRID_API_KEY: your-sendgrid-api-key
      # Expose SendGrid on all interfaces inside the container
      MP_SENDGRID_BIND_ADDR: "0.0.0.0:8100"

      # Twilio SMS — must match TWILIO_AUTH_TOKEN in your app
      MP_TWILIO_AUTH_TOKEN: your-twilio-auth-token
      # Fallback SMS callback URL (per-request StatusCallback takes priority)
      MP_TWILIO_WEBHOOK_URL: http://host.docker.internal:3000/webhooks/v1/sms
      # Email delivery webhook URL
      MP_EMAIL_WEBHOOK_URL: http://host.docker.internal:3000/webhooks/v1/email
      # ECDSA private key for signing email webhooks (see the SendGrid page)
      MP_EMAIL_WEBHOOK_SIGNING_KEY: "<base64-encoded SEC1 DER private key>"
    healthcheck:
      test: ["CMD", "/messagepit", "readyz"]
      interval: 10s
      timeout: 5s
      retries: 5

To generate the signing key, see Key pair setup.

Building from source

Requires Go 1.21+ and Node 22+.

make run     # build UI + binary and run with dev defaults
make install # build UI + binary and install to $GOPATH/bin
make test    # run Go test suite
make ui      # build frontend assets only
make build   # compile the binary only (requires ui assets)

Prebuilt binaries for each release are on the releases page.