AppleScript Errors with SpamSieve 3.0.5

Running SpamSieve 3 on macOS Sonoma 14.5 (23F79) on an Intel iMac 2019.

SpamSieve 3.0.4 was running very well for me.

But when I updated to 3.0.5 I started getting frequent errors in the log - hopefully it’s an easy fix! Here’s an example:

Summary:	An AppleScript error occurred.
Suggestion:	Mail encountered error -1712 (errAETimeout - the AppleEvent timed out ):

	Mail got an error: AppleEvent timed out.


	<unknown location>
	Date Logged:	Today at 10:32:22 AM

	SpamSieve:	3.0.5 at /Applications/
	Device:	macOS 14.5.0 (23F79) on zzzzz.local (iMac19,1)
	Language:	English

	Error:	<NSError Domain=NSOSStatusErrorDomain Code=-1712 UserInfo={
    MJTScriptArgumentsDescription = "<NSAppleEventDescriptor: [ 0 ]>",
    MJTScriptSubroutine = "listinboxestocheck",
    MJTStackFrames = (
        "-[NSAppleScript(MJT) mjtCallSubroutine:arguments:error:] (174)"
    NSAppleScriptErrorAppName = "Mail",
    NSAppleScriptErrorBriefMessage = "AppleEvent timed out.",
    NSAppleScriptErrorMessage = "Mail got an error: AppleEvent timed out.",
    NSAppleScriptErrorNumber = -1712,
    NSAppleScriptErrorRange = NSRange: {0, 0},
    NSLocalizedDescription = "An AppleScript error occurred.",
    NSLocalizedFailureReason = "Mail got an error: AppleEvent timed out.",
    NSLocalizedRecoverySuggestion = "Mail encountered error -1712 (errAETimeout - the AppleEvent timed out ):
        	Mail got an error: AppleEvent timed out.

The background on this is that there’s something weird going on with Mail on your particular Mac, where it’s taking a very long time to respond to commands from SpamSieve. This has been happening since SpamSieve 3.0, i.e. the entire time that SpamSieve has been making these particular queries of Mail.

Up through SpamSieve 3.0.3, SpamSieve would just keep waiting for Mail to respond, and if it didn’t this could prevent filtering from ever happening.

With SpamSieve 3.0.4, we added a timeout so that after 5 seconds (for this particular query of finding the inboxes for your accounts), SpamSieve would give up and log an error. Then it would try again later. You e-mailed us because you were suddenly seeing all else errors reported, which had been happening before but without your knowledge because they were not displayed in the Log window. I told you how you could change the setting so that the timeout was 30 seconds instead of 5, and this seemed to help. Evidently, Mail on your Mac was in many cases able to respond eventually; it just took a bit longer.

SpamSieve 3.0.5 works the same way in this regard except that the default timeout is now multiplied by 2, so 10 seconds, which translates to 60 seconds using your custom setting. The commands that SpamSieve is sending to Mail have not changed. So, if anything, I would expect to see fewer timeout errors than before because SpamSieve is waiting longer.

If you want, you can play around with the timeout using the Terminal app. The default is 5:

defaults wrote com.c-command.SpamSieve AppleMailScriptTimeout 5

and you have it set to 30. Or, you may want to try recording some sample logs from Mail when you are seeing a series of these errors to try to capture what it’s doing when it’s not responding.