Skip to content

Nigel1992/AutoSort-Plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

89 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Join our Discord

ko-fi

๐ŸŽฏ 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 cloud AI providers or run a local Ollama model:

  • Google Gemini - Best free tier + Multi-key support
  • OpenAI - Superior accuracy
  • Anthropic Claude - Privacy-focused
  • Groq - Fastest processing
  • Mistral AI - GDPR compliant
  • Ollama (Local) - Run LLMs locally (llama3.2, tinyllama, phi, gemma). No API key required; supports model download and CPU-only mode

๐Ÿ”‘ 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, Mistral, or Ollama (Local LLM)

2๏ธโƒฃ Get API Key (or install local Ollama)

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.

3๏ธโƒฃ Configure Folders

Load folders from IMAP or add custom labels

4๏ธโƒฃ Sort Emails (Two Options)

Option 1: AI-Powered Sorting

  • Select emails โ†’ Right-click โ†’ AutoSort+ โ†’ 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!


โš™๏ธ 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
๐Ÿ”น 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.

๐Ÿ“Š 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

Manual Labeling (Right-Click)

You can also manually label emails without AI analysis:

  1. Select Emails - Click one or more emails in Thunderbird.
  2. Right-Click Menu - Right-click โ†’ AutoSort+ โ†’ AutoSort Label โ†’ [Pick any label]
  3. 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

๐Ÿ”ง 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
    },
    ...
  ]
}

๐Ÿ”’ 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

Support This Project

Support this project! All donations go towards your chosen charity. You can pick any charity you'd like, and I will ensure the funds are sent their way. Please note that standard payment processing fees (Ko-fi & PayPal) will be deducted from the total. 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 of the donation or to let me know which charity you've selected!

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

 
 
 

Contributors