SPF (Sender Policy Framework)
What It Does
SPF lets you declare which mail servers are allowed to send email on behalf of your domain. Think of it as a guest list — if a server isn’t on the list, receiving mail servers know to be suspicious.How It Works
- You publish a DNS TXT record on your domain listing authorized sending servers.
- When a receiving server gets an email claiming to be from your domain, it looks up that TXT record.
- The receiving server checks whether the sending server’s IP address matches one of the authorized entries.
- If it matches, the SPF check passes. If not, it fails.
v=spf1— identifies this as an SPF recordinclude:sparkpostmail.com— authorizes all servers listed in sparkpostmail.com’s own SPF record (this is how Lettr’s infrastructure is authorized)~all— soft-fail any server not on the list (meaning treat it as suspicious but don’t outright reject)
How Lettr Handles SPF
When you add a sending domain in Lettr, you configure a CNAME record that delegates SPF verification to Lettr’s infrastructure. This approach means you don’t need to manually manage IP addresses — Lettr’s CNAME points tosparkpostmail.com, which maintains the authoritative SPF record for all sending IPs.
You do not need to create a separate SPF TXT record for Lettr. The CNAME record handles this automatically. If you already have an SPF record for other services, the CNAME delegation works alongside it without conflict.
Limitations
SPF has one well-known weakness: it breaks when emails are forwarded. When a server forwards your email, the forwarding server’s IP address is what the next receiver sees — and that IP won’t be in your SPF record. This is one of the reasons SPF alone isn’t enough, and why DKIM and DMARC exist.DKIM (DomainKeys Identified Mail)
What It Does
DKIM adds a cryptographic signature to every outgoing email. This signature proves two things: the email came from an authorized sender, and the message wasn’t tampered with in transit. Unlike SPF, DKIM survives email forwarding because the signature travels with the message itself.How It Works
- The sending server signs each email using a private key that only it knows.
- The signature is added as a header in the email.
- The corresponding public key is published as a DNS TXT record on your domain.
- The receiving server retrieves the public key from DNS and uses it to verify the signature.
- If the signature checks out, the receiving server knows the email is authentic and unaltered.
Lettr Setup
When you add a sending domain in Lettr, you are provided with a DKIM selector and a public key. You add these to your DNS as a TXT record in the following format:selector— a unique identifier Lettr assigns (used to look up the correct public key)_domainkey— a fixed namespace that tells receivers this is a DKIM recordv=DKIM1— identifies the DKIM versionk=rsa— the encryption algorithm usedh=sha256— the hash algorithm used for signingp=MIGf...— the public key itself
nslookup:
Replace
selector with the actual selector value Lettr provides, and yourdomain.com with your sending domain. Copy the record values exactly as Lettr provides them — even a single missing character will cause verification to fail.DMARC (Domain-based Message Authentication, Reporting & Conformance)
What It Does
DMARC builds on top of SPF and DKIM. It does two things:- Policy — tells receiving servers what to do when an email fails both SPF and DKIM checks (or fails alignment).
- Reporting — provides a way for receiving servers to send you reports about authentication results, so you can monitor who is sending email using your domain.
DMARC Policies
| Policy | Value | What Happens |
|---|---|---|
| None | p=none | Do nothing — just collect reports. Use this to monitor before enforcing. |
| Quarantine | p=quarantine | Send failing emails to the spam/junk folder. |
| Reject | p=reject | Block failing emails entirely. They are never delivered. |
Example Record
A DMARC record is a DNS TXT record published at_dmarc.yourdomain.com:
v=DMARC1— identifies this as a DMARC recordp=none— the policy (start here)rua=mailto:dmarc@yourdomain.com— the email address where aggregate reports are sent
Recommended Progression
Lettr recommends a gradual approach:| Phase | Policy | Duration | Purpose |
|---|---|---|---|
| 1 | p=none | 2–4 weeks | Monitor reports, identify all legitimate senders |
| 2 | p=quarantine | 2–4 weeks | Failing emails go to spam — low risk, good signal |
| 3 | p=reject | Ongoing | Full protection — unauthorized emails are blocked |
How They Work Together
SPF, DKIM, and DMARC each handle a different piece of the authentication puzzle:| Protocol | What It Checks | How It Checks | What It Proves |
|---|---|---|---|
| SPF | Sender server | DNS lookup of authorized IPs | The sending server is permitted to send for your domain |
| DKIM | Message integrity | Cryptographic signature verification | The email content hasn’t been altered and was signed by an authorized sender |
| DMARC | Policy and alignment | Evaluates SPF and DKIM results against your policy | Tells receivers what to do on failure, and ensures the “From” domain matches |
- An email arrives claiming to be from
you@yourdomain.com. - The receiving server runs an SPF check — is the sending server authorized?
- The receiving server runs a DKIM check — is the cryptographic signature valid?
- The receiving server runs a DMARC check — do the SPF or DKIM results align with the “From” domain, and what does the domain’s DMARC policy say to do?
- Based on the DMARC policy, the email is delivered, quarantined, or rejected.
DMARC passes if at least one of SPF or DKIM passes and aligns with the “From” domain. Both don’t need to pass — but having both configured gives you redundancy.
Alignment
Alignment is the concept that makes DMARC work. It ensures that the domain a recipient sees in the “From” address actually matches the domain that passed authentication.SPF Alignment
The domain in the envelope from (also called the return-path — the technical sender address used during SMTP delivery) must match the domain in the header from (the address the recipient sees). If your email showsFrom: hello@yourdomain.com but the envelope sender is bounces@otherdomain.com, SPF alignment fails even if SPF itself passes.
DKIM Alignment
The signing domain (thed= value in the DKIM signature header) must match the domain in the header from. When you send through Lettr with a properly configured sending domain, Lettr signs with your domain, so DKIM alignment passes.
What DMARC Requires
DMARC requires at least one of the following to be true:- SPF passes and SPF alignment passes
- DKIM passes and DKIM alignment passes
Common Mistakes
Publishing multiple SPF records
Publishing multiple SPF records
A domain can only have one SPF TXT record. If you add a second one (for example, when configuring a new email service), DNS lookups will return both and SPF validation may fail. Instead, merge all your authorized senders into a single SPF record using multiple
include: directives:Using a DKIM key that is too short
Using a DKIM key that is too short
DKIM keys should be at least 1024 bits, and 2048 bits is the recommended standard. Keys shorter than 1024 bits are considered insecure and may be rejected by some receiving servers. Lettr provides a 2048-bit key by default when you add a sending domain.
Starting with DMARC p=reject
Starting with DMARC p=reject
Jumping straight to a reject policy without monitoring first is one of the most common and damaging mistakes. If any legitimate email source isn’t properly authenticated — a marketing tool, a ticketing system, a forwarding rule — those emails will be silently blocked. Always start with
p=none, review reports, and progress gradually.Not monitoring DMARC reports
Not monitoring DMARC reports
Setting up DMARC without reading the reports defeats half its purpose. Aggregate reports (
rua) tell you which servers are sending email as your domain, whether authentication is passing, and if anyone is spoofing you. Use a DMARC reporting service or regularly review the XML reports sent to your rua address.Checking Your Authentication
Use these commands to verify your DNS records are published correctly.Check SPF
Check DKIM
selector with the DKIM selector provided by Lettr.
Check DMARC
Reading Email Headers
You can also check authentication results by viewing the headers of a received email. Look for these headers:- Authentication-Results — shows the pass/fail status of SPF, DKIM, and DMARC
- Received-SPF — details of the SPF check
- DKIM-Signature — the DKIM signature that was applied to the message
pass for all three protocols means your authentication is fully configured and working.
Related Topics
Sending Domains
Step-by-step guide to adding and verifying a sending domain in Lettr.
DMARC
Detailed guide to configuring DMARC for your domain.
How Email Delivery Works
Understand the full journey of an email from send to inbox.
Email Headers
Learn how to read and interpret email headers for troubleshooting.