C-Command Software Forum

Apple Mail rule to add spam to corpus

Certain types of email I receive are guaranteed spam. In the past, I’ve written a rule in Apple Mail to immediately move such emails to the trash. However, I think it would probably be a good idea to add these emails to SpamSieve’s corpus, then move them to the trash. Is there some way of automatically doing that with an Apple Mail rule?

It’s not a good idea to train SpamSieve with lots of extra spam messages, especially if they are all similar. In cases like this, what you could so is create a SpamSieve blocklist rule to catch the messages. Then SpamSieve will classify them as spam, and it will auto-train itself with the ones that it thinks are interesting.

My end goal is to dump these specific messages into the trash, not my spam folder, because they are guaranteed spam and I don’t want to review them later. Simply setting up a blocklist wouldn’t do that, I don’t think. Is there some way of getting SpamSieve to move a message to the trash after handling it with the blocklist?

Yes.

I don’t understand. How do spam colors relate to what I’m trying to do? Are you saying I should set up an additional rule to move the “guaranteed spam” messages into the trash? I already did that; my confusion is how to make sure that SpamSieve sees the messages before they are moved to the trash.

Messages that match SpamSieve’s blocklist will always be given the most spammy color. So (as the linked page shows) you can setup an additional SpamSieve rule that moves these spam messages directly to the trash, while the other spam messages still go to the Spam mailbox. It’s better to do this with SpamSieve rules and colors than with a special-purpose Mail rule to match the messages by content, because (as you say) this way the messages go through SpamSieve.

I set up the two rules, but something is wrong. My spam is moving into the trash, not the spam folder. I’ve attached screenshots of the rules I set up. The [Score] one comes first. Do you see anything wrong with my setup?

Yes. First of all, you should not have any SpamAssassin stuff. Second, you need three rules:

  1. SpamSieve [Score]
    Message Type is Mail / Move Message to mailbox Spam
  2. SpamSieve [Blue]
    Message Type is Mail / Move Message to mailbox Trash
  3. SpamSieve [Spam]
    Message Type is Mail / Move Message to mailbox Spam

Actually, I need the SpamAssassin stuff. What I’m trying to do is move mail flagged by SpamAssassin directly into the trash, not the spam folder, but still allow SpamSieve to “learn” it.

It turns out the two rules I had were correct, at least they seem to be. The only reason it wasn’t working at first was because I had the SpamAssassin conditions set to “any” instead of “all”. After fixing that bug, the mail flagged by SpamAssassin is now placed directly in the trash, while mail flagged by SpamSieve is moved to the spam folder. Also, the SpamAssassin mail is showing up in the SpamSieve log, so apparently SpamSieve is still “learning” that spam before it gets dumped in the trash.

In other words, everything appears to be working exactly how I wanted. Thanks for your help!

I do not recommend setting it up that way, and I don’t think the rules do what you think they do. SpamSieve already has built-in SpamAssassin integration (it looks at the results of the individual tests that SpamAssassin performs), and this is the best way to combine the two products.

Hmm… This is getting complicated. Okay how about this… To keep things simple, I’ll just turn off SpamAssassin entirely and set up the appropriate Apple Mail rules, as directed in the manual, to move the SpamSieve “Blue” messages straight into the trash. That should work at least as well, right?

The thing that concerns me, though, is that it seems very easy for legitimate messages to get on SpamSieve’s blacklist. For example, if a phisher forges support@ebay.com as the From address, and I train this phishing email as spam, then all subsequent emails–including legitimate ones–from support@ebay.com will be blacklisted, right? And with the [Blue] rule set up, all these non-spam emails will go directly to the trash. Or am I missing something?

Yes. To be clear, I’m recommending that you leave SpamAssassin running on your server; just don’t make any special rules for it in Mail.

If that’s all you do, then yes. But in a normal situation you would also receive good messages from that address, so you’d train a few of them as good, and this would disable the blocklist rule. When there is no enabled blocklist or whitelist rule for an address, SpamSieve will classify messages from that address based on their contents. It will learn which eBay messages are good and which are spam.