Mac Mail problems running rules on multiple selected emails

In Mac Mail (serving up an IMAP Gmail account), I have a rule that deletes emails not received in the last 10 days. I use this to remove old emails in a few mailboxes with various newsletter subscriptions.

Gmail filters the emails to their respective mailboxes based on the sender.

If I manually “select all” in one of these mailboxes, and hit Opt Cmd L to run the rules, the rules are not applied. If I select just one, the rules run and the item is deleted.

But here’s something interesting:

If I select five contiguous emails and run the rules, the oldest three are deleted, but the next two remain and are still selected. If I run the rules again on those two remaining emails, the oldest one is deleted, but the other one remains, still selected. Of course, the next rule application deletes that final one of the five originally selected.

Any idea why Mail is having trouble running rules on multiple emails? Is it a Gmail issue?

P.S. This is all run via Keyboard Maestro when I launch Mail each day. But if I can’t get the rules to run manually, there’s no reason to automate the failure! :slight_smile:

Want to try this server side script I just found?

https://pixelbakery.com/recipes/gmail-automatically-delete-or-archive-emails

Thanks. Unfortunately, the article says this script operates on the inbox. I need it to delete emails that have a few specific tags (i.e. “mailboxes”, when displayed in Mac Mail). My filters have those emails bypass the Inbox and go straight to the mailboxes I need the script to prune.

I’ve looked through the script, and don’t see anywhere where the “Inbox” label is specified, not being a programmer, I don’t have any idea how I would tell the script to delete messages that have the label, “Inbox: Travel”.

1 Like