Free, openly licensed teaching material for classes and self-study

SPF, DKIM and DMARC check

Match eight terms to their job, sort nine facts by the check that uses them, then decide what happens to eight messages. A practice exercise after the email authentication guide, with teacher notes and a header-reading task.

Exercise20 minBachelor +2CC BY 4.0
3 tasks · 20 min

What you will learn

  • Name what SPF, DKIM and DMARC each check
  • Explain alignment between the From domain and the checked domains
  • Predict what a receiving server does with a message
  • Read an Authentication-Results header

Read the guide to SPF, DKIM and DMARC first if the terms are new. This exercise takes about 20 minutes and has three tasks.

Reminder in four lines

  • SPF checks whether the sending server is on the domain's list. It looks at the envelope sender (the bounce address), not the visible From line.

  • DKIM checks a signature in the message with a public key from DNS. It survives forwarding as long as the message is not changed.

  • DMARC passes when SPF or DKIM passes and the passing domain matches the From domain (alignment). Its policy says what to do when it fails.

  • Alignment is relaxed by default: mail.example.com aligns with example.com because both belong to the same organisational domain.

Worked example: reading the results

Receiving servers write their results into a header called Authentication-Results. Most mail apps show it under "Show original" or "View source".

Results for a newsletter from example.com
Authentication-Results: mx.receiver.example;
  spf=pass smtp.mailfrom=bounces.example.com;
  dkim=pass header.d=example.com header.s=mail2026;
  dmarc=pass header.from=example.com

SPF passed for bounces.example.com, which aligns with example.com in relaxed mode. DKIM passed for example.com itself. Either one would have been enough for DMARC to pass.

Extension for fast finishers

Open an email you received from a large organisation, such as a newsletter, and find "Show original", "View source" or "Show message headers" in your mail app. Find the Authentication-Results header.

  1. Did SPF, DKIM and DMARC pass?

  2. Which domain did SPF check (smtp.mailfrom), and which domain signed with DKIM (header.d)?

  3. Do they align with the domain in the From line?

Do not share screenshots of personal emails with the class.

Teacher notes

How to run it (20 minutes). 5 minutes: read the reminder and the worked example together; ask which line shows alignment. 12 minutes: learners do the three tasks alone. 3 minutes: discuss the newsletter question, which most learners get wrong at first.

Typical mistakes.

  • Thinking DMARC needs both SPF and DKIM to pass. One aligned pass is enough.

  • Forgetting alignment: a pass for the newsletter service's own domain does not help the From domain.

  • Believing SPF checks the visible From line. It checks the envelope sender.

  • Reading p=none as "no protection set up". It is a deliberate monitoring step.

Follow-up questions.

  • Why does SPF often fail after forwarding, while DKIM survives?

  • Why do domain owners start with p=none instead of p=reject?

  • What could happen to a company's real emails if it publishes p=reject before every sending service is set up?

Differentiation.

  • Easier: give learners the four-line reminder on paper and skip the two alignment questions.

  • Harder: learners write SPF, DKIM and DMARC records for a fictional company, Proseware, that sends from its own server (203.0.113.20) and from one newsletter service, and explain the order in which they would publish them.

Use it with a class
  1. 1. Copy the class link and share it with your class.
  2. 2. Learners finish the exercise and get a result code.
  3. 3. Paste the codes into Class results to see everyone at once.
Change the tasks in the builder

Reuse this material

CC BY 4.0

You may copy, adapt and share it, also commercially, as long as you credit ManyPI and link back.

"SPF, DKIM and DMARC check" by ManyPI (https://manypi.com/edu/email-authentication-exercise), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)