diff --git a/mozilla/mailnews/base/search/resources/content/FilterListDialog.js b/mozilla/mailnews/base/search/resources/content/FilterListDialog.js index 5025bfc10ac..96efc4c84d0 100644 --- a/mozilla/mailnews/base/search/resources/content/FilterListDialog.js +++ b/mozilla/mailnews/base/search/resources/content/FilterListDialog.js @@ -154,7 +154,7 @@ function setServer(uri) var resource = gRDF.GetResource(uri); var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); - //Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user + //Calling getFilterList will detect any errors in rules1.dat, backup the file, and alert the user //we need to do this because gFilterTree.setAttribute will cause rdf to call getFilterList and there is //no way to pass msgWindow in that case. diff --git a/mozilla/mailnews/base/search/resources/locale/en-US/filter.properties b/mozilla/mailnews/base/search/resources/locale/en-US/filter.properties index a10b77d45ec..26003cf74ec 100644 --- a/mozilla/mailnews/base/search/resources/locale/en-US/filter.properties +++ b/mozilla/mailnews/base/search/resources/locale/en-US/filter.properties @@ -6,10 +6,10 @@ cannotHaveDuplicateFilterTitle=Duplicate Filter Name cannotHaveDuplicateFilterMessage=The filter name you entered already exists. Please enter a different filter name. deleteFilterConfirmation=Are you sure you want to delete this filter? untitledFilterName=untitled filter -filterListBackUpMsg=Your filters do not work because the rules.dat file, which contains your filters, could not be read. A new rules.dat file will be created and a backup of the old file, called rulesbackup.dat, will be created in the same directory. +filterListBackUpMsg=Your filters do not work because the rules1.dat file, which contains your filters, could not be read. A new rules1.dat file will be created and a backup of the old file, called rulesbackup.dat, will be created in the same directory. customHeaderOverflow=You've exceeded the limit of 50 custom headers. Please remove one or more custom headers and try again. -filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules.dat file, which contains your filters, to use fewer custom headers. -invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules.dat file, which contains your filters, to remove invalid characters from your custom headers. +filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules1.dat file, which contains your filters, to use fewer custom headers. +invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules1.dat file, which contains your filters, to remove invalid characters from your custom headers. continueFilterExecution=Applying filter %S failed. Would you like to continue applying filters? promptTitle=Running Filters promptMsg=You are currently in the process of filtering messages.\nWould you like to continue applying filters? diff --git a/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp b/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp index 1efe2f4daa8..2ef57959fc5 100644 --- a/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp @@ -186,8 +186,8 @@ NS_IMETHODIMP nsMsgFilterService::SaveFilterList(nsIMsgFilterList *filterList, n filterFile->GetLeafName(getter_Copies(finalLeafName)); if (!finalLeafName.IsEmpty()) parentDir->Rename(finalLeafName); - else // fall back to rules.dat - parentDir->Rename("rules.dat"); + else // fall back to rules1.dat + parentDir->Rename("rules1.dat"); tmpFiltersFile->Delete(PR_FALSE); } diff --git a/mozilla/mailnews/base/src/nsMessengerMigrator.cpp b/mozilla/mailnews/base/src/nsMessengerMigrator.cpp index c7f96bd3e2d..3846eafa8b8 100644 --- a/mozilla/mailnews/base/src/nsMessengerMigrator.cpp +++ b/mozilla/mailnews/base/src/nsMessengerMigrator.cpp @@ -131,7 +131,7 @@ static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); #define DEFAULT_4X_TEMPLATES_FOLDER_NAME "Templates" #define UNSENT_MESSAGES_FOLDER_NAME "Unsent%20Messages" -#define FILTER_FILE_NAME "rules.dat" /* this is XP in 5.x */ +#define FILTER_FILE_NAME "rules1.dat" /* this uses a cross-platform file format */ /* we are going to clear these after migration */ #define PREF_4X_MAIL_IDENTITY_USEREMAIL "mail.identity.useremail" diff --git a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp index a70e87ea385..ead3c7a7e34 100644 --- a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp +++ b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp @@ -1083,8 +1083,40 @@ nsMsgIncomingServer::GetFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList ** rv = mFilterFile->FromFileSpec(thisFolder); NS_ENSURE_SUCCESS(rv, rv); - mFilterFile->AppendRelativeUnixPath("rules.dat"); - + mFilterFile->AppendRelativeUnixPath("rules1.dat"); + + PRBool fileExists; + mFilterFile->Exists(&fileExists); + if (!fileExists) + { + nsCOMPtr oldFilterFile = do_CreateInstance(NS_FILESPEC_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = oldFilterFile->FromFileSpec(thisFolder); + NS_ENSURE_SUCCESS(rv, rv); + oldFilterFile->AppendRelativeUnixPath("rules.dat"); + + oldFilterFile->Exists(&fileExists); + if (fileExists) //copy rules.dat --> rules1.dat + { + nsFileSpec rootFolderSpec; + thisFolder->GetFileSpec(&rootFolderSpec); + + nsCOMPtr rootFolderDir; + rv = NS_FileSpecToIFile(&rootFolderSpec, getter_AddRefs(rootFolderDir)); + NS_ENSURE_SUCCESS(rv, rv); + + nsFileSpec oldFilterSpec; + oldFilterFile->GetFileSpec(&oldFilterSpec); + + nsCOMPtr localFilterFile; + rv = NS_FileSpecToIFile(&oldFilterSpec, getter_AddRefs(localFilterFile)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = localFilterFile->CopyToNative(rootFolderDir, NS_LITERAL_CSTRING("rules1.dat")); + NS_ENSURE_SUCCESS(rv, rv); + } + } nsCOMPtr filterService = do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp index 5fe5a180b15..74ebff75b3b 100644 --- a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp @@ -189,7 +189,8 @@ nsShouldIgnoreFile(nsString& name) if (firstChar == '.' || firstChar == '#' || name.CharAt(name.Length() - 1) == '~') return PR_TRUE; - if (name.EqualsIgnoreCase("rules.dat") || + if (name.EqualsIgnoreCase("rules1.dat") || + name.EqualsIgnoreCase("rules.dat") || name.EqualsIgnoreCase("filterlog.html") || name.EqualsIgnoreCase("rulesbackup.dat")) return PR_TRUE;