Automation · 8 min read · 2026-05-08
How to Automatically Delete All Emails From a Specific Domain
Build a custom query to automatically identify and delete all incoming or historical emails from a specific company or domain.
The Relentless Senders: Why Blocking One Address Fails
We have all dealt with companies, vendors, or marketing platforms that simply refuse to take a hint. You unsubscribe or click "Block Sender" on an email from news@marketing.company.com. Three days later, you receive another email from updates@offers.company.com, followed by a note from sarah@sales.company.com.
Modern marketing operations utilize automated sending rotation pools across multiple subdomains and email aliases. In fact, many modern cold outreach platforms intentionally rotate between 10 to 30 lookalike domain variations to evade spam filters and bypass individual sender blocks. Blocking a single specific email address is like playing digital whack-a-mole:
- Subdomain Sprawl: Senders rotate across
mail1.domain.com, mail2.domain.com, promo.domain.com. - Personalized SDR Outreach: Sales teams generate dozens of automated addresses (
john.d@domain.com, alex.m@domain.com). - Legacy Archives: Even if you block future emails, the 450 emails they already sent you over the past three years remain in your account, eating up storage space.
To eliminate an offending sender permanently, you must target the entire domain.
In this guide, we show you how to purge an entire domain in native Gmail and how to automate complete historical and future domain blocks using Smart Mailbox Cleaner.
The Manual Way: Finding and Deleting Domain-Wide Emails in Gmail
Gmail supports wildcard domain matching using the from: operator.
1. Constructing the Domain Wildcard Search
To locate every email sent from a specific company across all subdomains and aliases, use this syntax:
from:(*@company.com)
If the company uses multiple root domains or distinct brand names, chain them with the OR operator:
from:(*@company.com OR *@companydeals.com OR *@companymail.com)
2. Adding an Age Parameter for Safe Pruning
If you want to keep recent correspondence with a company while purging old newsletters and notifications, add an age filter:
from:(*@company.com) older_than:90d -is:starred
3. Executing the Manual Deletion
- Enter your domain search query into the search bar.
- Select the checkbox at the top-left of the message view.
- Click the blue banner: "Select all conversations that match this search".
- Click the Delete icon.
- If you want to reclaim storage quota immediately, empty your Gmail Trash.
4. Creating a Native Gmail Filter to Block Future Messages
To auto-delete future incoming messages from this domain:
- Click the filter icon on the right side of the search bar.
- In the From field, enter
*@company.com. - Click Create filter.
- Check "Delete it" and optionally check "Also apply filter to matching conversations".
- Click Create filter.
Drawbacks of the Native Approach
- Typo Danger: If you accidentally enter
@gmail.com or @google.com into a native auto-delete filter, Gmail will silently trash critical emails with no warning or safety guardrails. - No Label Preservation on Undo: If your filter erroneously catches messages you needed, recovering them from Trash dumps everything into your general inbox, destroying all labels.
- No Unsubscribe Request: Native filtering merely deletes the messages; the company's servers continue firing emails into your account daily, wasting network and server resources.
The Smart Way: Complete Domain Purges with Smart Mailbox Cleaner
Smart Mailbox Cleaner combines historical archiving, bulk unsubscribe requests, and automated deletion into a unified two-step workflow.
Step 1: Target the Domain in Custom Scan Builder
Open the Custom Scan Builder in your dashboard:
- In the Sender field, enter the domain format:
@company.com (or specific subdomains). - Set optional filters (e.g.,
Older than 30 Days, or leave blank to target all historical messages).
Step 2: Live Exact Metrics & Sender Distribution
Our engine queries your account metadata and displays:
- The exact count of emails originating from that domain across all aliases.
- The total storage space they consume.
- A list of every specific sending alias (
billing@company.com, marketing@company.com, promo@company.com).
Step 3: Dual Action: Purge and Unsubscribe
When you click Clean:
- Background Bulk Deletion: All historical emails from that domain are moved to Trash via official Google API calls.
- RFC-Compliant Unsubscribe: Our Newsletter Manager automatically sends official unsubscription requests to the company's mail handlers so they stop sending future messages.
Step 4: Schedule as an Auto-Delete Playbook
To ensure that any stragglers who ignore your unsubscribe request are immediately eliminated, click "Save as Playbook":
- Set the schedule: Run Daily at 6:00 AM.
Every morning, Smart Mailbox Cleaner runs a quick server check. If the domain sent any new emails overnight, they are automatically routed to the Trash before you even open your inbox.
Advanced Domain Scenarios: Subdomain Wildcards and Infrastructure Spam
Modern cold emailers and commercial platforms often send transactional and promotional messages from separate infrastructure. For instance:
orders@store.com vs discounts@mailer.store.comsupport@crm.io vs outreach@app-outbound.crm.io
When configuring your domain target in Smart Mailbox Cleaner, entering the root domain @store.com automatically includes all nested subdomains (*.store.com). If you wish to preserve transactional receipts while wiping only marketing subdomains, our Custom Scan Builder allows you to input exact subdomains such as @mailer.store.com. Furthermore, by pairing this scan with our Storage Growth Predictor, you can see how blocking a single high-volume domain will curb your inbox's storage expansion over the next 12 months.
Enterprise Management: Domain Admin Console
If you are a Google Workspace administrator managing email across an entire organization, rogue domain spam wastes company productivity and balloons storage tiers.
Using our Domain Admin Console:
- Super Admins can deploy automated Playbooks across organizational units (OUs).
- Blacklist aggressive sales domains company-wide.
- Allocate cleanup credits to employees to purge historical vendor archives without paying for Google Workspace tier upgrades.
What If You Accidentally Target the Wrong Domain?
The biggest fear when executing domain-wide purges is typing a wrong domain name.
Smart Mailbox Cleaner includes built-in safety protections:
- Protected System Domains: Our platform automatically blocks users from running broad domain deletions on critical infrastructure domains like
@google.com, @apple.com, @microsoft.com, or major national banks. - 30-Day Undo Log: If you purge a company domain and later realize you needed an archived contract, open your History Dashboard and click Undo. Our server pulls the exact batch of emails out of Trash and restores their original labels within seconds.
Metadata Privacy Guarantee
You never have to worry about our servers inspecting your sensitive correspondence:
We only access email metadata — sender, date, size, labels. We never read email content.
Take back control of your inbox and silence aggressive senders permanently. Clean up your first domain for free on Smart Mailbox Cleaner.
Related Reading
Frequently Asked Questions
How do I delete all past emails from an entire domain in Gmail without deleting one by one?
In Gmail search, enter "from:(*@domain.com)", select all conversations across all pages using the top checkbox link, and click Delete. In Smart Mailbox Cleaner, enter "@domain.com" in the Custom Scan Builder to see the exact count and purge them in one click.
What is the difference between blocking an email address and creating a domain-wide filter?
Blocking an email address only flags emails from that specific sender (e.g. news@domain.com). A domain-wide filter targets any email coming from that root domain, regardless of the prefix or subdomain used.
Can I target subdomains, such as emails coming from mail.example.com?
Yes. You can enter "@mail.example.com" to target only that specific sending subdomain, or enter "@example.com" to capture the root domain and all associated subdomains.
What if I accidentally delete all emails from a critical domain like google.com or my bank?
Smart Mailbox Cleaner maintains a protected whitelist of essential provider domains to prevent catastrophic accidental purges. In addition, our 30-Day Undo Log allows you to restore any deleted batch back to its original labels.
Does deleting emails from a domain also unsubscribe me from their mailing list?
Deleting emails only removes them from your inbox. To stop future delivery, use Smart Mailbox Cleaner's Newsletter Manager, which sends official unsubscribe requests while trashing historical messages.
Try Smart Mailbox Cleaner free →