[Meta] Problems with folders having names with illegal(or special) characters or special name
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
People
(Reporter: sheelar, Unassigned)
References
(Depends on 46 open bugs, Blocks 1 open bug)
Details
(Keywords: intl, meta)
Attachments
(1 file, 1 obsolete file)
|
2.25 KB,
patch
|
Details | Diff | Splinter Review |
| Reporter | ||
Comment 1•23 years ago
|
||
| Reporter | ||
Comment 2•23 years ago
|
||
Comment 3•22 years ago
|
||
Comment 4•22 years ago
|
||
Comment 5•22 years ago
|
||
Comment 6•22 years ago
|
||
Comment 7•21 years ago
|
||
Comment 8•21 years ago
|
||
Comment 9•21 years ago
|
||
Comment 10•21 years ago
|
||
Comment 11•21 years ago
|
||
Updated•21 years ago
|
Comment 12•21 years ago
|
||
Updated•21 years ago
|
Updated•21 years ago
|
Comment 13•21 years ago
|
||
Comment 14•21 years ago
|
||
Comment 15•21 years ago
|
||
Comment 16•20 years ago
|
||
Updated•20 years ago
|
Comment 17•20 years ago
|
||
Comment 18•19 years ago
|
||
Updated•18 years ago
|
Updated•18 years ago
|
Comment 19•17 years ago
|
||
Updated•17 years ago
|
Comment 20•16 years ago
|
||
Updated•16 years ago
|
Updated•16 years ago
|
Updated•16 years ago
|
Updated•13 years ago
|
Comment 21•12 years ago
|
||
Updated•12 years ago
|
Comment 22•11 years ago
|
||
Updated•11 years ago
|
Comment 23•11 years ago
|
||
Comment 24•10 years ago
|
||
Comment 26•6 years ago
|
||
I've made some notes about the various flavours of folder names in use. I think a lot of the bugs we've got can be solved by being really clear on what the naming requirements are in each case, and how the various naming schemes should be mapped to one another.
Places where folder names are used:
Folder Name
- The 'canonical'/internal name of the folder.
- exposed via the
nsIMsgFoldernameattribute - Usually the same as the user-facing name (but there is a
prettyNameattr too) - Used to derive URI in
nsIMsgFolder getURI()implementations. - There is some special-case handling for certain folder names - case tweaking, localisation etc. See
nsMsgDBFolder::SetPrettyName()for an example. - There is also
abbrieviatedName, which uses account-specific rules to shorten long names for nicer display. I think only Newsfolders use it (eg "comp.sys.lang.basic" => "c.s.l.basic").
User-facing names
- As displayed in the folder tree UI panel.
- Should probably be able to display any printable characters: non-latin chars, '/','' etc.
- TODO: look in the UI code to see where display name is taken from.
MailStore (ie mbox/maildir on filesystem)
- The names of files and directories on disk.
- Allowed characters depends on OS
- Case-sensitivity depends on OS
- some names illegal on some OSes (eg
CON,PRN,AUXetc on windows) - Some names have special significance? "INBOX", "Trash" etc. Sets flags on the folder.
- Folder discovery iterates over filesystem names, and uses those names for the UI
=> some names are tweaked/localised when mapped to UI, eg "INBOX" -> "Inbox"
=> TODO: where is this mapping performed? - should users be able to copy folders across OSes? This means enforcing a superset of naming rules. eg Treat
Stuffandstuffas the same folder, even on case-sensitive filesystems. - Numeric suffixes sometimes added to deduplicate... eg "INBOX-1" (TODO: why is this needed? How does it work with folder discovery?)
- some name extensions have special meaning (eg
.sbdis used to distinguish subfolders) .
Windows filename rules: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
It would be nice if filesystem naming schemes were entirely handled by the appropriate mailstore, but currently there are a lot of places all over the codebase which make assumptions about the filesystem. Maybe over time this can change, particularly if new mailstores are added which aren't directly filesystem-based (eg a database-backed store).
IMAP folders
- TB queries IMAP server to find remote folders.
- Base IMAP has ascii names, but extensions handle full unicode (TODO: confirm)
- Takes time to ask server. Usually, if there's a mailstore (filesystem) folder that will be picked up first.
- Missing mailstore folders are created as needed (TODO: identify code that does this). Eg, for a new TB install.
Folder URIs
- Full identity of a folder within TB
- stored in VirtualFolders.dat, and elsewhere
- what are the current encoding rules? What should they be?
=> I think the folder parts of the URI should be UTF-8, then percent-encoded. For example, a subfolder of Inbox called "はい/いいえ" ("yes/no") would end up with a URI something like:
imap://bobsmith%40example.com@imap.example.com/INBOX/%E3%81%AF%E3%81%84%2F%E3%81%84%E3%81%84%E3%81%88
VirtualFolders.dat
- Contains URI of virtual folder to create
- Upon loading, creates a
nsDBMsgFolderwith name and parent folder based upon URI - see
nsMsgAccountManager::LoadVirtualFolders()andnsMsgAccountManager::SaveVirtualFolders().
Comment 27•6 years ago
|
||
Here's a particularly extra special one - on macos there is a difference between composed and decomposed utf8 chars, meaning the folder name is not what you think it is if using it for a key. Manifests in Bug 1219084 and maybe elsewhere.
Updated•6 years ago
|
Updated•3 years ago
|
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Comment 30•8 months ago
•
|
||
Some more win32 file naming quirks to deal with:
https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/file-folder-name-whitespace-characters
(edit: I don't think these apply to the API level - they're just rules applied when the user enters filenames in the windows shell/file explorer.)
Comment 31•8 months ago
|
||
Also just experienced recently in TB Beta, after moving folders, some of the sub-folders disappeared from TB in my IMAP account without error or noticed, while there were still present in webmail. This prevented access to the folders and emails it contained.
After some lengthy investigation, it turned out the issue was TB not able to create the .msf file for few of the sub-folders because the 255 full file path limit was exceeded on Windows, so Windows itself refused to create such files with too long path.
At least TB shall raise/log the error in such situation, not just silently hide the folder(s).
Part of the issue is that the prefix path to the mailbox folder is already very long something like:
C:\Users\richard\AppData\Roaming\Thunderbird\Profiles\cnantXXX.default\ImapMail\mail.my-domain.com
...so if you then have a many sub-folders the full file path can easily reach/exceed the 255 characters limit of Windows.
Should it be time for TB to start using \\?\ prefix to specify an extended-length path?
For example, \\?\C:\<very long path> rather than just C:\<very long path> which is causing issues on Windows.
Updated•1 month ago
|
Description
•