Set up SPF, DKIM and DMARC

Authenticate your sending domain with SPF, DKIM and DMARC, verify it on coss.com, and move your DMARC policy safely to p=reject.

Mailbox providers trust mail that proves it comes from the domain in its From address. Three DNS records do that. This guide adds a domain to coss.com, publishes its records, verifies it and takes its DMARC policy from monitoring to p=reject.

What SPF, DKIM and DMARC do

  • SPF lists the servers allowed to send mail for a domain. Receivers check it against the envelope sender (the bounce address, or Return-Path), not the From address people see.
  • DKIM signs each message with a private key. Receivers fetch the public key from DNS (<selector>._domainkey.<domain>) and check that the message wasn't changed and that the signing domain vouches for it.
  • DMARC ties both to the From address. A message passes when SPF or DKIM passes and its domain is aligned with the From domain. The DMARC record tells receivers what to do with mail that fails (p=none, p=quarantine or p=reject) and where to send reports about it.

Add your domain

Add the domain in the dashboard (Domains) or with the SDK. Domains belong to the organization and are shared by all of its projects; live keys can only send from verified ones.

const { : ,  } = await ..({ : "acme.com" });

for (const  of ?. ?? []) {
  .(., ., ., ., .);
}

The DNS records coss.com asks for

Copy the exact values from the dashboard or the records array: the DKIM tokens, the region and the DMARC report address are specific to your domain.

  • The three DKIM records sign your mail as your own domain, so DKIM is aligned for DMARC.
  • SPF lives on the send. subdomain, the envelope sender coss.com uses for bounces. Your root domain's SPF record doesn't change, so it keeps working for your other mail.
  • The DMARC record is optional for verification (required: false) but recommended. It starts in monitoring mode and sends aggregate reports to coss.com.

If you already have a DMARC record, keep it and add coss.com's address to its rua tag (addresses are comma-separated) instead of publishing a second one.

One-click setup with Domain Connect

If your DNS provider supports Domain Connect (Cloudflare, for example), the domain's page in the dashboard shows Connect with your provider. Your provider lists the records coss.com would add and asks you to confirm; then coss.com checks them right away. Only missing records are added, and a DMARC record only when your domain has none, so an existing policy is never weakened.

Verify the domain

coss.com checks the records automatically. Verification usually takes minutes, but DNS changes can take longer to propagate; a domain not verified within 72 hours fails. To check now, use Verify in the dashboard or coss.domains.verify():

const { :  } = await ..();

.(?., ?.); // "verified" true
for (const  of ?. ?? []) {
  if (. !== "verified") {
    .(., ., ., .);
  }
}

Each record's status is verified, missing, mismatch or not_checked, and found shows what DNS returned when it didn't match. Calling verify on a failed domain starts over with new DKIM records, which you publish again.

Move DMARC from p=none to p=reject

Mail providers send daily aggregate reports to the rua address. coss.com reads them, shows every source that sent as your domain on the domain's DMARC tab, and unlocks each stricter step once the last 14 days of reports say it's safe:

  1. Monitor (p=none): nothing changes for delivery; reports start arriving.
  2. Quarantine (p=quarantine): once mail through coss.com and all reported mail pass at high enough rates, and no other significant source fails.
  3. Reject (p=reject): after 14 days of a full quarantine, with the same checks.

coss.com never changes your DNS. When a step is ready, the dashboard shows the record to publish and owners and admins get an email with it. The same status is in the API:

const { :  } = await ...();

.(?.); // "monitoring"
if (?. && .) {
  .(`Publish at _dmarc: ${..}`);
}

A source in the reports that isn't coss.com is another service sending as your domain (a CRM, a help desk, your mail server) or someone spoofing it. Set up DKIM or SPF for your own services, aligned with your domain, before you tighten the policy. DMARC lists the exact checks. To build or read a record by hand, use the free DMARC record generator and checker.

Show your logo with BIMI

Once DMARC is at p=quarantine or p=reject for all of your mail, you can publish a BIMI record so Gmail, Apple Mail and others show your logo next to your emails. It needs an SVG logo and a mark certificate (VMC or CMC). See brand logos (BIMI).

Bulk sender requirements

Gmail, Yahoo and Outlook require bulk senders to support one-click unsubscribe. coss.com adds the headers for the categories you choose: see one-click unsubscribe.

Common mistakes

  • Two SPF records at one name. A name may have only one v=spf1 record; with two, SPF fails with an error. Merge them into one. coss.com's SPF is on send., so it never adds a second record to your root domain.
  • The domain added twice. Many DNS providers append your domain to the name you type, so send.example.com becomes send.example.com.example.com. Enter only send if yours does.
  • Proxied DKIM records. At providers that can proxy records (Cloudflare), keep the DKIM CNAMEs DNS-only, or they won't resolve to the keys.
  • Strict SPF alignment. aspf=s requires the envelope sender to be exactly the From domain, so SPF on send.example.com no longer aligns. Keep the default relaxed alignment.
  • Two DMARC records. Receivers may ignore both. Edit the one you have.
  • Going straight to p=reject. Without reading reports first, you can block your own CRM or help desk. Follow the steps on the DMARC tab.

Next steps

  • Domains: the reference for domains, verification and tracking domains.
  • DMARC: reports, checks and the API.
  • Brand logos (BIMI): the BIMI record and its checks.
  • Sending email: send your first email from the verified domain.

Last updated