How to create a spam filter in Mail on OSX?

On our server we are running a few diferent spam filters to ensure that now spam or virus get into your mailbox.

The last in the chain is SpamAssasin that is putting a tag to the e-mails header. The tag is "X-Spam-Flag" witch is set to "NO" if the e-mail is a non spam e-mail. If the system suspect that the e-mail is a spam message the tag will be set to "YES".


To activate this function in Mail on OSX/Mac you need to follow this guide:


Start Mail and push on the "Mail" button in the upper left corner and chose "Preferences...".



Push the button on the top of the new windows named "Rules" and click on the button to "Add Rule".



Click in the dropdown field with "Any Recipient" and scroll to the bottom of that list.

On the bottom you wil find a choise to "Edit Header List..." and click on that choise.



In the new windows there will be a small "Plus" button to click and add a new line for "X-Spam-Flag". The system is case sensitive, so please remember to type upper and lower case letters as under!

When the new line is added (as the image under), click the "OK" button.



Than, again, click the field for "Any Recipient" and choose the "X-Spam-Flag".

Complete the form as under and click on the button for "OK".

We have choosen to send the spam to the "Trash". Feel free to add your own spam folder etc for you spam e-mails.


When all fields have been completet, push the "OK" button and a new dialogbox will appare. Click "Apply" in that one.


If any e-mail that appears to be spam is now coming through our filters SpamAssasin will try to filter it to your chosen folder.

SpamAssasin follow a specific set of rules and sets the X-Spam-Flag to "YES" if it is suspected that the e-mail is spam. The filter you have now created will then move the suspicious e-mail to a separate folder (trash / spam basket, etc).


Please contact us if you have any questions or need some more assistans!

  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

Hvordan oppretter jeg en regel for spam i Outlook 2013/2016?

I denne guiden viser vi hvordan du lager en regel som automatisk flytter e-post vårt spamfilter...

Hvordan videresender jeg en spam melding til dere for gjennomgang?

Dersom du har laget en regel i Outlook eller tilsvarende e-post program og fortsatt får inn...

Hvordan lage filter for spam i Outlook 2010 på Windows? --

På vår server kjører vi en rekke filter for å hindre spam/søppelpost og virus i å nå fram til din...