I Built a Lightweight SMTP-to-Mailgun Bridge in Go (In Just Two Days)
说明与用途
Mailgun Passport 是一个用 Go 编写的轻量级 SMTP‑to‑Mailgun 桥接器,允许仅支持 SMTP 的旧应用程序通过 Mailgun 发送邮件,而无需安装完整的 MTA。
问题
Legacy applications that only speak SMTP cannot send mail through modern providers that block outbound port 25.
结果
Mailgun Passport enables legacy SMTP clients to send mail through Mailgun in a lightweight, secure, and production‑ready way, eliminating the need for a full MTA.
工作流
- 1. Run Mailgun Passport locally on 127.0.0.1:587.
- 2. Send SMTP messages to the local server (e.g., via swaks).
- 3. Passport parses the raw SMTP envelope and MIME body.
- 4. It reconciles envelope recipients with MIME headers, treating missing recipients as Bcc.
- 5. Passport forwards the message to Mailgun’s /v3/{domain}/messages endpoint via HTTP.
- 6. Systemd runs the service as a dedicated low‑privilege user with sandboxed capabilities.
证据
If you've ever tried to plug a legacy application, an old monitoring script, or an enterprise tool into a modern email delivery service like Mailgun, you've probably hit a brick wall: your app only speaks SMTP, but many cloud providers block outbound port 25 entirely.
Mailgun Passport, a minimal SMTP-to-Mailgun bridge written in Go.
It already supports native RPM/DEB packaging, structured logging, flexible configuration via .env or systemd, and dual parsing/MIME modes.
- 记录日期: 2026-10-24T09:11:18.549Z