Google, Microsoft Clean — Self-hosted tool that scans your inbox, classifies emails, and lets you mass-unsubscribe, bulk-delete, and export — without ever sharing your data.
v2.0 — Now with Multi-Account support, Inbox Health Score, and Sender Insights.
Services like Unroll.me and Clean Email promise inbox cleanup — but at a hidden cost. They read and sell your email data, harvest purchase receipts, and build ad profiles from your private messages.
GMClean is the zero-knowledge alternative.
- 🚫 No cloud database — your data never leaves your machine
- 🚫 No email bodies — only headers are scanned (subject, sender, List-Unsubscribe)
- 🚫 No telemetry — zero tracking, zero analytics, zero data collection
- ✅ 100% self-hosted — runs entirely on your computer
- ✅ Open source — audit every line of code yourself
| Feature | Description | |
|---|---|---|
| 🔒 | Privacy-First Scanning | Headers-only analysis — email bodies are never downloaded |
| 👥 | Multi-Account | Connect up to 10 mailboxes (Gmail, Outlook, custom IMAP) simultaneously |
| 📊 | Inbox Health Score | 0-100 hygiene score with 5 weighted factors and actionable recommendations |
| 📈 | Sender Insights | Trend arrows, frequency, and last activity for every top sender |
| 📅 | Email Age Distribution | Color-coded age breakdown to identify cleanup opportunities |
| 📊 | Inbox Analytics | Interactive donut charts, top senders, newsletter-to-personal ratio |
| 📁 | Multi-Folder Scanning | INBOX, Spam, Promotions, Trash — any IMAP folder |
| ☑️ | Multi-Select & Bulk Actions | Select individual senders or Select All with a floating action bar |
| ✉️ | One-Click Unsubscribe | RFC 8058 compliant List-Unsubscribe-Post support |
| 🚫 | Bulk Unsubscribe | Unsubscribe from multiple senders at once with progress tracking |
| 🗑️ | Bulk Delete | Mass-delete emails by sender — batched for safety (500/batch) |
| 📤 | Export Subscriptions | Export selected senders to CSV with resubscribe links |
| 📥 | Full Email Export | Export all scanned emails to CSV for offline review |
| 🤖 | AI Smart Boost | Optional Gemini-powered classification for edge cases |
| 🛡️ | Unsubscribe Tracking | Detects senders who ignore your unsubscribe request |
| ⚡ | Quick Clean | One-click cleanup of stale senders from Health Score recommendations |
| 🔑 | Flexible Auth | App Password + OAuth2 (Google, Microsoft) |
| 📱 | Responsive Design | Fully functional on desktop, tablet, and mobile |
| 💾 | 100% Local Storage | All data stored in IndexedDB — nothing in the cloud |
git clone https://github.com/h-khalid-h/GMClean.git
cd GMClean
npm install
cp .env.example .env.local
# Edit .env.local with your ENCRYPTION_SECRET
npm run devdocker run -p 3000:3000 \
-e ENCRYPTION_SECRET=$(openssl rand -base64 32) \
ghcr.io/h-khalid-h/gmclean:latestgit clone https://github.com/h-khalid-h/GMClean.git
cd GMClean
cp .env.example .env.local
# Edit .env.local with your ENCRYPTION_SECRET
docker compose up -dCopy .env.example to .env.local and configure:
| Variable | Required | Description |
|---|---|---|
ENCRYPTION_SECRET |
✅ Yes | AES-256 key for credential encryption. Generate with openssl rand -base64 32 |
GOOGLE_CLIENT_ID |
Optional | Google OAuth2 client ID for one-click Gmail login |
GOOGLE_CLIENT_SECRET |
Optional | Google OAuth2 client secret |
MICROSOFT_CLIENT_ID |
Optional | Microsoft OAuth2 client ID for Outlook login |
MICROSOFT_CLIENT_SECRET |
Optional | Microsoft OAuth2 client secret |
For quick setup without OAuth, use an App Password:
- Gmail: Google App Passwords (requires 2FA enabled)
- Outlook: Microsoft App Passwords
- Yahoo: Yahoo App Passwords
- Any IMAP server: Use your mail provider's documentation
flowchart LR
A[📧 Your Mailbox] -->|IMAP Connection| B[🔐 GMClean Server]
B -->|Fetch Headers Only| C[📋 Subject / Sender / List-Unsubscribe]
C -->|Classify| D{Heuristics + AI}
D -->|Newsletter| E[📊 Dashboard]
D -->|Personal| F[Ignored]
E -->|User Action| G[✉️ Unsubscribe / 🗑️ Delete]
G -->|IMAP Commands| A
- Connect via IMAP using an App Password or OAuth2 (up to 10 accounts)
- Fetch email headers only — subject, sender,
List-Unsubscribe(NO body content) - Classify using heuristic rules + optional Gemini AI for ambiguous cases
- Score your inbox health across 5 hygiene factors (0-100)
- Store results locally in IndexedDB (your browser, your machine)
- Act — multi-select senders, bulk-unsubscribe, bulk-delete, or export to CSV
- Switch between accounts instantly from the sidebar
Your email content is NEVER downloaded. Period.
- 📨 Only email headers are fetched — subject line, sender address, and unsubscribe links
- 🔐 Credentials are encrypted with AES-256-CBC before storage
- 💻 Zero cloud dependencies — the entire app runs on your machine
- 🚫 No telemetry, no tracking cookies, no analytics scripts
- 🗄️ All data lives in your browser's IndexedDB — clear it anytime
- 📖 Fully open source — audit the code yourself
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| UI | React 19 |
| IMAP Client | ImapFlow |
| Local Storage | Dexie.js (IndexedDB wrapper) |
| Icons | Lucide React |
| Styling | Pure CSS (no Tailwind) |
| Language | TypeScript 5 |
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Please make sure your code:
- Passes
npm run lintwith no errors - Follows the existing code style
- Includes appropriate comments for complex logic
This project is licensed under the MIT License — see the LICENSE file for details.
Built with ❤️ for people who value their privacy.