How to set up one-click unsubscribe for Gmail and Yahoo (RFC 8058)

tutorialgmailyahoo mail

If bulk email compliance work is already underway, one-click unsubscribe is usually where teams discover that a footer link is not the same thing as a provider-recognized unsubscribe flow.

That distinction matters now.

Google's Email sender guidelines require bulk senders to support one-click unsubscribe for marketing and subscribed messages, and to include a clearly visible unsubscribe link in the message body. Google's sender FAQ also makes the practical part explicit: a mailto link or a normal body link does not satisfy Gmail's one-click requirement by itself.

Yahoo's Sender Requirements & Recommendations point in the same direction for bulk senders: easy unsubscribe, a visible body link, and honoring requests within 2 days. Yahoo says the RFC 8058 POST method is highly recommended.

So the safest implementation for mail that needs to work well at both Gmail and Yahoo is:

  • RFC 8058 one-click headers
  • a real HTTPS endpoint that unsubscribes without a confirmation page
  • DKIM that signs those headers
  • a normal visible unsubscribe link in the body as well

If the broader provider checklist is still being cleaned up, Gmail, Yahoo, and Microsoft email sender requirements is the bigger picture. This post stays focused on the unsubscribe part.

What one-click unsubscribe actually is

There are two related standards here:

  • RFC 2369 defines the List-Unsubscribe header
  • RFC 8058 adds List-Unsubscribe-Post: List-Unsubscribe=One-Click so mailbox providers can tell the HTTPS URL is meant for a direct unsubscribe POST

That second header is the important bit.

Without it, many senders fall back to a landing page or a confirmation click, because receivers and security tools may prefetch links. RFC 8058 exists specifically to avoid accidental unsubscribes caused by automated URL fetching while still allowing mailbox providers to offer a real unsubscribe action inside the mail client.

Which messages need it

For Gmail, one-click unsubscribe is required for marketing and promotional mail from bulk senders. Transactional mail such as password resets, receipts, and reservation confirmations is not the target of this requirement, as Google's sender FAQ explains.

That means the first operational step is not "add these headers to everything".

It is:

  1. Identify which streams are actually promotional or subscription mail.
  2. Add one-click unsubscribe to those streams.
  3. Keep transactional mail separate so compliance and complaint handling stay clean.

If a stream mixes marketing and transactional content in the same messages, fix that first. Those mixed streams are where unsubscribe behavior and spam complaints get messy very quickly.

The headers to send

The minimal RFC 8058 pattern looks like this:

List-Unsubscribe: <https://example.com/unsubscribe/9f2c4a8e>, <mailto:unsubscribe@example.com?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

Three details matter here:

  1. The List-Unsubscribe header must include one HTTPS URL for the one-click flow.
  2. A mailto: entry can still be present as an additional option, but for Gmail it does not replace the HTTPS one-click path.
  3. The List-Unsubscribe-Post header value must be exactly List-Unsubscribe=One-Click.

That exact value is not decorative. RFC 8058 defines it as the signal that tells the receiver it can perform an HTTPS POST for a direct unsubscribe.

What the HTTPS endpoint must do

This is where many otherwise-correct implementations quietly miss the point.

The one-click URL should identify the recipient and list well enough that the unsubscribe can complete immediately. RFC 8058 recommends using an opaque or hard-to-forge identifier in the URL rather than trusting a plain email address alone.

The endpoint should behave like this:

  • accept an HTTPS POST
  • accept List-Unsubscribe=One-Click in the request body
  • unsubscribe the recipient from the mailing list tied to that message
  • return success without requiring login or a second confirmation click
  • avoid redirects for the unsubscribe POST

What it should not do:

  • require the user to sign in
  • send the user to a preferences page before the unsubscribe completes
  • depend on cookies or prior web session state
  • redirect the POST somewhere else and hope the client follows it correctly

RFC 8058 is explicit about several of those behaviors. The POST should stand on its own, and the unsubscribe target should already carry the information needed to process the request.

Keep the preference center if it is useful. Just do not make the RFC 8058 endpoint depend on that page. The body link can go to preferences. The one-click header target should directly process the unsubscribe.

Why body links are not enough

This is the most common misunderstanding.

Teams often say, "There is already an unsubscribe link in the footer, so this is handled." For Gmail compliance, that is incomplete.

Google's sender FAQ says:

  • Gmail does not treat a body mailto link as meeting the one-click requirement
  • Gmail does not inspect the body and treat an ordinary link there as RFC 8058 one-click unsubscribe
  • additional body links are allowed, but they do not replace the required header-based one-click flow

In other words:

  • the body link is for the human-readable unsubscribe path
  • the headers are for provider-recognized one-click unsubscribe

For Gmail bulk senders, both matter.

Yahoo's guidance also expects a clearly visible body unsubscribe link, so this is not an either-or design. The operationally correct answer is header-based one-click plus a visible body link.

DKIM must cover the unsubscribe headers

This part is easy to miss and important enough to check explicitly.

RFC 8058 requires a valid DKIM signature that covers at least these two headers:

  • List-Unsubscribe
  • List-Unsubscribe-Post

That means the h= list in the DKIM-Signature header needs to include them.

Example pattern:

DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mailer1;
 h=from:to:subject:date:message-id:list-unsubscribe:list-unsubscribe-post;
 bh=...; b=...

If those headers are present in the message but not covered by DKIM, receivers have less reason to trust them, and the one-click flow may not be treated as eligible.

If DKIM handling still needs cleanup, DKIM selectors and key rotation playbook and DKIM key length and algorithms are the adjacent topics worth checking.

A practical implementation sequence

The cleanest rollout usually looks like this:

1. Separate the right traffic

Put promotional and subscribed traffic on the code path where the headers will be added.

2. Generate a per-message unsubscribe URL

Use a token or opaque identifier that maps to:

  • recipient
  • mailing list or subscription category
  • optional expiration or integrity metadata

Avoid plain links that only expose email=user@example.com with no protection.

3. Add the RFC 8058 headers

Add both headers before signing.

4. DKIM-sign the final message

Make sure the signing step happens after the unsubscribe headers are in place, and make sure both headers are included in the signed header list.

5. Keep the visible body unsubscribe link

That body link can go to a preference page if wanted. Just do not confuse that page with the one-click endpoint.

6. Process removals quickly

Google recommends fulfilling unsubscribe requests within 48 hours in its sender FAQ. Yahoo says requests should be processed within 2 days in its sender requirements.

Operationally, faster is better. Slow unsubscribe handling turns a normal opt-out into a spam complaint.

How to test it

Testing should cover both message construction and endpoint behavior.

1. Send a real test message to Gmail

In Gmail, open the message and use Show original.

Verify that:

  • List-Unsubscribe is present
  • List-Unsubscribe-Post: List-Unsubscribe=One-Click is present
  • DKIM passes
  • the DKIM signed header list includes the unsubscribe headers

2. Inspect the raw delivered message

Where possible, confirm the delivered message source still contains the headers exactly as expected. This catches cases where an ESP added the headers in one path but not another.

3. Exercise the HTTPS endpoint directly

The RFC 8058 POST is simple enough to test without guessing:

curl -i -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "List-Unsubscribe=One-Click" \
  "https://example.com/unsubscribe/9f2c4a8e"

The test should confirm that the recipient is actually removed from the intended list and that no login, redirect chain, or confirmation page is required for success.

4. Test at least one Yahoo delivery path too

Even if Gmail is the immediate driver, Yahoo is part of the same compliance reality now. Send a live message through the same campaign path and confirm the headers survive the real outbound flow.

Common failure modes

These are the ones that show up most often in production:

Header added, but only in some templates

Many stacks have multiple mail paths: campaign mail, lifecycle mail, legacy mailers, ESP-specific adapters. One path gets the headers right; another silently does not.

HTTPS URL points to a preference center, not a one-click action

That is a normal body-link design, but it is not RFC 8058 one-click behavior.

Headers exist, but DKIM does not sign them

This is especially common when a downstream provider injects headers after the original signing step.

mailto: is present, but no HTTPS one-click endpoint exists

That may be acceptable for older list behavior, but it does not meet Gmail's one-click requirement.

Unsubscribe works, but not within the expected time

If suppression runs in a delayed batch, users keep receiving mail after opting out. That is exactly when spam complaints rise.

The visible body link is removed because "the header already handles it"

Do not do that. Google requires a clearly visible body unsubscribe link for relevant bulk mail, and Yahoo expects the same general user experience.

Bottom line

For Gmail and Yahoo, a footer unsubscribe link by itself is no longer the full answer for bulk promotional mail.

The practical standard now is:

  • add List-Unsubscribe with an HTTPS unsubscribe URL
  • add List-Unsubscribe-Post: List-Unsubscribe=One-Click
  • DKIM-sign those headers
  • keep a visible unsubscribe link in the body
  • process the unsubscribe promptly and without extra friction

That is the version that matches RFC 8058, matches what Gmail actually expects, and lines up well with Yahoo's current sender guidance.

Previous PostNext Post