Messages Not Removed from TrainGood

The Spam Filtering Drone is not removing the TrainGood label from messages. The downloaded script file seems to have an error in it. So when a message is put into TrainGood after it processes the message now appears in both INBOX and TrainGood. Then everytime it is run it reprocesses the same message. Looking at the script file I noticed the following line:
my moveMessage(_message, my inboxForAccount(_account), false )
I edited that line and changed the “false” to “true” and now the messages are removed from the TrainGood folder as they should be.

Is this with a Gmail account? The script was written that way in order to work around a problem other customers had reported where Mail was not properly moving messages to the inbox. However, if it works better for you with that change, feel free to keep using the script like that.

Yes this is with Gmail. I will have to try my bellsouth and icloud accounts and see what they do.

Ok yes this is causing an issue with my Yahoo mail account. iCloud account works fine.

What happens with the Yahoo account?

Now it is really not functioning correctly. I erased the edited file and redownload a fresh copy and put it in the scirpts folder. I set the flag for logging and the movemessage flag to true. saved the file. But now when I put anything in the traingood folder and run the script it moves the message to Junk. This is happpening on all the accounts but the Mail app no longer freezes.
tell current application

do shell script “/usr/bin/logger -s ‘SpamSieve [Apple Mail Remote Training MJTLog] Moving message to Junk: [C-Command] [SpamSieve] Messages Not Removed from TrainGood’”

→ “”

end tell

tell application “Mail”

move message id 1161014 of mailbox “[Gmail]/All Mail” of account id “CA8C41D2-74E1-4CB2-95C3-D002F332A204” to junk mailbox

The modification that you made was to tell the script that the messages being moved were always spam. If you want to modify the script to tell Mail a different way of moving the messages, I would instead change the line:

move _message to inbox

to:

set _message's mailbox to _mailbox

I don’t understand your point about Mail no longer freezing, since you didn’t mention that before…

Not sure what was happening but the mail app was freezing. It is not anymore. Also, to make Gmail work like the rest with the default script no changes. I went into the Gmail settings itself and turned off “Show in IMAP” Important, Chats, and All Mail. Doing that fixed the issue with Apple Scripts and Gmail IMAP not playing nicely.

1 Like

I’m having the same issue here with SS 3.0.3 and Mail 16.0 on mac OS 14.2.1 (23C71). It seems to only be a problem with my two Gmail accounts, as iCloud moves the messages. As far as I can tell, it seems the logic when using this script is that:

  1. Message is identified as spam and put into the Junk folder (which shows “Spam” label in GMail web UI).
  2. I move the message to TrainGood in Mail, which removes “Spam” and adds the “TrainGood” label in the web UI.
  3. The script runs and moves the message, but actually only adds the “Inbox” label to the message. Now locally the message appears in both folders and in the web UI it has two labels, both “TrainGood” and “Inbox”

It would seem the solution is to remove the TrainGood label when moving the message. I set pMoveBySettingMailbox to false with no change, as well as modified the

move _message to inbox

line with no success. I also don’t see any “Show in IMAP” settings in Gmail as mentioned above. I’ll admit I’ve reached the limit of my knowledge and would appreciate any additional ideas on next steps.

Apple Mail doesn’t offer direct control over Gmail labels, but it’s supposed to remove TrainGood when moving the message to the inbox. I’m not sure why that’s working for other people but not on your Mac.

There’s info about the Gmail IMAP settings here.