postalserver/postal
📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
How postal is put together
Postal is a full-featured self-hosted mail delivery platform (SendGrid/Mailgun alternative) built primarily in Ruby on Rails 7.1 with a MySQL-backed ActiveRecord data model. The web application handles organizations, servers, domains, credentials, routes, endpoints, message inspection, and webhooks through a Haml/Turbolinks UI plus a legacy HTTP API (/api/v1). A Rack-level TrackingMiddleware intercepts requests on the track host to record opens/clicks and issue redirects before hitting Rails routing. Background processing is modeled via WorkerRole/ScheduledTask records and scheduled task classes, while message sending is delegated to SMTP/HTTP senders and webhook delivery services; per-server message databases are accessed through Postal::MessageDB.
Languages
Frameworks
Datastores
Infrastructure
Major components
Rails web UI & controllers
Serves the organization/server/domain/credential/message/webhook management interface under org/:org_permalink scoped routes.
Legacy API
Exposes /api/v1/send and /api/v1/messages HTTP endpoints handled by LegacyApi controllers using server credentials.
TrackingMiddleware
Rack middleware that serves tracking pixels, records message loads/clicks, triggers MessageLinkClicked webhooks, and 307-redirects tracked links based on X-Postal-Track-Host.
Models & MessageDB layer
ActiveRecord models for organizations, servers, domains, credentials, routes, endpoints, IP pools, webhooks, and queued messages; per-server message databases accessed via server.message_db.
Senders
BaseSender, HttpSender, and SmtpSender classes deliver queued outgoing messages to SMTP or HTTP endpoints and return SendResult objects.
Webhook delivery
WebhookRequest/WebhookEvent models and WebhookDeliveryService deliver signed webhook payloads to configured HTTP endpoints with lock fields and history tracking.
Scheduled tasks & worker roles
Worker-role-gated ScheduledTask subclasses perform DNS checks, retention cleanup, suppression pruning, authie session cleanup, held-message expiry, and notifications.
Configuration system
lib/postal/config.rb and config_schema.rb define a typed configuration schema sourced from YAML/env/Helm exports, including OIDC enablement gating gem loading.
No digest this week
1 weeksWeek of
Dependencies and code review
Dependency advisories
Security Watch
No known advisories across 0 scanned dependencies.
No known advisories in the scanned dependencies.
Code review
No concrete code-level issues confirmed.
Get this report every week for your repos.
GitZoid learns each repo, reports what changed, and flags what needs attention. One flat price for the whole team.
$19 a month, flat · First 10 outputs free · No card required