Forward a copy of every email to Mailbag, search it instantly, never lose an important thread. The audit trail for your business communications, on your own server.
Every operation in Mailbag is available through a JSON REST API. No SDK required — use curl, fetch, or any HTTP client.
GET /api/emails — list all emails with optional search and filter query parametersPOST /api/emails — create a new email recordGET /api/emails/{id} — retrieve a single email by IDPUT /api/emails/{id} — update an existing emailDELETE /api/emails/{id} — remove a emailGET /api/stats — aggregated statistics with status breakdownGET /api/health — health check endpoint for monitoringPrivacy-conscious teams often build internal emails workflows in Notion or Google Sheets because the alternative is a $200/month SaaS contract. Mailbag gives you a purpose-built tool at a fraction of the cost, running on infrastructure you already control.
Start Mailbag with a port and a data directory. It creates its SQLite database on first run and serves both the API and the dashboard on the same port. Create emails through the web interface or POST JSON to the API. Filter by from addr, to addr, or search by keyword. Update records with PUT, delete with DELETE. The stats endpoint returns aggregate counts grouped by status for monitoring.
A freelance consultant keeps Mailbag running on a home server. Client emails stay on local disk, which simplifies the privacy section of every contract. The search endpoint powers a custom dashboard built with a static site generator. Total infrastructure cost: the electricity to run a Raspberry Pi.
GET /api/emails — List all emails. Supports ?q=keyword for search and ?status=value for filteringPOST /api/emails — Create a new email. Send JSON with at least subjectGET /api/emails/{id} — Fetch one email by IDPUT /api/emails/{id} — Update fields on an existing emailDELETE /api/emails/{id} — Remove a emailGET /api/stats — Returns total count and breakdown by statusGET /api/health — Returns {"status":"ok"} for uptime monitoringSelf-hosted email archive. Self-hosted on your infrastructure. Your data never leaves your server.
curl -fsSL https://stockyard.dev/install.sh | sh -s -- --tool mailbag
PORT=8750 ./mailbag
http://localhost:8750
Single binary. Embedded SQLite. No Docker. No database. No dependencies.
Your license key arrives by email within 5 minutes of checkout. Set it as an environment variable and restart the binary.
export MAILBAG_LICENSE_KEY=stockyard_xxxxxxxxxxxxxxxxxxxx ./mailbag
No cloud connectivity required. The binary validates the key offline with Ed25519 signatures.