List-Unsubscribe and List-Unsubscribe-Post headers. When the sender supports RFC 8058 one-click unsubscribe over https, the server sends the request itself.
Call it only after the user has said yes for that sender. The request goes to the sender and cannot be taken back, so the tool is annotated outward destructive. To stop seeing a sender’s mail without telling them, use archive_emails or create_mail_rule instead.
Parameters
Only for mail tagged
notification (GitHub, Jira and similar): set true once the user has confirmed that muting what the link covers is what they want. Without it, the tool refuses such mail and explains why.Example
Call
Result
What happens, by what the message offers
What the result claims
- “Request accepted”, never “unsubscribed”. A 2xx answer only means the sender’s endpoint took the request: in testing, two of five senders answered with an empty body. The result shows the HTTP status and a response excerpt of up to 200 characters.
- A non-2xx answer or a network error is reported as such, together with the link and any
mailto:address so the user can unsubscribe by hand. - Scope. A link that looks like “unsubscribe from all” (
unsubscribe-alland similar) is flagged: it may stop all marketing mail from the sender, not only this list. - Which address. The result names the address this copy was delivered to (the newest
Delivered-Toheader, or a singleTorecipient). A sender that mails several of the user’s addresses needs one call per address; find the other copies withsearch_emails. - Redirects. At most three are followed. When the sender redirects after receiving the POST and the redirect is refused, the result says the request reached the sender and that the outcome is unknown.
Safety
- Junk is refused. Unsubscribing from spam confirms to the sender that the address is read. Use
move_emailsfirst if the user says the message is not spam. - Notification mail needs confirmation. On GitHub, Jira and other notification mail, the link may mute a single thread, or more than the user expects. The tool refuses without
confirmNotification: true. - No internal addresses. The request is only ever made to
httpsURLs on public addresses. The address check runs at connect time, on every redirect hop, and on IP literals, so a link cannot reach a private, loopback, link-local or cloud-metadata address. - Bounded. Each request has a 10-second deadline and reads at most 16 KB of the response. Errors name a reason (timeout, connection failed, TLS), never the address that was dialled.
Errors
Email not found: <id>. Nothing was sent. Use search_emails or get_thread to find the message id.This message is in Junk. Nothing was sent: …This message is a notification (GitHub, Jira and similar), not a newsletter. Nothing was sent. …Nothing was sent: <host> resolves to a private or internal address.— the one-click link points at a private, loopback, link-local or cloud-metadata address.