Skip to content

Instantly share code, notes, and snippets.

@michael-o
Last active October 2, 2025 18:04
Show Gist options
  • Save michael-o/9665e29a759d1a37ceaec25a6b534e27 to your computer and use it in GitHub Desktop.
Save michael-o/9665e29a759d1a37ceaec25a6b534e27 to your computer and use it in GitHub Desktop.
Mapping Flags/Tags between Open-Xchange (OX) App Suite (Webmail) UI and Thunderbird

Mapping Flags (Tags, Labels) Between Open-Xchange (OX) App Suite (Webmail) UI and Mozilla Thunderbird

Both Thunderbird (TB) and OX App Suite (OX AS) provide message flagging features. While OX AS has only ten predefined flags named by colors, Thunderbird allows an arbitrary number of flags. The flags in OX AS cannot be customized by the user and are localized for display, but their underlying values are well defined and language agnostic.

Through reverse engineering via IMAP, I discovered that these flags are named from $cl_0 through $cl_10. IMAP allows querying the FLAGS set in addition to the standard IMAP flags. All additional flags are custom and not standardized.

Here’s an example of probing via IMAP (C: denotes client, S: denotes server):

$ openssl s_client -connect imap.example.com:993 -crlf
...
C: a login [email protected] PASSWORD
S: a OK User logged in (47)
C: a select inbox
S: ...
C: a fetch {message-id} (FLAGS)
S: * 20 FETCH (FLAGS (\Seen $cl_9))

The following tag mappings can be compiled for Thunderbird's user.js:

user_pref("mailnews.tags.$cl_0.color", "#ffffff");
user_pref("mailnews.tags.$cl_0.key", "$cl_0");
user_pref("mailnews.tags.$cl_0.tag", "Keine");

user_pref("mailnews.tags.$cl_1.color", "#ff0000");
user_pref("mailnews.tags.$cl_1.key", "$cl_1");
user_pref("mailnews.tags.$cl_1.tag", "Rot");

user_pref("mailnews.tags.$cl_2.color", "#0000FF");
user_pref("mailnews.tags.$cl_2.key", "$cl_2");
user_pref("mailnews.tags.$cl_2.tag", "Blau");

user_pref("mailnews.tags.$cl_3.color", "#008000");
user_pref("mailnews.tags.$cl_3.key", "$cl_3");
user_pref("mailnews.tags.$cl_3.tag", "Grün");

user_pref("mailnews.tags.$cl_4.color", "#808080");
user_pref("mailnews.tags.$cl_4.key", "$cl_4");
user_pref("mailnews.tags.$cl_4.tag", "Grau");

user_pref("mailnews.tags.$cl_5.color", "#800080");
user_pref("mailnews.tags.$cl_5.key", "$cl_5");
user_pref("mailnews.tags.$cl_5.tag", "Violett");

user_pref("mailnews.tags.$cl_6.color", "#90EE90");
user_pref("mailnews.tags.$cl_6.key", "$cl_6");
user_pref("mailnews.tags.$cl_6.tag", "Hellgrün");

user_pref("mailnews.tags.$cl_7.color", "#FFA500");
user_pref("mailnews.tags.$cl_7.key", "$cl_7");
user_pref("mailnews.tags.$cl_7.tag", "Orange");

user_pref("mailnews.tags.$cl_8.color", "#FFC0CB");
user_pref("mailnews.tags.$cl_8.key", "$cl_8");
user_pref("mailnews.tags.$cl_8.tag", "Pink");

user_pref("mailnews.tags.$cl_9.color", "#00FFFF");
user_pref("mailnews.tags.$cl_9.key", "$cl_9");
user_pref("mailnews.tags.$cl_9.tag", "Cyan");

user_pref("mailnews.tags.$cl_10.color", "#FFFF00");
user_pref("mailnews.tags.$cl_10.key", "$cl_10");
user_pref("mailnews.tags.$cl_10.tag", "Gelb");

Although my tags are in German, you can replace the labels with any translation or naming convention you prefer.


Quick Note on OX AS Behavior

While OX AS allows you to "remove" flags, what actually happens is that it purges custom flags but then adds the $cl_0 flag to FLAGS. You may or may not want to map $cl_0 into Thunderbird.


How to Apply

  1. Open your Thunderbird profile directory.
  2. Check profiles.ini to identify which profile is active.
  3. Create or edit a user.js file in the active profile directory.
  4. Paste the above preferences listing into user.js.
  5. Restart Thunderbird.
  6. Open the tags/flags interface in Thunderbird. All your custom tags will appear.
  7. When you start using these tags, Thunderbird will issue the appropriate IMAP commands, and these flags will synchronize across Thunderbird clients on different machines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment