Skip to content
mailpiecePublic

About

Send all the email you want, and keep it private.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

129 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostRider

📮 A boring mail relay you run yourself.

Send and receive mail for your own domains from one self-hosted app. PostRider takes outbound mail over an HTTP API and SMTP submission and delivers it direct to MX with DKIM, takes inbound mail on MX for the domains an account registers, and reports what happened to each message through webhooks.

PostRider handles:

  • outbound mail over an HTTP API and SMTP submission, signed with DKIM and delivered direct to MX
  • inbound mail on MX for the mailboxes, or the catch-all, of the domains you register
  • forwarding from a mailbox to another address, ARC-sealed with the relay's own key, for approved and authenticated senders
  • webhooks for inbound mail and delivery events, signed per webhook
  • its own TLS certificate, issued and renewed over ACME

Plus:

  • a mail log of every message in both directions, with its history, in the app and over the API
  • sign-in by passkey only, so PostRider sends no sign-in mail
  • no reputation score, no warm-up schedule, no pricing tier

Ship the email. Trust that the people who want it will find it.

Contents

Installation

PostRider is a Rails app built into one image. It needs a persistent volume for its SQLite database and stored mail, ports 80 and 443 for the web UI, 25 and 587 for mail and 53 for the certificate challenge, outbound port 25, and at minimum SECRET_KEY_BASE and either RELAY_HOSTNAME or BASE_URL. Deploy your fork with Kamal:

bin/kamal setup     # the first time
bin/kamal deploy    # from then on

Deployment & operations covers Kamal, Docker and ONCE; Installation takes it from first sign-in to a verified domain.

Getting Started

Create a sending token on a verified domain's Sending tokens page, then send:

curl https://postrider.example.com/123456789/messages \
  -H "Authorization: Bearer $SENDING_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "from": "hello@<domain>", "to": ["you@example.com"], "subject": "Hello", "text": "It works." }'

The path starts with your account's number, the one in the app's URLs. The same token is the password for SMTP submission on port 587, with STARTTLS.

Design

Mail: one log, both directions

A mailpiece is the mail log's row, over either an inbound email or a delivery. A message has no status of its own: each delivery, one per recipient, carries it, and Statuses & lifecycle says what each one means. Raw mail is purged after RETENTION_DAYS; the row and its events stay.

Tenancy: by URL, by domain

Each account lives under its number in the URL, and everything hangs off a domain, which a user sees only through an access. One install is one account; teammates join by invitation.

Tokens: one domain each

A sending token sends only for its own verified domain, and only its digest is stored. Webhook secrets, DKIM keys and the certificate are encrypted columns. A forward is sealed with the relay's key, never signed with the tenant's.

Roles: web, jobs and SMTP

Production runs the web app, the jobs and the SMTP listeners as separate roles. The certificate is issued over ACME by a small DNS responder in the app and swapped into the running listeners, so renewing it restarts nothing.

Deliverability: the fundamentals

Most mail is something a person is waiting for: a password reset, a receipt, a notification they triggered. Keep the relay clean, sign with DKIM, publish SPF, DMARC and reverse DNS, and that mail lands without anyone renting deliverability.

Interfaces

  • API: sending over HTTP and SMTP, and reading the mail log, with sending tokens and personal access tokens.
  • Webhooks: signed events for inbound mail and deliveries, including Action Mailbox's relay format.
  • Statuses & lifecycle: what each inbound and delivery status means.
  • Deployment & operations: ports, configuration, DNS, the TLS certificate and backups.
  • Development: running it locally and in a dev container.

Testing

bin/setup
bin/rails test
bin/ci

Contributing

Everyone is encouraged to help improve this project:

License

MIT. See MIT-LICENSE.

About

Send all the email you want, and keep it private.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

Used by

Contributors

Languages