C-Command Software Forum

Slow "Train as Spam" in Mavericks with Apple Mail

Just started using Spamsieve (2.9.11, non-beta), and it’s on a brand-new system with 10.9. I’m using Apple Mail. The “Train as Spam” menu item most of the time (but not all the time) takes so long to transfer messages that I will often go on and select another message, and at some point, my current message will end up getting trained as spam. I’d estimate that when the delay happens, it’s around 4-5 seconds. Mail is otherwise completely responsive and fast when this happens. It’s quite annoying and I’m spending a lot of time fixing up bad rules in my blocklist. Anyone else experiencing this? The actual filtering itself is fast and working fine.

Training as spam used to be almost instantaneous. It’s still fast, but under Mavericks, Apple Mail is very slow at moving messages via AppleScript (and also in some other situations). You can tell SpamSieve not to move the trained messages, and this will also speed it up; you could then delete the messages after training (e.g. after they change color) or use one of the “Message > Move to Favorite Mailbox” keyboard shortcuts to file them.

Secondly, when you train a batch of messages, SpamSieve does “snapshot” which messages were selected. So it’s OK to select another message without worrying about it being trained. The issue is that you can only do this once at a time; if you train again while the first training is in progress, the second training won’t snapshot its messages until the first training is done.

Just a quick update here. I’ve turned off moving messages, and that hasn’t helped the matter.

If I open the SpamSieve log alongside Mail, when I train a message as spam, I see the same delay of around 4s before anything gets logged. So, it’s not really the moving that’s most of the slowness. In fact, I’m going to re-enable moving because, without keeping the log open, the moving is the only way I can tell that the training has happened and completed. Like others have reported, it seems like around 1/3-1/2 of the time, training isn’t happening at all.

This is with the latest Apple Mail, 7.0 (1822)

For performance reasons, SpamSieve waits several seconds before updating the log. So the log is not a very accurate way to gauge the speed.

I’ve looked into this with a bunch of users, and for everyone else:

  1. Training without moving is fast.
  2. Moving via AppleScript without training is slow.

So if #1 is slow for you, you’re seeing something atypical, and I would suggest recording samples of Mail and SpamSieve during the training so that we can see what’s causing the slowness on your Mac.

Regarding the moving, there are lots of aspects of Mail in Mavericks that are slower than before, as well as new bugs that have been introduced. I’m sure that Apple will continue to work to improve Mail, and I have filed a bug for this particular performance regression. (Oddly, it does not seem to affect all users, or even all messages for the users who are affected.) I am also looking into workarounds to make the moving faster in the interim.

You can also tell that training has happened because the SpamSieve Dock icon will flash an “S” or “G” for each message trained, and SpamSieve will change the color of the message in Mail (which you can see after de-selecting).

I have not seen other reports saying that. You can click this link to turn on some logging (to the regular Console) so that we can see if the training commands are getting lost, and how long they’re taking. After clicking the link, restart SpamSieve and then Apple Mail. If you need to turn off the logging, click this link.

Fair enough!

Will do!

Right. Unfortunately, neither of those are great for my set-up–I have the dock auto-hide, so I don’t see those icon notifications. And it’s pretty unnatural to deselect a message to see if it has changed color–normally I’m just moving to the next message, and sometimes SpamSieve will train on that one instead. Thanks for the suggestions, though!

Delay of 8-10 seconds for every “Train as Spam”
I’m seeing a delay of 8-10 seconds with every “Train as Spam”. If I move to another message before the trained email disappears, it makes a different email disappear. Not good!

Right now I’m just waiting the 10 seconds, but it is pretty annoying…

Any solutions will be welcome! Thanks!


Did you try my suggestions here?

Moving Mails manually is NOT a solution.

I’m sorry, but SpamSieve has to help me do my work more efficiently. If I have to move any marked mail manually to the destination folder, than it’s just the contrary of what I want and what I expect, be it Apple’s fault or not.

Is there a solution to wait for and looking forward to?

Best regards

The reason I asked whether you had tried those particular manual steps is that I’m working on a way of automating that sequence of actions. So it would be useful to know whether that works quickly on your Mac.

Secondly, in the interim, I would expect it to be much easier/faster for you to press Command-Control-S, then Command-Control-5 than to do the former and then wait 10 seconds.

Unfortunately, this flash is so quick that most of the time it’s imperceptible.

Dysfunctional “Train as Spam” & “Train as Good”

YES, I have the same problem, but worse. It takes at least 5 minutes for the command to be processed. During the “processing time”, the message in question is greyed out. When will this be fixed? It’s extremely annoying and I might as well not use SpamSieve at all if it’s going to be this slow. Nothing suggested in the threads below has helped.

I’m working on a beta version of SpamSieve to work around this OS issue. If you’re interested in trying it out, please contact me via e-mail.

SpamSieve 2.9.12 includes a workaround that makes moving trained messages much faster.

So, this is slightly better, but the problem is still there. What seems to be happening is that SpamSieve is training immediately, as requested, but Mail won’t reliably move the message (or change its color if I’m training on something in the Spam folder).

A common action for me is to look at all the rainbow-color messages in the Spam folder, select the ones which are spam, and train on them. What should happen is that they become the standard background color. What actually happens is that if I control-command-S (“Train As Spam”) even as much as 30 times, they won’t reliably change color. If I then command-click on one of them (to deselect it), it seems that all the messages will usually get the correct Spam treatment.

A more frustrating action is when I have a piece of spam in my Inbox. If I control-command-S on it, sometimes everything works as it should. More often than not though, I see Spam Sieve train on it, but it stays in the Inbox. If I then click on another message, that message will immediately be moved to the Spam folder, and if I look in the Spam Sieve log, I see that both the message I trained AND the message I subsequently clicked have both been manually trained as spam. This is really not good, and I end up editing the Spam Sieve blocklist several times a day.

This is with OS X 10.9.1 and no other Mail plugins or mods. Thanks.

I have not seen any cases where issuing the training command multiple times is necessary or helpful, and doing can cause problems and additional slowdowns. I recommend that you train once and then wait. It may speed things up if you click to a different application and then back to Mail.

I have identified another cause of the slowness and am working on addressing it.

This problem should be avoided if you follow the advice above.

The proper remedy if this happens is not to edit the blacklist but to train the good message as good.

Possible Solution?
I had the same problem regarding a multiple second delay in marking emails as Spam, either via the keyboard shortcut or via the menu item. I am running SpamSieve 2.9.12 in Mavericks 10.9.1.

On a lark, I unchecked “Save fales negatives to disk” under the Advanced tab in SpamSieve settings and now I am getting excellent (instant) performance using either the keyboard shortcut or menu option.

Give this a whirl and post your experience, I’m curious if this helps other folks.

Thanks for the report. Based on the way the code is designed, I would not expect there to be any connection between that preference and the delay when training. But I would certainly be interested to hear whether others notice the same behavior that you did.

Also having slow Training and more
I’ve experienced the slow ability for SpamSieve to move mail I’ve labeled as SPAM - and for some reason some mail I find in the SPAM folder and keep marking as good continues to be treated as SPAM - I have reset and started retraining and this still occurs. Ideas?

You can speed this up using the AppleMailTrainSpamGUIScripting esoteric preference, and I’m working on making it even faster in the next version of SpamSieve.

Resetting the corpus should be your last resort, after you’ve verified that SpamSieve thought the messages were spam. It sounds like you have some other configuration problem here. Please follow the If you have good messages in your Spam mailbox instructions and send me an e-mail if you need further assistance.

Rumors are that there is a beta out of Apple Mail that fixes a lot of Apple Mail interactions with Gmail. Is it advisable to wait for the new version before trying below?

(I am a new user of SpamSieve; our institution moved to Gmail and the flow of spam increased enormously.)