The t_dkim_invalid error indicates that an email's DKIM (DomainKeys Identified Mail) signature is invalid or missing, causing it to be marked as potentially spam.
Before troubleshooting, verify your DKIM records.
Run this command to check DKIM on your domain:
dig TXT default._domainkey.yourdomain.com +short
Replace yourdomain.com with your actual domain.
If you get a valid response, it should look like this:
"v=DKIM1; k=rsa; p=MIGf... (your public DKIM key)"
If it's missing or incorrect, proceed to Step 2.
https://yourdomain.com:2083).If using Cloudflare, Namecheap, or GoDaddy DNS, manually add the TXT record.
If your DKIM record is missing or incorrect, update it manually.
In your DNS provider (Cloudflare, GoDaddy, Namecheap, etc.), add the following TXT record:
default._domainkeyv=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQE... (your public DKIM key)
Save changes and wait for DNS propagation (can take 24-48 hours).
If your mail server is not signing emails correctly, restart the necessary services.
service exim restart
systemctl restart postfix
systemctl restart opendkim
Send a test email after restarting.
After fixing your DKIM record, test it using:
If DKIM passes, your email authentication is fixed.
| Issue | Fix |
|---|---|
| DKIM record missing | Add a TXT record (default._domainkey.yourdomain.com) |
| Incorrect DKIM format | Use v=DKIM1; k=rsa; p=... |
| Emails not signed with DKIM | Restart exim, postfix, or opendkim |
| Verify DKIM | Use dig, MXToolBox, or Mail-Tester |
Now your emails should pass DKIM validation and avoid spam filters!