Unfiltered Email: First steps in how not to get spam filtered


For pro-level email handling you can edit your DNS file with an SPF line and add a DMARC subdomain/line, and use DKIM signatures.

This post isn't about that but if you want to look at your own DMARC record for the interest of it, you can do so using the terminal and the following line:
dig txt _dmarc.example.com
Replacing example.com with your own domain or the one your nosing around at. (You might find your hosting provider has already got you covered.)

Your DNS file is also worth a look, so investigate how to view and edit. Using dig you can see your DNS file like so:
dig example.com txt
And this will reveal SPF settings. (Again, you might be pleasantly surprised to see you have an SPF record by default.)

Back to Basics

This post assumes you're not using a dedicated server, so might not have the necessary access to install DKIM or might not have the urge at present. But you've set up automated email and you're wanting to know why it's getting filtered, and you want to reduce the risk of this.

Step One

The first step is to ensure something very simple, and that is you have a sufficient number of headers to make your email look the part. You want to include not only To: and From: but also Date:, Reply-To:, Content-Type: and perhaps MIME-Version:, X-Mailer: (see Step Two, they might be included automatically and you can test this).

If you're sloppy in providing information, then your mail starts to look suspicious. But sometimes you can go too far. I started reading around the web that it was necessary to include a MAIL FROM header. The problem in a shared environment is that your host has a mail server where all mail goes through and so if you use your domain name in the MAIL FROM header this information will be incorrect, and you'll be spam filtered. My advice here is let the mail server cover the MAIL FROM base (the addition just seemed to totally bork things for me and displayed the raw source as the email).

Step Two

Look at the emails originating from your site by sending them to a few different email addresses (tip: include a gmail one). Now open the email in Apple Mail or another program.

With the message selected go to View -> Message -> Raw Source

This provides you not only with a view of the email you sent, which is really useful but you might well see series of lines starting X-Spam- and in there you'll see a score and an upper threshold, e.g. 5. You can then tell if your email is reaching the danger zone and how quickly you need to act to rectify problems.

Step Three

This step is really what you should consider in the first place, and that is to ensure that the content of your email is well written in terms of language and doesn't contain words that are going to make the email look like spam.


Sending email is worth researching and getting right, spam filtered email is at a high risk of not being read. If your website relies on getting messages to users, do all you can to open the path for messages to arrive safely.