Blog/ Apple Mail & iCloud

How to Create Rules in Apple Mail on Mac (Step by Step)

Nafiul HasanNafiul Hasan· 12 min read
How to create rules in Apple Mail on Mac — the Rules tab in Mail Settings showing a condition set to From Contains and an action set to Move Message to a folder

The short answer

To create a rule in Apple Mail on Mac, open Mail > Settings > Rules, click Add Rule, name it, set your conditions, choose your actions, then click OK. Rules run locally, so they only fire while Mail is open — not at delivery time. For time-sensitive routing, iCloud.com server-side rules run at delivery instead.

How to create rules in Apple Mail on Mac: step-by-step setup, five practical recipes, platform differences, and why rules only run when Mail is open.

On this page
  1. 01Before you start: what Apple Mail rules can and can't do
  2. 02How to create a rule in Apple Mail on Mac
  3. 03Five rules worth setting up right now
  4. 04Apple Mail rules vs iCloud rules vs iOS: what runs where
  5. 05What to do when your rules don't fire
  6. 06A faster way for ongoing triage

Apple Mail's rules engine is older than most AI email features, and for good reason: it works. You write a condition, pick an action, and every message that matches is handled the same way, every time, without anything beyond Mail itself touching your mail. The question is how to create rules in Apple Mail on Mac that actually do something useful — rather than ones you forget about inside a week.

This post covers the core setup steps, then builds five rules a professional actually needs: one that files receipts into a folder, one that colour-labels a client's messages, one that auto-forwards from a single sender, one that silences a mailing list, and one that marks a whole domain as worth reading first. Each recipe gives you the exact conditions and actions to configure. The last section covers what to do when a rule simply will not fire.

Before you start: what Apple Mail rules can and can't do#

Apple Mail rules are available on macOS Sonoma, Ventura, Monterey, and earlier. The Settings panel was renamed from Preferences in macOS Ventura (13), so the path changed from Mail > Preferences > Rules to Mail > Settings > Rules — same screen, different label depending on your OS version.

The most important thing to understand is where rules run. Apple Mail rules execute locally on your Mac, inside the app. They do not run on Apple's servers, and they do not run on your iPhone or iPad. If Mail is closed or your Mac is asleep when a message arrives, the rule fires when Mail next opens and syncs — not at delivery time. For anything time-sensitive, such as a rule that auto-forwards an urgent sender to a colleague, that delay matters.

Rules only run while Mail is open

A message that arrives at 2 a.m. will not be filed, forwarded, or flagged until Mail opens and syncs the next morning. If you need server-side filtering, iCloud Mail offers a separate rule set at icloud.com that runs at delivery — covered in the platform table below.

How to create a rule in Apple Mail on Mac#

The steps are the same across every recent macOS version. The only thing that changes is the menu label: Settings on macOS Ventura and later, Preferences on Monterey and earlier.

  1. 1

    Open Mail > Settings (or Mail > Preferences on macOS Monterey and earlier)

    In the menu bar, click Mail, then Settings on macOS Ventura or later. On Monterey and earlier the option reads Preferences. The keyboard shortcut Command + Comma works on all versions.

  2. 2

    Click the Rules tab

    The Rules tab is the last one in the row. You will see any rules already set up, including Apple Mail's default rule that colours messages from Contacts.

  3. 3

    Click Add Rule

    A dialog opens with a default description field, one blank condition row, and one blank action row.

  4. 4

    Name the rule something specific

    Replace the default description with a name that says what the rule does — for example, "File receipts — Amazon" rather than "Rule 3". You will want this when you have fifteen rules and need to find the one that is misfiring.

  5. 5

    Set your condition or conditions

    The left dropdown picks the field to match: From, To, Subject, Message Content, Date Received, Priority, Header, and others. The middle dropdown sets the operator: Contains, Does Not Contain, Begins With, Ends With, Is Equal To. The right field is where you type the value. Click the + button to add more conditions, then use the Any or All toggle at the top to control whether one condition or all of them must match.

  6. 6

    Set your action or actions

    Actions include Move Message, Copy Message, Reply To Message, Forward To, Redirect To, Mark as Read, Mark as Flagged, Set Color of Message, Delete Message, and Play Sound. Click + to chain multiple actions. For Move Message, choose the destination mailbox from the dropdown — the mailbox must already exist, or the rule will fail silently.

  7. 7

    Click OK, then choose whether to apply it to existing messages

    Mail will ask whether to apply the rule to messages already in your inbox. Click Apply to process existing mail or Don't Apply to start fresh. After this, the rule fires automatically on every new message that matches, whenever Mail is running.

Five rules worth setting up right now#

These are recipes for situations that come up in most professional inboxes, not demonstrations. Each gives you the condition type and action values so you can copy them directly.

  1. 1

    File receipts into a folder

    Condition: Any — Subject Contains "order confirmation", Subject Contains "receipt", Subject Contains "your order", Subject Contains "invoice". Action: Move Message to a mailbox named Receipts. Create the mailbox first under your account in the sidebar. This keeps receipts out of your inbox while leaving them fully searchable. Adjust the subject strings to match the senders you actually buy from.

  2. 2

    Colour-label messages from a client

    Condition: From Contains the client's email domain, for example "@acmecorp.com". Action: Set Color of Message — pick a colour you have not used elsewhere. The colour appears in the message list, making that client's threads impossible to miss. Use the domain rather than a single address if the client has multiple people emailing you.

  3. 3

    Auto-forward from one specific sender

    Condition: From Is Equal To the exact sender address. Action: Forward Message to the colleague's address. Use Is Equal To rather than Contains to avoid catching unrelated senders who share part of an address. Note that the forwarded message will appear to come from your address, not the original sender's, so the recipient may need a second action that appends a short note for context.

  4. 4

    Silence a mailing list

    Condition: Any — Header Contains "List-Unsubscribe" (catches most list mail by its header), or From Contains the list's domain as a fallback. Action: Mark as Read, then Move Message to a mailbox named Lists. The Mark as Read action paired with a move keeps the unread badge clean. If you want to review the list occasionally, skip Mark as Read and just move it.

  5. 5

    Mark a whole domain as priority-adjacent

    Condition: From Contains "@partnerdomain.com". Action: Mark as Flagged — or Set Color of Message to a distinct hue. This makes every message from that domain visually distinct in the inbox without reorganising your folder structure. Combined with a Smart Mailbox filtering on flagged messages, it becomes a lightweight VIP view with no additional account required.

Apple Mail rules vs iCloud rules vs iOS: what runs where#

This is the most common source of confusion. The same Apple account has three separate rule systems, and they do not sync with each other.

Where you set itWhen it runsConditionsActionsAppears on iPhone
Apple Mail app on MacLocally, while Mail is openFrom, To, Subject, Message Content, Date, Priority, Header, Account, Every MessageMove, Copy, Forward, Redirect, Reply, Mark, Color, Flag, Play Sound, Delete, Run ScriptNo — only the result (filed message) syncs if the destination is an IMAP folder
iCloud.com web rulesOn Apple's servers, at deliveryFrom, To, Subject — basic string match onlyMove to Folder, Mark as Read, Mark as Flagged, Forward to addressYes — fires before your device ever sees the message
iOS or iPadOS MailNo rules editor availableCannot create rules on iOS MailCannot create rules on iOS MailInherits iCloud server rules only

The practical upshot: if you need a rule to file mail into a folder and have it appear already-filed on your iPhone, set it at icloud.com, not in the Mac app. The iCloud rule set is narrower — From, To, and Subject conditions only, with four possible actions — but it runs at delivery on every device. If you need conditions or actions that iCloud does not offer, such as colour-labelling, forwarding with conditions, or multi-condition logic, the Mac app rules are the only option, with the limitation that they only fire while Mail is running.

For non-iCloud accounts — Gmail, Outlook, Exchange, Fastmail — there are no server-side rules inside Apple Mail. Gmail's own filter engine, Outlook's server-side rules, and Fastmail's filters run before mail ever reaches your Mac and are the right place to build routing rules for those accounts. Apple Mail rules on top of those accounts run after the fact, locally.

Diagram showing incoming email sorted into labelled bins representing Receipts, Client, Lists, and Priority — illustrating how Apple Mail rules route messages to different mailboxes based on conditions set in the Rules editor
Apple Mail rules sort incoming messages into mailboxes based on conditions you define — but only while the app is running on your Mac.

What to do when your rules don't fire#

Rules that look correct but don't process messages are a common problem. The cause is almost always one of the following.

  1. 1

    Mail was not running when the message arrived

    Open Mail, let it sync, then go to Message > Apply Rules to run your rules against messages that came in while the app was closed. If the rule fires correctly on those, the problem was simply that Mail was not open — not a configuration error.

  2. 2

    The condition does not match the raw From header

    "From Contains" matches the raw From header, not the display name. If a sender shows as "Amazon Orders" in the message list but sends from [email protected], a condition matching "Amazon Orders" will not fire. Check the exact From header by selecting the message and pressing Command + Shift + H to view the raw source.

  3. 3

    The destination mailbox doesn't exist or is on a different account

    A Move Message action pointing to a deleted mailbox, or to an On My Mac mailbox from an IMAP account, fails silently. Re-create the destination mailbox or update the action to point to an existing one, then run Message > Apply Rules to test.

  4. 4

    A condition is too broad and conflicts with another rule

    Apple Mail applies rules in order, top to bottom, and stops after the first matching rule unless you add a Continue Applying Rules action. If two rules both match a message, only the first one fires. Reorder rules by dragging them, or add Continue Applying Rules as the final action on any rule that should not stop the chain.

Test a rule immediately after creating it

After adding or editing a rule, go to Message > Apply Rules while viewing the mailbox that should be affected. The rule runs against all messages currently in view. This catches a misconfiguration right away rather than waiting for new mail to arrive and fail silently.

A faster way for ongoing triage#

Rules are the right tool for repeating, predictable patterns — the same receipt domain, the same client colour, the same list header. Where they hit a ceiling is the judgment call: a first-time sender whose importance depends on what they said, a thread that is urgent based on context, or the exception that would take three patch rules to describe. That is where a rule set tends to sprawl past the point of being manageable.

We build AI Emaily, an AI-native email client that connects to Gmail, Outlook, and any IMAP account — including iCloud. Its Rules Brain handles the deterministic patterns you would write as Apple Mail rules. Its Context Brain takes on the new senders and nuanced priority that fixed conditions cannot describe in advance, using a Personal Context brain and per-client profiles you set yourself — not by mining your sent folder. Every action goes through Copilot mode by default: AI Emaily prepares the move or draft and waits for your one-tap approval. Nothing is filed or sent without an audit trail.

If you use Apple Mail because you want local processing with no third party reading your mail, that is a real preference and Apple Mail rules serve it well within their limits. If you find yourself writing rule twelve to patch the exception to rule seven, that is the structural ceiling of condition-based filtering, and a client that combines rules with an AI judgment layer handles it differently. Current plans are at aiemaily.com/pricing.

Frequently asked

Nafiul Hasan

Written by

Nafiul Hasan

Nafiul Hasan is an entrepreneur and AI automation system builder with 10+ years of experience turning messy, manual workflows into reliable automated systems. He designs and ships AI enterprise solutions end-to-end — the agent logic, the data plumbing, and the product people actually use — and founded AI Emaily to give busy professionals their attention back. He writes here from the builder's seat: what works, what breaks, and how to put AI to work without giving up control.

EntrepreneurAI Automation System BuilderAI EnthusiastBuilds AI Enterprise Solutions10+ years experience
More from Nafiul
Ready when you are

Rules handle the predictable. What about everything else?

AI Emaily pairs a rules engine with an AI layer for new senders, nuanced priority, and the exceptions that fixed conditions keep failing on — approval-first control, undo, and no training on your mail. We build it. Compare plans at aiemaily.com/pricing.

  • 7-day free trial
  • Cancel anytime
  • Every provider