Mark read (gmail)

I have two accounts in Mail, one iCloud (my main one) and one gmail (alternative when needed). I want to be able have all gmail junk messages marked as read, but iCloud ones as unread (because I get the very occasional false positive that needs training).

I note that your general advice is to add “mark read” as an action in the SpamSieve Mail rule. But presumably I’d then have to have separate rules for the two accounts? I had it that way for many years for reasons I forget, and it’s been so liberating to change to a single rule using “All Junk”. So I’m not keen to go back to separate rules if I can avoid it.

I’ve tried doing this with various AppleScripts and/or Automator workflows. But though the scripts seem to compile and run without errors, they don’t actually work. Nothing actually changes in the read status of messages in All Junk > gmail.

Worth mentioning I’m using the “Apple Mail - Rescue Good Messages” script.

Is there any way either SpamSieve itself or one of the associated AppleScripts could be set or tweaked to provide what I want? Or is separate rules my only resort? Thanks.

I’m not sure I understand your aversion to having multiple rules (both targeting All Junk). That seems like an easy solution to this problem for the messages that come into your inbox.

For the ones caught by server filters, the Rescue Good Messages script does have an option to mark the spam messages as read. However, you would need to tweak the script to only do this for that account.

Thanks Michael. I hadn’t realised that multiple SS rules could all target “All Junk”. I’d assumed each would have to target the specific junk mail box the account. That’s helpful.

Anyway, I’ve discovered I have the solution in your script “Mark Server Spam Messages as Read”. I’ve successfully edited it to specify the account and mailbox, and I have my rule to run it. All good.

But before I sign off I have a question arising from my attempts to create my own AppleScript. Here’s the list of system labels and other labels I have in gmail


I’m puzzled about having both a “Spam” system label and a “Junk” label, each displaying a separate list of junk messages (no overlap in contents). It appears that the mailbox “All Junk/gmail” maps to the system label “Spam” (even though it’s called “Junk” in the gmail mailboxes listed in Mail), while the separate mailbox (also called “Junk”!) maps to the label “Junk”. So I apparently have two separate Spam/Junk mailboxes.

The messages in the second mailbox/label aren’t all from years back before I started using SpamSieve with this account. They include very current ones as well. How is that possible given I have the filter recommended in the manual that’s meant to turn off gmail’s spam filtering? Is gmail continuing to filter it’s own junk mail despite the filter? If so, does it matter? And can SpamSieve’s “Rescue Good Messages” script monitor that label, or only the other one?

What I’ve done for now is simply remove it from IMAP, thus it no longer shows in Mail. Is that the best thing to do? Or should I keep monitoring it in Mail?

Great! To be clear, this script doesn’t rescue good messages caught by the server filter; it only marks them as read.

Correct.

I’m not sure what’s going on there unless you have another Mail or Gmail rule or another device accessing this account. Normally, Gmail’s filter would move messages to the Spam label, which maps to the special Junk mailbox, and the SpamSieve rule would move messages there, too, so I wouldn’t expect anything to be moving messages to the non-special Junk mailbox in Mail.

No, the rescue script is designed to filter messages in place in the special Junk mailbox. The Server Junk Mailbox script can handle a separate mailbox. However, in this case I would recommend trying to figure out why the messages are moving there in the first place so you can turn off whatever’s doing that.

I don’t think that’s great because what if there are good messages there?