Show HN: Posthorn, self-hosted mail without the mail server
Recorded: May 27, 2026, 7:01 a.m.
| Original | Summarized |
GitHub - craigmccaskill/posthorn: Self-hosted email gateway between your apps and a transactional mail provider (Postmark, Resend, Mailgun, AWS SES, or outbound-SMTP). Three ingress shapes (HTTP form, HTTP API, SMTP). One Docker container, one TOML config. · GitHub Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert craigmccaskill posthorn Public
Notifications
Fork
Star Code Issues Pull requests Discussions Actions Projects Security and quality Insights
Additional navigation options
Code Issues Pull requests Discussions Actions Projects Security and quality Insights
mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History82 Commits82 Commits.github.github corecore docsdocs sitesite specspec .gitignore.gitignore CHANGELOG.mdCHANGELOG.md CLAUDE.mdCLAUDE.md CODE_OF_CONDUCT.mdCODE_OF_CONDUCT.md CONTRIBUTING.mdCONTRIBUTING.md LICENSELICENSE README.mdREADME.md SECURITY.mdSECURITY.md View all filesRepository files navigationREADMECode of conductContributingApache-2.0 licenseSecurityPosthorn The unified outbound mail layer for self-hosted projects. One gateway between every app you self-host and the transactional mail provider you've already picked. Three ingress shapes (HTTP form, HTTP API, SMTP), five transports (Postmark, Resend, Mailgun, AWS SES, outbound-SMTP relay), single Go binary, single TOML config. Where your app connects HTTP form (contact forms, signups, alert webhooks) HTTP API mode (workers, cron, payment handlers, internal services) SMTP listener (Ghost, Gitea, Mastodon, Matrix, NextCloud, Authentik, anything that emits SMTP) All three ingresses converge on one transport.Message and one outbound provider — pick from Postmark, Resend, Mailgun, AWS SES, or an outbound-SMTP relay. What it does Not a mail server Not its own outbound infrastructure Not a marketing email platform Not webmail / a mailbox UI The wedge is the integration layer between your self-hosted apps and the transactional provider you've already picked. {{.message}} [endpoints.transport] [endpoints.transport.settings] [endpoints.rate_limit] [endpoints.transport] [endpoints.transport.settings] [[smtp_listener.smtp_users]] [smtp_listener.transport] [smtp_listener.transport.settings] Transport Postmark Resend Mailgun AWS SES Outbound SMTP Switching providers is a TOML edit — every transport implements the same Transport interface. See posthorn.dev/configuration/transports for per-provider config. DNS — SPF, DKIM, and DMARC records on your sending domain. Without these your mail goes to spam. See posthorn.dev/security/dns. The full operator checklist is on posthorn.dev. Block Form ingress API mode Transports SMTP listener Operations Failure handling Logging Deployment Three external Go dependencies in the whole module: TOML parser, UUID library, LRU cache. Every transport is bespoke — no vendor SDK in transport code. About Self-hosted email gateway between your apps and a transactional mail provider (Postmark, Resend, Mailgun, AWS SES, or outbound-SMTP). Three ingress shapes (HTTP form, HTTP API, SMTP). One Docker container, one TOML config. posthorn.dev Topics go docker self-hosted postmark homelab email-gateway smtp-relay transactional-email mail-gateway Resources Readme Apache-2.0 license Code of conduct Code of conduct Contributing Contributing Security policy Security policy Uh oh! There was an error while loading. Please reload this page. Activity 7 1 0 Report repository Releases v1.0.0 — Initial release Latest Packages
Uh oh! There was an error while loading. Please reload this page. Contributors Uh oh! There was an error while loading. Please reload this page. Languages Go MDX Other
Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
Posthorn is designed as a unified, self-hosted email gateway that serves as an intermediary layer between various self-hosted applications and chosen transactional mail providers, such as Postmark, Resend, Mailgun, AWS SES, or outbound-SMTP relays. The core objective of Posthorn is to eliminate the need for individual applications to manage the complexities and duplicate concerns associated with sending transactional emails, which typically involves managing API keys, retry logic, bounce handling, and sender reputation across multiple integration points. This addresses the fragmented nature of email integration where each application must independently manage communication with its chosen provider. The system centralizes this functionality using a single architectural deployment consisting of one Docker container and a single TOML configuration file. Posthorn supports three distinct ingress shapes, allowing flexibility depending on the application's communication method: HTTP form submission, HTTP API requests, and native SMTP listening. When handling HTTP form ingress, Posthorn implements security measures such as honeypots, validation of the Origin or Referer header, rate limiting, and optional Cross-Site Request Forgery protection. For HTTP API mode, the gateway supports authorization using bearer tokens, accepts JSON body data, and implements idempotent retries along with a mechanism for overriding specific fields for transactional sends. Furthermore, for an SMTP listener, Posthorn can handle applications natively speaking SMTP, parsing MIME messages, enforcing authentication via AUTH PLAIN or client-cert, requiring STARTTLS, and enforcing allowlists for senders and recipients. All these varied ingress methods converge into a unified transport layer that routes messages to a single chosen outbound provider. Posthorn explicitly defines what it is not. It is not a full-fledged mail server, as it does not include mailbox storage, IMAP/JMAP services, or comprehensive DKIM key management. It is also not an outbound infrastructure provider, as it functions purely as a relay, not managing its own SMTP fleet or IP reputation. Similarly, it does not function as a marketing email platform or a webmail interface. Instead, Posthorn serves as the crucial integration layer that bridges self-hosted applications with existing transactional email services. The system offers flexibility in selecting the outbound transport provider, which is managed through the configuration. The available transports include Postmark, Resend, Mailgun, AWS SES (using bespoke SigV4), and generic outbound-SMTP relays. Switching between these providers is achieved by modifying the TOML configuration. The technical specification of the initial release details the implementation of these features. It includes structured handling for failure management, implementing a retry mechanism for transient or server errors and specific handling for rate-limiting (e.g., 429 responses). Logging is structured in JSON format, incorporating UUIDv4 submission IDs and SMTP session IDs for traceability. The deployment package consists of a single Go binary and a multi-architecture distroless Docker image. The development roadmap outlines future enhancements. Version two is planned to focus on platform maturity by introducing features like an SQLite submission log, a retry queue that persists across restarts, a suppression list for hard bounces, durable idempotency, and lifecycle event callbacks via HMAC-signed webhooks. Version three suggests speculative features including an administrative user interface, a proof-of-work spam challenge, and PGP encryption. The architecture documentation and specification details the design choices, with the architecture document serving as the source of truth for design inquiries. |