C-Command Software Forum

Apple Mail Remote Training Error, Can't get mailbox "Spam", and unread mail

Hi, I’ve just started trialling SpamSieve and while SpamSieve is successfully filtering messages into the relevant spam mailboxes I have the following problems:

  1. I’m getting an error message in the Console, as described below.
  2. Messages moved into the spam mailboxes are not being marked as read, despite being set to that in “Change Settings” and in the Remote Training script.
  3. Messages put in the TrainGood and TrainSpam mailboxes are not being moved when I run the Remote Training script.

I’ve set up SpamSieve for multiple IMAP accounts in Mail.app on our office server (running OS 10.11.1). SpamSieve is not installed on the associated client machines.

This is the kind of error I’m getting for each account:

23/10/2015 15:32:51.590 sysadmin[50068]: SpamSieve [Apple Mail Remote Training] Error training from account “Mike Work”: Mail got an error: Can’t get mailbox “Spam” of account “Mike Work”.

The spam mailbox for this account is called “Spam - Mike Work”. The associated rules are “SpamSieve - Mike Work”, which is set to move messages for this account to the above folder. And “Remote Training”, which is set to run the Remote Training script for Every Message.

My configuration for the Remote Training script is:

property pMarkSpamMessagesRead : true
property pMarkGoodMessagesUnread : false
property pSpamMailboxName : “Spam”
property pEnableDebugLogging : false

on accountNamesForDrone()
– Enter your account names here. If you have more than one, separate with commas: {“Account 1”, “Account 2”}
– The account name comes from the “Description” field in the Accounts tab of Mail’s preferences.
return {“Info”, “Fiona iCloud”, “Mike Work”, “Fiona Work”}
end accountNamesForDrone

(I’ve replaced our two-word business name with “Work” in the above examples)

All your spam mailboxes need to be named “Spam” (or whatever else you’ve set in pSpamMailboxName). If the script can’t find the mailbox, it won’t move the messages or mark them as read.

Gotcha, thanks Michael. I misread the manual.

Where it says:

If you have multiple mail accounts, create a Spam mailbox in each account. Instead of creating one SpamSieve rule, create one per account. The name of each rule should be SpamSieve - Account 1 (where Account 1 is the Description of your account). The conditions of the rule should say:

It might be better if there was a paragraph break like so, separating the two topics of Spam mailbox and rules:

If you have multiple mail accounts, create a Spam mailbox in each account.

Instead of creating one SpamSieve rule, create one per account. The name of each rule should be SpamSieve - Account 1 (where Account 1 is the Description of your account). The conditions of the rule should say:

That worked great for all the accounts except the iCloud account:

  1. Messages in the iCloud TrainSpam mailbox remain in there after running the Remote Training script.
  2. Junkmail is appearing in the default Junkmail folder, despite Mail.app’s Junkmail being disabled on all machines.

Thanks for the suggestion. I’ve updated the formatting.

Are you sure that that account’s name is listed in your script? You could also enable debug logging in the script to see which accounts it’s processing and how many messages it’s finding.

This is probably because of the iCloud server filter.

I just ran the script again and this time it cleared it. Not sure why this didn’t appear to do this mailbox the first time.

Thanks for the amazing support!