Step 2: Update SPF and turn on DKIM
After the relay adds a signature, it hands the message back to your Exchange Online. Exchange Online checks the message on the way in, like any other mail. For that check to pass, the relay has to be listed in your SPF record. Once DKIM is on for your domain, DMARC also passes on DKIM, which survives forwarding.
Do this for every domain you send mail from, before you route mail through the relay.
SPF: allow the relay
Add ip4:102.213.7.195 to the existing SPF record (the TXT record that starts with v=spf1) of each sending domain.
Put it before the include: entries, and keep the rest of the record unchanged:
| Before | After |
|---|---|
v=spf1 include:spf.protection.outlook.com -all |
v=spf1 ip4:102.213.7.195 include:spf.protection.outlook.com -all |
Rules to keep in mind:
- A domain must have exactly one SPF record. Edit the existing one; do not add a second.
- An
ip4:entry does not count towards SPF's limit of 10 DNS lookups, so it is always safe to add. - If you use a DNS provider's "SPF wizard", choose add IP address and enter
102.213.7.195.
Check it from PowerShell (Windows) or a terminal (macOS/Linux):
Resolve-DnsName contoso.com -Type TXT | Where-Object Strings -like 'v=spf1*'
dig +short TXT contoso.com | grep spf1
Without this change, mail can be rejected. Exchange Online checks SPF and DMARC on every message the relay hands back, even though it recognises the relay by its certificate. When the relay adds a signature it also has to remove the original DKIM signature, so SPF is what lets DMARC pass. If your domain has a DMARC policy of
p=reject, mail that fails SPF is bounced with 550 5.7.509 Access denied, sending domain … does not pass DMARC verification; withp=quarantineit lands in Junk. The Mail authentication section of your tenant page in the portal shows whether each domain is ready, and is checked again every 6 hours.
DKIM: sign with your own domain
New Microsoft 365 tenants sign outgoing mail as yourtenant.onmicrosoft.com. Signing as your own domain lets DMARC
pass on DKIM. Gmail, Yahoo and Microsoft expect this from business senders.
With the script
.\Enable-InnovarroDkim.ps1
The script creates 2048-bit keys for each domain that has none and prints two CNAME records per domain, for example:
| Type | Name | Points to |
|---|---|---|
| CNAME | selector1._domainkey |
selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft |
| CNAME | selector2._domainkey |
selector2-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft |
Copy the exact values the script prints for your domains; they differ per tenant. Add them at your DNS provider, wait until they are visible (usually minutes, at most an hour), then turn signing on:
.\Enable-InnovarroDkim.ps1 -Enable
If Microsoft answers that the CNAME is missing even though it is published, Microsoft has not finished publishing
the new key yet. Wait 15 minutes and run -Enable again.
In the Defender portal
- Open security.microsoft.com → Email authentication settings → DKIM.
- Select your domain. If it says No DKIM keys saved, choose Create DKIM keys.
- Publish the two CNAME records shown.
- Switch Sign messages for this domain with DKIM signatures on. The status becomes Valid.
DMARC
If you do not have a DMARC record yet, start with monitoring only. Add a TXT record named _dmarc:
v=DMARC1; p=none; rua=mailto:dmarc@innovarro.cloud
The reports then appear on the Protection page of your organisation in the portal. Keep p=none until every
legitimate sender passes, then move to p=quarantine and later p=reject. With
Email & Domain Protection, Innovarro hosts the record and takes these steps for you,
once the reports show they are safe.
Check
The Mail authentication section on your organisation's page in the portal checks every domain (SPF for the relay,
DMARC and DKIM) and should show OK for each. You can also run .\Test-InnovarroSignatures.ps1: each domain should
show PASS for SPF and DKIM.