Email, Messaging, & Video Calls Email How to Set up Apple Mail Rules Mail rules can automate your Mac's mail system by Tom Nelson Writer Tom Nelson is an engineer, programmer, network manager, and computer network and systems designer who has written for Other World Computing,and others. our editorial process Facebook Twitter Tom Nelson Updated on August 08, 2019 Email Yahoo! Mail Gmail Tweet Share Email Automate basic email tasks in Apple Mail with Apple Mail rules. When you create Mail rules, you tell the app how to process incoming pieces of mail. Mail rules automate repetitive tasks, such as moving the same type of messages to a particular folder, highlighting messages from friends and family, or eliminating spam emails. With a little creativity and some free time, you can use Apple Mail rules to organize and automate your mail system. Instructions in this article apply to Macs running macOS Mojave (10.14.) and Mail version 12.4. Earlier versions of macOS follow similar processes. How Mail Rules Work Rules have two components: a condition and an action. Conditions are guidelines for selecting the messages an action impacts. For example, a Mail rule with the condition to look for emails from your friend Sean might have an action to highlight the message so you can easily notice it in your inbox. Mail rules do more than find and highlight messages. Rules organize mail. For example, rules can: Recognize banking-related messages and move them to a bank email folder.Move spam from recurring senders to a Junk folder or the Trash.Forward a message to a different email address. In addition to creating simple rules, you can create compound rules that look for multiple conditions before performing one or more actions. If you know how to create AppleScripts, Mail can run AppleScripts to perform additional actions, such as launching specific applications. Types of Mail Conditions and Actions The list of conditions Mail can check for is extensive, but some are more commonly used than others. Mail can use any item that is included in the mail header as a conditional item. Some examples include From, To, CC, Subject, Any recipient, date sent, date received, priority, and mail account. Email can also be filtered by: ContainsDoes not containBegins withEnds withIs equal to Actions that are available when an email matches a condition include: Move MessageCopy MessageSet Color of MessagePlay SoundBounce Icon in DockSend NotificationReply to MessageForward MessageRedirect MessageDelete messageMark as ReadMark as FlaggedRun an Applescript Other conditions and actions are available in Mail rules, but this list gives a general idea about what can be accomplished with Apple Mail rules. Create Your First Mail Rule This tutorial creates a compound rule that recognizes mail from a credit card company and highlights the message in the inbox. In this example, the message is sent from the alert service at Example Bank and has a From address that ends in alert.examplebank.com. Because various types of alerts are received from Example Bank, this tutorial creates a rule that filters messages based on the From field and the Subject field. Use these two fields to differentiate the types of alerts received. Add a Rule in the Apple Mail App on Your Mac The quickest way to start a new rule is to open a message in Mail and base the rule on the information in the message. If a message is selected when you add a new rule, Mail uses the information in the From, To, and Subject fields to fill in the rule conditions. Having the message open also displays any specific text you may need for the rule. To create a rule based on a selected message: Go to the Mail menu and select Preferences. In the Preferences window, choose Rules. Select Add Rule. In the Description text box, enter a name for the rule. For example, use Example Bank CC Statement as the description. Add the First Condition The If statement toggles between two conditions: If any and If all. The If statement is useful when you have multiple conditions to test for, such as in this example, where you want to test both the From and Subject fields of the selected message. If you only test for one condition, the If statement doesn't matter, so you can leave it in its default position. Select the If drop-down arrow and choose All. In the conditions section located below the If statement, select the first drop-down arrow and choose From. Select the second drop-down arrow and choose contains. If a message is open (or selected) when you create this rule, the field next to contains automatically fills with the appropriate From email address. Otherwise, enter this information manually. For example, enter alert.examplebank.com. Add the Second Condition To create complex rules, add a second set of conditions that further filter the types of messages that the rule is applied to. In this tutorial, the rule is applied to messages that are from a specified sender and that contain a specified Subject line. To add a second condition to a rule: Go to the right of the first condition line and click the Plus (+) button to add a second condition line. In the second condition section, select the first drop-down arrow and choose Subject. Select the second drop-down arrow and choose contains. If a message is open, the field next to the contains field automatically fills with the subject line from the email. Otherwise, enter this information manually. For example, enter Example Bank Statement. Add the Action to Be Performed Now it's time to choose an action that will be performed on the messages selected by the rule conditions. In this example, messages that meet the rule conditions for the sender and subject are highlighted in red. To add an action to a rule: In the Perform the following actions section, select the first drop-down arrow and choose Set Color. Select the second drop-down arrow and choose of text. Select the third drop-down arrow and choose Red. Click OK to save the new rule. You can add more than one action, just like you can add more than one condition. Use multiple criteria to fine-tune the effectiveness of the rule. The new rule is applied to all subsequent messages you receive. Any that have, for example, the From and Subject information specified in the rule appear in red text. If you want a new rule to process the current content of your inbox, press Command+A to select all the messages in the inbox, then go to the Mail menu, select Message, and choose Apply Rules. Mail rules are versatile. You can create complex rules with multiple conditions and multiple actions. You can also create multiple rules that work together to process messages.