One-click unsubscribe (RFC 8058), explained

By Sendviser · Updated · 6 min read

One-click unsubscribe lets a mailbox provider offer its own unsubscribe control and act on it without sending the recipient to your website. Gmail and Yahoo require it on marketing and subscribed mail from high-volume senders, which for Gmail means more than 5,000 messages a day. This guide covers the headers, the request your server receives, and the mistakes that quietly break it.

Why it exists

The List-Unsubscribe header is old: RFC 2369 defined it in 1998. It could always carry an HTTPS link. The problem, as RFC 8058 explains, is that anti-spam software fetches links in mail headers automatically, and a sender cannot tell an automated fetch from a person. So senders put a confirmation page behind the link, and unsubscribing took more than one click.

RFC 8058 fixes this with a POST. The mailbox provider or mail client asks the user, then sends an HTTPS POST to your URI in the background. The user never sees your response. Because the POST is distinct from automated fetches, RFC 8058 lets you act on it without a confirmation step.

RFC 8058 makes the reputational case itself. If unsubscribing is too hard, recipients report the mail as junk instead, and mail that is often reported as junk tends to have poor deliverability.

The two headers

List-Unsubscribe: <https://example.com/u/7f3c9a2e1b4d>, <mailto:[email protected]?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

The rules, from RFC 8058 section 3.1:

  • Put one List-Unsubscribe header and one List-Unsubscribe-Post header in the message.
  • List-Unsubscribe must contain one HTTPS URI. It may also contain a mailto: URI. Each URI sits in angle brackets, separated by commas.
  • List-Unsubscribe-Post must contain exactly List-Unsubscribe=One-Click.
  • The URI must identify both the recipient and the list, because the POST carries no other arguments.
  • The URI should contain an opaque, hard-to-forge component, and your server should check it. This stops someone from unsubscribing your recipients by guessing URIs.

A mailto: address alone does not meet Google’s requirement. Yahoo accepts it but strongly recommends the POST method. Keep mailto: as a second option if you like, but the HTTPS URI is the one that matters.

The request your server receives

When a user clicks the provider’s unsubscribe control, your server receives this:

POST /u/7f3c9a2e1b4d HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 26

List-Unsubscribe=One-Click

RFC 8058 says providers should send the body as multipart/form-data and may send it as application/x-www-form-urlencoded. Accept both.

What the endpoint must do, and must not do:

  • Unsubscribe on the POST itself. No login, no confirmation page, no “are you sure”. The provider has already asked the user.
  • Expect no context. The request must not carry cookies, HTTP authorisation or anything else that links it to earlier web activity. Do not require a session.
  • Never redirect. RFC 8058 forbids an HTTPS redirect in reply, because redirected POSTs have historically not worked reliably.
  • Answer with a success status. Return a 2xx promptly. If removal takes longer, queue it and answer first.
  • Stay idempotent. A second POST for the same address should succeed quietly.

The same URI also serves people who open it in a browser. RFC 8058 intends one URI for both: a GET shows a page, typically with a confirm button, and a POST unsubscribes. Never unsubscribe on a GET.

DKIM must cover both headers

RFC 8058 section 4 requires a valid DKIM signature on the message, with both headers listed in the signature’s h= tag. Without it, the provider should not offer one-click unsubscribe for that message.

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=s1;
    h=from:to:subject:date:message-id:list-unsubscribe:list-unsubscribe-post;
    bh=...; b=...

Add the headers before the message is signed. If a later system adds or rewrites them, they fall outside the signature, or the signature breaks. Use d= set to your own domain, aligned with the From address, since Gmail and Yahoo require DMARC alignment from the same senders anyway. See SPF, DKIM and DMARC when you send through several providers.

Which mail needs it

Required on marketing and subscribed mail. Google requires one-click unsubscribe on marketing and subscribed messages from senders of more than 5,000 messages a day. Yahoo requires a working List-Unsubscribe header on promotional and marketing mail, strongly recommends the RFC 8058 POST, and began enforcing in June 2024.

Not required on transactional mail. Both exclude it. Google’s examples are password resets, reservation confirmations and form submission confirmations. Yahoo’s are order confirmations and password resets.

Grey areas. Newsletters, digests, product announcements and opt-in notifications are subscribed mail: include the headers. If you add them to transactional mail as well, decide in advance what the request unsubscribes from. It should never stop a receipt or a password reset.

Keep the body link. Google and Yahoo both require a clearly visible unsubscribe link in the message body. That link does not have to be one-click. It can lead to a preference centre.

Honour it within 48 hours. Yahoo requires two days. Google’s FAQ recommends 48 hours, and its Postmaster Tools compliance dashboard marks a sender as needing work when requests take longer. Better still, suppress the address the moment the POST arrives, in the suppression list that every sending system reads. If you send through several providers, an unsubscribe recorded at one must stop mail from all of them.

Common mistakes

  1. Unsubscribing on GET. Link scanners and security gateways fetch URLs in messages and headers. A GET handler that unsubscribes will remove recipients who never asked. Unsubscribe only on POST.
  2. Expiring tokens. People unsubscribe from old messages, and the provider may POST long after delivery. If the token has expired, the unsubscribe fails and the next message becomes a complaint. Make the opaque part permanent: a signed value, not a time-limited one.
  3. Unsigned headers. The headers are added after signing, or the signer’s h= list leaves them out. The message looks right, but the provider will not offer one-click unsubscribe.
  4. Missing List-Unsubscribe-Post. Without it, the HTTPS URI is an ordinary link, not one-click.
  5. Protection that blocks the POST. Web frameworks often reject a POST without a session token, and a web application firewall or bot filter may refuse requests from a provider’s servers. Exempt this endpoint and rely on the opaque identifier instead. Google says a request counts whether or not it reaches your servers.
  6. Redirects. A 301, 302 or 303 to a “you have been unsubscribed” page breaks the flow. Return the 2xx directly.
  7. One list, many systems. The request removes the address from one platform’s list while another system keeps sending. Suppression has to be shared.

Testing it

Send a message to a test mailbox and view the raw source. Check that both headers are present, that DKIM passes, and that h= lists both headers. Then test the endpoint directly:

curl -i -X POST -d 'List-Unsubscribe=One-Click' https://example.com/u/7f3c9a2e1b4d
curl -i -F 'List-Unsubscribe=One-Click' https://example.com/u/7f3c9a2e1b4d
curl -i https://example.com/u/7f3c9a2e1b4d

The first two must return a 2xx with no Location header and must unsubscribe the address. The third, a GET, must leave the subscription untouched.

How Sendviser handles this

Sendviser applies an unsubscribe on one route to every route, so a recipient who opts out is not mailed through another provider.

Talk to us.

[email protected]