Regarding confirmation and performance, users need to know a) what to
consider changing and b) what do we recommend, if anything. For
example, under what circumstances should user change one or both the
subscription and sync settings for the All Mail folder. Syncing All
Mail for a very large gmail account has significant performance
implications. If not synced, how does it impact global search? How do
labels work? Under what circumstances do we store a separate copy of
the message/body? How does Archiving fit in.
Also, for those who are inclined to understand the code - where in the
code do one find the guts about gmail specialization? My mxr search
skills are not great. An example mxr search URL would be helpful.
The thing about Gmail is that we don't use subscription at all, because we want to use Gmail's XLIST command to find out about the special folders, and XLIST doesn't respect subscription. So the way to hide All Mail from Thunderbird is in the Gmail settings, Labels, uncheck "show in IMAP". I don't honestly know what happens if you do that and then use Archive command in Thunderbird.
There can be several reasons to hide All Mail. One is that you have > 100K messages or so, so the occasional attempts by things like autosync to open the .msf file cause a bit of beachballing. Or, you have bandwidth limitations, so downloading all the message bodies costs you money. Or, you have extremely limited disk space.
Currently, we store a copy of each message for each label you have on a message. So there can be some problems of limited disk space or Thunderbird taking few GB's of your hard disk. But in future releases this won't be a problem. We are currently working on fixing this. You can have a look at the progress here: https://bugzilla.mozilla.org/show_bug.cgi?id=721316. The basic strategy that we are using to implement this is to store the messages just one in the folder where it first arrived. And in other folders/labels, we will be just pointing at the single-tored message in whichever folder it is. Also, this won't create clashes if you have your All Mail disabled, as we are not storing mails in All Mail. We are storing them in the folder where it first arrives. This will be soon in our future releases. So I guess there won't be a problem of limited disk space. Plus this will save the bandwidth and money too :)
It used to be true that we only used XLIST with gmail servers and didn't respect imap subscription, but I fixed that all in
https://bugzilla.mozilla.org/show_bug.cgi?id=493455, so that we use XLIST to find out about special folders, but still respect IMAP subscription. Sorry for the confusion.