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.
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.
- Open your Thunderbird profile directory.
- Check
profiles.inito identify which profile is active. - Create or edit a
user.jsfile in the active profile directory. - Paste the above preferences listing into
user.js. - Restart Thunderbird.
- Open the tags/flags interface in Thunderbird. All your custom tags will appear.
- When you start using these tags, Thunderbird will issue the appropriate IMAP commands, and these flags will synchronize across Thunderbird clients on different machines.