DMARC and SPF updates
A while back I added a DMARC entry in DNS for my @gardiner.net.au domain. The existence of this entry then means I get daily email reports which include data from a number of email servers (eg. Google, Yahoo) about emails received from my domain and whether they were regarded as legitimate or spam. I don't receive copies of the emails themselves – just a summary of how many emails the destination site thought were legitimate and how many were rejected because they thought they were spam.
Microsoft have just announced that they too are now sending DMARC reports, so this prompted me to review my current SPF and DMARC settings to ensure that they're working properly.
The trouble with the DMARC reports are that they come via email with an attached zipped .XML file, which means you can't just view them... you have to download them, unzip them, then open it in IE (or Notepad), and scan through the XML to try and make sense of it. Wouldn't it be nice if there was a tool or service that summarised this for you?
Both of these services allow you to upload existing DMARC reports or set up email forwarding to automatically send the reports directly. You can then log in and view a summary.
I uploaded the data from the last 7 days. Here's some examples of the kind of report you get from each service:
The details for data from the 9th of December:
GARDINER.NET.AU - 3 msgs, 3 IPs
SPF-Authorized Servers - 2 groups , 2 msgs, 2 IPs, 100% auth'd
Other Servers - 1 group , 1 msg, 1 IP, 0% auth'd
I was curious that both of them flagged a potential problem with an email. Sometimes this can be because it is actually spam – an email sent from an address that was not part of the authorised sender list as defined in the SPF record. But in this case, the error indicated that the email did come from a legitimate source.
Next step to confirm that my SPF record is correct. A quick trip to the SPF Record Testing Tools confirmed that yes, my SPF record was in effect, but that there was also an error message I hadn't noticed previously:
PermError SPF Permanent Error: Too many DNS lookups
So it turns out that there are limits on how many DNS lookups are allowed for SPF records. 10 to be precise.
My old SFP record was:
v=spf1 a mx ip4:22.214.171.124/24 include:aspmx.googlemail.com include:hotmail.com include:gmail.com include:live.com -all
It does looks like there's some redundancy there with two similar includes covering GMail and another two for Hotmail/Live. Simplifying things down (and hopefully not losing any accuracy) I've changed the record to this:
v=spf1 a mx ip4:126.96.36.199/24 include:hotmail.com include:_spf.google.com ~all
This now passes validation. Note that I've reverted back to ~all (a 'Soft' fail which means that recipients won't outright reject emails if there is a problem with the new rule). I'll switch back to -all (a 'hard' fail) after a week or two once I'm happy that nothing is broken!
I'll also be interested to see if the DMARC reports contain passing results for the hotmail emails.