Filtering Direct Delivery Spam with Mac Mail

The following guide will create a rule to filter direct delivery spam using Mac's Mail application. This technique should be used only when you are unable to implement protection against direct delivery attacks at the firewall or server level.

This rule works because real email will always pass through MX Guarddog, only spam that is delivered directly to your server will be filtered.

Step #1

  • Choose Mail -> Preferences, then click Rules.
  • Click Add Rule to create a new rule.

Step #2

Create a new filter with the following values.

  • Description: Prevent Direct Delivery
  • If all of the following conditions are met.
  • In the first condition select account, and choose your account from the selection list.

Step #3

When adding the 2nd condition, we need to filter on Received. Received will probably not show that as an option, you can add it by selecting Edit header list... and adding Received to the list.

Step #4

You can now complete the conditions using the following values:

  • 2nd condition, Received does not contain
  • 3rd condition, From does not contain (use your domain, not

If you have other domains on your sever, create additional conditions like the 3rd condition and add as many domains as you have on your email server.

Under perform the following actions, choose to Move Message to a mailbox of your choosing. Here we are moving the messages to the junk folder.

Setup Complete

With your new rule in place Mail will move any incoming messages, which did not pass through MX Gurddog into the mailbox you have specified.