2

I would like to create a rule for Apple Mail that combines "all" and "any". Specifically, I need to do a rule where I have a group of "any" criteria, "Message content contains X" OR "Message content contains Y" (and potentially some more ...) but I would like this to only apply to one of my email accounts, so the condition "Account is iCloud" must always be met. Somehow along those lines

In the Rulesenter image description here

I could, of course, create multiple "all"-rules and have them perform the following action, but that is cumbersome. Any suggestions?

EDIT:
The action I would want to attach is to move the matching messages to a designated "On my Mac" mailbox/folder and at the same time moving them to the IMAP trash so they'll get deleted from the server.

2
  • 1
    Sorry mixed up rules and mailboxes - there might be an answer if we know what actions you will take.
    – mmmmmm
    Apr 21, 2019 at 13:12
  • @Mark See my edit above. Your first idea seemed like it would do the trick if only there was that option to find messages "in a particular mailbox" also under rules (not just under SmartFolders). Seems to me like a poor design decision ...
    – jan
    Apr 21, 2019 at 15:55

1 Answer 1

2

There are three ways to do this, but all are cumbersome. There's no simple way.

  1. Like you mentioned make one rule per OR condition, such that each rule looks like
    belongs to <account> AND message content contains <blah>
    
  2. Make a "guard" rule to match all your other accounts, like so:
    belongs to <other account> OR belongs to <other account> OR ...
    
    with an action of "Stop evaluating rules". Position this rule to be the last of all your rules. Then below it, you can add one final rule with your other conditions:
    message contains <blah> OR message contains <blah> OR ...
    
    with the action you want to take. The second-to-last rule will stop all your other accounts from reaching this final rule, so by deduction only your desired account will apply the action.
  3. (Advanced) Write an AppleScript to check the conditions you need, and sort the mail into the right mailbox. In Mail, you can set a rule to run on "Every Message" with an action of "Run AppleScript". You'll have to look elsewhere for the details of writing the AppleScript.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .