Reflect 'Outlook Categories' to 'Thunderbird Tags'
Brought to you by:
mguessan
I don't know if this would be possible, but it would be useful for people using both Outlook and Thunderbird-through-DavMail (like me ;-) ).
According to http://kb.mozillazine.org/Tags#IMAP Thunderbird will store Tags on the IMAP server, if the server supports this.
Check bug report: https://sourceforge.net/tracker/?func=detail&aid=2871077&group_id=184600&atid=909904
Will need to investigate this again
Hi Mikael,
This would still be very useful to me; I use 'Tags' a lot in Thunderbird, but with them currently being stored only locally, and sometimes suddently being erased when Thunderbird/DavMail/Exchange decides that messages need to be 'refreshed' or something, the Tags mechanism is not reliable enough.
In EWSEditor I see that 'Outlook Categories' are stored in a mail item's 'Categories' property of type 'Microsoft.Exchange.WebServices.Data.StringList'. It seems to me it would be possible to convert these Categories to/from IMAP keywords.
Thanks in advance for looking into this ;-)
Roel
You are right, one of the issues I had for categories/labels support was the $Label1 $Label2... naming in Thunderbird.
However I recently discovered that default categories can be deleted => you can use any category name
Hi MIckael,
I've already done a small test with r2016 and so far it is already looking good!
When I use Thunderbird+IMAP+DavMail to open a folder at first the messages don't have a Tag. Now when I create a new Tag type, corresponding to an 'Outlook Category' (by adding a Tag to one message), all the messages with that same Category immediately are shown with the corresponding Tag.
When I set such a 'new' Tag to a message in Thunderbird, also Outlook shows the corresponding Category. The only thing is that it shows it in lowercase (like 'todo' instead of 'TODO'). This may be caused by Thunderbird, since davmail.log shows:
2012-09-17 13:25:44,576 DEBUG [ImapConnection-57573] davmail - < 3 uid store 4944 +FLAGS (todo)
Setting a message with a 'standard' Tag type has no effect in Outlook.
When I set/change a Category in Outlook, it doesn't have an immediate effect in Thunderbird. I think it will only have an effect when Thunderbird reloads the message or so. By the way, this is the same behaviour for instance for the 'Seen' flag; Thunderbird doesn't mark a message as 'seen' when it is read in Outlook after Thunderbird has loaded the message.
Anyway, this is already very useful so far. Thanks a lot!
A small update: Setting for instance a standard 'To Do' Tag in Thunderbird gives a '$label4' Category in the message in Outlook.
Ok improved implementation to make it case insensitive.
However, Thunderbird implementation is buggy:
- all store commands lowercase keyword first
- keyword is RFC2060 encoded *before* toLowerCase
=> the flag value is corrupted
It seems the reason that Thunderbird uses lowercase keywords, is that internally it uses a mapping between keywords and Tag names. From my 'prefs.js':
user_pref("mailnews.tags.$label1.color", "#FF0000");
user_pref("mailnews.tags.$label1.tag", "Important");
user_pref("mailnews.tags.$label2.color", "#FF9900");
user_pref("mailnews.tags.$label2.tag", "Work");
user_pref("mailnews.tags.$label3.color", "#009900");
user_pref("mailnews.tags.$label3.tag", "Personal");
user_pref("mailnews.tags.$label4.color", "#3333FF");
user_pref("mailnews.tags.$label4.tag", "To Do");
user_pref("mailnews.tags.$label5.color", "#993399");
user_pref("mailnews.tags.$label5.tag", "Later");
user_pref("mailnews.tags.it.color", "#336666");
user_pref("mailnews.tags.it.tag", "IT");
user_pref("mailnews.tags.or.color", "#003300");
user_pref("mailnews.tags.or.tag", "OR");
So the keywords that are used seem to be just the part of the variable name after 'mailnews.tags.'.
I tried modifying these setting to have an uppercase variable name, like mailnews.tags.IT.tag, but that doesn't seem to work.
Unfortunately, DavMail cannot know about this mapping. Otherwise it could have made a 'reverse' mapping to have the Category names match the Tag names. Having a separate mapping configuration in DavMail would work (keyword '$label4' <-> category 'To Do'), but would perhaps require too much configuring by a user.
Thunderbird bug reference on broken lowercase flags: https://bugzilla.mozilla.org/show_bug.cgi?id=650623
Yes, if you want to use the keywords directly, this lowercasing seems like a bug. But if you look at it as only a Thunderbird-internal way of storing data it is not.
The Tag name is not only made lowercase. For instance a Tag 'This is a Test' gets converted to a keyword 'this_is_a_test'.
Right, as long as your only client is Thunderbird this will work. However this is not the case with DavMail, or even with any IMAP server if you want to access mailbox with different clients.
Anyway, I implemented flag mapping to categories for the five default Thunderbird categories => the label is now stored in Exchange instead of $label1 to $label5
I assume the keyword mechanism in Thunderbird was never implemented with the idea that other clients would want to make use of it as well.
Anyway, the 'keywork mapping' works fine. For now, I've added a few lines to imapflags.properties for my own tags (like 'it=IT').
Thanks again!
Hi Mickael,
With r2027 Outlook shows a '\Seen' Category on messages that were marked as 'read' in Thunderbird :-)
Didn't reproduce this, can you please provide more details ?
Hmm, I can't reproduce this either now. But I do have a few mails from around the update to r2027 that show '\Seen' in the Category column in Outlook. No idea what I did differently with those messages :-\
If I see this happen again, I'll let you know.
Hi Mickael,
I still do see these '\Seen' Categories sometimes, although I have no idea how to reproduce this. In this log line I can see a '\Seen' Keywords property value, as well as an 'IsRead' property:
2012-09-24 14:57:38,127 DEBUG [ImapConnection-44822] httpclient.wire.content - << "roperty><t:ExtendedFieldURI PropertyTag="0xff9" PropertyType="Binary" /><t:Value>AAAAAO0afCQn/OdOtq4yyJwLR2MBAPtsSndnqOxFhr7EHMrTYTgAmApxrgUAAA==</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x10f3" PropertyType="String" /><t:Value>RE%3A IM0000020433455 (OMT%3AIM0000020433455)-2.EML</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI DistinguishedPropertySetId="InternetHeaders" PropertyName="content-class" PropertyType="String" /><t:Value>urn:content-classes:message</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe23" PropertyType="Integer" /><t:Value>5346</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x670e" PropertyType="String" /><t:Value>/-FlatUrlSpace-/fb6c4a7767a8ec4586bec41ccad36138-18e7458f96/fb6c4a7767a8ec4586bec41ccad36138-980a71ae05</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="Keywords" PropertyType="StringArray" /><t:Values><t:Value>IT</t:Value><t:Value>\Seen</t:Value></t:Values></t:ExtendedProperty><t:IsRead>true</t:IsRead></t:Message><t:Message><t:ItemId Id="AAMkADMxZGVjMWRjLTg5MDAtNDE3YS1iMGU4LTgxNGEyYzE1ZTkzNgBGAAAAAADtGnwkJ/znTrauMsicC0djBwD7bEp3Z6jsRYa+xBzK02E4ABjnRY+WAAD7bEp3Z6jsRYa+xBzK02E4AJgKca4EAAA=" ChangeKey="CQAAABYAAAD7bEp3Z6jsRYa+xBzK02E4AJgKoxc+" /><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x1081" PropertyType="Integer" /><t:Value>102</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe06" PropertyType="SystemTime" /><t:Value>2012-09-20T12:08:45Z</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe08" PropertyType="Integer" /><t:Value>25560</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x3008" PropertyType="SystemTime" /><t:Value>2012-09-20T12:19:36Z</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe07" PropertyType="Integer" /><t:Value>17</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xff9" PropertyType="Binary" /><t:Value>AAAAAO0afCQn/OdOtq4yyJwLR2MBAPtsSndnqOxFhr7EHMrTYTgAmApxrgQAAA==</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x10f3" PropertyType="String" /><t:Value>PSA - Comm module.EML</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI DistinguishedPropertySetId="InternetHeaders" PropertyName="content-class" PropertyType="String" /><t:Value>urn:content-classes:message</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe23" PropertyType="Integer" /><t:Value>5059</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x670e" PropertyType="String" /><t:Value>/-FlatUrlSpace-/fb6c4a7767a8ec4586bec41ccad36138-18e7458f96/fb6c4a7767a8ec4586bec41ccad36138-980a71ae04</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="Keywords" PropertyType="StringArray" /><t:Values><t:Value>\Seen</t:Value></t:Values></t:ExtendedProperty><t:IsRead>true</t:IsRead></t:Message><t:Message><t:ItemId Id="AAMkADMxZGVjMWRjLTg5MDAtNDE3YS1iMGU4LTgxNGEyYzE1ZTkzNgBGAAAAAADtGnwkJ/znTrauMsicC0djBwD7bEp3Z6jsRYa+xBzK02E4ABjnRY+WAAD7bEp3Z6jsRYa+xBzK02E4AJgKca4DAAA=" ChangeKey="CQAAABYAAAD7bEp3Z6jsRYa+xBzK02E4AJgLyTbG" /><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x1081" PropertyType="Integer" /><t:Value>103</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe06" PropertyType="SystemTime" /><t:Value>2012-09-20T12:06:12Z</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0xe08" PropertyType="Integer" /><t:Value>6980</t:Value></t:ExtendedProperty><t:ExtendedProperty><t:ExtendedFieldURI PropertyTag="0x3008" PropertyType="SystemTime" /><t:Value>2012-09-24T09:32:46Z</t:Value></t:"
Maybe it's a bug with a previous version, just remove invalid categories in Outlook to fix this
These are all mails that were received after I've started using r2027. So I can't imagine how a bug with a previous version could cause this...
OK, here is how to reproduce it:
* Receive a new mail
* Wait until both Outlook and Thunderbird (through DavMail EWS) show it in the INBOX (as 'unread')
* Mark the mail as read in Outlook
* 'Get mail' in Thunderbird? not sure if this is necessary. But at least Thunderbird will keep it as 'unread'
* Mark the mail as read in Thunderbird
* Outlook will now show the '\Seen' Category
Still unable to reproduce this:
davmail - < 10 uid store 47347 +Flags (\Seen)
davmail - > * 855 FETCH (UID 47347 FLAGS (\Seen))
davmail - > 10 OK STORE completed
Is this different in your case ?
I would need the log statements with the UpdateItem request that sets the wrong value
Fix released in 4.1.0
We are trying to share thunderbird tags to outlook categories but no luck.
As we monitored thunderbird generates random keys under X-tagtoolbar Header, which we cannot filter.
Is there any method to share thunderbird tags with Outlook category via filteration.
Any help would be really appreciated as we are stuck in this issue with few days.
This is how Thunderbird behaves on my system (TB 17.0.8 on Fedora 18). When I define a new tag (e.g. through the Tag button and Manage Tags), TB creates an 'internally used' tag name. This name is stored in prefs.js:
user_pref("mailnews.tags.some_test_tag.tag", "Some test Tag");
When this tag is used, TB will add this to the mail:
Keywords: some_test_tag
By default, DavMail will directly convert this to an Outlook Category, so Outlook will show 'some_test_tag'. It is however possible to let DavMail convert the name by (manually) adding a 'translation' in .davmail.properties:
davmail.imapFlags.some_test_tag=Some test Category
I have checked at my end int htunderbird (17.0.8 on ubuntu 12.04). bt i am nt getting where i need to define "Keywords" to proper mapping with "Tags"
I also want to know can we do this with out Davmail??