Skip to content

AI-powered Thunderbird addon that automatically sorts emails into your custom folders/categories using AI. Fully customizable with your own folder structure and categories.

License

Notifications You must be signed in to change notification settings

Nigel1992/AutoSort-Plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ko-fi

Support this project! All donations go towards your chosen charity. You can pick any charity you'd like, and 5% is retained due to Ko-Fi fees. As a thank you, your name will be listed as a supporter/donor in this project. Feel free to email me at thedjskywalker@gmail.com for proof! :)

🎯 AutoSort+

AI-Powered Email Organization for Thunderbird

AutoSort+ Logo

License: MIT Version Thunderbird Development Status

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


πŸ“Œ Table of Contents



✨ Features

πŸ€– Multi-Provider AI

Choose from 5 leading AI providers:

  • Google Gemini - Best free tier + Multi-key support
  • OpenAI - Superior accuracy
  • Anthropic Claude - Privacy-focused
  • Groq - Fastest processing
  • Mistral AI - GDPR compliant

πŸ”‘ Multiple API Keys (Gemini)

  • Add keys from multiple projects
  • Automatic rotation on limit
  • Per-key usage tracking
  • 5 keys = 100 requests/day

πŸ“ Smart Folder Management

  • IMAP folder auto-discovery
  • Bulk label import
  • Custom folder creation
  • Recursive traversal

🎯 Intelligent Classification

  • Content analysis
  • Context-aware sorting
  • Multi-label support
  • 100-entry history
πŸ”₯ Additional Features
  • βœ… Secure Storage - Encrypted API key storage
  • βœ… Batch Processing - Sort multiple emails at once
  • βœ… 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


πŸ“₯ Installation

Option 1: Download Release (Recommended)

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

Option 2: Build from Source

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/

πŸš€ Quick Start

1️⃣ Choose AI Provider

Open settings and select from Gemini, OpenAI, Claude, Groq, or Mistral

2️⃣ Get API Key

Click "Get API Key" button β†’ Create free account β†’ Copy key

3️⃣ Configure Folders

Load folders from IMAP or add custom labels

4️⃣ Start Sorting

Select emails β†’ Right-click β†’ AutoSort+ β†’ Analyze with AI

πŸ“Œ Note: Currently requires manual selection and right-click. Automatic background sorting coming in future update!


βš™οΈ AI Provider Setup

βš™οΈ AI Provider Setup

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 ⚠️ $5 credit Highest accuracy
πŸ”Ή Mistral Get Key βœ… Limited GDPR compliance

πŸ“Š Usage Limits & Recommendations

⚠️ 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)

πŸ’‘ Usage

Basic Operation

  1. Select Emails - Click one or more emails in Thunderbird
  2. Right-Click Menu - Right-click β†’ AutoSort+ β†’ Analyze with AI
  3. Smart Sorting - AI analyzes and moves emails to appropriate folders
  4. Track History - View last 100 moves in settings

πŸ”„ Coming Soon: Automatic background sorting (currently manual via right-click)

Advanced Features

οΏ½ Multiple API Keys (Gemini - NEW!)

  • Add unlimited keys from different projects
  • 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

πŸ“š 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

πŸ”§ Technical Details

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Thunderbird Email Client        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        AutoSort+ Extension              β”‚
β”‚                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚ UI Layer β”‚  β”‚ Backgroundβ”‚           β”‚
β”‚  β”‚(options) │◄──  Script   β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                      β”‚                  β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚              β”‚  Rate Limiter  β”‚        β”‚
β”‚              β”‚  (Gemini only) β”‚        β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚                           β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
    β”‚ Gemini  β”‚  β”‚  Groq  β”‚  β”‚  Claude   β”‚
    β”‚   API   β”‚  β”‚  API   β”‚  β”‚   API     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

File Structure

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

Storage Schema

{
  // User Configuration
  apiKey: "string",
  aiProvider: "gemini|openai|anthropic|groq|mistral",
  labels: ["Work", "Personal", ...],
  enableAi: boolean,
  geminiPaidPlan: boolean,
  
  // Rate Limiting (Gemini)
  geminiRateLimit: {
    requests: [timestamp, ...],
    dailyCount: number,
    dailyResetTime: timestamp
  },
  
  // History
  moveHistory: [
    {
      timestamp: string,
      subject: string,
      status: string,
      destination: string
    },
    ...
  ]
}

Supported AI Models

Provider Model Context Window Speed Cost
Gemini gemini-2.5-flash 1M tokens ⚑⚑⚑ Free/Paid
OpenAI gpt-4o-mini 128K tokens ⚑⚑ Paid
Claude claude-3-haiku 200K tokens ⚑⚑⚑ Free/Paid
Groq llama-3.3-70b 8K tokens ⚑⚑⚑⚑ Free
Mistral mistral-small-latest 32K tokens ⚑⚑⚑ Free/Paid

πŸ”’ Privacy & Security

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!


⚠️ Troubleshooting

πŸ”§ 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

πŸ“‹ System Requirements

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

πŸ“ Changelog

πŸŽ‰ v1.2.0 (2026-01-13) - Multi-Provider Release

πŸ†• New Features
  • βœ… Multi-provider AI support (5 providers)
  • βœ… Gemini rate limiting (5/min, 20/day enforcement)
  • βœ… Real-time usage tracking dashboard
  • βœ… IMAP folder auto-discovery
  • βœ… Bulk label import
  • βœ… Move history (last 100 entries)
  • βœ… Professional UI redesign
  • βœ… Provider info cards
πŸ”§ Improvements
  • βœ… Groq updated to llama-3.3-70b
  • βœ… Better error handling and validation
  • βœ… Auto-create missing folders
  • βœ… Skip null categories
  • βœ… Batch email processing fixes
  • βœ… Professional funnel/envelope icons
  • βœ… Example folder categories
βš™οΈ Technical Changes
  • βœ… Unified API key storage
  • βœ… Settings validation system
  • βœ… Recursive folder traversal
  • βœ… Fixed syntax errors in options.js
  • βœ… Improved state management

v1.0.0 (2026-01-10) - Initial Release

  • Initial release with Gemini support

🚧 Roadmap & TODO

Priority Feature Status
πŸ”΄ High Detailed Logging - Debug mode with console output πŸ“‹ Planned
πŸ”΄ High API Response Headers - Extract rate limit info from API πŸ“‹ Planned
🟑 Medium Smart Key Switching - Auto-suggest when to switch keys πŸ’‘ Proposed
🟑 Medium Scheduled Processing - Auto-sort at specific times πŸ’‘ Proposed
🟒 Low Custom Rules - User-defined sorting logic πŸ’‘ Proposed
🟒 Low Statistics Dashboard - Email sorting analytics πŸ’‘ Proposed

πŸ› Known Issues

None currently reported! πŸŽ‰

If you encounter any issues, please open an issue on GitHub.


πŸ’¬ Support & Community

πŸ’‘ Questions πŸ› Bug Reports ✨ Feature Requests
Discussions Issues Issues

Before reporting:

  1. Check Troubleshooting section
  2. Search existing issues
  3. Include Thunderbird version and extension version

πŸ™ Contributing

We welcome contributions! Here's how to help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open a Pull Request

Guidelines:

  • Follow existing code style
  • Add comments for complex logic
  • Test with multiple AI providers
  • Update README for new features

πŸ“„ License

MIT License

Copyright (c) 2026 Nigel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

See LICENSE file for full text.


🎨 Credits & Acknowledgments

Icon Design:
Email filtering icons created by Fantasyou - Flaticon

AI Providers:

Built with:


⭐ Star History

Star History Chart


Made with ❀️ to help you organize email faster

⬆ Back to Top β€’ 🏠 GitHub β€’ πŸ“¦ Latest Release β€’ πŸ“– Documentation


Thunderbird License Version

About

AI-powered Thunderbird addon that automatically sorts emails into your custom folders/categories using AI. Fully customizable with your own folder structure and categories.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published