How to add the List-Unsubscribe header (RFC 8058)

Last updated: October 27, 2026

The List-Unsubscribe header tells mailbox providers how a recipient can leave your mailing list without hunting for a link in the footer. When Gmail, Yahoo or Apple Mail see it, they render a native 'Unsubscribe' button right next to your sender name. Since February 2024, Google and Yahoo require this header for anyone sending more than 5,000 messages a day to their users, and they require the one-click variant defined in RFC 8058 for marketing and subscribed mail.

There are two headers working as a pair. List-Unsubscribe carries one or more URLs (an HTTPS endpoint, optionally a mailto: address). List-Unsubscribe-Post: List-Unsubscribe=One-Click declares that your HTTPS endpoint accepts a machine POST request and unsubscribes the user instantly — no confirmation landing page, no login, no extra click. Gmail's one-click button issues exactly that POST.

The part almost everyone misses: Gmail silently ignores unsubscribe headers that are not covered by your DKIM signature. If list-unsubscribe is not listed in the h= tag of your DKIM-Signature, Gmail treats the header as untrusted — an attacker could inject it — and the button never appears. The header is in the raw message, your ESP swears it was added, and Gmail acts as if it does not exist. This guide walks through correct setup per platform and shows how to verify the result.

Not sure if this affects you? Send one test email and see exactly which checks fail.

Send a free test email

Step by step

The two headers (what you need to end up with)

  1. Add a List-Unsubscribe header with at least an HTTPS URL: List-Unsubscribe: <https://example.com/unsub?u={{token}}>. Keep the URL unique per recipient so the unsubscribe is authenticated by the link itself.
  2. Add the companion header exactly as written: List-Unsubscribe-Post: List-Unsubscribe=One-Click. Only the literal value List-Unsubscribe=One-Click is valid.
  3. Make your HTTPS endpoint accept POST with a form body of List-Unsubscribe=One-Click and unsubscribe the user immediately, returning HTTP 200. No cookies, no login, no CAPTCHA — mailbox providers call it server-to-server.
  4. Keep a mailto: fallback as the second entry if you like — List-Unsubscribe: <https://...>, <mailto:unsub@example.com> — but HTTPS must come first for one-click to be used.
  5. Make sure your DKIM signature covers both headers: the h= tag of DKIM-Signature must include list-unsubscribe (and ideally list-unsubscribe-post).

Google Workspace (Gmail for your domain)

  1. Workspace itself does not inject List-Unsubscribe for mail you send through it — the header must be added by your application or campaign tool before submission.
  2. If you relay bulk mail through Workspace, add the headers in your sending code and sign with your own DKIM selector (Workspace signs with its domain key by default; enable DKIM in Admin console → Apps → Google Workspace → Gmail → Authenticate email).
  3. Verify in Gmail: open a received message → Show original → check that list-unsubscribe appears in the h= list of the DKIM-Signature and that Authentication-Results shows dkim=pass.

SendGrid

  1. SendGrid adds List-Unsubscribe automatically when Subscription Tracking is enabled (Settings → Tracking → Subscription Tracking).
  2. For true one-click, use SendGrid's unsubscribe groups (asm group id); SendGrid then emits List-Unsubscribe-Post and an HTTPS unsubscribe URL.
  3. SendGrid signs DKIM with your authenticated domain and includes list-unsubscribe in h= — run our test to confirm; older templates signed with a limited h= list may need re-authentication of the domain.

Mailgun

  1. Enable unsubscribe tracking: Sending → Domain settings → Tracking → Unsubscribes. Mailgun then injects List-Unsubscribe with an HTTPS URL.
  2. Mailgun's default DKIM signature historically lists a fixed h= set; confirm list-unsubscribe is covered — if not, contact support or move unsubscribe handling to your own header added before SMTP submission.
  3. If you add your own List-Unsubscribe header in the message you hand to Mailgun, disable their auto-injection to avoid two competing headers.

Amazon SES

  1. SES does not add List-Unsubscribe for you in raw sending. Add both headers in your application before calling SendEmail/SendRawEmail.
  2. If you use SES configuration sets with headers, you can inject List-Unsubscribe there; the HTTPS endpoint is yours to host (an API Gateway + Lambda behind https://unsub.yourdomain.com works well).
  3. SES signs with DKIM using your Easy DKIM domain — SES's signing includes custom headers you added only when they are part of the signed header list; send a test and inspect h= to be sure.

Postmark

  1. Postmark adds List-Unsubscribe automatically on broadcast (Message Stream type 'Broadcasts') mail when you use their subscription handling.
  2. Transactional streams intentionally do not get unsubscribe headers — do not force them onto receipts and password resets.
  3. Postmark's DKIM covers the unsubscribe headers; verify once with a real send and keep the working configuration as a template.

Postfix (self-hosted)

  1. Add headers at injection time with header_checks or a milter: /etc/postfix/header_checks with /^Subject:/ PREPEND List-Unsubscribe: <https://unsub.example.com/u?t=$recipient> is the crude form — a milter (or your queueing app) that can tokenize per-recipient URLs is the clean form.
  2. Sign with OpenDKIM and make sure /etc/opendkim.conf or the KeyTable signing includes the headers: opendkim signs the headers listed in its 'SignHeaders'/'OversignHeaders' if configured — explicitly add list-unsubscribe and list-unsubscribe-post to OversignHeaders.
  3. Host the HTTPS endpoint on any small web service; it must respond 200 to an unauthenticated POST containing List-Unsubscribe=One-Click and process the removal within a day (Gmail expects immediate effect).

Copy-paste examples

Message headers (not DNS) — what a compliant email carries
List-Unsubscribe: <https://mail.example.com/unsub?u=9f2c7a>, <mailto:unsub@example.com>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
What the one-click POST from Gmail looks like at your endpoint
POST /unsub?u=9f2c7a HTTP/1.1
Host: mail.example.com
Content-Type: application/x-www-form-urlencoded

List-Unsubscribe=One-Click
DKIM-Signature h= tag — list-unsubscribe must be inside
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mail;
  h=from:to:subject:date:message-id:list-unsubscribe:list-unsubscribe-post;
  bh=...; b=...

Common mistakes

  • Header present but not in DKIM h= — Gmail silently ignores it. This is the #1 cause of 'I added the header and nothing changed'.
  • List-Unsubscribe-Post missing — Gmail falls back to a legacy link flow and bulk-sender compliance fails even though List-Unsubscribe exists.
  • HTTPS endpoint requires login, shows a confirmation page, or redirects — one-click must succeed in a single unauthenticated POST.
  • mailto:-only List-Unsubscribe — not accepted as one-click; Gmail wants the HTTPS URL first.
  • Adding the header after DKIM signing (wrong order in your pipeline) — the signature then provably cannot cover it.
  • One shared unsubscribe URL for all recipients — providers distrust non-unique URLs and you cannot authenticate who unsubscribed.

FAQ

Is List-Unsubscribe required for transactional email?

No. Gmail and Yahoo require it for marketing and subscribed (bulk) mail. Receipts, password resets and alerts are exempt — and you should not offer one-click unsubscribe on a password-reset email. If more than 5,000 messages per day from your domain reach Gmail, all subscribed mail must carry the one-click pair.

I added List-Unsubscribe but Gmail shows no button. Why?

Almost always the DKIM h= tag does not include list-unsubscribe, so Gmail ignores the header. Check Show original: find DKIM-Signature, look at h=. Also confirm your From domain passes DMARC — Gmail only shows one-click for authenticated senders with reasonable reputation.

Does the unsubscribe endpoint need to be on my sending domain?

It is strongly recommended. The URL's domain should align with (or be a subdomain of) the domain in your From address. Random third-party-looking URLs reduce trust and can break alignment expectations.

What HTTP response should the endpoint return?

200 OK with an empty or short body, after recording the unsubscribe. Do not return redirects to a preference center for the one-click POST — offer preferences on the manual link flow instead. Process the removal promptly; Gmail states senders should honor unsubscribes within two days, instantly is best.

Will the native button hurt my list?

It reduces spam complaints, which is worth far more. People who cannot find unsubscribe hit 'Report spam' — and complaint rate above 0.3% in Google Postmaster Tools damages deliverability for everyone you mail.

Fixed it? Prove it.

Send a test email and watch every check go green.

Send a test email to verify the fix

Related guides