The List-Unsubscribe header is a line in your email’s headers that tells mail apps how to unsubscribe the recipient. When it is present, Gmail, Yahoo, Apple Mail and others can show an Unsubscribe link next to the sender’s name, so people leave your list instead of pressing “Report spam”. One-click unsubscribe adds a second header, List-Unsubscribe-Post, so the mail app can unsubscribe the person with a single request, without opening a web page.
What the headers look like
List-Unsubscribe: <https://acme.com/unsubscribe?t=8f2c1d>, <mailto:unsubscribe@acme.com?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
List-Unsubscribecomes from RFC 2369. It holds one or more URLs in angle brackets: an HTTPS link, amailto:address, or both.List-Unsubscribe-Postcomes from RFC 8058. Its value must be exactlyList-Unsubscribe=One-Click.
The token in the URL (t=8f2c1d here) should identify the recipient and the list without exposing the email address in plain text, and it should be hard to guess.
How one-click unsubscribe works
- The recipient clicks Unsubscribe in their mail app.
- The mail app sends an HTTPS
POSTto the URL inList-Unsubscribe, with the bodyList-Unsubscribe=One-Click. - Your server unsubscribes the person and returns a success response. No login, no confirmation page, no “are you sure”.
RFC 8058 adds three conditions:
- The
List-Unsubscribeheader must contain an HTTPS URI. - The message must have a valid DKIM signature that covers both
List-UnsubscribeandList-Unsubscribe-Post(they must be listed in the signature’sh=tag). Without that, receivers should not offer one-click. - The POST body is sent as a form, preferably
multipart/form-data, thoughapplication/x-www-form-urlencodedis allowed. Accept both.
Your endpoint should also handle GET, because some mail apps and security scanners open the link. Show a page with a button for GET and only unsubscribe on POST, so link scanners do not unsubscribe people by accident.
What Gmail and Yahoo require
Since 2024, Gmail and Yahoo require bulk senders to support one-click unsubscribe:
- Gmail: senders of more than 5,000 messages a day to Gmail accounts must support one-click unsubscribe for marketing and subscribed messages, with
List-Unsubscribe-Post: List-Unsubscribe=One-Clickand an HTTPSList-UnsubscribeURL, plus a clearly visible unsubscribe link in the body. Source: Google sender guidelines. Google’s FAQ recommends processing requests within 48 hours. - Yahoo: bulk senders must have a functioning
List-Unsubscribeheader supporting one-click for marketing and subscribed messages. The POST method is “highly recommended” and mailto is acceptable. Unsubscribes must be honored within 2 days. Source: Yahoo sender best practices.
Our Gmail and Yahoo bulk sender rules guide covers the rest of the requirements.
Do transactional emails need a List-Unsubscribe header?
No, not for the Gmail rule. Google’s FAQ states that transactional messages are excluded from the one-click requirement, and gives password resets and reservation notices as examples. Receipts, login codes, security alerts and shipping updates fall into the same group.
Be honest about what is transactional. A “receipt” that is mostly a promotion is marketing. A product newsletter sent to all users is marketing even if it comes from your app. If people can sensibly opt out of a message, give them a way to. See transactional vs marketing email.
How to add the headers yourself
If you send marketing or notification mail through an email API, add the headers on each message. With Mailcandor, pass them in headers:
const res = await fetch('https://api.mailcandor.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MAILCANDOR_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
from: 'Acme <news@news.acme.com>',
to: 'sam@example.com',
subject: 'What shipped in November',
html: '<p>...</p><p><a href="https://acme.com/unsubscribe?t=8f2c1d">Unsubscribe</a></p>',
headers: {
'List-Unsubscribe': '<https://acme.com/unsubscribe?t=8f2c1d>',
'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
},
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
After you send, open the received message in Gmail, choose “Show original”, and check two things: both headers are present, and the DKIM-Signature header’s h= list includes list-unsubscribe and list-unsubscribe-post.
Handling the unsubscribe request
A minimal endpoint does three things: looks up the token, marks the recipient as unsubscribed from that list, and returns 200. Do it synchronously or queue it, but make sure it takes effect within two days. Then check that list before every send. If the token is unknown, still return success, so you do not leak which tokens are valid. Log every request with a timestamp, so you can show when someone left if they later complain.
Common mistakes
- HTTP instead of HTTPS. RFC 8058 requires an HTTPS URI for one-click. A plain
http://link does not qualify. - Headers added after signing. If a system adds the headers after the DKIM signature is created, the signature does not cover them and one-click will not be offered. Add them before the message is signed.
- A confirmation step. Asking people to log in or confirm on the POST request defeats the purpose. The POST itself is the confirmation.
- Unsubscribing from everything. One-click should remove the person from the list the message came from. If you have several lists or topics, offer a preferences page in the body link as well.
- Ignoring the mailto address. If you include a
mailto:option, something must read that inbox and process the requests within two days. - Slow processing. Sending another campaign to someone who unsubscribed yesterday is the fastest way to earn a spam complaint.
The easier route
Mailcandor Broadcasts handle this for you: audiences, contacts and topics with one-click unsubscribe using the RFC 8058 List-Unsubscribe-Post header, so you do not need to build the endpoint. For transactional mail sent through the email API, you can leave the headers off.