If you run Postfix, Exim, or OpenSMTPD on Linux, DKIM is already your problem. The private key lives on your box. If that key leaks or signing stops, your domain reputation moves without you.
You usually notice it in logs first. Bounces increase, DMARC reports show drift, or a partner says your mail failed authentication even though nothing “changed”. Something always changed.
On most Linux deployments, DKIM signing runs through:
The private keys are typically stored under paths like:
/etc/opendkim/keys/example.com/
/var/lib/rspamd/dkim/
If those files are readable by the wrong account, an attacker does not need to spoof your domain. They can sign mail as you and pass authentication checks downstream. That is harder to detect and far more damaging over time.
You start to see it during incident response. Phishing emails that pass DKIM and DMARC because the signing key was taken from a compromised host.
It rarely announces itself clearly.
You might see:
Mail still flows. That is the problem. Misconfigurations and alignment failures can persist unnoticed in complex environments. Regularly reviewing DMARC settings helps ensure that authentication issues are detected early and that policies are consistently enforced across all sending systems.
When signing stops, DMARC enforcement weakens. If your policy is set to quarantine or reject, failure rates climb. If your policy is relaxed, spoofed mail starts slipping through because there is no valid signature to evaluate.
Linux admins usually trace this through logs, not dashboards.
You do not need a web tool to confirm whether DKIM is visible. Start local.
dig +short TXT selector1._domainkey.example.com
You are looking for a complete public key string. If it is truncated, split incorrectly, or missing, validation will fail regardless of what your mail server is doing.
After publishing or modifying a record, confirm global visibility using a DNS propagation tester. If DNS has not propagated, signing validation will fail outside your resolver even if it works locally.
opendkim-testkey -d example.com -s selector1 -vvv
If you see “key OK”, DNS and your local configuration align. If not, the selector, domain, or key file does not match what is published.
Mismatch between DNS and the private key is one of the most common causes of silent DKIM failure.
DKIM configured is not the same as DKIM signing.
Send a message from the server to a mailbox you control. Then inspect full headers and look for:
dkim=pass
If you see:
dkim=none
The message was not signed at all.
If you see:
dkim=fail
The signature did not validate against DNS.
Now check the local side.
OpenDKIM service status
systemctl status opendkim
journalctl -u opendkim --since "1 hour ago"
Postfix milter configuration
postconf | grep -i milter
If the Milter socket path changed or permissions shifted after an update, Postfix may be sending mail without passing it through the signing service. It does not always fail loudly.
You start noticing it only after external reports show authentication drift.
DKIM private keys should be treated like TLS private keys. Same risk profile.
Check ownership and permissions:
ls -l /etc/opendkim/keys/example.com/
Typical hardened setup:
If a private DKIM key is readable by a compromised web user or container runtime account, an attacker can extract it and sign mail elsewhere. That bypasses simple spoof detection because the signature is valid.
This is where DKIM moves from deliverability control to more of a Linux security issue.
Many teams generate a selector once and never rotate it. Years pass. The same key signs everything.
Key rotation should follow the same operational pattern as certificate rotation:
If rotation is incomplete, you will see dkim=fail for one path and dkim=pass for another. That usually means multiple outbound systems are not aligned.
Third-party senders are frequent offenders. Marketing platforms and ticketing systems often require their own DKIM configuration. If they are not aligned with your DNS records, DMARC alignment fails even though your primary Linux host is configured correctly.
In container deployments, DKIM keys are often mounted as volumes or baked into images. The second approach is risky.
If private keys are embedded in container images:
Mounting keys from a secured host path is safer, but permissions still matter. Containers run as specific UIDs. If that UID can read more than it should, the key exposure risk expands quietly.
It usually surfaces during a breach review, not during setup.
DKIM problems are often slow drift issues.
Patterns worth watching:
These are not noisy events. They blend into normal mail traffic unless someone is reviewing authentication headers or DMARC aggregate reports regularly.
You start to see the pattern once you correlate bounce reports with log timestamps.
DKIM on Linux is not abstract email theory. It is a signing service running on your server, using private keys stored on disk, wired into your MTA through sockets and permissions.
If the service stops, mail degrades quietly.
If the key leaks, attackers inherit your domain identity.
Most of the time, it works, and nobody thinks about it. Until a small config change, a package update, or a permissions shift introduces a gap that only shows up once external systems start rejecting your mail.
That is usually when someone finally runs dig, checks headers, and traces it back to the Linux host where the key has been sitting all along.