"Trust junk mail headers set by" dropdown in account manager/ junk settings shows only a number 5 instead of the names of the server classifiers supported.
I think this regressed by bug 824150:
14.2 +++ b/mailnews/base/prefs/content/am-junk.js
14.3 @@ -272,21 +272,21 @@ function buildServerFilterListFromDir(aD
14.4 // now iterate over each file in the directory looking for .sfd files
14.5 let entries = aDir.directoryEntries
14.8 while (entries.hasMoreElements())
14.10 let entry = entries.nextFile;
14.11 // we only care about files that end in .sfd
14.12 - if (entry.isFile() && /\.sfd$/.test(entry.leafName))
14.13 + if (entry.isFile() && entry.leafName.endsWith(".sfd"))
14.15 let fileName = RegExp.leftContext;
14.16 // if we've already added an item with this name, then don't add it again.
14.17 - if (!aISPHeaderList.getElementsByAttribute("value", fileName).item(0))
14.18 + if (!aISPHeaderList.querySelector('[value="'+ fileName + '"]'))
14.19 aISPHeaderList.appendItem(fileName, fileName);
As the /regular expression/ was removed, it looks like the RegExp object(?) now returns something else as expected. This is easy to fix by converting that line to string operations on entry.leafName.
I'll do it shortly.
The offending patch http://hg.mozilla.org/comm-central/rev/89fa8b687178 landed on Feb 04, so this will be needed for branch 21.
Created attachment 719913 [details] [diff] [review]
patch to fix the issue
Sorry for the breakage.
I wanted to convert the ".sfd" to a constant so that the .endWith and -4 could be derived from it. In case it changes in the future.
Even with the patch, I am not sure the pref mail.server.%serverkey%.serverFilterName is saved properly (I did not find it in prefs.js), I'd like to check that out.
Created attachment 720405 [details] [diff] [review]
Ok, it looks like the mail.server.serverX.serverFilterName pref is not set if the value matches mail.server.default.serverFilterName . But that seems fine, as retrieving the
...retrieving the pref value returns the default value as if it was the value of the pref.
Comment on attachment 720405 [details] [diff] [review]
Review of attachment 720405 [details] [diff] [review]:
Just one nit - beyond that, I'm happy with it.
@@ +269,5 @@
> function buildServerFilterListFromDir(aDir, aISPHeaderList)
> + // Now iterate over each file in the directory looking for .sfd files.
> + const suffix = ".sfd";
consts should begin with k's, so this should be const kSuffix.
Created attachment 725940 [details] [diff] [review]
Comment on attachment 725940 [details] [diff] [review]
[Approval Request Comment]
Regression caused by (bug #): bug 824150
User impact if declined: server junk filtering gets broken/unable to be set when the user enters the Junk settings pane.
Testing completed (on c-c, etc.): Verified fix on Daily 20130320030725.
Risk to taking this patch (and alternatives if risky): probably can't be much worse than it is.
Checked in: https://hg.mozilla.org/releases/comm-aurora/rev/19386d8aa499