Open Bug 366789 Opened 18 years ago Updated 2 years ago

folders "lost" after restart if named or renamed to a name ending in .msf or .sbd

Categories

(Thunderbird :: Folder and Message Lists, defect)

defect
Not set
critical

Tracking

(Not tracked)

People

(Reporter: moz, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dataloss)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Build Identifier: Thunderbird 1.5.0.9

If a user rename the folder "Example in Microsoft Format" to "example.msf", the user is no warned but next time Thunderbird starts... the folder will not be found, it dissapeared!

The same happens if people finish a name with ".sbd"  

Reproducible: Always



Expected Results:  
For example, if a user renamed the folder to "example.msf" or "example.sbd", the user could be told and not allowed.
->NEW on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2pre) Gecko/20070112 Thunderbird/2.0b1 ID:2007011203
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dataloss
OS: Windows 2000 → All
Hardware: PC → All
Summary: Folders "lost" because of a name change → folders "lost" if renaming folder to a name ending in .msf or .sbd
Assignee: mscott → nobody
yeah
Severity: normal → critical
Component: Mail Window Front End → Folder and Message Lists
Summary: folders "lost" if renaming folder to a name ending in .msf or .sbd → folders "lost" after restart if named or renamed to a name ending in .msf or .sbd
This is similar issue to local folder name starting with "." , and is restriction inherited from Netscape Mail&News.

Because file start with "." is hidden file in *nix, file starts with "." is excluded from file list when getting files for mail folder from directory list. So, "." is defined as ILLEGAL_FOLDER_CHARS_AS_FIRST_LETTER, and if folder name in user's creation request starts with ".", hashed file name is used.
> http://mxr.mozilla.org/comm-central/source/mailnews/base/util/nsMsgUtils.cpp#81
> 81 #define ILLEGAL_FOLDER_CHARS_AS_FIRST_LETTER "."
> http://mxr.mozilla.org/comm-central/source/mailnews/base/util/nsMsgUtils.cpp#386
This is enhanced for ending special character and is defined as   ILLEGAL_FOLDER_CHARS_AS_LAST_LETTER( ".~ ").

In ending ".msf" and ".sbd" case, when folder is created, "xxx.msf" and "xxx.sbd" is leagal folder name, then Tb creates set of "xxx.msf and xxx.msf.msf", set of "xxx.sbd and xxx.sbd.msf", and normally uses them as file for folder named "xxx.msf" or "xxx.sbd".
However, in restart of Tb, "xxx.msf", ""xxx.msf.msf" "xxx.sbd.msf", "xxx.sbd", is excluded from file list, because ending ".msf" is reserved name for .msf file and ending ".sbd" is reserved for .sbd directory.

File name hashing by definition like next is needed for reserved file name.
> ILLEGAL_FOLDER_STRING_AS_ENDING_LETTERS ".msf , .sbd"
This is usable for special and stupidly prohibited file name like CON, PRN on MS Windows.
> ILLEGAL_FOLDER_NAMES_ON_WIN "CON , PRN , ..."
FYI.
Ignoring "file with starting special character", "file with reserved file extension", and "reserved file", is done in nsMsgLocalStoreUtils::nsShouldIgnoreFile.
> http://mxr.mozilla.org/comm-central/source/mailnews/local/src/nsMsgLocalStoreUtils.cpp#25
As for ending file extension string, same problem occurs on ".toc", ".snm"(Netscape's index file), and ".mozmsgs" too.
To resolve this kind of problems, clear isolation of "Folder name or Mbox name" and "(local) file name" is mandatory, but it's still not achieved in Mail&News, and "URL like format for any internal resource address of mailer" makes it worse, as easily known by meta bug 124287...
You need to log in before you can comment on or make changes to this bug.