Rutba MTA
Open-source multi-tenant email relay middleware. It sits between your applications and their own SMTP servers, taking on reputation, pacing, suppression, bounces and reporting, so that each application does not have to solve deliverability again from scratch.
Rutba MTA: open-source email relay middleware
Every application that sends email ends up rebuilding the same deliverability work. Rutba MTA does it once, between your applications and your own SMTP servers.
Plays from YouTube, with English subtitles. Nothing is loaded from YouTube until you press play. Watch it on YouTube, or see more films on the Tech Style channel.
Middleware, not a mail server
Rutba MTA is not an MTA in the direct-to-MX sense, and doesn't pretend to be. Final delivery is always performed by the sender's own registered SMTP server: Mailcow, Postfix, SES or whatever you already run. Your sending identity and your IP reputation stay yours.
In front of it sits the part nobody enjoys building: a suppression list that holds, pacing that responds to how each receiving domain treats you, a queue where a password reset overtakes a newsletter, DSN and ARF bounce parsing, and one-click unsubscribe. Several applications or customers register as senders, each with their own credentials, suppression scope and reporting.
- Tenancy
- Multi-sender, each with its own SMTP and token
- Credentials
- AES-256-GCM encrypted at rest
- Signing
- HMAC-SHA-256 for action links, unsubscribe links and webhooks
- Licence
- AGPL 3.0 · commercial available
Send speed follows the evidence
Each receiving domain carries a live reputation score from 0 to 100, calculated from real outcome ratios. For marketing mail, the score selects the delay between messages to that domain.
| Behaviour | What it means | Inter-message delay |
|---|---|---|
| Healthy domain (96 to 100) | Deliveries succeeding, few bounces or complaints | 0 ms, with no artificial pacing |
| Slight degradation (86 to 95) | Outcome ratio starting to slip | 500 ms |
| Warning (71 to 85) | Bounce or complaint rate climbing | 1500 ms |
| Poor (51 to 70) | Sustained negative outcomes | 3000 ms |
| Critical (0 to 50) | Domain treating this stream badly | 6000 ms |
| New domain | No history yet, so it is scored 80 for its first 20 sends | 1500 ms until evidence arrives |
Administrators can override the score and rate configuration per domain when they know something the data doesn't yet.
What it handles for you
Sender registration
Applications register a sending address plus SMTP credentials and receive a trust token. Passwords are encrypted with AES-256-GCM at rest, and both token and webhook secret can be rotated.
Suppression gate
Hard bounces, complaints, manual blocks and unsubscribes are checked before a message is queued. Hard bounces and complaints become global automatically; unsubscribes stay scoped per sender.
Priority queue
Transactional messages skip the reputation delay, so a password reset isn't stuck behind a campaign; they still count against each domain's per-minute ceiling and the concurrency caps. Marketing mail is paced by reputation.
Templated batch sends
Post a template plus a recipient array and get personalised messages grouped as a batch, with suppression checked per recipient.
Action interception
Embed calls to action as {{action_key}} placeholders. Rutba issues per-recipient signed tokens, records the click, calls your webhook, then 302s the visitor onward.
Retry & backoff
Transient 4xx failures reschedule on an exponential ladder of 1 minute, 5, 15, 1 hour and 3 hours, six attempts in all. A permanent rejection of the recipient (5.1.x, 5.2.1 or a bare 550) suppresses the address; a policy or message refusal fails that message and leaves the address alone.
Bounce capture
An IMAP poller reads the bounce mailbox and parses DSN (RFC 3464) and ARF (RFC 5965) reports, feeding both the suppression list and the domain scores.
Unsubscribe handling
List-Unsubscribe headers plus RFC 8058 one-click support, with a hosted unsubscribe page and per-sender scope.
Delivery reporting
Per-message status through the API, live batch-level reports including action click counts, and HMAC-signed webhooks for anything you'd rather not poll for.
From API call to inbox
Your app posts the message
POST /v1/send or /v1/send/batch, authenticated with the sender's X-Trust-Token header.
DNS gate
A send from a domain without its SPF and DKIM records is refused with a 422 before anything is queued, and the send worker checks again before it relays. Mail cannot leave in the name of a domain that has not published them.
Suppression gate
Each recipient is checked against global and per-sender suppressions before anything is queued. Blocked addresses never reach the queue.
Queue in MySQL
Surviving messages are persisted, so a restart doesn't lose a batch halfway through.
SendWorker paces the stream
Transactional messages go first, with no reputation delay, inside each domain's per-minute ceiling. Marketing messages wait for the delay their destination domain's reputation currently earns.
Relay through your SMTP
Delivery is handed to the sender's own registered SMTP server, never direct to MX.
BouncePoller listens
DSN and ARF reports arriving by IMAP update suppression lists and adjust the domain score, closing the feedback loop.
WebhookWorker reports
HMAC-signed webhooks push status changes and action clicks back to your application.
Endpoints
Every /v1/* route requires the X-Trust-Token header, with one exception: on an empty database, the first POST /v1/senders needs no token and creates the admin sender. Action, unsubscribe and health routes are public by design. Domain and DNS routes are for the admin sender only.
- POST/v1/sendersRegister a sender with SMTP credentials (admin token after the first)
- GET/v1/senders/meRead, update or delete the current sender
- POST/v1/senders/me/rotate-tokenRotate the trust token
- POST/v1/senders/me/rotate-webhook-secretRotate the webhook signing secret
- POST/v1/sendSend a single message, transactional by default, optionally scheduled or with a calendar invitation
- POST/v1/send/batchSend a templated batch (marketing by default)
- GET/v1/messagesList the sender's messages
- GET/v1/messages/:uuidMessage status and history
- GET/v1/batchesList the sender's batches
- GET/v1/batches/:idOne batch and its progress
- GET/v1/batches/:id/reportLive batch report with action click counts
- GET/v1/suppressionsList, add or remove suppressions
- GET/v1/domainsEvery receiving domain's reputation (admin)
- GET/v1/domains/:domainRead or override domain reputation and rate config
- POST/v1/domains/:domain/resetReset a receiving domain's reputation
- GET/v1/dns/:domainThe sending domain's stored DNS verdict
- POST/v1/dns/:domain/verifyRe-check a sending domain's records now
- GET/action/:tokenRecord a click and redirect (public)
- GET/unsubscribe/:tokenHosted unsubscribe page (public)
- POST/unsubscribe/:tokenRFC 8058 one-click unsubscribe (public)
- GET/healthDatabase connectivity check (public)
# send a transactional message curl -X POST https://mta.example.com/v1/send \ -H "X-Trust-Token: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"to":"customer@example.com","subject":"Your order","class":"transactional","text":"..."}'
Request shape is indicative. See the repository README for the full schema.
What it runs on
| Runtime | Node.js 20 to 22; the Docker image runs Node 22 LTS. |
|---|---|
| Database | MySQL 8. MySQL 5.7 is supported with limitations. |
| Outbound | Standard SMTP relays, one per sender, driven through nodemailer. |
| Bounce parsing | imapflow and mailparser, handling DSN (RFC 3464) and ARF (RFC 5965). |
| Cryptography | AES-256-GCM for stored SMTP passwords; HMAC-SHA-256 for action and unsubscribe tokens and webhook signatures; trust tokens kept only as SHA-256 hashes. |
| Workers | SendWorker, BouncePoller and WebhookWorker run alongside the API. |
| Testing | Node's built-in test framework, 78 tests in 12 files, all passing on 2026-10-17. |
| Licence | GNU AGPL 3.0 or later, with a commercial licence for products that cannot accept copyleft. Contributions welcomed. |
Other products
Struggling with deliverability?
Use Rutba MTA under the AGPL 3.0 licence, take a commercial licence if copyleft does not suit your product, or talk to us about deploying and operating it alongside your applications.
