Dev.to Security 🔐 Cybersecurity 👁 0 📖 25 min read

How to Set Up SPF, DKIM and DMARC for a Custom Domain on Kagi Mail

Short answer A Kagi Mail custom domain needs five kinds of DNS record: an ownership TXT record that starts with kagimail-verification=, plus MX, SPF, DKIM and DMARC records. For the domain we added, Settings > Domains l

How to Set Up SPF, DKIM and DMARC for a Custom Domain on Kagi Mail

Short answer

A Kagi Mail custom domain needs five kinds of DNS record: an ownership TXT
record that starts with kagimail-verification=, plus MX, SPF,
DKIM and DMARC records. For the domain we added, Settings > Domains listed an
MX record for mail.kagimail.com, the SPF value
v=spf1 include:kagimail.com ~all, two DKIM keys as TXT records, and the DMARC value
v=DMARC1; p=reject, which has no report address. If no DMARC policy
covers your domain yet, start at p=none with a report address
instead. For
domains whose users may post to mailing lists, RFC 9989 advises at least a month
there and as long at quarantine before reject. Check the result with the
DMARC checker.

Setting up a Kagi Mail custom domain means publishing a handful of DNS records.
Kagi announced the public beta of Kagi
Mail on November 23, 2026. Its
help page says a custom domain needs
an MX record plus SPF
(RFC 7208), DKIM
(RFC 6376) and DMARC
(RFC 9989) records. It names
the kinds of record and points to Settings > Domains for the values.

We added a domain, published the records and sent mail from it. This guide
prints the values Kagi listed, what four mailbox providers recorded for that
mail, and how the values compare with kagimail.com and kagi.com. It is for
anyone moving a personal or company domain to Kagi Mail who wants mail to keep
authenticating on the way. You will leave
with the records,
an order to publish them in,
and a DMARC policy you chose on purpose.

Which DNS records does a Kagi Mail custom domain need?

Kagi Mail asks for five kinds of record: one to prove you own the domain, then
the four its help page says it checks, which are MX, SPF, DKIM and DMARC. The ownership
record comes first. In Settings > Domains you click Add domain, enter the
domain, and publish a TXT record whose value starts with
kagimail-verification=. After you click I’ve added the
record
, Kagi lists the rest.

On November 24, 2026 we added kagi.dmarcguard.dev in a trial
account. This is what the screen listed. We set up a second domain in the same
account as well. Three results below come from that one: a forwarded message,
a Received header and Yahoo Mail’s filing of its messages. The text says so
where they do.

The records Kagi Mail listed for the domain we added

Record Host on the screen Type Value
Ownership kagi TXT kagimail-verification= followed by a token
MX kagi MX 10 mail.kagimail.com.
SPF kagi TXT v=spf1 include:kagimail.com ~all
DKIM v1-ed25519-20261124._domainkey.kagi TXT v=DKIM1; k=ed25519; h=sha256; p= and the key
DKIM v1-rsa-20261124._domainkey.kagi TXT v=DKIM1; k=rsa; h=sha256; p= and the key
DMARC _dmarc.kagi TXT v=DMARC1; p=reject

We added a subdomain of dmarcguard.dev, so every host ends in
kagi. For a domain at its apex (the bare domain, with no
subdomain), expect the same names without that ending: the root (often written
@), the two _domainkey names, and _dmarc. The screen shows the exact
hosts for your domain.

The same set, written for an apex domain

; The set Kagi Mail listed for our subdomain, written for an apex domain
; (host names inferred). The token, the selector dates and the keys are your
; own: copy them from Settings > Domains.
@                               TXT  "kagimail-verification=<your token>"
@                               MX   10 mail.kagimail.com.
@                               TXT  "v=spf1 include:kagimail.com ~all"
v1-ed25519-YYYYMMDD._domainkey  TXT  "v=DKIM1; k=ed25519; h=sha256; p=<your Ed25519 key>"
v1-rsa-YYYYMMDD._domainkey      TXT  "v=DKIM1; k=rsa; h=sha256; p=<your RSA key>"
; The DMARC value exactly as the screen lists it: no rua, no other tag.
_dmarc                          TXT  "v=DMARC1; p=reject"

Kagi puts setup at “about 5 to 10
minutes”, plus the time DNS changes take to apply, which it says is usually a
few minutes and can be up to 24 hours. For any record that is
missing or wrong, the screen shows the value it expects beside the value it
found, and it flags extra records for removal.

Kagi Mail's Domains screen listing the MX, SPF and two DKIM records for a custom domain, each with its found value shown as missing.

Kagi Mail's Domains screen for our domain, before the four records in view were published. The two DKIM keys are covered.

What MX record does Kagi Mail use?

Kagi Mail uses one MX host, mail.kagimail.com, and listed it for
our domain at priority 10. The screen listed one MX record.
kagi.com publishes the same host at the same priority, and kagimail.com
points at it too, at priority 1.

Take the previous provider’s MX records out in the same change. Two sets of MX
records split incoming mail between two providers according to their
priorities.

The MX record is the last of Kagi’s records to change, not the first. Until it changes,
incoming mail keeps arriving where it always has.
The migration order
explains why. Once it is published, an MX lookup shows
what the world sees.

What SPF record should you publish for Kagi Mail?

Kagi listed v=spf1 include:kagimail.com ~all for our domain: one include, which costs
1 of the 10 DNS lookups SPF allows, and a soft fail (~all),
which says any other sender is probably not authorized.

SPF (TXT at the domain)

v=spf1 include:kagimail.com ~all

The include is the lookup, and what it points at is kagimail.com’s own record,
v=spf1 ip4:34.134.57.174 ip4:198.133.160.17 -all: two ip4 terms (fixed addresses) and -all, none of
which queries DNS
(RFC 7208 §4.6.4).

The -all inside the included record does not make your record a hard fail.
An include only answers “does this sender match?”
(RFC 7208 §5.2); what
happens to everyone else is decided by your own record’s ~all. The
difference between the two endings is covered in
SPF softfail vs. hardfail.

A domain name may carry only one SPF record. Two of them make a check of that
name return a permanent error
(RFC 7208 §4.5). So if
another service still sends mail for the domain, its include goes into the
same record as Kagi’s. A domain that is leaving Google Workspace would publish
this while both are in use:

SPF while Google Workspace still sends

v=spf1 include:kagimail.com include:_spf.google.com ~all

That is 2 lookups, because Google’s include costs
1 on its own. Our
Google Workspace SPF guide walks through
the merge, and the SPF checker counts the lookups in
whatever you end up with.

We did not test whether Recheck DNS accepts a merged record like this one, or
whether anything else waits on that row. Because the screen compares the value
it expects with the one it finds, it may show a mismatch.

Which DKIM selectors does Kagi Mail use?

For our domain Kagi listed two DKIM keys, both published as TXT records: an
Ed25519 key (RFC 8463, a newer
algorithm whose keys are much shorter than RSA keys for similar security) at
the selector v1-ed25519-20261124 and an RSA key at
v1-rsa-20261124. The digits match the day we added the
domain, so the shape is v1-ed25519-YYYYMMDD and v1-rsa-YYYYMMDD. kagi.com
publishes keys at the same pattern, v1-rsa-20260831 and
v1-ed25519-20260831. Expect a pair shaped like this for your
domain, and copy the exact names from the screen.

Publish both keys, because Kagi signs with both. Each message from the domain
whose source we read carried two DKIM signatures, one per selector, each with
the domain itself after d=. Every DKIM verifier has to implement RSA with SHA-256
(RFC 6376 §3.3), and
RFC 8463 §5 says verifiers
must implement Ed25519 as well. In our test, three of four receivers did not
record a pass for it:

How four receivers recorded the two DKIM signatures on mail from our domain on November 28, 2026

Receiver Ed25519 signature RSA signature DMARC
Gmail dkim=neutral (no key) pass pass
Outlook.com dkim=ignore (unsupported signature algorithm) pass pass
Proton Mail dkim=permerror (0-bit key) pass pass
Yahoo Mail dkim=pass pass pass

The RSA signature passed at all four, and so did DMARC, which needs only one
passing signature whose domain aligns with the From domain
(RFC 9989 §4.4.1).
So a line that is not a pass for the Ed25519 selector, beside a pass for the
RSA one, is what a working setup looked like in our test.

The same shows up in aggregate reports. Google’s report on that day’s mail from
our domain covers 6 messages: it lists the
Ed25519 selector as fail and the RSA selector as pass, and every message
passed DMARC. Yahoo’s report, on 2 messages, lists
both selectors as pass. For this setup, a fail beside that selector was not
a sign that anything was broken.

kagi.com’s RSA key is 2,048 bits, the
length RFC 8301 §3.2
recommends. A key that long does not fit in a single DNS string, which holds
at most 255 characters. It is stored as several strings that a verifier joins
back together with nothing in between
(RFC 6376 §3.6.2.2).
Many DNS panels split the value for you; if yours does not, split it yourself.
If a key fails to validate, look for a space or a line break pasted into the
middle of it.

Because these are TXT records, the public keys live in your zone. If Kagi ever
changes a key, you publish the new record yourself. Some hosts take the other
route: Fastmail and
Proton each ask for
3 CNAME records that point at keys on
their side, and Proton says it generates a new key every
6 months.

One practical note: a date-stamped selector is not on the lists of common
names a checker tries, so such a checker will not find it. Type the selector
into the DKIM checker to test a key. Our
DKIM setup guide covers selectors and key records
in general.

Which DMARC policy should you start with on Kagi Mail?

The DMARC value Kagi listed for our domain is v=DMARC1; p=reject,
with no other tag, and we suggest starting somewhere else: p=none
with a report address, unless a DMARC policy already covers the domain. This is
the one place where we suggest something different from the value on the
screen.

p=reject asks receivers to refuse mail that claims to come from your domain
and fails DMARC. Some domains end up there. It is a demanding place to begin.
As listed, the value also asks for no reports: it has no rua tag, so
receivers have no address to send them to.

DMARC’s own standard says so. RFC 9989 singles out domains “that host users
who might post messages to mailing lists” and says they should not publish
p=reject. A domain that wants to get there should first publish p=none for
at least a month, then p=quarantine for an equally long period, and compare
the aggregate reports
(RFC 9989 §7.4).

A personal domain, or a company domain whose staff write to mailing lists, is
that kind of domain.

The reason is what a mailing list does to a message. It
sends your message on from its own servers, so SPF often no longer matches
your domain. If it also adds a footer or a tag in the subject, your DKIM
signature stops verifying. The message then fails DMARC through no fault of
yours, and under p=reject a receiver may refuse it.
Why forwarded mail fails DMARC has the full
mechanics.

We saw the SPF half of this ourselves. A message from the second domain, sent
to an address that forwards through Cloudflare Email Routing, arrived at Gmail
with its envelope sender rewritten to the forwarding domain, so SPF no longer
matched ours. It passed DMARC because the RSA signature still verified.

So for a domain that has never had a DMARC record, publish a monitoring policy
and read what comes back:

DMARC starter (TXT at _dmarc)

v=DMARC1; p=none; rua=mailto:[email protected]

Aggregate reports are XML files, usually sent daily by the receivers that
support them. Point rua, the tag that sets where those reports go, at
something that parses them: a DMARC monitoring service (DMARCguard’s free plan
is one) or our open-source report parser, Parse DMARC.
Where rua reports go explains the address
itself.

Then follow the schedule above: quarantine for as long again, compare the
reports, and only then decide whether p=reject suits your domain. Skip the pct
ramp older guides suggest: RFC 9989 lists that tag as historic
(RFC 9989 §9.3).

Key finding 57.9% of domains that publish DMARC sit at p=none: 967,563 of 1,670,975 Source: DMARCguard State of Email Authentication 2026 scan, 5,499,028 Tranco domains, 2026-02-27

Kagi’s screen may mark that row with a cross. To see what the screen does, we
published a p=none record with report addresses and alignment tags on our
test subdomain. The row showed a cross, and still did after Recheck DNS. When we changed that record to p=reject and
added sp=reject, leaving the other tags as they were, the row showed a
check. So the row accepted tags beyond the bare value it lists. Two records do
not establish what rule it applies. We did not try the shorter starter record
above, or a subdomain with no DMARC record of its own.

The other four records were not yet published while p=none was up. We
cannot say whether a domain reaches the Valid status, or can send, with a
cross on that row. Receivers read what is in DNS.

If you decide to publish p=reject from the start anyway, add a rua address
to it. Without one, the domain enforces and you receive no reports.

Two cases need different handling:

  • The domain already has a DMARC policy. Leave it alone during the move. If it is already at p=reject, have Kagi’s DKIM records live before you send through Kagi. RFC 9989 requires a p=reject domain to sign with DKIM and not to rely on SPF alone (RFC 9989 §7.4).
  • The domain is a subdomain. With no _dmarc record of its own, an existing subdomain takes the sp tag of the DMARC record above it, or that record’s p tag if there is no sp. Ours did: dmarcguard.dev publishes sp=reject, so the test domain was at reject before we added anything.

If the parent already enforces, your subdomain is already covered. Leave it
without a _dmarc record instead of publishing the p=none starter, which
would override the inherited policy.
DMARC subdomain policy covers sp and np.

None of this is a comment on kagimail.com’s own record, which is p=reject.
A mailbox provider decides the policy for its own domain. Your domain is your
decision, and how to create a DMARC record
goes through each tag.

Why do Kagi Mail’s records look like Stalwart’s defaults?

Because Kagi Mail runs on the
Stalwart mail server, and
Stalwart computes a set of DNS records for every domain it
hosts. The Received header on mail we sent to an address on the second
domain names it too: "Stalwart SMTP". We read the
source code to see what it
generates and compared that with DNS. Stalwart’s default DMARC
record is v=DMARC1; p=reject; rua=mailto:postmaster@<domain>; in the releases we read before
v0.16.0 it was v=DMARC1; p=reject; rua=mailto:postmaster@<domain>; ruf=mailto:postmaster@<domain>.

What Stalwart generates, what Kagi's own domains publish in DNS on November 28, 2026, and what Kagi listed for our domain

Record Stalwart generates kagimail.com kagi.com Listed for our domain
DKIM selector v{version}-{algorithm}-{date-%Y%m%d}; v0.11.8 to v0.15.5, YYYYMM + r or e 202503r, 202503e v1-rsa-20260831, v1-ed25519-20260831 v1-ed25519-20261124, v1-rsa-20261124
DMARC v=DMARC1; p=reject; rua=mailto:postmaster@<domain>; v0.11.8 to v0.15.5, v=DMARC1; p=reject; rua=mailto:postmaster@<domain>; ruf=mailto:postmaster@<domain> v=DMARC1; p=reject; rua=mailto:[email protected]; ruf=mailto:[email protected] v=DMARC1; p=reject; v=DMARC1; p=reject
SPF v=spf1 mx -all v=spf1 ip4:34.134.57.174 ip4:198.133.160.17 -all v=spf1 ip4:35.212.75.77/32 ip4:198.133.160.17/32 include:_spf.google.com -all v=spf1 include:kagimail.com ~all
TLS-RPT v=TLSRPTv1; rua=mailto:postmaster@<domain> v=TLSRPTv1; rua=mailto:[email protected] none not among the four on Kagi’s help page
MTA-STS a policy that starts in testing mode a policy in testing mode none not among the four on Kagi’s help page

Three things match. kagimail.com’s DMARC record is, character for character,
the string Stalwart generated in the releases we read before v0.16.0.
Its TLS-RPT record matches Stalwart’s, and its MTA-STS policy mode is
Stalwart’s default. The date-stamped selectors on kagi.com and on our domain
follow Stalwart’s current selector template, while kagimail.com’s two selectors
follow the older one.

These are comparisons of strings. They say nothing about which Stalwart
version Kagi runs.

SPF is the record that does not match, and it matters if you ever follow a
generic Stalwart guide. Stalwart’s default, v=spf1 mx -all,
authorizes whatever the domain’s MX record points at. For a Kagi domain that
is the address behind mail.kagimail.com, which is neither of the
two addresses in kagimail.com’s SPF record. Mail from the two addresses Kagi’s
own record authorizes would fail SPF under -all. Every message of ours
whose headers we read had left from one of those two,
198.133.160.17.

Kagi lists an include of its own instead. Use Kagi’s value.

The takeaway is about DMARC. p=reject is the policy in this mail server’s
default record, and that default carries a report address. The value Kagi
listed for our domain has the same policy and no report address. Both are
good reasons to choose your policy, and where your reports go, deliberately.
Stalwart also
appears in our DKIM2 draft tracker, among the
software the DKIM2 project’s deployments page lists.

What about MTA-STS, TLS-RPT and BIMI on Kagi Mail?

None of the three is among the four records Kagi’s help page lists for a
custom domain. Here is what applies to each.

MTA-STS (RFC 8461) tells sending
servers to require an encrypted connection to your MX host. kagimail.com
publishes a policy in testing mode, in which senders report failures
and still deliver
(RFC 8461 §5).

It needs two things on your domain: a _mta-sts TXT record and a policy file
served over HTTPS at mta-sts.yourdomain. Kagi’s help page and FAQ do not say
whether Kagi serves that file for custom domains. Do not publish the TXT
record unless something serves the policy.

A domain whose MTA-STS policy for its old provider is in enforce mode needs
that policy changed before the MX record moves. A sender that holds a policy
in enforce mode does not deliver to an MX host the policy does not list
(RFC 8461 §5). Updating a
policy has its own order and its own waiting time
(RFC 8461 §8.1): follow
that section, and move the MX record only afterwards.

Thundermail, another service built
on Stalwart, tells its custom-domain users that
automated support “isn’t currently planned” and recommends leaving the record
out. See an MTA-STS policy, line by line.

TLS-RPT (RFC 8460) only asks
senders for reports on their TLS sessions to you, failures included. A
_smtp._tls record changes nothing about delivery, so you can add one on its
own. Reading a TLS-RPT report shows what arrives.

BIMI puts your logo beside your messages in mailboxes that support it, and
it requires DMARC at quarantine or reject first. It is a later step.
What BIMI needs from DMARC has the list. Kagi
Mail is on the displaying side of BIMI as well: its

Sender brand logos

feature, part of Kagi Mail Labs, shows a sender’s verified logo in place of
the letter avatar.

How do you move a domain from Google Workspace to Kagi Mail?

Publish first the records that do not change how current mail is checked: the
DKIM keys, and an SPF record that keeps every current sender and stays within
10 DNS lookups. Change the MX record last.
Google Workspace is the worked case here. We ran no move ourselves, so the
order is our reasoning from how each record works, not a tested result. Kagi
lists all four records together after the ownership step.

An order for the move

  1. Start your Kagi Mail trial or Kagi Ultimate plan: Kagi says that until the trial starts you can only send to Kagi support and yourself. Then add the domain in Settings > Domains and publish the ownership TXT record.
  2. Publish the DKIM TXT records. They are public keys, so they can go in before anything else changes.
  3. Add include:kagimail.com to your existing SPF record. Keep your current provider’s include (for Google Workspace, include:_spf.google.com) while anything still sends through it, and check that the merged record stays within SPF’s 10 DNS lookups. A domain with no SPF record yet, and with nothing else sending for it (the old provider counts), publishes Kagi’s value as it is.
  4. Leave your DMARC record as it is. If the domain has no DMARC record and no parent domain’s policy covers it, publish the p=none starter record.
  5. Change the MX record to 10 mail.kagimail.com. and remove the previous provider’s MX records. If the domain already publishes an MTA-STS policy, read the MTA-STS note before this step.
  6. Send a test message and check it, as described in the next section. Do not send real mail through Kagi until the test shows dkim=pass for your domain.
  7. When nothing sends through the old provider any more, remove its include from SPF. A Google Workspace google._domainkey record can stay until then: DKIM records for two providers do not conflict.

A p=none record we published showed a cross on the DMARC row in Recheck DNS
(see the
DMARC section). A
merged SPF record from step 3 may show one too: we did not test it (see the
SPF section).

Kagi’s import helps with the mailbox itself. Connect the old account and Kagi
Mail keeps checking it for new mail every few
minutes, so the switch can be gradual.

kagi.com gives a before and after. Our February 2026 scan of
5,499,028 domains recorded kagi.com’s records, so we can show them
beside what it publishes now. Two snapshots show what changed, not the order
or the reason.

kagi.com in our scan of February 27, 2026 and in DNS on November 28, 2026

Record February 2026 scan Now
MX host mail.kagi.com mail.kagimail.com
SPF v=spf1 ip4:35.212.75.77/32 include:_spf.google.com -all v=spf1 ip4:35.212.75.77/32 ip4:198.133.160.17/32 include:_spf.google.com -all
DKIM selectors (6 common names probed in the scan) google, dkim the same two; also v1-rsa-20260831 and v1-ed25519-20260831, which the scan did not probe
DMARC policy reject reject

The MX host changed, the SPF record gained one address and kept Google’s
include, and the DMARC policy did not move. Two date-stamped DKIM keys now sit beside the old ones, and the date in
their names falls after the scan. In that February scan, no domain pointed its
MX record at Kagi Mail.

For the Google side of the move, see
DMARC for Google Workspace.

How do you check that a Kagi Mail custom domain works?

Check four things: what Kagi sees, what DNS returns, what a receiving server
concludes, and which folder the message reaches.

In Kagi Mail. Click Recheck DNS in Settings > Domains. For a record
that is missing or differs, the row shows the value Kagi expects beside the
one it found. Once every record of ours was found, with the DMARC record at
p=reject, each of the five rows showed a check and the domain’s DNS status
read “Valid”.

In DNS. Query each record yourself:

Query the records

# Replace example.com with your domain and YYYYMMDD with the date in your selectors.
dig +short MX example.com
dig +short TXT example.com | grep spf1
dig +short TXT v1-ed25519-YYYYMMDD._domainkey.example.com
dig +short TXT v1-rsa-YYYYMMDD._domainkey.example.com
dig +short TXT _dmarc.example.com

In a real message. Send one message from the new address to a mailbox at
another provider, open the message’s headers there, and find the
Authentication-Results header
(RFC 8601). You want spf=pass,
dkim=pass with your own domain, and dmarc=pass. Outlook.com and Proton
Mail printed our domain after header.d=; Gmail and Yahoo Mail printed it
after header.i=@. If
dkim=pass names a domain outside your Organizational Domain (for
mail.example.com, usually example.com), the message was signed, but DMARC
cannot use that signature. A parent or sibling name with the same
Organizational Domain counts under DMARC’s default relaxed alignment, and does
not under adkim=s, which needs the two names to be identical.

This is what Gmail recorded for the first message from our domain. We sent it
after every record was published. By then our DMARC record was the p=reject
one that got the check, which is why Gmail prints p=REJECT.

Authentication-Results at Gmail (address and signature data cut)

Authentication-Results: mx.google.com;
       dkim=neutral (no key) [email protected] header.s=v1-ed25519-20261124 header.b=...;
       dkim=pass [email protected] header.s=v1-rsa-20261124 header.b=...;
       spf=pass (google.com: domain of [email protected] designates 198.133.160.17 as permitted sender) [email protected];
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kagi.dmarcguard.dev

The Return-Path was the address on our domain, and both signatures carried
the domain after d=. Each is identical to the From domain, so SPF and DKIM
both align, even under the strict alignment (adkim=s; aspf=s) our DMARC
record asked for. The first DKIM line is the Ed25519 signature Gmail did not
verify, as the DKIM section
shows; it does not change the result. Our
guide to reading email headers explains each
field.

In the folder. A pass is not a place in the inbox. We sent a first message
from a new address on the domain to 7 mailboxes of our own, had
each mailbox write back, and then sent a second message.

Read the results narrowly. This was one account on one afternoon:
21 short messages between one person’s mailboxes. The address
was a minute old and the domain had never sent mail, and the test cannot tell
those two apart. The Google Workspace mailbox is on the parent of the domain
we sent from, a third thing it cannot separate. We did not send the same
messages from another provider, so the table says nothing about Kagi Mail
compared with anyone else.

Where mail from our domain landed on November 28, 2026

Mailbox First message Next message, after the mailbox wrote back
Gmail (two mailboxes) Inbox not checked
Google Workspace Spam Inbox
Outlook.com (two mailboxes) Junk Email Inbox
Yahoo Mail Spam Spam
Proton Mail Inbox not checked

SPF, DMARC and a DKIM signature passed at each of the
5 mailboxes where we read the authentication results, three of which had filed
the message as spam or junk. The results were the same whether the message
went to the inbox or not. Yahoo Mail filed the second domain’s messages as
spam too, so that row is not only about a new address.

The practical point is to test placement as well as headers. Send a first
message to a mailbox you control at each provider your contacts use, and look
at which folder it reaches.

Frequently asked questions

What DNS records does Kagi Mail need for a custom domain?

Five kinds: a TXT record whose value starts with
kagimail-verification= to prove you own the domain, an MX
record pointing to mail.kagimail.com, one SPF record, DKIM keys
published as TXT records, and a DMARC record. Settings > Domains shows the
exact values for your domain and flags extra records.

What is the MX record for Kagi Mail?

For the domain we added, Kagi listed priority 10 and the
host mail.kagimail.com. kagi.com, Kagi’s own domain, publishes the
same record. Remove the previous provider’s MX records when you switch: two
sets of MX records split mail between providers, and Kagi’s checker flags
extra records.

What DKIM selector does Kagi Mail use?

For the domain we added, Kagi listed two keys, both published as TXT records:
an Ed25519 key and an RSA key, at selectors shaped like v1-ed25519-YYYYMMDD
and v1-rsa-YYYYMMDD. The date on ours was the day we added the domain.
Settings > Domains shows the exact selector names for your domain.

Should I publish p=reject for my Kagi Mail domain?

Not as the domain’s first DMARC record. The DMARC value Kagi listed for the
domain we added is v=DMARC1; p=reject, with no report address. RFC
9989 says domains
whose users may post to mailing lists should not publish p=reject. It advises
at least a month at p=none and as long at p=quarantine before a domain that
wants p=reject moves to it. A domain that a DMARC policy already covers keeps
that policy during the move. Kagi’s screen showed a cross beside the p=none
record we published.

Can I keep my Google Workspace SPF include while moving to Kagi Mail?

Yes. SPF allows one record per domain name, so put include:kagimail.com and
include:_spf.google.com in the same record while Google still sends for the
domain, and remove Google’s include once it no longer does. That merged record
costs 2 of the 10 DNS lookups SPF allows. Kagi’s Recheck DNS may
show a merged record as a mismatch; we did not test it.

Does Kagi Mail support MTA-STS for custom domains?

Kagi’s help page and FAQ do not say. The help page lists four records it
checks for a custom domain: MX, SPF, DKIM and DMARC. kagimail.com itself publishes an
MTA-STS policy in testing mode. Do not publish an _mta-sts record
for your domain unless a policy file is served for it.

How long does Kagi Mail custom-domain setup take?

Kagi says about 5 to 10 minutes, plus
the time your DNS changes take to apply. It says DNS changes usually apply
within a few minutes and can take up to 24 hours.

Does Kagi Mail check DMARC on incoming mail?

Yes. For each message we sent to an address on our domain, Kagi recorded DKIM,
SPF and DMARC results and a spam score. Each score included
-0.50 from a rule named DMARC_POLICY_ALLOW. Kagi’s

View spam results

lists the rules behind a score.

Kagi Mail has also sent aggregate reports: we hold three from
kagimail.com about two of our own domains. One row is a message
that failed DMARC under p=reject, with the disposition
reject. We did not see what happened to that message.

Why does Gmail show dkim=neutral (no key) for a Kagi Mail message?

Every Kagi Mail message whose source we read carried two DKIM signatures, one
made with an Ed25519 key and one with an RSA key. In our test Gmail recorded the Ed25519 signature as
dkim=neutral (no key) and the RSA signature as a pass, and the
message passed DMARC. Outlook.com recorded the Ed25519 signature as ignored
and Proton Mail as a permanent error; Yahoo Mail verified both. One passing
signature whose domain matches the From domain is enough for DMARC.

The short version

  • A Kagi Mail custom domain needs an ownership TXT record, an MX record for mail.kagimail.com, one SPF record with include:kagimail.com, DKIM keys as TXT records, and a DMARC record.
  • Copy the selector names and keys from Settings > Domains. Ours carried the date we added the domain.
  • Keep one SPF record, and merge other senders into it.
  • The DMARC value Kagi listed is v=DMARC1; p=reject, with no report address. A domain that no DMARC policy covers yet is better served by p=none with a report address, then quarantine, with reject as a later decision. Kagi’s screen showed a cross beside our p=none record.
  • Kagi signs with both keys. In our test Gmail, Outlook.com and Proton Mail did not verify the Ed25519 signature; the RSA one passed at every receiver we read, and so did DMARC.
  • Change MX last. Then read Authentication-Results on a test message, and check which folder it reached, before you send real mail.

This article was created with the help of AI.

Originally published at dmarcguard.io.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.