How to Automatically Archive Cold Emails in Gmail
Cold emails are the fastest-growing category of unwanted email in 2026. AI outreach tools have made it trivially cheap to send thousands of personalised messages per day, and Gmail's spam filter — built for a different era of email abuse — lets most of them through. The result: your inbox fills up with messages from strangers who scraped your LinkedIn and generated a pitch in milliseconds.
This guide covers three progressively more effective methods to automatically archive cold emails in Gmail, from free built-in tools to a fully automated sender verification system. Each method has trade-offs in terms of setup time, maintenance, and effectiveness. By the end, you'll know which approach fits your situation.
Method 1: Gmail's Native Filters
Gmail includes a built-in filtering system that can automatically archive, label, or delete incoming email based on rules you define. It's free, requires no external tools, and works immediately. For many people, this is the right starting point.
How to set up a cold email filter
- Open Gmail and click the search bar's filter icon (the small slider icon on the right side of the search box).
- In the filter creation dialog, you can filter by sender address, subject line, keywords, or whether the email includes certain phrases.
- For cold email, try filtering by common phrases. Enter terms like "quick question", "saw your profile", "reaching out because", "love to connect", "15 minutes", or "book a call" in the "Has the words" field. Separate multiple terms with OR.
- Click "Create filter" and select "Skip the Inbox (Archive it)" and optionally "Apply the label" (e.g., "Cold Outreach") so you can review them later.
- Check "Also apply filter to matching conversations" to retroactively archive existing cold emails.
Advanced filter combinations
Gmail's filters support the minus operator to exclude known contacts. For example:
- from:(-@yourcompany.com -@clientdomain.com) combined with cold-email keywords targets messages from outside your known network.
- is:unread newer_than:1d -from:me -in:sent in a saved search helps you review recent inbound mail from unfamiliar senders.
- You can create multiple filters for different patterns — one for "book a call" phrases, another for "partnership opportunity" language, another for common cold email sign-off patterns.
Limitations of native filters
Gmail filters are keyword-based, which makes them a blunt instrument against AI-generated cold email. Modern outreach tools deliberately vary their language, avoid common trigger phrases, and use personalised openers that don't match static keyword patterns. You'll catch some cold emails, but the sophisticated ones will sail through.
Additionally, keyword filters inevitably create false positives. A legitimate contact who writes "I'd love to connect" or "do you have 15 minutes?" will get archived alongside the cold outreach. There's no way to distinguish intent from vocabulary alone.
Native filters work best as a first layer of defence — catching the laziest cold emails — but they won't solve the problem for anyone receiving high volumes of AI-personalised outreach.
Method 2: Google Apps Script Automation
For users comfortable with a small amount of code, Google Apps Script offers significantly more power than native filters. Apps Script runs server-side on Google's infrastructure, can access your Gmail data programmatically, and can be scheduled to run at regular intervals.
What you can build
A Google Apps Script can:
- Check incoming emails against a whitelist of known sender addresses and domains
- Automatically archive emails from any sender not on your whitelist
- Label archived emails for easy batch review
- Auto-generate your whitelist from your sent mail history (anyone you've emailed is likely legitimate)
- Run on a schedule — every 5 minutes, every hour, or on-demand
Basic implementation outline
- Go to script.google.com and create a new project.
- Use the GmailApp service to access your inbox. The
GmailApp.getInboxThreads()method returns all current inbox threads. - Build a whitelist by scanning your sent messages:
GmailApp.search('in:sent')returns threads you've participated in. Extract unique sender domains and addresses. - For each inbox thread, check whether the sender's address or domain appears in your whitelist. If not, archive the thread using
thread.moveToArchive()and optionally apply a label. - Set up a time-driven trigger (Edit > Triggers > Add Trigger) to run the script every 5 or 10 minutes.
Example pseudocode
A simplified version of the core logic looks like this:
- Scan sent mail to build a Set of trusted email addresses and domains
- For each thread in the inbox, extract the sender address from the most recent message
- If the sender's address is not in the trusted set, and the sender's domain is not in the trusted set, archive the thread and apply a "Review" label
- Log the action for debugging
Limitations of Google Apps Script
This approach is more effective than native filters because it operates on sender identity rather than content. But it has meaningful drawbacks:
- No verification mechanism: Archived senders have no way to prove they're legitimate. You must manually review the "Review" label to catch genuine first-time contacts.
- Execution quotas: Google Apps Script has daily execution limits (6 minutes per execution for free accounts, 90 minutes total per day). High-volume inboxes may hit these limits.
- Latency: Scripts run on a schedule, not in real-time. A cold email might sit in your inbox for 5-10 minutes before being archived.
- Maintenance burden: You need to maintain the script yourself. Gmail API changes, edge cases with forwarded mail or mailing lists, and whitelist updates all require manual attention.
- No auto-reply: The script archives cold emails silently. Legitimate first-time contacts have no indication that their email was deprioritised or how to get through to you.
For technically inclined users who want a free solution and don't mind some manual maintenance, Google Apps Script is a solid middle ground. But it leaves the most important problem unsolved: distinguishing genuine first-time contacts from cold outreach.
Method 3: Automated Sender Verification (Most Effective)
The most effective approach to automatically archiving cold emails combines identity-based filtering with a verification mechanism that lets legitimate senders prove themselves. This is the challenge-response model — the same principle that CAPTCHAs use on websites, applied to your inbox.
How sender verification works
- Connect your Gmail account via OAuth. The system requests only the permissions needed to read, archive, and reply to email.
- Build an automatic whitelist by scanning your sent mail history. Anyone you've emailed before is trusted. Trusted transactional domains (banks, SaaS tools, payment providers) are included by default.
- Enable real-time monitoring. Gmail's Pub/Sub API provides near-instant notification when new mail arrives — no polling delays.
- Unknown senders are automatically archived and receive an auto-reply explaining that you use inbox protection. The reply includes a verification link.
- The sender completes a quick CAPTCHA (typically Cloudflare Turnstile — a single checkbox for humans, impossible for bots at scale).
- Upon verification, their original email is unarchived and appears in your inbox. The sender is permanently added to your whitelist.
Why this stops cold email specifically
The economics are what make this approach work against cold outreach. An AI tool sending 10,000 cold emails per day cannot complete 10,000 individual CAPTCHA challenges. Even if CAPTCHA-solving services are used, the cost per solve ($0.002-$0.01) multiplied by volume makes mass outreach unprofitable. A human sending a genuine email takes 30 seconds to verify once.
This is fundamentally different from content-based filtering. It doesn't matter how well-written the cold email is, how personalised the opener, or how clean the sending domain. The filter is economic, not linguistic.
Comparison: Three Methods Side by Side
| Feature | Gmail Native Filters | Google Apps Script | Sender Verification |
|---|---|---|---|
| Setup time | 5 minutes | 30-60 minutes | 5 minutes |
| Cost | Free | Free | Free or paid (varies by tool) |
| Catches basic cold email | Some | Most | All |
| Catches AI-personalised cold email | Rarely | Most (sender-based) | All (sender-based + verification) |
| False positives (real email archived) | Moderate | Low-moderate | Very low (sender can verify) |
| Legitimate sender recovery | None (must find manually) | Manual review of label | Automatic (sender verifies themselves) |
| Real-time processing | Yes | No (5-10 min delay) | Yes (Pub/Sub API) |
| Maintenance required | Ongoing keyword updates | Script maintenance + whitelist | Minimal (self-maintaining whitelist) |
| Works against future cold email tactics | No (keyword-dependent) | Partially | Yes (content-agnostic) |
Which Method Should You Choose?
The right method depends on your cold email volume and how much time you're willing to invest:
- Low volume (a few cold emails per week): Gmail's native filters are probably sufficient. Create a few keyword-based filters and revisit them monthly.
- Moderate volume (5-15 cold emails per day): A Google Apps Script with a sent-mail-based whitelist will catch most of the noise. Plan to spend 30 minutes setting it up and 10 minutes per month maintaining it.
- High volume (15+ cold emails per day): Sender verification is the only approach that scales. The self-service verification mechanism means you don't need to manually review archived mail, and the whitelist grows automatically over time.
Many people start with native filters, realise the problem is bigger than keyword matching can solve, move to a script-based approach, and eventually adopt sender verification when the maintenance burden becomes too high. Each step is a meaningful improvement.
Tips for Any Approach
Regardless of which method you choose, a few practices make cold email archiving more effective:
- Never delete cold emails outright. Archive them. Occasionally, a legitimate contact gets caught, and you want the ability to find their message.
- Use labels for review. Whether you're using native filters, a script, or a verification tool, label archived cold emails so you can batch-review them weekly if needed.
- Maintain your whitelist. When you send an email to a new contact, make sure they're added to your trusted list. Most automated systems handle this, but if you're using native filters, you'll need to update manually.
- Combine with Gmail's built-in spam filter. None of these methods replace Gmail's spam filter — they complement it. Gmail catches the obvious spam; your archiving system handles the sophisticated cold outreach that Gmail misses.
Frequently Asked Questions
Will archiving cold emails affect my Gmail storage?
Archived emails still count toward your Google storage quota, but cold emails are typically small (text-only, no attachments). Even at 20 cold emails per day, the storage impact is negligible — a few megabytes per year at most. If storage becomes a concern, you can periodically delete older archived cold emails from the label you've assigned them.
Can cold email senders tell that their email was archived?
No. Archiving in Gmail simply removes the email from your inbox view. The sender receives no bounce notification or delivery failure. From their perspective, the email was delivered successfully. If you're using a sender verification tool that sends an auto-reply, the sender will know their email was deprioritised — but this is intentional and gives them a path to verify.
What about cold emails that come from someone at a company I know?
This is a common edge case. You might have a relationship with Company X, but a different person at Company X sends you a cold sales email. If your whitelist is domain-based, they'll get through. If it's address-based, they won't. The best approach depends on context: for small companies where you know everyone, domain-based whitelisting works. For large enterprises, address-based is more precise.
Is auto-archiving cold emails compliant with email regulations like CAN-SPAM or GDPR?
Yes. Auto-archiving is an action taken on your own inbox — you're not modifying or interfering with the sender's email delivery. The email is delivered to your account; you're simply choosing not to display it in your primary inbox view. This is functionally identical to manually archiving an email, just automated. No email regulation requires you to read or act on email you receive.
Email Verification for Founders: Why VCs and Investors Still Get Through
Older →We Analysed 10,000 Cold Emails. Here's What We Found.
Ready to stop AI spam from reaching your inbox?
Captchainbox protects your Gmail from AI-generated cold email. 5-minute setup, no ongoing maintenance.
Join the waitlist