Block list, remote training

(This is on Apple Mail, by the way.)

I still cannot get my recurrent spams to go to the block list and therefore have new emails from these spammers go directly to Trash. This is despite doing “train as spam” on most of them. This need to be made more simple. The best way would be to incorporate a move to block list item in the remote training. In addition to Train as Spam and Train Good there should be provision for a folder called something like Move to Block List. This should work both on the host Mac and for client devices.

It is time and beyond time to make designating recurrent spams to a mechanism that sends future recurrence of these spams directly to Trash. This is a simple topic that SpamSieve seems to have made either impossible or so opaque that my small brain cannot manage it

I’m not sure what you’re referring to. The regular Train as Spam command, as well as remote training, have always added the sender’s e-mail and name to the blocklist (unless you have unchecked Train SpamSieve blocklist in the settings). It’s much simpler to just always do this automatically than to make the user decide separately whether to train or add to the blocklist.

Do you have a specific example of a message that you trained where that didn’t happen?

No. If you Train as Spam future mails from that sender go to Junk, not Trash 0

It sounds like you are agreeing that training the blocklist works. To control where messages are moved you can use the Move it to the Trash if the spam score is at least setting. Set it to 99 (blocklist) if you want only the blocklisted messages to go to Trash. There’s also a note on that page about how to make the rescue script also move blocked messages to Trash, if you’re trying to get SpamSieve to move messages that another filter put in Junk to Trash. We previously discussed that here.

I think it’s working now. I went by and redid all the steps in order, discarding the old stuff, and I think stuff is now going directly to Trash. BTW doing this I discovered that the Mail rule to run an Applescript can only find a script, not a compiled app. Strange.

Yes, you can either run the script with a rule (where it will be triggered by a new message arriving in the inbox) or run the compiled app in the background (where it will check on a fixed interval).

I agree with Carrickp. I have tried for years using AppleScript to put emails that I never want to see in the blocklist and they occasionally keep appearing in my Inbox or Junk email folder because apparently their score is not 99 but something less. I wish there was a “Train Trash” so that I never ever see emails from that address again. I’m using a timed compiled script and either the script or SpamSieve times out sometimes. Maybe I should try Carrickp’s method and use the script as a SpamSieve rule.

What makes you say that the score is less than 99? We discussed this before here and here, and that was not the problem. It had nothing to do with the blocklist. Rather, the issue was that SpamSieve was not looking at the messages at all because your server junk filter had moved them out of the inbox before they got to your Mac. The solution is to use the rescue script, as I suggested to Carrickp.

If you have SpamSieve configured to move blocklisted messages to the trash, that’s what the regular Train as Spam command will do. You also set up a TrainTrash and script mailbox yourself. I think that’s more complex than what most people want, but it’s fine to do that so long as you only use it for messages that were already moved to Junk automatically.

Did you ever investigate that as previously discussed?

Hey Michael,

| Michael_Tsai Developer
October 10 |

  • | - |

Rand:

I have tried for years using AppleScript to put emails that I never want to see in the blocklist and they occasionally keep appearing in my Inbox or Junk email folder because apparently their score is not 99 but something less.

What makes you say that the score is less than 99? We discussed this before here and here, and that was not the problem. It had nothing to do with the blocklist. Rather, the issue was that SpamSieve was not looking at the messages at all because your server junk filter had moved them out of the inbox before they got to your Mac. The solution is to use the rescue script, as I suggested to Carrickp.

I don’t use the rescue script but likely took ideas from it.

Rand:

I wish there was a “Train Trash” so that I never ever see emails from that address again.

If you have SpamSieve configured to move blocklisted messages to the trash, that’s what the regular Train as Spam command will do. You also set up a TrainTrash and script mailbox yourself. I think that’s more complex than what most people want, but it’s fine to do that so long as you only use it for messages that were already moved to Junk automatically.

Tha’s exactly what. I’ve done. I have a “Train Good”, “Train Junk” and “Train Trash” folders that my script goes through to train those messages. In addition I’ve added scanning of the Junk mailbox again to try to find messages who’s email address is in the blocklist which means I have to run "set _score to score message _source without auto training” which (as I remember) doesn’t always return 99. I don’t move the message to Trash unless the score is 99. Not sure that this works but I’ve also used the junk mail status as a flag. Once I’ve checked a message in Junk whose junk mail status is true I set it to false and only check messages in Junk whose junk mail status is false, but they get left in Junk.

Rand:

I’m using a timed compiled script and either the script or SpamSieve times out sometimes.

Did you ever investigate that as previously discussed?

I have but now don’t remember what the result was. I added a bunch of logger debug messages and and using “log” to stream those errors. I think it appeared during this sequence when the Error Dialog appeared which has to be canceled,

try

with timeout of 5 * 60 seconds

set _score to score message _source without auto training

end timeout

my debugLog("Junk Spam score of message is " & _score)

– set _moveToTrash to my colorMessageAndDecideIfShouldMoveToTrash(_message, 99)

my debugLog("Begin _moveToTrash score is " & _score)

I don’t think I saw “Junk Spam score of message is” message in the log when the dialog was on the screen. I suspect that the timeout occurred between SpamSieve and Mail, but I don’t really remember. So I’ve set that up again and let you know what I find next time it times out.

Thanks

Rand

Here is a screenshot of a message in Junk that arrive about 2 hours ago. I believe that the email address is the same as the blocklist but I will go back and check for sure. My script runs every 5 minutes but only moves a message to Trash if the score is 99.

Rand

Looks exactly the same. Don’t know what the junk status of that message is now, probably false since my script runs every 5 minutes. So either it wasn’t true when it was moved to junk or the score was 99 when first checked I’m thinking. Guess I need to check the I explicitly set the junk status to true (If I don’t already) if train it as junk from “Train Junk”.

Michael, I went back and searched the logs for a timeout. Here is where I think it happened and the dialog popped up. When I clicked it to let the script continue it then go the undefined message.

7 0 logger: SpamSieve [Apple Mail Remote Training MJTLog] Begin set _score to score message

2024-10-10 06:32:43.930934-0500 0x1957da Default 0x0 46389 0 logger: SpamSieve [Apple Mail Remote Training MJTLog] Error: SpamSieve got an error: AppleEvent timed out.

2024-10-10 06:32:43.951570-0500 0x1957ed Default 0x0 46390 0 logger: SpamSieve [Apple Mail Remote Training MJTLog] Error training from account “iCloudâ€<9d>: The variable _moveToTrash is not defined.

2024-10-10 06:37:44.500749-0500 0x196301 Default 0x0 4642

Waiting on a new timeout to verify.

There have been some updates to Mac OS 15. I’m now running 10.15.1.

Rand

Noticed I have the debugLog statement one statement to high. I set it to to 99 to color it one color. Here is a little bit more of the script. I’ve move that debug statement to the correct place.

try

with timeout of 5 * 60 seconds

set _score to score message _source without auto training

end timeout

my debugLog("Junk Spam score of message is " & _score)

– set _moveToTrash to my colorMessageAndDecideIfShouldMoveToTrash(_message, 99)

my debugLog("Begin _moveToTrash score is " & _score)

set _moveToTrash to my colorMessageAndDecideIfShouldMoveToTrash(_message, _score)

if _moveToTrash then

Rand

All the information is in the Log window if you want to see why a message got the score that it did.

I recommend that you look at the score that SpamSieve gives you back and ignore the junk mail status. Do not try to read or write to it.

The message has no background color, so it was probably moved there by the server and not examined by SpamSieve at all. Again, you can verify this in the Log window. Does it even say that your script asked SpamSieve to look at the message?

My overall advice is to use the standard rescue script that we provide. You could still use a separate script for Train Trash if you want.

| Michael_Tsai Developer
October 10 |

  • | - |

Rand:

I have to run "set _score to score message _source without auto training” which (as I remember) doesn’t always return 99.

All the information is in the Log window if you want to see why a message got the score that it did.

Rand:

I don’t move the message to Trash unless the score is 99. Not sure that this works but I’ve also used the junk mail status as a flag. Once I’ve checked a message in Junk whose junk mail status is true I set it to false and only check messages in Junk whose junk mail status is false, but they get left in Junk.

I recommend that you look at the score that SpamSieve gives you back and ignore the junk mail status. Do not try to read or write to it.

I’m using the junk mail status in this way as a flag. If there lots of junk mail (when I don’t clean it out in a while), the script can run a long time so I’m trying to only check the messages once. That is the reason for using that flag in that way.

Rand:

Here is a screenshot of a message in Junk that arrive about 2 hours ago. I believe that the email address is the same as the blocklist but I will go back and check for sure.

The message has no background color, so it was probably moved there by the server and not examined by SpamSieve at all. Again, you can verify this in the Log window. Does it even say that your script asked SpamSieve to look at the message?

My overall advice is to use the standard rescue script that we provide. You could still use a separate script for Train Trash if you want.

Next time it hangs I’ll send you the log. Thanks

Rand

Try what I did: Keep your corpus but otherwise erase all your scripts and all your Mail rules, then start all over again as if it were a new installation. Follow all the SpamSieve installation instructions. You may have to dig two, three or more levels into the instructions to get every detail. Don’t miss the thing where you actually have to change the properties in one of the supplied scripts to get everything to work.

Doing approximately this is what got it working for me.

If you are like me, you have a whole birdsnest of workarounds and patches going to try to get the thing working, and trying to get to the bottom of all if it is impossible. A fresh start worked for me, and it may for you.

I strongly recommend not doing that. We already supply a script that does this in a better way. I don’t understand why you are trying to rewrite it yourself.

Thanks Michael. Other than the occasional hang, it works I think. I do this to learn things and understand the way something works. Am IT professional so I like to tinker. Thanks.

Rand

Thanks Carrickp. Appreciate the suggestions.
Rand

Michael,

This is what the web page says the rescue script does,

You can use the Apple Mail - Rescue Good Messages script to work around a problematic server junk filter. Whenever the script runs, it will tell SpamSieve to examine the messages in the Junk mailbox, leaving the spam messages in place but moving any messages caught by the server filter that SpamSieve thinks are good to the inbox. In order for this to work, you should follow the instructions in the Setting the Junk Mailbox in Apple Mail section of the manual to make sure that SpamSieve and the server filters are both using the special Junk mailbox.

I’m not trying to rescue messages from the Junk mailbox to the Inbox. I’m trying to look at mail in the Junk Mailbox and if the sender is in the blocklist, move those messages to Trash, otherwise leave in Junk.

Thanks

Rand