Suppressions
Each mail server has a suppression list (Karta.Suppressions): addresses
it does not send to. The server's Suppressions page shows it, and
members and above add an address and remove one there; the reasons are
the same the API offers.
What a suppression does
A message to a suppressed address is still accepted, and its other
recipients are delivered as usual. The suppressed recipient is recorded
with the status suppressed (Held in the Postal API, a failed event
with a suppress-* reason in Mailgun's events) and never delivered to.
Whether an address is suppressed is decided when the message is accepted;
adding or removing a suppression later does not change messages already
accepted.
The list is per server: the same address can be suppressed for one server and not for another, even in one organisation.
Entries
| Field | Meaning |
|---|---|
address | local@domain, the domain in lower-case ASCII form; compared without case |
reason | manual, unsubscribe, hard_bounce or complaint |
source | who or what added it: api:<key prefix> for an API key, list-unsubscribe for one-click unsubscribe, or what an operator gave |
expires_at | when the entry stops counting (it stays on the list); set from the server's policy, or given with an entry |
created_at, updated_at | when it was added and last changed |
An address has one entry per server: adding it again, with another reason, replaces the reason, source and expiry.
How addresses get on the list
| Way | Reason |
|---|---|
| A recipient clicks one-click unsubscribe (Tracking and unsubscribe) | unsubscribe (only if the address has no entry yet) |
POST /api/v2/suppressions | manual (default) or unsubscribe |
Mailgun API: bounces, unsubscribes, complaints | hard_bounce, unsubscribe, complaint |
| SendGrid API: global unsubscribes | unsubscribe |
| A receiving server's permanent failure of a recipient during delivery, or a hard bounce that comes back to its return path | hard_bounce |
| A feedback-loop complaint that comes back to the message's return path | complaint (outranks every other reason) |
| The server's policy: N temporary failures of the address within its window | hard_bounce, source soft_bounce_policy |
Console: Karta.Suppressions.suppress/3, bounce/3, complaint/3 or soft_bounce/3 | any |
A message to a suppressed address gives the webhook event
message.suppressed for that recipient.
A bounce adds the address by itself: when a receiving server refuses a
recipient for good (5xx), or a hard bounce (5.x.x) comes back to the
message's return path, the address is suppressed with hard_bounce. A
5.7.x policy rejection, a temporary failure and an entry that came from
someone else (a complaint, an unsubscribe, a person) are left alone.
A feedback-loop report (RFC 5965) is read and suppresses the address with
complaint, which outranks a bounce, an unsubscribe and an entry added by
hand (see Complaints). A server's policy can also suppress
an address after repeated temporary failures, and can give every kind of
entry an expiry (see The suppression policy).
Complaints
When a recipient marks a message as spam, its provider may send the sender
a feedback report (RFC 5965) to the address the message came from:
Karta's per-recipient return path. Karta reads it, records it against that
recipient's message, suppresses the address with complaint and emits the
webhook event message.complained.
- The return path decides. A report is matched to the recipient its
return path names, an address Karta made for that delivery and checked
by its HMAC. What the report says about the message — its
Original-Rcpt-To, the quoted message's headers — is kept as a record and never decides anything: it is written by whoever sent the report. - Every type is a complaint:
abuse,auth-failure,fraud,other,virus, and a type Karta does not know, which RFC 5965 says to take for abuse. Anot-spamreport says the message was legitimate, and suppresses nothing. - Once per report. The same report delivered twice is recorded once.
- Nothing is sent to the reporter. A complaint about a complaint would be more unwanted mail.
The complaint is kept with the message, so retention removes it with the
message, and Karta.Complaints.for_message/1 lists a message's.
The suppression policy
Each server has a policy for when addresses go onto its list by themselves
and how long entries last. Owners and admins change it on the server's
Settings page, and applications over the API
(Karta API,
GET and PUT /api/v2/suppression-policy, scope suppressions:write).
| Setting | Default | What it does |
|---|---|---|
| Temporary failures | 0 (never) | After this many temporary failures of one address within the window, the address is suppressed with hard_bounce |
| The window | 30 days | How far back those failures are counted |
| A hard bounce lasts | 0 (never) | Days an entry lasts from when it becomes a hard bounce |
| A complaint lasts | 0 (never) | The same, for a complaint |
| An unsubscribe lasts | 0 (never) | The same, for an unsubscribe |
| An entry added by hand lasts | 0 (never) | The same, for manual |
Temporary failures are the soft bounces reported to Karta's return paths
(Karta.Bounces), counted per address, the one being recorded included: a
threshold of 3 suppresses on the third report. The policy sets expires_at
when an entry is added or changes its reason, and never removes an entry:
an expired entry stays on the list, is shown with its expiry, and no longer
counts, so mail is sent to the address again. Removing an entry is always
someone's explicit action.
The list in each API
| API | Endpoints | Notes |
|---|---|---|
| Karta API | /api/v2/suppressions | every reason, expired entries included; add as manual or unsubscribe |
| Mailgun | /mailgun/v3/<domain>/bounces, /unsubscribes, /complaints | each list shows one reason, and only entries that still count; manual entries are in none |
| SendGrid | /sendgrid/v3/suppression/bounces, /suppression/spam_reports, /suppression/unsubscribes, /asm/suppressions/global | the same |
Because an address has one entry, adding it to Mailgun's complaints moves
it out of bounces. The Mailgun and SendGrid lists do not keep a bounce's
code, error or reason, or a spam report's IP address; those fields come
back empty (Mailgun's code as "550").
From the console
Karta.Suppressions.suppress(server, %{address: "bob@example.net", reason: :manual}, "operator")
Karta.Suppressions.suppress(server, %{address: "bob@example.net", reason: :manual,
expires_at: ~U[2027-01-01 00:00:00Z]}, "operator")
Karta.Suppressions.get_suppression(server, "bob@example.net")
Karta.Suppressions.unsuppress(server, "bob@example.net")
Karta.Suppressions.unsuppress_all(server, :hard_bounce)
Karta.Suppressions.list_suppressions(server, reason: :unsubscribe, limit: 100)
Karta.Suppressions.complaint(server.id, "bob@example.net", source: "operator")
Karta.Suppressions.soft_bounce(server.id, "bob@example.net")list_suppressions/2 also takes prefix, pattern (with % for any
text), changed_since, changed_before, offset, after, before and
last: true; pages are in address order, at most 1000 entries.