by Samy (Kondasamy Jayaraman)

Module 41 · How email arrives

Beginner

Anyone can write any From line

Larkspur’s real confirmations land in junk while a fake invoice walks into the inbox. Here you sort mail in a customer’s post room: peel the postmarks, then check who may send, the seal, and what to do when a check fails.

Read as

The whole idea in one example

The fake invoice, before and after

No records

fake

inbox

It passes SPF for its own domain, while Larkspur’s real confirmation goes to junk.

SPF, DKIM and DMARC reject

fake

bounced

No pass is for Larkspur’s domain, so Larkspur’s policy sends it back.

Made-up mail and DNS on .example names, judged by real SPF, DKIM and DMARC checks. The DKIM key is a demo key, public on purpose.

How it works

Four ideas carry the module

  1. 1 Postmarks

    Each server stamps the message on top; read them bottom-up for its road

    RFC 5321 says each mail server that takes a message must add a Received line at its top, and the server that makes final delivery adds a Return-Path line holding the envelope sender.

    Source, checked 28 October 2026

  2. 2 A list of allowed senders

    SPF lists the servers that may send with your envelope

    RFC 7208 has SPF check the envelope sender’s domain (the MAIL FROM address) against the IP address of the server handing the message over, and caps one check at 10 DNS lookups.

    Source, checked 30 October 2026

  3. 3 A seal on the letter

    DKIM signs the words; one changed digit breaks it

    RFC 6376 has the signer name its domain (d=) and a selector, a name for the key, and publish the public key in DNS at <selector>._domainkey.<domain>.

    Source, checked 30 October 2026

  4. 4 What to do with a failure

    DMARC wants a pass for the From line’s own domain, then applies your policy

    RFC 7489 counts an SPF or DKIM pass for DMARC only when its domain aligns with the From domain, relaxed by default, and offers three policies: none, quarantine and reject.

    Source, checked 28 October 2026

The story

Larkspur’s mail, and a forger

Larkspur Supply Co.’s order confirmations land in junk while a fake Larkspur invoice reaches a customer’s inbox; the team learns that anyone can write any From line, and SPF, DKIM and DMARC are how the receiver checks it. You run the checks at the customer’s end.

7
made-up messages, each checked for real in your browser
5
postmarks on the forwarded copy
98
messages in chapter 7’s day of mail
2
settings win chapter 7

Your path

The chapters

  1. Chapter 1

    An envelope and a letter

    What does a mail server read, and what does a person read?

  2. Chapter 2

    Who takes it next

    Which servers carried the message, and in what order?

  3. Chapter 3

    Anyone can write From

    How can a stranger send mail that says it is from Larkspur?

  4. Chapter 4

    The list of allowed senders

    Does a list of allowed senders stop the fake invoice?

  5. Chapter 5

    A seal on the letter

    Can a seal show that nobody changed the message?

  6. Chapter 6

    What to do with a failure

    How does a receiver know which pass speaks for the From line?

  7. Chapter 7

    Set the mail records

    Which records deliver every real message and stop every fake?

Who it’s for

  • Engineers
  • Product managers
  • Analysts
  • No code needed

Anyone whose company sends mail customers must trust, or who has been asked “why is our mail in spam?”. Opening a web page teaches the DNS these checks read, and Locks and keys the signature behind DKIM.