Rules in Apple Mail automate what happens to incoming messages, from highlighting mail from specific contacts to moving it out of the Inbox or deleting it. Choose Mail > Settings > Rules to see provided examples, where Edit opens a rule to inspect and Cancel turns it off. Click Add Rule, enter a name, and decide whether any condition or all conditions must be met. Set the conditions, using Edit Header List at the bottom of the first pop-up menu to choose different fields and adding your own headers in the Mail Headers window. Choose the actions, adding several if needed, including AppleScript. Click OK, then apply the rule to existing messages or only to new mail; drag rules to reorder them.

Before you begin

Decide what outcome you want, since rules can automate replying, deleting, or simply highlighting messages. A rule can be as light as highlighting mail from a particular contact, or as active as moving messages out of the Inbox automatically. Keep in mind that rule order matters: rules are evaluated in the sequence shown in the list. If you use iCloud Drive, rules are available on other Macs with iCloud Drive and Mail enabled, but files attached to rules, such as sound files or scripts, are not.

Steps

  1. Choose Mail > Settings > Rules, and inspect a provided rule with Edit or turn one off with Cancel.
  2. Click Add Rule, enter a name, and choose whether any or all conditions must be met.
  3. Set the conditions; use Edit Header List to pick other header fields and add your own in the Mail Headers window.
  4. Choose the actions, clicking the add button for multiple actions; AppleScript can be used as an action.
  5. Click OK, then choose to apply the rule to messages already in the mailbox or only to new mail.
  6. Reorder rules by dragging them up or down, and use Mail > Apply Rules to run them later.

What to check

Rules are applied in the order shown, so a broad rule placed above a narrow one may catch mail first; drag them to change that sequence. Mail stops applying rules when it meets a Stop Evaluating Rules action or when a message is transferred to another mailbox by a server-based or synced rule, so later rules will not run on that message. If you rely on attached sound files or scripts, check that they are present on the Mac where the rule runs, because iCloud Drive does not carry those attachments to other Macs.

Where people go wrong

People write a rule that never fires because an earlier rule in the list handles the message first. Others are surprised when a synced or server-based rule moves mail and their local rules stop evaluating. Some assume a sound file or AppleScript attached to a rule will appear on every Mac, when only the rules themselves sync. And a few forget they can apply a rule to existing mail, so they wait for new messages to test it.

If you want a utility alongside the built-in steps, Spark — fast email client. The macOS workflow above remains the primary path.

Sources

Frequently Asked Questions

Can I apply a rule to mail already in my mailbox?

Yes. When you create a rule you can apply it to existing messages, and you can run rules later via Mail > Apply Rules.

Why does my rule not do anything?

Order matters: rules run in the listed sequence, and evaluation stops at a Stop Evaluating Rules action or when a server-based or synced rule moves the message.

Do rules follow me to another Mac?

With iCloud Drive, rules are available on other Macs with iCloud Drive and Mail enabled, but files attached to rules such as sounds or scripts are not.