为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Setting flags on IMAP mail files maps inconsistently to Thunderbird flags

  • 7 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 Mark Foley

more options

I am investigating moving our office users from Outlook to Thunderbird. One big issue is preserving their Outlook color catagories. The server is IMAP/Dovecot, self-hosted on Linux.

When I set a flag in Thunderbird, it sets the corresponding flag on the IMAP file. For example, setting the Thunderbird flag "1 Important" (red) on message "cur/1451494595.18051_0.mail:2,S" changes the filename to "cur/1451494595.18051_0.mail:2,Sa". So far so good.

If I manually add the flag letter (a-e) to the filename on the IMAP server, the corresponding message is flagged/colored in Thunderbird. For example:

mv "cur/1449002162.8993_0.mail:2,S" "cur/1449002162.8993_0.mail:2,Sb"

Will turn the messing in Thuderbird to yellow (2 Work).

This is all totally awesome! I have a VB script that will extract all color categories from Outlook and another bash script that will rename the IMAP files with the corresponding flag letter. My hope is that I can export all the Outlook category settings and rename the IMAP files so the same categories show as Thunderbird flags and, voila! Goodbye Outlook!

But there's a wrinkle. That works just fine for the Thunderbird inbox, but in a different mail folder the IMAP flag letters and Thunderbird flag numbers map differently:

TB flag inbox other 1 Important a d 2 Work b f 3 Personal c g 4 To Do d h

Note that IMAP flag 'd' designates TB flag 4 in the inbox and TB flag 1 in the other folder.

So, is this a Thunderbird issue? A setting of some sort? Any ideas? I need flags to map consistently.

I am investigating moving our office users from Outlook to Thunderbird. One big issue is preserving their Outlook color catagories. The server is IMAP/Dovecot, self-hosted on Linux. When I set a flag in Thunderbird, it sets the corresponding flag on the IMAP file. For example, setting the Thunderbird flag "1 Important" (red) on message "cur/1451494595.18051_0.mail:2,S" changes the filename to "cur/1451494595.18051_0.mail:2,Sa". So far so good. If I manually add the flag letter (a-e) to the filename on the IMAP server, the corresponding message is flagged/colored in Thunderbird. For example: mv "cur/1449002162.8993_0.mail:2,S" "cur/1449002162.8993_0.mail:2,Sb" Will turn the messing in Thuderbird to yellow (2 Work). This is all totally awesome! I have a VB script that will extract all color categories from Outlook and another bash script that will rename the IMAP files with the corresponding flag letter. My hope is that I can export all the Outlook category settings and rename the IMAP files so the same categories show as Thunderbird flags and, voila! Goodbye Outlook! But there's a wrinkle. That works just fine for the Thunderbird inbox, but in a different mail folder the IMAP flag letters and Thunderbird flag numbers map differently: TB flag inbox other 1 Important a d 2 Work b f 3 Personal c g 4 To Do d h Note that IMAP flag 'd' designates TB flag 4 in the inbox and TB flag 1 in the other folder. So, is this a Thunderbird issue? A setting of some sort? Any ideas? I need flags to map consistently.

所有回复 (7)

more options

I really think you need help from developers, not users like us folk here. I suggest you try the dev.apps.thunderbird google group.

https://groups.google.com/forum/#!forum/mozilla.dev.apps.thunderbird or is you prefer is it available on news.mozilla.org as a usenet group.

more options

It looks like my carefully spaced table of flag letters versus folders got all munged onto one line in my posting. I guess I need to eventually figure out the formatting conventions on this forum. I'll try indenting in this message ...

Anyway, I figured it out. Dovecot has a file: dovecot-keywords, which may exist in each mail folder directory. This maps the IMAP filename flag letters to Thunderbird tag values (http://wiki2.dovecot.org/MailboxFormat/Maildir). So, the dovecot-keywords file in my inbox folder was:

 0 $label1
 1 $label2
 2 $label3
 3 $label4
 4 $Labelimportant
 5 $Labelpersonal
 6 $Labelwork
 7 Junk

(Hopefully that comes out as one line per number) While the dovecot-keywords file in the 'other' folder are:

 0 unknown-0
 1 unknown-1
 2 unknown-2
 3 $label1
 4 unknown-4
 5 $label2
 6 $label3
 7 $label4

The ones having "$label" are the Thunderbird keywords. Therefore, in the inbox $label1 gets mapped to an "a" flag letter while $label1 in the other folder gets mapped to a "d". This explains the question in my posting.

The non-Thunderbird keywords (without "$label") are from the current Outlook mail client, though I've never noticed what attribute they visually map to when using Outlook.

My migration solution will be to make sure all dovecot-keyword files in all Maildir directories for all users look like:

0 $label1  = 1 Important   IMAP flag 'a'
1 $label2  = 2 Work        IMAP flag 'b' 
2 $label3  = 3 Personal    IMAP flag 'c'
3 $label4  = 4 To Do       IMAP flag 'd'
4 $label5  = 5 Later       IMAP flag 'e'

(note that the text from the '=' sign to the end is NOT part of the dovecot-keyword file. I've put that commentary there to show the correlations)

Then run my rename script to parse the exported Outlook color categories and append the flag letter(s) to the mail filenames. This will end up mapping one-to-one with Thunderbird tags and I will effect our migration away from Outlook! Yeah!

(Note: I could go the extra mile and keep the existing dovecot-keywords files and modify the script to look up the appropriate flag letter in that file, but I'd rather start Thunderbird clean and know that all IMAP filenames ending in 'a' are Thunderbird tag "0 Important". Also, I'm not sure what the "$Labelimportant" keywords are. Are they from Outlook? Thunderbird? For now, I'm going to pretend these don't exist!)

If someone has read this far and does want to help, is there a way to change the text used to display the Thunderbird tags? For example, is there a way to change "0 Important" to be "0 Red Category"?

由Mark Foley于修改

more options

Tags are defined in the settings, e.g.

Name                         Status    Type      Value    
mailnews.tags.$label1.color  user set  string    #FF0000
mailnews.tags.$label1.tag    user set  string    Important

Obviously you could go through each installation and do this by hand in the Config Editor.

But since the settings are stored in the file prefs.js, you could do an automated search-and-replace on this file. Just make sure Thunderbird is closed and not running when you edit this file.

Do test it on a non-production set-up. Errors in the prefs files can totally break Thunderbird.

Amazing amount of effort for a feature I've never even used. Some of us just don't "get" tags. ;-)

BTW, the actual line you'd need to edit looks like this:

user_pref("mailnews.tags.$label1.tag", "Important");

由Zenos于修改

more options

Zenos - thanks a lot for your answer. This will be really useful for our migration.

"Amazing amount of effort for a feature I've never even used."

You are right! I'd never even noticed this feature on Outlook (but I rarely use Outlook) until our Director made a big deal about it when we got off Exchange and wend to Dovecot/IMAP and he couldn't find his categories. I was able to recover these, but Microsoft didn't make it easy. Our Director has nearly 19,000 emails and "color categories" is his main organization tool. Naturally, we cannot migrate from Outlook to anything if that info can't be preserved. Now it can!

more options

check the config editor for mailnews.tags. the preinstalled ones are label 1 to 5 after that they have names

more options

one should not just click Post on stuff that has been sitting there 24 hours. Sorry guys.

more options

Thanks Matt. That's a useful bit of info too.