One-click unsubscribe: List-Unsubscribe-Post explained
One-click unsubscribe (RFC 8058) is two headers: List-Unsubscribe containing an HTTPS URL, and List-Unsubscribe-Post: List-Unsubscribe=One-Click. When someone clicks Unsubscribe in their mail app, the mailbox provider sends an HTTPS POST with the body List-Unsubscribe=One-Click to that URL, and your server removes them with no page to visit. Both headers must be covered by a valid DKIM signature. Gmail and Yahoo require it for marketing and subscribed mail from bulk senders, not for transactional mail.
- Build the endpoint Create an HTTPS URL per recipient and list with an opaque token that unsubscribes on POST and shows a page on GET.
- Add both headers Send List-Unsubscribe with the HTTPS URL and List-Unsubscribe-Post: List-Unsubscribe=One-Click, or turn on your provider's unsubscribe handling.
- Sign them with DKIM Make sure your DKIM signature's h= tag includes list-unsubscribe and list-unsubscribe-post.
- Test the POST POST List-Unsubscribe=One-Click to the URL with curl and confirm a 200 or 202 and the address removed.
- Process within 48 hours Remove the address from that list promptly; Google recommends 48 hours and Yahoo 2 days.
The headers, exactly
List-Unsubscribe: <https://example.com/u/3f9a7c2e1b>, <mailto:[email protected]?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=s1;
h=from:to:subject:date:message-id:list-unsubscribe:list-unsubscribe-post; …What RFC 8058 requires of the sender:
List-Unsubscribemust contain one HTTPS URI. It may also contain other URIs such asmailto:, but Google says mailto alone does not meet its requirement.List-Unsubscribe-Postmust contain the single pairList-Unsubscribe=One-Click, nothing else.- The message must carry a valid DKIM signature whose
h=tag includes both headers. Without it, receivers should not offer one-click. - The URI must identify both the recipient and the list, because the POST carries no other data. It should include an opaque, hard-to-forge token rather than a plain email address.
What your endpoint receives and must do
Google's guidelines show the request your server gets:
POST /u/3f9a7c2e1b HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 26
List-Unsubscribe=One-Click- Accept both
application/x-www-form-urlencodedandmultipart/form-data: RFC 8058 says receivers should use multipart and may use urlencoded. - Do not redirect. RFC 8058 says the sender must not return an HTTPS redirect, and the request carries no cookies or authorisation, so do not require either.
- Unsubscribe on POST only. A GET to the same URL (a person opening the link, or a link scanner) should show a normal unsubscribe or confirmation page. Resend's docs suggest answering the POST with a blank
200or202. - Remove the address from that list. Google's FAQ says one-click removes the recipient only from the list associated with the message, not from everything you send.
- Act fast. Google recommends within 48 hours, and Postmaster Tools flags "Honor unsubscribe" if you do not; Yahoo says within 2 days. Google counts requests that a CDN or firewall blocked before they reached you as yours to process.
Test it yourself:
curl -i -X POST https://example.com/u/3f9a7c2e1b \
-d 'List-Unsubscribe=One-Click'
# expect 200 or 202, no redirect, and the address removed from that listWhich mail needs it
| One-click required? | |
|---|---|
| Newsletters, promotions, product announcements from a bulk sender | Yes, for Gmail and Yahoo, plus a visible unsubscribe link in the body |
| Password resets, confirmations, receipts | No. Google: "Transactional messages are excluded from this requirement." Yahoo: "The requirement does not apply to transactional messages" |
| Optional notifications (digests, activity alerts) | Not strictly, but Yahoo suggests one-click where complaint rates are high, and it lowers spam complaints |
Google adds that recipients, not Google, decide whether a message is promotional. See the full bulk sender checklist.
Why the Unsubscribe button is not showing in Gmail: Google only shows it next to the sender name for messages that pass automated eligibility checks, which include meeting the sender requirements. Yahoo shows its button when the header is correct and it sees sufficient reputation and engagement. Correct headers are necessary, but not a guarantee.
How the providers add it
- Postmark: on Broadcast streams where Postmark manages unsubscribes, it adds the one-click
List-Unsubscribe-PostandList-Unsubscribeheaders itself. If you manage unsubscribes yourself, you add the headers and a visible link. On Transactional streams they are not required, but Postmark sends them if you include them. - SendGrid: with subscription tracking enabled, it inserts
List-Unsubscribeand aList-Unsubscribe-Postheader withList-Unsubscribe=One-Click. Otherwise add them in the request'sheaders. - Resend: Broadcasts handle unsubscribes when you include
{{{RESEND_UNSUBSCRIBE_URL}}}. For emails sent through the API, you add the headers yourself. - Mailgun: unsubscribe tracking and the
%unsubscribe_url%variable handle unsubscribes per domain; check Mailgun's current docs for how it sets the headers.
Adding the headers yourself through Postmark's API, where newsletter is the ID of a broadcast stream on which you manage unsubscribes:
curl https://api.postmarkapp.com/email \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
-d '{
"From": "[email protected]",
"To": "[email protected]",
"Subject": "November product update",
"HtmlBody": "<p>…</p>",
"MessageStream": "newsletter",
"Headers": [
{"Name": "List-Unsubscribe-Post", "Value": "List-Unsubscribe=One-Click"},
{"Name": "List-Unsubscribe", "Value": "<https://example.com/u/3f9a7c2e1b>"}
]
}'Is one-click unsubscribe a law?
No. The one-click header is a requirement of Gmail and Yahoo for bulk senders, enforced through delivery, not a legal rule. Laws set their own unsubscribe duties: in the US, CAN-SPAM gives recipients the right to have you stop emailing them, and in the UK and EU, marketing email rules apply alongside data protection law. Meeting the mailbox providers' rules does not by itself make you compliant with those, or the other way round. This is not legal advice.
Questions
What does List-Unsubscribe=One-Click mean?
It is the only allowed value of the List-Unsubscribe-Post header. It tells the mailbox provider it can unsubscribe the recipient by POSTing that value to the HTTPS URL in List-Unsubscribe, with no page to visit.
Is a mailto List-Unsubscribe enough?
Not for Gmail, which requires an HTTPS URL with List-Unsubscribe-Post. Yahoo accepts mailto but highly recommends the RFC 8058 POST method.
Do transactional emails need one-click unsubscribe?
No. Google and Yahoo both exclude transactional messages such as password resets and order confirmations.
Does a link in the email body count?
No. Google says a body link does not meet the one-click requirement; you need the headers. A body link is still required too, and may go to a preferences page.
Related
- Gmail and Yahoo bulk sender requirements: checklistBulk senders to Gmail and Yahoo need SPF, DKIM, DMARC, From alignment, PTR, a low spam rate and one-click unsubscribe. The checklist and the errors.
- Gmail and Yahoo spam rate limit: the 0.3% rule explainedGmail and Yahoo require a spam complaint rate below 0.3%; Gmail says aim under 0.1%. How it is measured, who it applies to, what it means for receipts.
- What is transactional email? Examples, vs marketingTransactional email is triggered by a user action; marketing goes out on your schedule. Split them by stream, IP and subdomain to protect receipts.
- Postmark message streams: transactional, broadcast, inboundEach Postmark server has an outbound transactional stream and an inbound stream; you add broadcast streams. Pick one per email with MessageStream.
- DKIM fail: what it means and how to fix each causedkim=fail means a signature did not verify: the body changed, signed headers changed, or the key is missing from DNS. Find the reason and fix it.