A Thunderbird extension that synchronizes labels from TMail/James server with Thunderbird's native tag system.
- Uni-directional sync: Labels created on TMail server appear as Thunderbird tags
- Native integration: Uses Thunderbird's built-in tag UI (columns, context menus, etc.)
- CRUD operations: Create, update, and delete labels on messages from Thunderbird
- Auto-sync: Configurable automatic synchronization on startup and at intervals
- Multi-account: Supports multiple IMAP accounts
- Thunderbird 128 or later
- TMail server 1.0.16 or later
- Clone this repository
- Open Thunderbird
- Go to Add-ons and Themes (Ctrl+Shift+A)
- Click the gear icon → Debug Add-ons
- Click Load Temporary Add-on
- Select the
manifest.jsonfile from this directory
- Download the
.xpifile from releases - Open Thunderbird → Add-ons and Themes
- Click the gear icon → Install Add-on From File
- Select the downloaded
.xpifile
TMail/James stores labels as IMAP METADATA entries:
/private/vendor/tmail/labels/{labelId}/keyword → UUID (IMAP keyword)
/private/vendor/tmail/labels/{labelId}/displayname → Human-readable name
/private/vendor/tmail/labels/{labelId}/color → (optional) Color hex code
This extension:
- Fetches labels using IMAP
GETMETADATAcommand - Creates corresponding Thunderbird tags with matching keywords
- Syncs changes back to the server using
SETMETADATA
Since the IMAP keyword is shared between TMail and Thunderbird, applying a tag to a message automatically applies the label on the server.
Start a TMail test server:
docker run -p 8000:8000 -p 993:993 -d chibenwa/tmail-backend:memory-imap-label
# Get container ID
CONTAINER_ID=$(docker ps -q --filter ancestor=chibenwa/tmail-backend:memory-imap-label)
# Create test user
docker exec -ti $CONTAINER_ID james-cli addUser alice@localhost 123456Provision labels using Twake Mail Admin:
cd ~/Documents/twake-mail-admin
bun run dev
# Browse http://localhost:3000/users/user/alice%40localhost
# Create INBOX first, then add labelsVerify labels via IMAP:
openssl s_client -connect 127.0.0.1:993
# Then type:
a0 login alice@localhost 123456
A1 GETMETADATA "INBOX" (DEPTH infinity) /private/vendor/tmail/labels
a2 logoutConfigure Thunderbird:
- Add account: alice@localhost / 123456
- IMAP server: 127.0.0.1:993 (SSL)
- Install the extension
- Click the extension icon → Sync Labels
thunderbird-labels/
├── manifest.json # Extension manifest
├── experiment-apis/
│ └── imap-metadata/
│ ├── api.js # IMAP METADATA privileged API
│ └── schema.json # API schema
├── src/
│ ├── background.js # Background service worker
│ ├── core/
│ │ ├── constants.js # Configuration constants
│ │ └── label-sync.js # Label synchronization service
│ └── ui/
│ ├── popup.html # Popup UI
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
├── icons/ # Extension icons
└── _locales/
├── en/messages.json # English translations
└── fr/messages.json # French translations
No build step required - the extension runs directly from source.
- Open Thunderbird → Tools → Developer Tools → Error Console
- Filter by "TMail Labels" to see extension logs
cd thunderbird-labels
zip -r ../thunderbird-labels.xpi . -x "*.git*" -x "*.DS_Store"MIT
Issues and pull requests welcome at https://github.com/yadd/thunderbird-labels