Skip to content

Postmark

[endpoints.transport]
type = "postmark"
[endpoints.transport.settings]
api_key = "${env.POSTMARK_API_KEY}"
SettingRequiredDescription
api_keyyesPostmark server token (per-server, not per-account). Found in Postmark dashboard → Server → API Tokens.
base_urlnoOverride the API endpoint. Test-only escape hatch; production never sets this.
AspectBehavior
API endpointPOST https://api.postmarkapp.com/email
AuthenticationX-Postmark-Server-Token: <api_key> header
Body formatJSON (structured fields: From, To, Subject, TextBody, ReplyTo)
Per-request timeout5s (transport-level)
Connection reuseOne *http.Client per process, HTTP/2 with connection pool
transport_message_idParsed from response MessageID field
Postmark responseError classRetry?
200 OK or 202 Accepted(success)no
429 Too Many RequestsErrRateLimitedyes, after 5s
5xx server errorErrTransientyes, after 1s
Network timeout / connection refusedErrTransientyes, after 1s
4xx other than 429 (401, 422, etc.)ErrTerminalno

Sender-not-verified errors (typical 422) are common during operator onboarding — verify the sender signature in Postmark before sending, or expect terminal failures with the upstream Message field surfaced in the submission_failed log line.

For mail to actually deliver:

  • Sender Policy Framework (SPF) record on your sending domain authorizing Postmark
  • DomainKeys Identified Mail (DKIM) record published from Postmark’s dashboard
  • Return-Path custom domain (recommended)

Posthorn doesn’t manage any of this — Postmark’s setup wizard walks through it. See DNS for the cross-provider details.

SymptomLikely causeFix
HTTP 401 every sendUsing account-level token instead of server tokenPostmark dashboard → server → API Tokens
HTTP 422 Sender signature not confirmedSender domain DKIM/SPF not set upComplete Postmark’s DNS wizard before going live
HTTP 422 Email address not allowedSandbox mode (Postmark gates outbound until you verify)Request production access in dashboard
Mail goes to recipient spamAuthentication-Results headers show DKIM/SPF failCheck DNS records; Postmark’s dashboard has a verifier