App Logo
mail.google.com

Unsubscribe from a sender in Gmail

Automatically unsubscribe from a sender in Gmail on mail.google.com. Unsubscribe from a mailing list using Gmail's own unsubscribe control, which appears beside the sender on a message carrying a List-Unsubscribe header, in the chosen Google account. Returns the sender it acted on, whether the control was present, and whether Gmail confirmed the request. This leaves the mailing list for real and cannot be undone from Gmail: confirm the exact sender with the user before running, and note that approval for one sender does not carry over to another. The sender is checked against the one expected before anything is clicked. Senders with no unsubscribe control are reported rather than acted on, and the script never falls back to reporting spam. The run fails, doing nothing, if the requested account is not signed in.

Input

threadId required

A thread from the sender to unsubscribe from, as returned by mail.google.com/search_emails (its threadId field).

expectedSender required

The sender address the thread is expected to be from, asserted against the message before anything is clicked, so a stale thread id cannot unsubscribe you from the wrong list.

account optional

The Google account whose mail this is: its email address, or Gmail's account number in this browser (e.g. "2"). The run fails if that account is not signed in. Omit for the first signed-in account (u/0).

Output

sender required

The sender address read from the message, not echoed from the input.

threadId required
unsubscribed required

Whether the unsubscribe was confirmed to Gmail. False when the sender offers no control, or only an off-Gmail one (see requires_sender_website).

control_present required

Whether Gmail offered an unsubscribe control for this sender at all.

link_gone optional

Whether the unsubscribe control disappeared afterwards, which is Gmail's own signal that the request was accepted.

confirmation optional

Gmail's own wording, quoted for the record rather than matched against.

requires_sender_website optional

True when Gmail has no one-click unsubscribe for this sender and only offers to send you to the sender's own website. Nothing was clicked through: finishing an unsubscribe on a third-party site is the caller's decision.

FAQ

Unsubscribe from a mailing list using Gmail's own unsubscribe control, which appears beside the sender on a message carrying a List-Unsubscribe header, in the chosen Google account. Returns the sender it acted on, whether the control was present, and whether Gmail confirmed the request. This leaves the mailing list for real and cannot be undone from Gmail: confirm the exact sender with the user before running, and note that approval for one sender does not carry over to another. The sender is checked against the one expected before anything is clicked. Senders with no unsubscribe control are reported rather than acted on, and the script never falls back to reporting spam. The run fails, doing nothing, if the requested account is not signed in.
Ask an AI agent connected to Reduck to run reduck/mail.google.com/unsubscribe_from_sender, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mail.google.com/unsubscribe_from_sender
You do not need one. "Unsubscribe from a sender in Gmail" drives the real mail.google.com pages in a browser, so it works whether or not mail.google.com offers an API for this.
Required: threadId, expectedSender. Optional: account.
It returns sender, threadId, link_gone, confirmation, unsubscribed, control_present, requires_sender_website.
Yes. It acts as you on mail.google.com: on your own Chrome it reuses your session, and on a Reduck-hosted browser it loads the mail.google.com cookies saved by the Reduck extension.
It makes changes on mail.google.com, like sending, posting, booking or buying something.
Ask an AI agent connected to Reduck to run reduck/mail.google.com/unsubscribe_from_sender, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mail.google.com/unsubscribe_from_sender
It is part of Reduck's official curated catalogue.

Start building not clicking