Let AI help you organize your emails intelligently.
β οΈ Not yet in Thunderbird Add-on Store - Manual installation required. Official store submission in progress.
π₯ Download β’ π Documentation β’ π Report Bug β’ π‘ Request Feature
- β¨ Features
- π₯ Installation
- π Quick Start
- βοΈ AI Provider Setup
- π‘ Usage
- π§ Technical Details
β οΈ Troubleshooting- π Changelog
- π€ Contributing
|
Choose from 5 leading cloud AI providers or run a local Ollama model:
|
|
|
|
π₯ Additional Features
- β Secure Storage - Encrypted API key storage
- β Batch Processing - Sort many emails in parallel with a live progress panel (cancel / retry failed)
- β Bulk Key Import - Add many Gemini keys at once with duplicate detection
- β Toolbar Popup - Quick API usage summary with shortcuts to Settings and Batch Panel
- β Dark Mode - Full dark-theme support across all screens
- β Rate Limiting - Built-in quota management (Gemini)
- β Professional UI - Clean, intuitive interface
- β Move History - Track all email movements
- β Real-time Validation - Instant feedback
- β Open Source - Transparent, auditable code
1. Visit: https://github.com/Nigel1992/AutoSort-Plus/releases 2. Download: autosortplus.xpi 3. Thunderbird: Tools β Add-ons and Extensions 4. Click: βοΈ β Install Add-on From File 5. Select: autosortplus.xpi 6. Restart Thunderbird
git clone https://github.com/Nigel1992/AutoSort-Plus.git
cd AutoSort-Plus
zip -r autosortplus.xpi manifest.json background.js options.js options.html styles.css content.js icons/Open settings and select from Gemini, OpenAI, Claude, Groq, Mistral, or Ollama (Local LLM)
Click "Get API Key" button β Create free account β Copy key. For Ollama (local): install Ollama from https://ollama.ai/download and pull a model (e.g., ollama pull llama3.2). No API key required for Ollama.
Load folders from IMAP or add custom labels
Option 1: AI-Powered Sorting
- Select emails β Right-click β AutoSort+ β Batch Analyze with AI
- The AI will analyze and move emails to the best folder/category.
Option 2: Manual Labeling
- Select emails β Right-click β AutoSort+ β AutoSort Label β [Pick any label]
- The selected label/category will be applied instantly to all selected emails.
β οΈ Warning: If you add or change labels in the settings menu, you must restart Thunderbird for the new labels to appear in the right-click menu.
π Note: Currently requires manual selection and right-click. Automatic background sorting coming in future update!
| Provider | Get API Key | Free Tier | Best For |
|---|---|---|---|
| πΉ Gemini | Get Key | β 20/day per key | Best overall free option |
| πΉ Groq | Get Key | β 30/min | Speed & high limits |
| πΉ Claude | Get Key | β Limited | Privacy & safety |
| πΉ OpenAI | Get Key | Highest accuracy | |
| πΉ Mistral | Get Key | β Limited | GDPR compliance |
| πΉ Ollama | Install Ollama | β Local (no external usage) | Run local LLMs (llama3.2, tinyllama, phi, gemma). No API keys required; supports model downloads and CPU-only mode. |
β οΈ IMPORTANT: Free tiers are limited for email processing due to large text content.
| Provider | Free Limit | Recommendation |
|---|---|---|
| Gemini | 20 emails/day per API key | β Create multiple keys in different projects |
| Groq | 20-30 emails/day | β Best free tier overall |
| Claude | 10-15 emails/day | Good for privacy-conscious users |
| OpenAI | 5-10 emails/day | Consider paid plan ($5-20/mo) |
| Mistral | 10-15 emails/day | Best for EU users |
π‘ Tips for Managing Free Tier Limits
For Gemini users (NEW in v1.2.1!):
- π Multiple API Keys: Add keys from different Google Cloud projects
- π Automatic Rotation: Extension switches keys when limits are reached
- π Per-Key Tracking: Monitor usage for each key independently
- β¨ Example: 5 keys = 100 requests/day total (20 per key)
- π§ How to add: Settings β Add Another Gemini Key
- Check usage: AI Studio Usage
For all providers:
- Process emails in small batches
- Use "Gemini paid plan" checkbox to disable limits (if you have paid tier)
- Consider paid plans for daily use ($5-20/month)
- Select Emails - Click one or more emails in Thunderbird
- Right-Click Menu - Right-click β AutoSort+ β Batch Analyze with AI
- Smart Sorting - A Batch Panel tab opens with a live progress bar; the AI analyzes and moves each email to the appropriate folder. You can Cancel at any time, or Retry Failed emails when it finishes
- Track History - View last 100 moves in settings
π Coming Soon: Automatic background sorting (currently manual via right-click)
οΏ½ Multiple API Keys (Gemini)
- Add unlimited keys from different projects
- Bulk import many keys at once (one per line) with duplicate detection
- Automatic rotation when limits reached
- Individual testing and status tracking
- Visual indicators (Active, Ready, Near Limit)
- Combined quota = keys Γ 20 requests/day
π Usage Monitoring (Gemini)
- Real-time usage display in settings
- Per-key usage statistics
- Automatic warnings at 15/20 limit
- Smart key rotation
π Folder Management
- Load folders from IMAP accounts
- Bulk import from text list
- Create custom categories
- Auto-create missing folders
π Move History
- Last 100 email moves
- Timestamps and destinations
- Success/failure status
- Clear history option
ποΈ Batch Processing
- Right-click β Batch Analyze with AI to sort many emails
- Live progress panel with per-email results
- Parallel analysis β Parallel batch size is configurable (1β20) in Settings
- Cancel anytime, or retry only the failed emails
You can also manually label emails without AI analysis:
- Select Emails - Click one or more emails in Thunderbird.
- Right-Click Menu - Right-click β AutoSort+ β AutoSort Label β [Pick any label]
- Label Applied - The selected label/category will be applied to all selected emails instantly.
Note: If you add or change labels in the settings menu, you must restart Thunderbird for the new labels to appear in the right-click menu.
π Example Folder Categories
Work & Professional:
- Meetings
- Project Updates
- Invoices
- HR & Benefits
Financial:
- Bills & Payments
- Bank Statements
- Receipts
- Tax Documents
Personal:
- Family
- Friends
- Health
- Travel
Online Services:
- Shopping Confirmations
- Social Media Notifications
- Subscriptions
- Password Resets
Promotions:
- Newsletters
- Sales & Discounts
- Offers
- Marketing
Support:
- Tickets & Help
- Documentation
- Updates
- Complaints
βββββββββββββββββββββββββββββββββββββββββββ
β Thunderbird Email Client β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββββββ
β AutoSort+ Extension β
β β
β ββββββββββββ ββββββββββββ β
β β UI Layer β β Backgroundβ β
β β(options) ββββ€ Script β β
β ββββββββββββ βββββββ¬ββββββ β
β β β
β βββββββββΌβββββββββ β
β β Rate Limiter β β
β β (Gemini only) β β
β βββββββββ¬βββββββββ β
ββββββββββββββββββββββββΌββββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
β β
ββββββΌβββββ ββββββββββ βββββββΌββββββ
β Gemini β β Groq β β Claude β
β API β β API β β API β
βββββββββββ ββββββββββ βββββββββββββ
| File | Purpose | Key Functions |
|---|---|---|
background.js |
AI analysis engine | analyzeEmailContent(), rate limiting |
options.js |
Settings UI | Provider config, usage display |
content.js |
Email extraction | Message content parsing |
manifest.json |
Extension config | Permissions, metadata |
{ // User Configuration apiKey: "string", aiProvider: "gemini|openai|anthropic|groq|mistral", labels: ["Work", "Personal", ...], enableAi: boolean, geminiPaidPlan: boolean, geminiModel: "string", // e.g. "gemini-3.5-flash-lite" providerModel: "string", // optional model override for non-Gemini providers // Rate Limiting (Gemini) geminiRateLimit: { requests: [timestamp, ...], dailyCount: number, dailyResetTime: timestamp }, // History moveHistory: [ { timestamp: string, subject: string, status: string, destination: string }, ... ] }
| Feature | Status | Details |
|---|---|---|
| π API Key Storage | β Encrypted | OS-level encryption via browser storage |
| π§ Email Content | β Not Stored | Analyzed in memory, never persisted |
| π Data Transmission | β Direct to AI | No intermediary servers |
| π Telemetry | β None | Zero tracking or analytics |
| π Open Source | β Auditable | Full transparency |
| π‘οΈ Permissions | β Minimal | Only required APIs |
Your privacy matters: All email analysis happens directly between your Thunderbird and chosen AI provider. No data passes through our servers because we don't have any!
π§ Settings Page Won't Load
1. Thunderbird β Settings β Privacy β Cookies and Site Data
2. Click "Clear Data"
3. Tools β Add-ons β AutoSort+ β Reloadπ API Key Not Working
- Verify key is copied correctly (no spaces)
- Click "Test API Connection" button
- Check key is from correct provider
- Ensure API key has proper permissions
- For Gemini: Check usage page
β Email Analysis Fails
Check:
- β Internet connection active
- β API key is valid
- β Provider status page for outages
- β Rate limits not exceeded
- β Email content isn't empty
For Gemini users:
- Check usage counter in settings
- Verify daily limit not reached (20/day)
- Switch to new API key if needed
π Wrong Labels Applied
- Ensure labels are case-sensitive matches
- Avoid special characters in folder names
- Verify labels are saved (green checkmark)
- Check move history for patterns
β±οΈ Rate Limit Errors
Gemini (20/day per key):
- Create new API key in different project
- Reset counter after switching keys
- Enable "paid plan" option if you have one
Other Providers:
- Wait for rate limit window to reset
- Consider upgrading to paid tier
- Use provider's usage dashboard
| Component | Requirement |
|---|---|
| Thunderbird | 78.0 or later |
| Internet | Active connection for API calls |
| API Key | Valid key from chosen provider |
| Storage | ~1MB for extension data |
| OS | Windows, macOS, Linux |
- β Gemini 429 responses now honor Google's retry delay and retry up to five times; failed API responses don't increment local usage counters
- β
Increased Gemini output-token budget and preserve returned label text when a response reaches
MAX_TOKENS - β Gemini usage counters refresh automatically every 10 seconds; Settings has a live per-key countdown and optional reset notifications
- β Each key's 24-hour countdown starts only when that key reaches the add-on's 20-request cap; other keys have independent counters and countdowns
- β Parallel requests reserve each key's remaining daily slots before sending, so concurrent batches cannot push the counter above 20/20; failed requests release their reservations
- β Test all Gemini keys sequentially, reveal/hide keys individually, and remove keys from usage cards immediately
- β Optional longer, more audible completion chime after batch sorting finishes
π New Features
- β Batch progress panel - "Batch Analyze with AI" opens a dedicated panel with a live progress bar, per-email results (sorted / skipped / failed), running counts, and live per-key API usage cards. Includes Cancel and Retry Failed only controls, and re-syncs automatically if you reopen the tab
- β Parallel batch processing - Emails are analyzed concurrently in chunks (5 at a time by default, configurable 1β20 in Settings β General Settings) so large batches finish much faster, with per-key usage counting kept correct
- β Bulk import Gemini API keys - Paste many keys at once (one per line) into Settings β Multiple Gemini API Keys β Bulk Import with duplicate detection, instead of adding them one at a time
- β Toolbar popup - Click the AutoSort+ toolbar icon for an at-a-glance API usage summary (aggregated across all Gemini keys) with quick buttons to open Settings and the Batch Panel
- β Dark mode - Full dark-theme support across Settings, the popup, and the Batch Panel (follows your OS/Thunderbird color scheme)
π Bug Fixes
- β Accurate AI call counting - One email now uses exactly one API request; retries no longer re-analyze the same email (previously batches could over-consume quota)
- β More reliable email content extraction - HTML bodies are now properly converted to text (the conversion is awaited) and messages without MIME parts are handled, so fewer emails are skipped
- β
Fixed
rateLimit is undefined- Per-key Gemini usage is now normalized with safe defaults - β Fixed usage race condition - Concurrent requests could clobber the per-key daily counter; a lock now serializes reads/writes so batch usage is counted correctly
I build this project in my free time and don't need donations for myself. If you'd like to give something back, I'd kindly ask you to donate to a charity of your choice instead β they need it far more than I do. If you still prefer to support me directly in private, thank you so much; it's genuinely appreciated, and I'll be happy to list you as a donor on GitHub and, where applicable, in a donors section of the project, as a small thank you.