Change Junk Mail Advanced settings in Mail on Mac
Use Junk Mail Advanced settings in Mail to change the criteria messages must meet to be identified as junk mail, and the actions to take when that happens.
To change these preferences in the Mail app on your Mac, choose Mail > Preferences, click Junk Mail, select the “Perform custom actions” checkbox, then click Advanced.
Enter the name of your custom action.
If “any” or “all” of the following conditions are met
Choose whether a message must meet any (even just one) or all of the conditions you specify, then use the pop-up menus to set the conditions.
If you exempted messages from junk mail filtering in the Junk Mail preferences pane, the conditions for those exemptions are listed and “all” appears in the pop-up menu.
To add or remove a condition, click the Add button or the Remove button at the end of a row.
Perform the following actions
Use the pop-up menus to specify the actions to take when a message meets the conditions you set.
For example, to create an action, you might choose Move Message from the first pop-up menu, then choose a mailbox from the second one.
To add or remove an action, click the Add button or the Remove button at the end of a row.