Collects as they arrive, acts daily
Collect unsubscribes and bounces for your list
Unsubscribe requests and bounced emails are labelled, and you get the addresses once a day to clean your list.
- Runs
- Collects as they arrive, acts daily
- Apps
- Gmail
- AI
- Not needed
- Access
- read+write (gmail.modify)
Send this to your assistant
Create a ClickRuntime automation: every hour, find unsubscribe requests and bounce messages in my inbox and label them. Once a day, email me the addresses.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
If you send newsletters or cold outreach from Gmail, the replies include two kinds of mail that quietly damage your reputation if ignored: people asking to be removed and delivery failure notices from addresses that no longer exist. Left in the inbox, you email the same unhappy person again, and repeated bounces teach providers to treat your domain as a spammer, so real messages land in junk.
As messages arrive, searches look for bounce and unsubscribe patterns, addresses are pulled out of them and a label is applied in Gmail. Once a day you receive a single email listing the addresses collected, ready to remove from your mailing list or spreadsheet in one go.
Small marketers, consultants running outreach and anyone who sends from their own mailbox rather than a dedicated platform will find it useful.
What you get out of it
Your sender reputation is protected
Removing bad addresses promptly lowers your bounce rate, which is one of the main signals providers use to decide whether your mail goes to the inbox or to spam. Deliverability is hard to repair once it has been damaged.
People who opted out stay opted out
Emailing someone again after they asked to stop causes complaints and can break privacy rules, so a reliable list of requests is simple protection. Respecting requests is also simply good practice.
Cleanup takes minutes
A daily list of addresses to remove replaces scrolling through hundreds of automatic replies, which is the kind of chore most senders skip until a problem appears. Regular upkeep beats a rare and painful purge.
Everything is labeled for your reference
Labels in Gmail group the bounce and unsubscribe messages, so you can audit what was received if a recipient later disputes that they asked to be removed. Records matter when a complaint arrives weeks later.
The inbox stays usable
Moving the noise under labels keeps real replies from customers and prospects visible, so genuine conversations are not hidden behind failure notices. Real customer replies become easier to notice and answer promptly.
How it works
What happens, step by step
Every hour ClickRuntime searches your Gmail for unsubscribe requests and bounced-email notices.
It pulls out the email addresses involved and labels the messages so they aren't counted twice.
Once a day you get an email listing every address that unsubscribed or bounced, ready to remove from your mailing list.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Gmail steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import re
from datetime import datetime
from zoneinfo import ZoneInfo
from clickruntime import on_trigger, credentials, state, notify
QUERY = 'newer_than:1d (subject:unsubscribe OR from:mailer-daemon OR subject:"delivery status notification")'
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.]+")
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
labels = {l["name"]: l["id"] for l in gmail.users().labels().list(userId="me").execute()["labels"]}
label = labels.get("Unsub-Bounce") or gmail.users().labels().create(userId="me", body={"name": "Unsub-Bounce"}).execute()["id"]
pending = set(state.get("pending") or [])
msgs = gmail.users().messages().list(userId="me", q=QUERY + " -label:Unsub-Bounce").execute().get("messages", [])
for m in msgs:
msg = gmail.users().messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From"]).execute()
sender = next(h["value"] for h in msg["payload"]["headers"] if h["name"] == "From")
source = msg["snippet"] if "mailer-daemon" in sender.lower() else sender
pending.update(a.lower() for a in EMAIL.findall(source) if "mailer-daemon" not in a.lower())
gmail.users().messages().modify(userId="me", id=m["id"], body={"addLabelIds": [label]}).execute()
if datetime.now(ZoneInfo("Europe/London")).hour == 17 and pending: # once a day
notify.email_me(f"{len(pending)} unsubscribes and bounces", "\n".join(sorted(pending)))
pending = set()
state.set("pending", sorted(pending))
return {"labelled": len(msgs)}FAQ
Common questions
What counts as an unsubscribe request?
How are bounces recognized?
Does it remove people from my mailing list?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a weekly list of invoices from your inbox
Each week you get the vendor, amount and due date of every invoice and receipt that arrived by email.
See how it worksClean up your inbox every night
Old promotions, social mail and spam go to trash and read mail is archived, so your inbox only holds what's current.
See how it worksGet pinged when an important email arrives
Emails from the people or companies you care about are flagged within minutes, with sender, subject and a link.
See how it worksKeep exploring
Set up “Collect unsubscribes and bounces for your list” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.