A Thunderbird extension that automatically manages emails with expiration dates by moving or deleting them when they expire.
- β Automatic Detection: Identifies emails with "Expires" headers
- ποΈ Flexible Actions: Choose to delete or move expired emails
- π Multiple Check Options: Manual, startup, or periodic checks
- π― Folder Selection: Check all folders or select specific ones
- π§ͺ Dry Run Mode: Test without making changes
- π Activity Logs: Track all actions with detailed history
- π Notifications: Optional notifications on completion
- π Multilingual: English and French included (easily extensible)
- π¨ Modern UI: Clean, intuitive interface
- Thunderbird 102.0 or higher
-
Clone or download this repository
-
Open Thunderbird
-
Go to Add-ons Manager:
- Click the menu button (β°)
- Select "Add-ons and Themes"
- Or press
Ctrl+Shift+A(Windows/Linux) /Cmd+Shift+A(Mac)
-
Click the gear icon (βοΈ) and select "Debug Add-ons"
-
Click "Load Temporary Add-on"
-
Navigate to the extension folder and select the
manifest.jsonfile -
The extension is now installed temporarily (will be removed when Thunderbird closes)
Package the extension as an XPI file:
# From the extension directory
zip -r email-expiration-manager.xpi * -x "*.git*"Or download it directly here
Then install the XPI file through the Add-ons Manager.
-
Click the extension icon in the toolbar (or go to Tools β Add-ons β Email Expiration Manager)
-
Configure Settings:
- Choose action (delete or move to folder)
- Select target folder (if moving)
- Enable/disable startup checks
- Configure periodic checks (optional)
- Select folders to monitor
-
Click "Save Settings"
- Click the extension icon in the toolbar
- Click "Run Check Now"
- View results in the popup
- On Startup: Enable "Check on Thunderbird startup" in settings
- Periodic: Enable "Enable periodic checks" and set interval in minutes
Test the extension without making changes:
- Go to settings
- Enable "Dry run mode (simulation)"
- Run a check
- Review the logs to see what would have been processed
email-expiration-manager/
βββ manifest.json # Extension manifest
βββ background.js # Core logic and message handling
βββ options/
β βββ options.html # Settings page HTML
β βββ options.js # Settings page logic
β βββ options.css # Settings page styles
βββ popup/
β βββ popup.html # Toolbar popup HTML
β βββ popup.js # Popup logic
β βββ popup.css # Popup styles
βββ _locales/
β βββ en/
β β βββ messages.json # English translations
β βββ fr/
β βββ messages.json # French translations
βββ icons/ # Extension icons (16, 32, 48, 128 px)
βββ README.md # This file
- Basic knowledge of HTML, CSS, and JavaScript
- Text editor (VS Code, Sublime Text, etc.)
- Thunderbird 102+ for testing
- browser.messages: Read and manipulate emails
- browser.accounts: Access email accounts and folders
- browser.storage.local: Store settings and logs
- browser.notifications: Display notifications
- browser.alarms: Schedule periodic checks
- browser.i18n: Internationalization
- Create a new folder in
_locales/with the language code (e.g.,defor German) - Copy
en/messages.jsonto the new folder - Translate all message values (keep the keys unchanged)
- The extension will automatically detect and use the language
- Main extension logic
- Handles alarms and periodic checks
- Processes messages from popup/options
- Parses "Expires" headers
- Manages email operations
- Settings page logic
- Loads and saves user preferences
- Manages folder selection
- Displays activity logs
- Toolbar popup logic
- Displays current status
- Triggers manual checks
- Shows check results
- Email Detection: The extension scans emails for the "Expires" header
- Date Parsing: Parses RFC 5322 date format (e.g., "Tue, 20 Aug 2024 14:18:31 -0000")
- Expiration Check: Compares the expiration date with the current date
- Action: If expired:
- Delete mode: Moves to trash
- Move mode: Moves to specified folder
- Logging: Records all actions with timestamp and statistics
accountsRead: Access email accounts and foldersmessagesRead: Read email content and headersmessagesMove: Move emails to foldersmessagesDelete: Delete expired emailsstorage: Save settings and logsnotifications: Display completion notificationsalarms: Schedule periodic checks
Open the Browser Console:
- Tools β Developer Tools β Browser Console
- Or press
Ctrl+Shift+J(Windows/Linux) /Cmd+Shift+J(Mac)
The extension logs its activities with console.log() statements.
Extension doesn't activate
- Check that Thunderbird version is 102+
- Verify all files are in correct locations
- Check Browser Console for errors
Emails not being processed
- Ensure the "Expires" header is present in emails
- Check the date format matches RFC 5322
- Verify settings are saved and extension is enabled
- Use dry run mode to test detection
Folders not appearing
- Click "Refresh folders" button in settings
- Check that accounts are configured in Thunderbird
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
For the complete license text, see the LICENSE file or visit: https://www.gnu.org/licenses/gpl-3.0.html
Copyright (C) 2025 Mindbaz & Sweego / Pierre-Yves Dubreucq
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see the LICENSE file for details.
Contributions are welcome! Please feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Add translations
The extension looks for the "Expires" header in emails:
Expires: Tue, 20 Aug 2024 14:18:31 -0000
Format: RFC 5322 date-time
Syntax: Expires: date-time CRLF
The "Expires" header is part of an important initiative to reduce the environmental impact of email. Digital pollution from email storage is a growing concern, and the Expires header provides a standardized way for senders to indicate when their messages are no longer needed.
The Zero Carbon Email project brings together email service providers, software vendors, and environmental advocates to promote sustainable email practices. By allowing senders to specify an expiration date, unnecessary emails can be automatically removed, reducing:
- Energy consumption from data center storage
- Carbon emissions from server operations
- Storage infrastructure requirements
The Expires header is currently being standardized through the Internet Engineering Task Force (IETF). The draft RFC is under review and can be found here:
This extension helps implement this emerging standard, allowing Thunderbird users to automatically manage expired emails according to sender preferences. By using this extension, you're participating in a broader effort to make email more environmentally sustainable.
- β Automatic cleanup of promotional emails, newsletters, and time-sensitive content
- β Reduced storage requirements on both client and server
- β Environmental impact reduction through decreased energy consumption
Icons used in this extension are provided by Ibrandify under the CC Attribution License via SVG Repo.
This extension:
- β Works entirely locally (no data sent to external servers)
- β Only accesses email headers and metadata
- β Stores settings and logs locally in Thunderbird
- β Does not collect any personal information
If you encounter any issues or have questions:
- Check this README
- Review the Browser Console for errors
- Enable debug logging
- Open an issue on GitHub (if applicable)
Enjoy managing your expired emails! π