How SPF, DKIM & DMARC Helps Prevent Email Spoofing - Part 1 (SPF)

How SPF, DKIM & DMARC Helps Prevent Email Spoofing - Part 1 (SPF)

SPF DKIM and DMARC are three tools that can be used to help prevent spoofing and validate email authenticity for your email service or domain and I’m going to explain how they work and show you how to set them up in this in this lesson here.

SPF

SPF stands for Sender Policy Framework.

No alt text provided for this image

The high level of SPF is a mechanism that tells servers receiving email servers what servers are allowed to send mail on behalf of your domain it uses an SPF record published in DNS to do that. so when you're setting up SPF you'll publish your SPF record to DNS to the sending organization's DNS server and then when an email is sent out from your domain the receiving server receives it and performs an SPF record lookup by querying DNS for the SPF record of the sending domain to verify whether it came from an authorized sending server or IP address and then if there's no SPF record or if the SPF record of the domain specifies that the server that the message came from was not authorized to send on behalf of that domain then the message can be rejected or marked as spam or if it passes SPF validation then the message can be accepted for delivery by the receiving email server and then sent placed into the recipient's mailbox. There there are some other details when configuring SPF. For example when considering things like sub domains or other servers that are allowed to send such as smart hosts and similar to that.

Every SPF record starts with a V equals that's the version number SPF one they're all they're all the same and then now again this is a very simplified version of an SPF record there are a lot of other tags and things you can put in an SPF record but for purposes of simplicity this SPF record specifies the version SPF the IP address that is allowed to send mail on behalf of the domain example.com and then whether all messages should be sent from that specific IP address or if there are some exceptions based on smart hosts and things like that.

The SPF record must contain each of these sections:

  • v=spf1 - this is the version of the SPF record
  • include:spf.protection.outlook.com - this allows use of the Mail Assure server SPF record
  • -all - this means to exclude everything else (cause a hard fail)

Example including your own IP address and domain:


v=spf1 ip4:1.2.3.4/32 include:spf. protection.outlook.com A:yourdomain.invalid -all


Replace the ip4 entry of 1.2.3.4/32 with your mail server IPv4 address and yourdomain.invalid with your domain.

Once the SPF record has been written, publish the SPF record (TXT record) to the authoritative DNS server for your domain. Instructions on how this can be done will differ from each domain provider.  

If you have multiple sending addresses, the following external links may be used for additional formatting and guidance:

Depending on your current SPF records Time to Live (TTL), this may take up to 24 hours or more to propagate.

There are several benefits of using Sender Policy Framework (SPF) for email:

  1. Improved email deliverability: By specifying which servers are authorized to send email on behalf of a domain, SPF can help to improve the deliverability of legitimate emails. This is because email servers are more likely to deliver emails that pass SPF checks, as they are less likely to be spam or malicious.
  2. Reduced spam and phishing: SPF can help to reduce the amount of spam and phishing emails that are received, as these types of emails are more likely to fail SPF checks. This can help to protect users from these types of attacks and improve the overall security of their email accounts.
  3. Improved domain reputation: By implementing SPF, domain owners can help to protect their reputation and prevent their domain from being used for spam or other types of online scams. This can help to improve the overall trustworthiness of their domain and make it more likely that emails from their domain will be delivered to the inbox.
  4. Simplified email administration: SPF can help to simplify email administration by making it easier to identify and block unauthorized email servers. This can help to reduce the burden on IT departments and improve the overall efficiency of an organization's email system.

Samantha Bandara Dissanayake

Head of Solution Consulting - @ John Keells IT | Cloud Strategy, Consulting Services

2y

Good work, keep it up

MINA HANA

Modern Work & Security Architect | Digital Transformation | Microsoft 365 | Microsoft Azure

2y

Thank you, very useful article

To view or add a comment, sign in

More articles by Mafais Saheed

Insights from the community

Others also viewed

Explore topics