Show HN: Posthorn, self-hosted mail without the mail server
Source: Hacker News
Introduction
Introducing Posthorn, a self‑hosted email gateway. It runs as a single Docker container (or a Go binary) that sits between your self‑hosted applications on a VPS and your transactional email provider. Set up Posthorn once, point your apps to it, and you’re done.
The Problem
Many VPS providers (e.g., DigitalOcean) block the default SMTP ports to combat abuse. This forces developers to:
- Deploy a custom Postfix relay just to send mail from apps like Ghost.
- Use third‑party services (e.g., Formspree) for static‑site contact forms, which often hit usage limits or lack needed anti‑spam features.
- Re‑implement the same email‑sending logic across multiple services (Gitea, Mastodon, Umami, Comentario, etc.), each hitting the same SMTP restrictions.
These recurring issues lack a simple, unified solution.
What Posthorn Does
Posthorn is a small Go binary (≈10 MB Docker image) that acts as a gateway between your applications and your chosen transactional email provider. It supports:
- Providers: Postmark, Resend, Mailgun, Amazon SES, or any outbound SMTP relay.
- HTML form handling: Accepts
POSTrequests from static‑site contact forms, adding security layers such as honeypot fields, origin checks, and IP rate limiting. - JSON HTTP API: A
/sendendpoint secured with Bearer authentication for backend scripts or cron jobs.
Features at a Glance
| Feature | Description |
|---|---|
| Single binary / Docker image | Easy deployment on any VPS. |
| Multi‑provider support | Switch providers without changing app code. |
| Form POST handling | Built‑in anti‑spam (honeypot, origin, rate limiting). |
| Bearer‑auth JSON API | Simple /send endpoint for scripts. |
| Open source | Licensed under Apache 2.0; contributions welcome. |
Usage
- Deploy the Docker container or run the Go binary.
- Configure your provider credentials (Postmark, Resend, Mailgun, SES, or SMTP).
- Point your applications (or static‑site forms) to the Posthorn endpoint.
- Send mail via the JSON API or standard SMTP relay.
Links
- Source code:
- Documentation:
- Longer write‑up:
- HN discussion of the problem:
- Comments on this post: