One-click unsubscribe (RFC 8058), explained
Two email headers let Gmail and Yahoo show their own Unsubscribe button. Done right, they cut spam complaints; done wrong, they unsubscribe people by accident.
The two headers
List-Unsubscribe: <https://example.com/u/TOKEN>
List-Unsubscribe-Post: List-Unsubscribe=One-ClickWhen a user clicks the mailbox's Unsubscribe button, the provider sends an HTTP POST to that URL with the body List-Unsubscribe=One-Click. Your server must unsubscribe them without asking anything else.
The common bug: unsubscribing on GET
Security scanners and link previews open (GET) every URL in an email. If a GET unsubscribes, people get removed without clicking. The correct pattern: POST unsubscribes; GET shows a confirmation button. That is how NovaMail implements it.
Requirements
- HTTPS URL, with a token that identifies the recipient and can't be guessed (signed).
- Both headers present, and the message DKIM-signed so they can't be tampered with.
- Honour the request immediately (Gmail allows up to two days).
- Keep a visible unsubscribe link in the email body too.
NovaMail adds both headers and a signed token to every campaign automatically; you can also place {{unsubscribe_url}} in your footer.