JunkMatcher Howto: Troubleshooting

(new stuff is in red)

How do I make my bug report more useful?

First thank you for making the effort to report a problem, and we all know the reason of reporting bugs - we all want to squash them (a good bug is a dead bug)! If you can do the following, it will make the process more manageable for me:

  • When reporting problems, I strongly recommend you to use the menu item Help -> Send Feedback in JunkMatcher.app - the message you send that way will have a little text appendage to tell me what kind of system you're running JunkMatcher on (don't worry, it's just a plain old email so you can see whatever that'll be sent to me in clear text).

    If that option is not possible (JunkMatcher is totally AWOL), please be as specific as possible about what OS X/Mail.app you're running on. For reference, this is the text appendage that'll get sent if you use Send Feedback menu item:

    ------ System Information ------
    Mail:2.0.3; JunkMatcher: 1.6.1; OS: 10.4.2 8C46 (8.2.0)
    Machine: PowerBook5,6; CPU: 1.67 GHz; Memory: 1.5 GB
    Running as an admin, using shell /bin/bash
    Python version 2.3.5 (#1, Mar 20 2005, 20:38:20)
    [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)]
  • Equally important, if not more important, is to send me any messages that JunkMatcher.app/Mail.app/Python might have printed out in the console log when the problem occurred. These diagnostic messages can help me tremendously in pinpointing the problem.

    But wait, where is this console log, you asked? Just fire up this application:

    ~/Applications/Utilities/Console.app

    and make sure you're looking at the "console.log", not one of the other logs available there. An additional hint: the search field ("Filter") at the upper-right corner of the Console.app window can be handy.

Users of all versions: Long whitelist causing process Python to take 100% CPU time.

The symptoms:

  • your Mac becomes very slow, and upon examination (using Activity Monitor.app, for example), a process python is taking almost all of CPU power.
  • If you open up the file Library/Application Support/JunkMatcher/whitelist under your home folder with a text editor (such as TextEdit.app), the file contains more than 200 lines.

The cause: In Python's regular expression library there is an obscure limitation on the number of "capturing groups" you can have in a single regular expression: the limit is 100. By having a long whitelist we're exceeding this limit. (If you don't know what this is about, just ignore this explanation)

(Why are there so many email addresses appearing in my whitelist you ask? Read here for an explanation.)

The workaround: You can't prune the whitelist using JunkMatcher.app, because the same limitation will hit there too. Again use a text editor such as TextEdit.app to edit the file Library/Application Support/JunkMatcher/whitelist in your home folder - just prune it so you have a file with no more than 200 lines. The file format is simple:

"regular expression pattern 1"
"pattern name 1" i

where i is either 0 or 1: it's 1 if the pattern is automatically added when you corrected JunkMatcher. Just make sure you remove the correct 2 adjacent lines for each pattern you want to prune.

(Yes a fix will come later when I finally have some time to work on this)

Upgrading from version 1.5.8 or earlier to 1.6.0+: JunkMatcher stopped filtering and I got error message "no attribute 'spamBayesTest'" (or similar) in the console log?

Unfortunately this is an installation-related bug introduced in version 1.6.0 - if you upgraded from 1.5.8 or earlier to 1.6.0 you might have experienced some of the following symptoms:

  • JunkMatcher stopped filtering.
  • Opening the Log window in JunkMatcher.app sometimes crashed the app.
  • In the console log there was this message: "Exception when JMServer is matching: 'Tests' object has no attribute 'spamBayesTest'."
  • Or you may have seen this error message in the console log: "Property test PropertySpamBayesClassification is AWOL."

Although this bug has been fixed in 1.6.1, but if you have used 1.6.0 and are experiencing these problems, the damage has been done. Fortunately, it's rather easy to fix the problems.

The root cause is just some missing lines in some of your configuration files - they're all text files so you can use any Unicode-capable text editor to open them and fix the errors. But before I tell you the (slightly) more complicated solution, you can just wipe out this directory:

~/Library/Application Support/JunkMatcher

and reinstall JunkMatcher 1.6.1 or later. Of course all of your settings will be gone.

A less drastic solution is:

  1. Quit Mail.app and JunkMatcher.app if they are open.
  2. Use a text editor to open the file ~/Library/Application Support/JunkMatcher/tests, and look for this line:

    PropertySpamBayesClassification H 1

    If it's not there, add it. Remember also to leave a blank line above and below, like the other Property strings in the file do. You don't need to care too much about where to add the line - after it's done you can always reorder the test in JunkMatcher.app like you always do.
  3. Use a text editor to open the file ~/Library/Application Support/JunkMatcher/properties, and look for these two lines:

    ""
    PropertySpamBayesClassification 99073.647972 837 14 3 138

    If they are not there, add them. Note you MUST add the two lines back-to-back - no blank line is allowed between the two. But remember also to add a blank line above the first line and below the second line.

That's it - make sure the problems are now all gone.