I noticed that lately, my junk mail filtering in Mail app was no longer working -- at least not very well, and perhaps not at all. By "not working," I mean that mail which was obviously junk was not getting moved to my junk mail folder automatically. I had to drag it over by hand.
I thought maybe the spammers were getting smarter (but really, who could believe that?). The weird thing was, it was happening on both of my Macs. After perhaps a week or so of this behavior, one machine wouldn't even allow me to drag junk mail over to the junk mail folder by hand. The Mail app would just crash!
I first tried repairing permissions. That didn't help. So I went to the ~/Library/Mail folder and saw this file called LSMMap2, which I knew had something to do with junk mail. I tried to open it up using SubEthaEdit. What do you know. It crashed as well! Something was obviously not right with this file.
Here's what worked for me:
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031207160555107