What it is

The unsubscribe link inside a message is for the reader. One-click unsubscribe is for the mail program: Gmail and Yahoo show an "Unsubscribe" button next to the sender name, and pressing it makes the program send one web request to your server. No page, no login, no questions. It is defined in RFC 8058.

Gmail requires it for bulk senders' marketing and subscribed mail, and says transactional messages are excluded. Yahoo says the POST method "is highly recommended" and accepts a mailto: link. Details and the exact quotes are in the Gmail and Yahoo requirements guide. A visible unsubscribe link in the message body is still needed.

The two headers

List-Unsubscribe: <https://mail.example.com/unsub/8f3a9c...>, <mailto:[email protected]?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

The DKIM requirement

RFC 8058 section 3.1 requires a valid DKIM signature that covers both headers. Without it, anyone who can inject a header could point the unsubscribe button at a stranger. In the DKIM-Signature header, the h= tag lists the signed headers, so it must include list-unsubscribe and list-unsubscribe-post. Most sending services do this for you when one-click is turned on; if you send through your own software, add both names to the signed-header list.

What your server does

When the button is pressed, the mail program sends a POST with a form-encoded body:

POST /unsub/8f3a9c... HTTP/1.1
Host: mail.example.com
Content-Type: application/x-www-form-urlencoded

List-Unsubscribe=One-Click

Your endpoint should check that the body contains List-Unsubscribe=One-Click, mark that recipient as unsubscribed, and return a 2xx status. Then honor it fast: Yahoo says "Honor unsubscribes within 2 days", and Google recommends 48 hours. A GET to the same address (someone opening the link in a browser) can show a confirmation page; it should not unsubscribe on its own, because security scanners fetch links in mail before the reader does.

Setting it up

  1. In a sending service: look for a setting named one-click unsubscribe, list-unsubscribe or unsubscribe header. Mailing tools built for newsletters usually have it on by default; transactional and sales-engagement tools often do not.
  2. In your own code: add the two headers to each marketing message, give each recipient a unique token, build the POST endpoint above, and add both header names to the DKIM signature.
  3. Both ways: keep a visible unsubscribe link in the body, and make sure the suppression list your unsubscribe writes to is the one every future send checks.

Testing a real message

DNS cannot show whether you did this, because the headers belong to each message. Send yourself a marketing message, open "Show original" (Gmail) or the equivalent in your mail program, copy the full headers into the analyzer, and tick the bulk-mail box:

Email header analyzer

Runs in your browser. The headers you paste are read by the code on this page and go nowhere: MailSetupCheck has no server, and this tool makes no network requests at all.

Use a copy that arrived in Gmail, Outlook or Yahoo, not the one in your sent folder: the receiving server writes the Authentication-Results line. Headers can include addresses and server names; they stay in this tab.

It reports whether both headers are present, whether the address is HTTPS, and whether the DKIM signature covers them. Then press the real Unsubscribe button in Gmail on a test address and confirm your system recorded it. Untick the bulk box for transactional mail such as receipts and password resets, which does not need the headers.

Common failures

Symptom Likely cause
No Unsubscribe button in Gmail List-Unsubscribe-Post missing, or the address is mailto: only
Header present but analyzer says unsigned DKIM h= list omits one or both header names
Button works but mail keeps arriving Unsubscribe not written to the suppression list the sending job reads
Unsubscribed on its own at the confirmation page The GET request unsubscribes; only POST should

Sources: RFC 8058, Google's email sender guidelines, Yahoo Sender Hub.

Also available as Markdown.