SaneBox Script Requires Update for Non-Default Spam Mailbox Names

Since I was forced to reinstall all my rules for SS due to Sierra upgrade wiping them out, I took the opportunity to also use non-default names for Spam folders as described as acceptable in SS setup manual in order to make Rules and scripts less visually confusing.

However, I quickly discovered this broke the SaneBox script/rule across 11 accounts.

I was able to (nearly as) quickly modify the existing script by adding the custom spam mailbox names to the account/mailbox pairs list:

return {{“Personal Account Name”, {"@SaneLater", “Other”},“Personal Account’s Spam Folder Name”}, {“Work Account Name”, {"@SaneLater"},“Work Account’s Spam Folder Name”}}

… and then altering the following lines:

– set {_accountName, _mailboxNames} to _pair
set {_accountName, _mailboxNames, _spamMailboxName} to _pair

– my filterAccountMailboxNamed(_account, _mailboxName)
my filterAccountMailboxNamed(_account, _mailboxName, _spamMailboxName)

– on filterAccountMailboxNamed(_account, _mailboxName)
on filterAccountMailboxNamed(_account, _mailboxName, _spamMailboxName)

– set _spamMailbox to my spamMailboxForAccount(_account)
set _spamMailbox to _account’s mailbox _spamMailboxName

I also globally replaced _pair with _accountParameters, but I wanted it to be clear here.

If I may say, SS desperately need to use a .plist interface to list accounts, specify Spam folders, and specify additional target folders, then have scripts query the one .plist file. This would also greatly facilitate actions and Rules based on score/color as well, and probably a bunch of other things I’ve not encountered yet.

Noted, thanks.