Sub topic 11
Easy unsubscribe and bulk sender requirements
This chapter assumes you know how SPF, DKIM, and DMARC work (covered earlier), that you can read a DNS TXT record, and that you know the difference between transactional and marketing email. It covers how unsubscribe handling protects your reputation, and what large mailbox providers now require from bulk senders.
Why unsubscribe belongs in a placement tutorial
A recipient who no longer wants your mail has three options:
- Ignore it. This hurts engagement signals over time.
- Click "Report spam" or "Junk". This creates a complaint, one of the strongest negative reputation inputs.
- Unsubscribe. This costs you one address but leaves your reputation intact.
Your goal is to make option 3 easier than option 2. A visible, working unsubscribe path turns would-be complaints into harmless list removals. Losing a subscriber who did not want your mail is a better outcome than keeping them and collecting a complaint.
Unsubscribe handling also has legal and policy sides. Laws such as CAN-SPAM in the US and the GDPR and ePrivacy rules in Europe set conditions for marketing mail. Mailbox providers add their own technical requirements. This chapter focuses on the technical and reputation side. It is not legal advice, so check the rules for each region you send to.
Two places to unsubscribe: the body and the header
Good unsubscribe handling has two parts that work together.
The link in the message body
Every marketing message should include a clearly visible unsubscribe link in the body, usually in the footer. Practical rules:
- Use readable text and sufficient contrast. A link in tiny grey text on a grey background pushes users toward the spam button.
- The link should lead to a page that works without logging in.
- Prefer a one-step flow. Asking for a password, or making the user re-enter their address, adds friction.
- A confirmation page is fine. A multi-page survey before removal is not.
The List-Unsubscribe headers
The second part is a pair of message headers that mailbox providers read. Gmail, Yahoo, and Apple Mail use them to show their own "Unsubscribe" control next to the sender name, outside the message body.
List-Unsubscribe: <https://example.com/unsubscribe/abc123>, <mailto:[email protected]?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-ClickThe first header lists one or more unsubscribe targets, each in angle brackets. An HTTPS URL and a mailto: address are the common choices. The second header, defined in RFC 8058, tells the provider that it may send a one-click request. The provider then sends an HTTP POST to the URL, with the body List-Unsubscribe=One-Click, and no browser page is shown to the user.
For one-click to work, three conditions must hold:
- The URL must be HTTPS.
- The message must carry a valid DKIM signature that covers both
List-UnsubscribeandList-Unsubscribe-Post. Without that, providers have no assurance that the headers came from you. - Your endpoint must accept a POST and process the removal immediately, without a login, a cookie, or a redirect to a confirmation form.
What your endpoint should do
The URL should identify the recipient and the list through an unguessable token, not through a plain email address. Otherwise anyone could unsubscribe other people by guessing addresses. The endpoint should record the removal first and return a success status quickly. Do not make the provider wait while you sync other systems.
from http import HTTPStatus
# In-memory stand-in for a real database.
SUBSCRIPTIONS = {"abc123": {"email": "[email protected]", "active": True}}
def handle_unsubscribe(method: str, token: str, form: dict) -> HTTPStatus:
"""Handle a request to the List-Unsubscribe URL."""
record = SUBSCRIPTIONS.get(token)
if record is None:
return HTTPStatus.NOT_FOUND
if method == "POST" and form.get("List-Unsubscribe") == "One-Click":
record["active"] = False # act immediately, no confirmation
return HTTPStatus.OK
if method == "GET":
# A person opened the link: show a page. The removal happens here
# only if the page itself confirms it.
return HTTPStatus.OK
return HTTPStatus.METHOD_NOT_ALLOWED
print(handle_unsubscribe("POST", "abc123", {"List-Unsubscribe": "One-Click"}))
print(SUBSCRIPTIONS["abc123"]["active"])Note that a GET request alone should not remove anyone. Security scanners and link-preview tools often fetch every URL in a message, and a GET-based removal would silently unsubscribe people who never asked. That is why RFC 8058 specifies POST.
How the pieces fit together
Bulk sender requirements
In February 2024, Gmail and Yahoo began enforcing a common set of requirements for senders who send large volumes to their users. Microsoft announced similar requirements for Outlook.com consumer domains, with enforcement beginning in May 2025. Exact thresholds and wording change, so confirm the details in each provider's current sender guidelines before relying on them.
Gmail's definition of a bulk sender is a sender that sends close to 5,000 or more messages a day to Gmail addresses. Once a domain has reached that level, Gmail treats it as a bulk sender permanently, even if volume later drops. Providers do not publish exactly how they count, and subdomains of one organizational domain are generally counted together.
The requirements fall into three groups.
| Group | Requirement | Applies to |
|---|---|---|
| Authentication | SPF and DKIM both pass for the sending domain | All senders to these providers (basic rules), bulk senders (strict) |
| Authentication | DMARC policy published, at least `p=none` | Bulk senders |
| Authentication | From domain aligns with the SPF or DKIM domain | Bulk senders |
| Infrastructure | Forward and reverse DNS records for sending IPs | All senders |
| Infrastructure | TLS for transport | All senders |
| Unsubscribe | One-click unsubscribe in the headers | Marketing and subscribed mail from bulk senders |
| Unsubscribe | Removal processed within two days | Bulk senders |
| Complaints | Spam rate below 0.10%, never reaching 0.30% | Bulk senders |
Three of these deserve closer reading.
Alignment
Passing SPF and DKIM is not enough. For DMARC, the domain that passes (the SPF envelope domain or the DKIM d= domain) must match the visible From domain. If your email platform signs with its own domain, DKIM can pass while DMARC alignment fails. Configure a custom signing domain, so the signature uses d=example.com and not the platform's domain. The DNS example below shows the three records for a sender that is ready for these checks.
; SPF: which servers may send for example.com
example.com. IN TXT "v=spf1 include:_spf.esp.example.net -all"
; DKIM: public key published under a selector chosen by the sender
selector1._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...(public key truncated)..."
; DMARC: policy and aggregate report address, starting in monitoring mode
_dmarc.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]"The complaint-rate thresholds
The complaint rate is complaints divided by delivered messages. Gmail's guidance is to stay under 0.10% and to never reach 0.30%. At 0.10%, one complaint per 1,000 delivered messages is already the limit you aim for. A sender with 10,000 delivered messages and 12 complaints sits at 0.12%, which is above the target.
def complaint_rate(complaints: int, delivered: int) -> float:
"""Share of delivered messages that recipients reported as spam."""
return complaints / delivered if delivered else 0.0
def complaint_status(rate: float) -> str:
if rate >= 0.003:
return "critical" # at or above 0.30%
if rate >= 0.001:
return "above target" # at or above 0.10%
return "healthy"
rate = complaint_rate(12, 10000)
print(f"{rate:.4%}", complaint_status(rate)) # 0.1200% above targetThe data comes from the provider's own tools (Google Postmaster Tools for Gmail, and complaint feedback loops where available), so your own counts will differ from what the provider sees. Treat the provider's number as the one that counts. Chapter 13 covers these tools.
The two-day removal rule
The requirement is that a request is honored within two days. In practice, aim for immediate suppression. Send pipelines often batch jobs overnight, so a message queued before the unsubscribe can still go out afterward. Check the suppression list at send time, not only when a campaign is built.
Common errors
- Header present, endpoint broken. The unsubscribe button appears, but the URL returns an error, requires login, or redirects. Users click it, nothing happens, and they report spam next. Test the endpoint with a real POST.
- Headers not covered by DKIM. One-click support is ignored when the headers are not signed. Check the
h=tag of your DKIM signature for both header names. - Unsubscribe from one list removes nothing else, or removes everything. Offer a preference page, but make the default action in the header remove the user from the stream they received, and make that clear.
- Using the unsubscribe link as a tracking signal. Do not treat link clicks on the unsubscribe URL as engagement, and do not let security scanners trigger removals through GET.
- Transactional mail treated as marketing. Password resets and receipts do not need a one-click header, and the unsubscribe rule targets marketing and subscribed mail. Mixing promotional content into transactional mail, however, makes it marketing in the eyes of regulators and filters.
- Re-adding unsubscribed people. Importing an old list over your suppression list brings back people who opted out. Keep suppression data separate and apply it on every import.
- Hiding the link. Making the link hard to find reduces unsubscribes and increases complaints. This is a loss.
A short checklist
- Visible unsubscribe link in every marketing message, working without login.
List-UnsubscribeandList-Unsubscribe-Postheaders on marketing mail, covered by the DKIM signature.- An HTTPS endpoint that accepts POST and suppresses the address immediately.
- A suppression check at send time, on every stream and every import.
- Aligned SPF or DKIM, a published DMARC record, and valid forward and reverse DNS.
- Complaint rate tracked in the provider's postmaster tool, with alerts well below 0.30%.
Exercise
A marketing email carries a List-Unsubscribe header with an HTTPS URL and a List-Unsubscribe-Post header, yet Gmail shows no unsubscribe button and some users report spam. Name two likely causes you would check first, and explain how you would test each.
Show answer
First, check whether the DKIM signature covers both headers. Look at the h= tag in the DKIM-Signature header of a received message and confirm it lists list-unsubscribe and list-unsubscribe-post. Unsigned headers are ignored. Second, test the endpoint with a real POST containing the body List-Unsubscribe=One-Click, without cookies or login. It must return a success status (for example 200) and mark the address as suppressed, with no redirect to a form. Also confirm the URL is HTTPS and that the message really came from a domain Gmail treats as a bulk sender with an authenticated From domain.
Exercise
A sender had 20,000 delivered messages to Gmail users in a day and received 45 spam complaints. Compute the complaint rate and say which threshold it crosses.
Show answer
45 / 20,000 = 0.00225, or 0.225%. This is above the 0.10% target but below the 0.30% limit, so the sender is in the "above target" range. It needs to reduce complaints now, by cleaning the list, making unsubscribe easier, and reviewing how addresses were acquired, before it reaches 0.30%.