Recipe for Trouble: OS X 10.8.2, MailMate, and SpamSieve

The Problem

Since Apple released the 10.8.2 update for Mountain Lion I have received several reports about MailMate being slow and unable to detect spam. The problem turns out to be that the AppleScript communication between MailMate and SpamSieve breaks down. Each request sent by MailMate to SpamSieve hangs for 2 minutes before failing with a timeout error. This happens for every incoming message. See further below for more technical details and a bit of insight into the detective work some times needed in the software development process.

The Solution

If you think you have this problem with MailMate/SpamSieve then you should fetch the current test version of MailMate by holding down ⌥ when clicking “Check Now” in the Software Update preferences pane of MailMate (note that, in general, test versions are not always stable versions of MailMate and they may include incomplete features).

If you have a Mac App Store license then you cannot update to a test version. Instead you should contact me directly.

You can also temporarily fix the problem by killing a process named appleeventsd. You can find and kill it in the Activity Monitor or you can paste the following in a Terminal window (requires a password):

sudo killall -KILL appleeventsd

The Technical Details

The time line of an investigation of this problem can be seen in this ticket. In short, Michael Tsai (SpamSieve developer) joined the discussion and we found a workaround involving a different approach to the AppleScript communication between MailMate and SpamSieve. But a much better understanding of the problem and a better workaround came about when Michael was contacted by Brian Webster. You can read about Brian’s findings here.

This is what is currently “known” about the problem:

  • The problem is related to the OS X 10.8.2 update.
  • The problem is related to the use of the AESendMessage/AESend functions used with typeApplicationBundleID or typeApplSignature for the target type.
  • Using typeKernelProcessID for the target type still works (thanks goes to Brian Webster for this crucial fact). This is what is used for the workaround in MailMate.
  • NSAppleScript and osascript are not affected by the problem.
  • Killing the appleeventsd daemon fixes the problem temporarily (Antonin Hildebrand discovered this fact).

The above indicates that the problem is likely to be some kind of stale cache used by appleeventsd for mapping bundle ids and 4-letter application signatures to process ids. It also indicates that triggering this problem involves relaunching the target application (in order to give it a new process id). This has been confirmed by a user (Torsten Grust) in the context of MailMate/SpamSieve.

Thanks to everyone who helped track down this problem. Note that I am still not able to reproduce the problem myself which means that feedback on the solutions above is still appreciated.

Post a comment.

Crowd Funding Campaign


Macworld wrote:
  • As email search abilities go, this seems less like bringing a gun to a knife fight, and more like thundering into that particular duel at the controls of a helicopter gunship.
  • Needless to say, the program never crashed, glitched, or gave me any sort of trouble during my tests. MailMate does not know weakness. wrote:
  • MailMate is a refreshingly efficient way to deal with mail in IMAP accounts, all with handy keyboard shortcuts, superior search and precise smart folders.
  • As a testament to its raw power, MailMate does not stop at From: or body text, of course; instead, you can have it match just names or first names, email addresses, domain names, parts of domain names, quoted text and what not.
Lifehacker wrote:
  • Search is amazing, providing you with a ridiculous amount of control.
  • Practically everything can be accessed using the keyboard.

User Quotes

Rob Schumann (MacUpdate) wrote:
  • I […] felt immediately at home with its much more capable filtering system that can be directed at any folder, not just the inbox, and the ability to construct complex any/all rules that can be nested multiple levels deep.
  • […] in general it just feels significantly faster than
David Levy (email) wrote:
  • I've been stress testing MailMate with a variable and highly intermittent connection. […] My overall assessment is that MailMate has been markedly superior [to Apple Mail] in this use modality […]
Tom Borowski (blog) wrote:
  • […]this way of handling signatures is far superior to any other approach I’ve seen so far. Why hardly anyone implements it in this way is a mystery to me.
TheBrix2008 (MacUpdate) wrote:
  • […] on first run, MailMate spotted my IMAP settings, prompted for import, then got to work without fuss.
  • it has a phenomenal array of filtering, statistics and views […] My favourite is “Correspondence”, which picks out all email from your current correspondent and lists it in a separate pane… instantly.
  • The author should be rewarded for having the courage to start from scratch.