my-appengineer Courses

Sender setup: SPF, DKIM and DMARC on your own domain

Deliverability and metricsLesson22 min17 / 21

You can write the best email in the world, and it's worth nothing if it lands in spam. Deliverability starts with proving to mailbox providers (Gmail, Outlook, Yahoo, Apple and the rest) that you are who you say you are. That proof is three DNS records on your domain: SPF, DKIM and DMARC.

This sounds technical. In practice it's copying a few records into your domain settings, once, and checking that they work. This lesson explains what each record does, how to check your domain with the platform, and how to combine your my-app.engineer mailboxes with an email service provider (ESP) without breaking anything.

Why this is no longer optional

Since 2024, Gmail and Yahoo require authentication from everyone who sends to their users, with stricter rules for bulk senders (Google names roughly 5,000 messages a day to personal Gmail accounts as the threshold). In 2025 Microsoft announced similar requirements for high-volume senders to Outlook.com addresses. For bulk senders that means, among other things:

  • SPF and DKIM both set up for the sending domain;
  • a DMARC record (at least p=none), with the From domain aligned with SPF or DKIM;
  • one-click unsubscribe in marketing email (the List-Unsubscribe and List-Unsubscribe-Post headers, defined in RFC 8058) and a visible unsubscribe link, with unsubscribes processed within two days;
  • a spam complaint rate kept low: Google asks to stay below 0.3% and recommends below 0.1%.

You may be far below 5,000 emails a day. Set it all up anyway: the requirements describe what mailbox providers trust, and a small sender with clean authentication has a head start.

Google's Email sender guidelines page in Gmail Help, listing requirements for all senders and for bulk senders
Google's Email sender guidelines: the requirements for sending to Gmail accounts

Read the current versions yourself, because they are updated: Google's Email sender guidelines, Yahoo Sender Best Practices and Microsoft's announcements for Outlook.com senders.

The three records in plain words

SPF (Sender Policy Framework) is a list of servers allowed to send mail for your domain. It's one TXT record on the domain, like:

yourdomain.example.  TXT  "v=spf1 include:_spf.provider-one.example include:spf.your-esp.example ~all"

Rules: only one SPF record per domain (two records break SPF), and at most 10 DNS lookups in total, so don't keep adding include: entries for services you no longer use.

DKIM (DomainKeys Identified Mail) is a digital signature on each email. The sending server signs with a private key; your DNS publishes the public key under a selector, for example esp1._domainkey.yourdomain.example. Each service that sends for you gets its own selector, so you can have several DKIM records side by side.

DMARC tells receivers what to do when an email claims to come from your domain but fails SPF and DKIM alignment, and where to send reports:

_dmarc.yourdomain.example.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.example"
  • p=none: only monitor (start here).
  • p=quarantine: failing mail goes to spam.
  • p=reject: failing mail is refused.

The rua reports are XML files that show which servers send as your domain. Once you see that all your real mail passes (usually after a few weeks), move step by step to quarantine and later reject. That protects customers from people spoofing your shop's name in phishing emails.

The DMARC.org overview page explaining how DMARC builds on SPF and DKIM
DMARC.org explains the background: SPF and DKIM prove the sender, DMARC tells receivers what to do when they fail

Step 1: check your domain with the platform

The mailboxes on the Mail page live on your own domain. The platform can tell you what your domain serves for mail now, and which records are missing. Ask Claude to run the domain check (mail_domain_status): it reports MX, SPF, DKIM and DMARC as present or missing, and gives you the exact records to add at your registrar for anything missing. Open Mail

Ask Claude
Check the mail setup of my domain [yourdomain.example] with mail_domain_status. Tell me in plain words which of MX, SPF, DKIM and DMARC are present and which are missing. For each missing record, give me the exact record (type, name/host, value) to add at my registrar, and explain in one sentence what it does. Don't change anything yourself.

Add the records where your domain's DNS is managed: usually at the registrar where you bought it. A domain you bought through my-app.engineer already has A, MX, SPF, DKIM and DMARC set automatically (plus a hello@ mailbox); for a domain bought in the BIAB Domain Store you edit all DNS records yourself under Settings → Domain Store → the domain's detail page. Open Settings

Step 2: add your ESP without breaking the platform mail

Your domain now sends from two places: the platform mailboxes (one-to-one mail, your app's transactional mail) and your ESP (newsletters, flows). Both must be authenticated.

  1. In your ESP, open the domain authentication settings and add your domain. The ESP shows you its records, usually one or more DKIM records and sometimes an SPF include: or a custom return-path.
  2. DKIM: add the ESP's DKIM records as new records. They don't conflict with the platform's DKIM, because they use a different selector.
  3. SPF: if the ESP asks for an include:, merge it into your one existing SPF record. Don't create a second SPF record and don't remove the platform's part.
  4. DMARC: one record per domain, which covers both.
  5. Run mail_domain_status again to check that the platform's records still pass, and use the ESP's verification button.
Watch out

The most common mistake: pasting the ESP's SPF record as a second TXT record that starts with v=spf1. With two SPF records, SPF fails for all your mail, including order confirmations and your personal replies. Always merge into one record, then check again.

Tip

Many senders put marketing on a subdomain, like news.pawsandco.example, while one-to-one and transactional mail stays on the main domain. If newsletters ever get complaints, the reputation of your order confirmations and personal replies is better protected. Check whether your ESP supports sending from a subdomain; then add the ESP's records for that subdomain instead.

Step 3: the other technical must-haves

  • A real From address on your domain, not a free mailbox address. Gmail and Yahoo addresses as From for bulk mail will fail DMARC at the receiver, because those providers publish strict DMARC policies.
  • A Reply-To that someone reads: replies are a positive signal and often a sale. Point it at a mailbox you check on the Mail page.
  • One-click unsubscribe: your ESP adds the List-Unsubscribe headers; check that it's enabled. Bulk mail sent from a plain mailbox one by one does not have this, which is another reason marketing belongs in an ESP.
  • TLS: modern ESPs and the platform's mail use encrypted connections; nothing to do, but don't use an old tool that doesn't.

Bookwise: the app's own mail

Bookwise sends booking confirmations and reminders itself. Connect the app to a mailbox with mail_connect_app, for example bookings@bookwise.example. The app gets SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_FROM, SMTP_PASSWORD and SMTP_FROM_NAME in its environment, must use exactly SMTP_FROM as From address, and can put the salon's address in Reply-To. Because it sends from your authenticated domain, it benefits from the same SPF, DKIM and DMARC. Test it with an email to yourself before telling anyone it works. Open your apps

How it works in your country

Authentication is a technical standard, the same everywhere. What differs per country is what must be in the email (sender identification, address, unsubscribe) and which authority enforces it: for example the ACM (Netherlands), UKE/UODO (Poland), the ICO (UK), the Bundesnetzagentur and state DPAs (Germany), the FTC under CAN-SPAM (US). Check the requirements for each country you send to.

Your task

Run the domain check with Claude and write down which records are present. Add the missing ones, authenticate your domain in your ESP (merging SPF into one record), and add a DMARC record with p=none and a reports address. Run the check again until everything passes. Set a reminder for four weeks from now to review the DMARC reports and decide on p=quarantine.

This course is general information, not personal legal, tax or financial advice. Rules, amounts and dates change: check the official source for your country before you act.