Mail hangs around in the TrainSpam folder on one of our Macs

We’re running SpamSieve 3.0.5 on several Macs which are all running Sonoma 14.6.1. On just one of them, when spam that gets through the filtering is manually moved to the TrainSpam folder it remains sitting there. On all of our other Macs it disappears pretty much instantly (i.e. the TrainSpam folder is always empty). SpamSieve is set up properly with the training script etc. so I’m at a bit of loss as to why it only happen on the one Mac.

Anyone have any thoughts as to what might be happeninghere?

Are you saying that the different Macs are using the same IMAP account but are showing different contents for the same mailbox?

No, each Mac is using a different account. The user of each Mac will move any spam that gets past SpamSieve to their account’s ‘TrainSpam’ folder. On all of the Macs these mails then vanish from the user’s TrainSpam folder almost instantly. One one Mac however the mails never get deleted from the TrainSpam folder; they just sit there until manually deleted. I suspect maybe the automatic training may not be happening on that Mac (since presumably that is what deletes the mails from TrainSpam?) but I don’t know how to verify if that is the case or not. The SpamSieve and Apple Mail configurations are the same on thsi Mac compared to the ones where things work as expected.

You can see in SpamSieve’s Log window whether training is happening. The main reasons it would not be checking TrainSpam are:

The log does confirm that manual training is not occurring.

The InBox most certainly receives new messages, many 10s per day. Everything seems to be set up correctly (see screenshot), at least it is set up the same as on Macs where it is working. Also, it used to work fine on this Mac when it was originally set up; it seems to have stopped working within the past couple of months.

That looks good to me.

You can test the script by opening it in Script Editor and clicking Run. If that works, you can test the rule by selecting a message that’s not in TrainSpam and choosing Message ‣ Apply Rules.

I tried running the Script via Script Editor and it failed with the error ‘SpamSieve got an error: Application is not running’, which is clearly not correct since Mail was right there and open.

Screenshot 2024-08-24 at 09.32.35

I checked the Automation and Full Disk Access permissions and they were all set as they should be. SO, I rebooted the Mac and tried again. Now the script ran just fine, it processed all the queued mails in the TrainSpam folder (confirmed by the SpamSieve log) and deleted them. Mail > message > Apply Rules also seems to behave correctly. So it seems the reboot fixed things. However…

This Mac has applied two macOS updates (14.6.0 and 14.6.1) since the script originally stopped working and each of those incurred a reboot, so I’m not convinced this is the whole story. Any thoughts?

After reporting an error, Script Editor should show which line of the script it pertains to, which would be interesting to know.

Good.

I’ve not heard of any related problems that those updates fixed.

As I recall this is the bit that was highlighted in Script Editor:

on doRemoteTraining()

if application “Mail” is not running then return

if my shouldDisableOnThisMac() then return

tell application “SpamSieve”

set useJunkMailbox to

lookup single key “AppleMailUseJunkMailbox” without default value

end tell

OK, thanks. That is very strange, although fluke behaviors get “fixed” by restarting the Mac all the time.

As you say, kind of strange. We’ll keep an eye on it - hopefully it won’t occur again.