How to Configure Canonicalization Method in DKIM Records
Learn how to configure the canonicalization method in DKIM records to improve email deliverability and avoid message tampering.
Why Canonicalization in DKIM Matters for Email Deliverability
You sent a batch of transactional emails, and some bounced. Others landed in spam. You checked the headers. The DKIM signature looks valid. But the receiver still rejected it.
It’s not always the signature that’s broken. It’s how the receiving server interpreted it — and that depends on canonicalization.
DKIM signs content and headers to prove authenticity. But without the right canonicalization method in your DKIM record, even a correct signature fails validation. This happens silently, often leaving senders confused.
For high-volume senders, or those using third-party platforms like SendGrid or Mailchimp, this mismatch can tank deliverability. Poor inbox placement, reputation damage, and hard bounces follow.
Key takeaways
- Canonicalization defines how DKIM interprets content and header formatting during verification, even when the signature itself is correct.
- Using the wrong canonicalization method (e.g.,
relaxedwhensimpleis expected) causes DKIM to fail even with a valid signature. - High-volume senders and platform users must ensure consistent canonicalization across all systems to maintain sender reputation and inbox placement.
What Is Canonicalization in DKIM, and How Does It Work?
Canonicalization in DKIM is the process of standardizing how email headers and body content are formatted before signing, so small changes in whitespace, line breaks, or attribute order don’t break the signature. Even a single extra space or newline can invalidate a DKIM check if not handled consistently. This ensures that the message you sign is the same one the recipient verifies, no matter how it’s processed in transit.
Why It Matters for Email Integrity
Let’s say you send the same email twice from the same system. If the first version has a space after a colon in a header, and the second doesn’t, that difference breaks the DKIM signature unless canonicalization normalizes both. Without this step, even valid messages fail verification — a common source of false bounces.
DKIM defines two types: header and body canonicalization. Header canon handles line breaks and whitespace in headers, ensuring consistent ordering and trimming of unnecessary spaces. Body canon treats the message body as a block, normalizing line endings and ignoring certain formatting differences like trailing spaces or extra newlines. This is critical because email clients and servers often reformat content during delivery.
Standardizing both header and body formats is what makes DKIM work at scale. If you're debugging a DKIM failure or setting up authentication for a large email campaign, this normalization step is why you can’t just paste raw email content into a tool and expect it to work. The system must re-parse and clean those inputs the same way the recipient will.
For deeper details on how this is defined, see the DKIM specification in RFC 6376, which outlines the two canonicalization methods: simple and relaxed. Relaxed (used by most senders) allows minor header reformatting, while simple requires exact matching. Most modern systems use relaxed for robustness.
How You Can Apply It in Practice
When you configure DKIM records in your DNS, you specify the canonicalization method via the c= tag. For example, c=relaxed/simple means header fields are relaxed but body content is strict. Setting this correctly is essential — mismatched or missing canonicalization rules cause signature failures even with valid keys.
Use tools like the inbox placement tester to verify how your messages are processed end-to-end. It checks DKIM signing, header integrity, and delivery behavior under real-world conditions. This avoids the guesswork of debugging from just a DNS record.
The Two Canonicalization Methods: Header vs Body
DKIM uses two canonicalization methods—relaxed and simple—to handle how email headers and body content are normalized before signing. Relaxed mode ignores insignificant whitespace and line breaks, making it resilient to minor formatting changes during transit. Simple mode treats every character exactly as it appears, which can break validation if headers or body content are altered in transit. Use relaxed for production email; simple is rarely used and highly fragile.
Relaxed vs Simple: How They Work
Relaxed mode applies to both headers and the body. It normalizes line breaks (converting CRLF to LF), collapses multiple whitespace characters into one, and ignores leading/trailing spaces on lines. This makes it robust against common transport changes, like those introduced by relays or content filters.
Simple mode preserves all formatting exactly. Even a single extra space or a different line ending can invalidate a signature. This mode is used only in rare cases where header or body integrity must be strictly preserved—such as in some automated system-to-system messaging.
Most email providers, including Gmail and Outlook, expect DKIM signatures to use relaxed canonicalization for headers and/or body. Using simple mode increases the risk of authentication failure, especially when emails pass through intermediaries.
| Feature | Relaxed | Simple |
|---|---|---|
| Line break handling | Normalizes CRLF to LF and skips repeated breaks | Preserves every line break exactly as sent |
| Whitespace treatment | Collapses multiple spaces into one; ignores leading/trailing spaces | Treats every space, tab, and newline as significant |
| Header normalization | Capitalizes field names; normalizes field values (e.g., strips extra spaces) | Preserves original capitalization and spacing |
| Body normalization | Applies same whitespace rules to body content | Preserves all whitespace, including between words or after line breaks |
| Resilience to transport changes | High — works reliably across most mail servers | Low — fragile to minor changes in forwarding, relaying, or formatting |
According to RFC 6376 — the standard for DKIM — relaxed canonicalization is recommended for most real-world message flows. It’s the default in most email platforms. Simple mode is only useful in narrow, deterministic environments where formatting must remain entirely unchanged.
When verifying your DKIM setup, test with headers and body content that mirrors real-world transport. Tools like MailTester’s email checker can validate if your DKIM signature holds under different canonicalization modes, though the verification process doesn't adjust your DNS record.
“Relaxed canonicalization is not just a preference — it’s a requirement for reliable email delivery at scale.”
How to Set the Correct Canonicalization in Your DKIM Record
You configure the canonicalization method in your DKIM record by editing the TXT record for your domain’s selector (like selector._domainkey.yourdomain.com) and ensuring it includes a=relaxed; b=relaxed or a=simple; b=simple. This tells receiving servers how to process header and body changes during email delivery — getting it wrong can cause DKIM failures even for valid emails.
Step-by-step: Set the correct canonicalization method
- Log in to your domain registrar or email platform (like AWS, Google Workspace, or Cloudflare) and navigate to your DNS management page. You need access here to edit your domain’s DNS records.
- Look for the DKIM TXT record. It typically starts with a selector name (e.g.,
mail._domainkey) followed by.yourdomain.com. This record is what verifies your emails are sent from an authorized source. - Check the content of the TXT record. It must include the
a=andb=flags. Usea=relaxed; b=relaxedfor most modern sending environments — it's the default standard, widely accepted, and handles common header and body changes (like line breaks) gracefully. It's used by default in most major ISPs and email providers. - If you're sending from a platform that requires strict matching, use
a=simple; b=simple. This avoids any header or body normalization, which can be useful for highly structured messaging (like transactional emails), but increases the risk of failure if formatting changes occur during transit. - Save the record and allow up to 48 hours for DNS propagation. Use a tool like MxToolbox or RFC 6376 to verify your DKIM record is correct and active.
Why canonicalization matters
Without the right canonicalization, your emails may fail DKIM validation — even if they’re legitimate. This can hurt sender reputation and lead to inbox placement issues. For example, if a receiving server applies relaxed canonicalization but your record expects strict, the signature will fail. This is common when migrating between email platforms or using third-party providers without reconfiguring DKIM.
If you’re verifying email lists before sending, make sure your DKIM settings are correct. An invalid DKIM signature can mark entire domains as suspicious. Use MailTester’s email checker to validate individual addresses and catch issues before they hit your inbox. For bulk lists, test deliverability with inbox placement testing to ensure your messages land where they should.
Why Relax Mode Is Usually the Right Choice
For most senders, especially those using bulk email platforms, marketing tools, or transactional systems, relaxed canonicalization is the default and correct choice in DKIM records. It accounts for common, harmless changes in message format during transit—like line breaks or header reordering—without breaking the signature. This reduces fails and improves delivery reliability across infrastructure.
What Gets Changed in Transit
Even small changes—adding a line break, normalizing whitespace, or reordering headers—can break a DKIM signature if strict canonicalization is used. These tweaks are routine in MTAs (Mail Transfer Agents), email gateways, and content filters. Without a flexible approach, legitimate messages get rejected or flagged.
For example, some SMTP servers add a Received: header or wrap long lines. Others normalize CRLF sequences or adjust spacing. These are not malicious alterations; they’re operational necessities. Using relaxed canonicalization tells the receiving server: "I expect minor formatting changes, and the signature should still validate."
Industry Standard for Real-World Email
Relaxed mode is the default in major email platforms and industry standards. It’s used by SendGrid, Mailgun, Amazon SES, and most ESPs handling high-volume traffic. The RFC 6376 standard itself recommends relaxed canonicalization for most cases.
Major deliverability services like Return Path and Google’s Postmaster Tools report that DKIM alignment failures often stem not from abuse, but from overly strict signing configurations. These issues are easily avoided by choosing relaxed mode when publishing your DKIM record.
You can verify a domain’s DKIM setup and test how messages will be validated using MailTester’s inbox placement tester. This helps confirm that your DKIM configuration—including canonicalization—will pass in real-world conditions.
For senders managing large lists, automated campaigns, or transactional workflows, relaxed is not just practical—it’s required for consistent inbox delivery. It’s the baseline choice for production environments where infrastructure variability is a given.
There are edge cases—like sending signed documents that require pixel-perfect formatting—but these are rare. For everyone else, relaxed mode is the right, safe, and proven choice.
Common Issues from Wrong Canonicalization Settings
Even with properly generated DKIM keys and correct signing, emails fail verification if the canonicalization method doesn’t match between sender and receiver. A mismatch in relaxed vs. simple canonicalization often causes inconsistent delivery—some providers accept messages, others reject them based on validation outcomes. Over time, repeated failures degrade domain reputation and increase the risk of being flagged as spam.
Why Mismatched Canonicalization Breaks Deliverability
- DKIM verification fails silently if the signing algorithm uses relaxed canonicalization but the receiving server expects simple, or vice versa—no bounce, just undelivered mail.
- Major providers like Gmail and Outlook apply different canonicalization rules by default; your mail can pass one but fail another due to this mismatch.
- If your email service or domain uses relaxed canonicalization but your DNS record specifies
relaxedwhile your backend usessimple, signature validation will fail. - Tools like RFC 6376 define the canonicalization standard—misunderstanding this leads to configuration errors that persist across campaigns.
- Testing the DKIM signature with a real-world verification tool is essential. Use an email checker before sending at scale to catch issues early.
Long-Term Reputational Risks from Ignoring Canonicalization
- Repeated DKIM failures—even minor ones—accumulate over time and contribute to a lower sender reputation score.
- Even if delivery isn't blocked immediately, inconsistent verification results skew analytics and reduce inbox placement rates over time.
- Mail providers like Microsoft and Google use aggregate feedback loops; persistent failures in signing or canonicalization can push your domain into quarantine.
- Fixing the issue after reputational damage is harder, requiring clean sending history and re-establishing trust with ISPs.
- To avoid this, validate your DKIM setup using a reliable inbox placement test that simulates real delivery across providers.
How to Test DKIM and Canonicalization Properly
Send a real email from your domain to a live inbox, then examine the full headers. Look for the DKIM-Signature header and confirm it includes a=relaxed — this confirms your canonicalization method is working. Use tools like MxToolbox or MailTester’s inbox-placement test to validate the signature and ensure the message reaches the inbox.
Step-by-step verification process
- Send a test email using your configured DKIM record. Use a real address you control — not a dummy or test-only account. This ensures you're testing the actual delivery path your users will follow.
- Download the full headers of the delivered message. Most email clients (like Gmail or Outlook) let you view raw headers. You’ll find the DKIM-Signature header here, which contains the cryptographic signature and canonicalization settings.
- Check for
a=relaxedin the DKIM-Signature header. This flag confirms that relaxed canonicalization is in effect. If you seea=simpleinstead, your email body or headers were processed differently than intended, which can break DKIM verification. - Validate the signature using a trusted tool. Paste the full headers into MxToolbox’s DKIM debugger or MailTester’s inbox-placement tester. These tools will check that the signature is valid according to the DNS record and that the canonicalization method matches your configuration.
- Check deliverability results. MailTester's inbox-placement feature simulates delivery across major providers. It shows whether the message lands in the inbox, spam, or is blocked — giving you a real-world view of how your DKIM and canonicalization settings perform under actual filtering rules.
Why header inspection matters
Many tools only verify DNS records. But DKIM only proves valid if the signature matches the delivered content. Canonicalization defines how whitespace and line breaks are normalized before signing. If your server applies relaxed but the receiver applies simple, the signature fails — even with correct DNS.
According to RFC 6376, DKIM’s relaxed canonicalization is the standard for email bodies and headers. Using a=relaxed ensures compatibility across the ecosystem. Always test with real mail flows, not just DNS checkers — because what works in theory may fail in practice.
The Role of Email Verification in Preventing DKIM Failures
DKIM doesn’t fail because of invalid email addresses—but sending to bad addresses harms your sender reputation, which weakens trust in your DKIM signatures over time. Clean lists with valid, engaged recipients improve deliverability and keep your reputation strong, ensuring DKIM remains a reliable trust signal for receiving servers.
How Bad Email Lists Undermine DKIM Trust
DKIM checks the signature alignment of your emails against your domain’s public key. It doesn’t care whether the recipient address is valid—but if your list is full of bounces, complaints, or undeliverable addresses, ISPs notice. High bounce rates or spam complaints trigger reputation penalties, making even properly signed messages more likely to be filtered or rejected.
Even a small percentage of invalid addresses can raise red flags. For example, a 2% bounce rate in a large send can trigger monitoring from services like Google’s Postmaster Tools or Microsoft’s SmartScreen. These systems correlate sending behavior with trustworthiness, and a poor reputation can cause receiving servers to de-prioritize or reject any message with a DKIM signature—even if technically correct.
MailTester Helps You Stay on the Right Side of Reputation
Let’s be clear: you don’t need to fix DKIM to avoid failures—you need to fix your list. Email verification is the most effective way to prevent the root causes of reputation damage. With MailTester, you can bulk verify your list—checking for invalid, catch-all, or role-based email addresses—before sending.
Our platform identifies risky addresses using real-time checks against SMTP, MX, and domain records, and flags addresses that could lead to bounces or spam traps. You can run this through our bulk verification tool, or integrate it via our real-time API for automated pre-send validation.
By removing invalid or suspicious addresses, you reduce bounces and complaints, directly improving your sender reputation. This consistency supports stronger trust in your DKIM alignment, helping ensure your messages land in the inbox—not the spam folder. It’s not about changing DKIM; it’s about maintaining the reputation that keeps it credible.
For deeper insight, you can test inbox placement with our inbox placement tester to see how your messages are treated across real inboxes, across major providers. The result? More consistent delivery—and stronger trust in your DKIM signature.
For context on industry standards, the DKIM specification defines the technical scope—but sender reputation, enforced by receivers, remains the real gatekeeper of deliverability.
How MailTester Helps Verify DKIM-Ready Addresses
MailTester’s real-time verification API checks individual email addresses for validity, including DNS health and SMTP readiness—key indicators of whether an address will pass DKIM validation. You can catch misconfigured domains, catch-all setups, or invalid syntax before sending, reducing the risk of DKIM failures due to poor recipient infrastructure. It’s a proactive step toward cleaner sends and better authentication.
Spot Issues Before They Break DKIM
Digital signatures like DKIM rely on correct DNS records and functional mail servers. If an email address is routed to a catch-all or a misconfigured domain, even valid-looking messages fail during authentication. MailTester flags these early by validating the underlying domain’s DNS records and testing SMTP connectivity—it doesn’t just check the address format, it tests whether the server will accept the mail.
For instance, if a domain lacks a proper DKIM record or uses a generic catch-all MX setup, MailTester surfaces that risk. This is especially important when you’re verifying large lists; a single failing domain can harm your sender score. With 98.9% accuracy in detecting invalid or non-deliverable addresses, MailTester stops many DKIM-ready failures before they happen.
Integrate Clean Lists at Scale
Let’s say you’re preparing a campaign in SendGrid, HubSpot, or Klaviyo. Instead of sending to a list that might include outdated, malformed, or non-existent addresses, integrate MailTester’s API directly. Each address gets verified in real time—before it ever hits your ESP’s system—ensuring only valid, properly configured emails are processed.
Use the email checker to test individual addresses you’re unsure about. Or automate list hygiene with the verification API for high-volume use, or clean entire lists with bulk verification. After verification, you’ll have fewer bounces and much better inbox placement—because DKIM checks are more likely to pass when the recipient’s server is actually ready to receive.
For deeper validation, pair your list cleaning with inbox placement testing via inbox tester, which simulates real delivery and shows exactly where your message lands. This gives you clarity on whether your DKIM, SPF, and DMARC configurations are doing their job in real-world inboxes.
DKIM doesn’t just validate messages—it verifies trust. And trust starts with clean, deliverable addresses. MailTester helps you build that foundation, one verified email at a time.
Best Practices for Managing DKIM and Canonicalization
You should always use relaxed canonicalization in DKIM records unless you're sending to a system that never modifies email content during transport — and even then, it's risky. Relaxed canonicalization handles common transit changes like line wrapping and whitespace adjustments. Test every new DKIM setup with a real inbound email and inspect the full headers to confirm alignment. Monitor inbox placement monthly; a dip could mean DKIM failure or canonicalization drift.
Core Configuration Rules
- Default to relaxed canonicalization for both headers and body — it’s designed to survive typical email transport changes.
- Only use simple canonicalization if you control the entire email pipeline and guarantee no formatting changes occur in transit.
- Never assume a DKIM signature works just because it’s published — validate it with a real message delivered to a test inbox.
- Inspect full message headers after sending to confirm the
DKIM-Signatureheader is present and passes validation. - Check alignment between the
fromaddress and the domain used in the DKIM signature — mismatched domains cause failures.
Monitoring and Verification
Even after correct setup, deliverability can degrade over time due to subtle configuration drift — maybe a new ESP alters header formatting, or a routing change impacts how content is handled.
- Run monthly inbox placement tests using tools that simulate delivery to real inboxes across major providers.
- Use actual inbox placement testing to validate not just delivery, but real inbox placement — this reveals issues that simple header checks miss.
- Automatically flag any drop in inbox placement rate above 5% over a 30-day window — that’s often a sign of signature or canonicalization failure.
- Verify your sender reputation and domain health regularly with a single email checker or bulk verification tool to catch issues early.
- Monitor DNS records for accidental changes — even a misconfigured SPF or DMARC can mask DKIM validation errors.
DKIM is only effective if the signature survives transit and matches the original content. Relaxed canonicalization exists to handle the inevitable modifications during delivery — don’t override it without strong justification.
For teams managing large volumes, consider integrating DKIM validation into your workflows using the MailTester API to verify sender configurations at scale. This helps catch issues before they impact deliverability. RFC 6376, the foundational DKIM specification, explicitly recommends relaxed canonicalization for general use — it’s not just best practice, it’s the standard. The official RFC is your reference when in doubt.
Conclusion: Proper DKIM Configuration Starts with Canonicalization
Canonicalization is not optional. It determines how the email body and headers are standardized before signing and validation. A mismatch here causes DKIM verification to fail, even with correct keys and domain setup.
Using relaxed mode for both header and body canonicalization minimizes delivery issues caused by minor formatting differences in transit. Always verify your DKIM record with a real-time email test to confirm alignment with receiving servers.
Combine proper DKIM configuration with clean email lists and continuous inbox placement testing. This reduces bounces, maintains sender reputation, and improves inbox placement across major providers.
Sources
- 52.1% of the world's top 1.8 million domains (937,931 domains) now publish a valid DMARC record, up from 29.1% in 2023. — EasyDMARC 2026 DMARC Adoption & Enforcement Report (2026)
- Google reported 265 billion fewer unauthenticated messages sent to Gmail users in 2024 — a 65% reduction — after its bulk-sender rules took effect, with 500,000+ top domains publishing DMARC records in response. — Google (via MailOver bulk-sender requirements guide) (2024)
Keep reading
- Email authentication: SPF, DKIM, DMARC, BIMI and MTA-STS (complete guide)
- Why Does My Email Show DKIM a=rsa-sha256 But No Key in DNS?
- DKIM l= Tag Body Length Limitation Exceeded 4096 Bytes in High-Attachment Emails
- SPF Mechanism Exp Tag Ignored Without SMTP Envelope Tracking
- How to Fix 5.7.1 Error Without Changing SPF Record
Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
What happens if I use simple canonicalization with a standard email service?
Simple mode fails easily if email infrastructure alters line breaks or whitespace. Most platforms normalize delivery — so simple mode leads to consistent DKIM failures.
Can I have different canonicalization settings for headers and body?
Yes — DKIM supports different modes for each: 'a=relaxed; b=relaxed' or 'a=simple; b=relaxed' are valid options based on your needs.
How do I find my DKIM TXT record?
It’s typically found under selector._domainkey.yourdomain.com in your DNS provider UI. Check your email platform’s admin panel for the correct entry.
Why does my DKIM pass in some tests but fail in others?
Inconsistent canonicalization settings or different handling of whitespace during transport can cause this. Always test with full header analysis.
Does MailTester check DKIM signature validity?
No — it doesn't validate DKIM signatures directly. But it verifies the addresses themselves and can test inbox placement, giving indirect insight into deliverability.
Can bad addresses affect DKIM verification?
Not directly. But a high bounce rate from bad addresses can hurt sender reputation, which may lead to stricter filtering and DKIM scrutiny.
How often should I test DKIM configuration after setup?
At least once per month. Also after DNS changes, infrastructure shifts, or new email service integrations.
What is the difference between SPF, DKIM, and DMARC?
SPF checks sender IP authenticity. DKIM signs message content. DMARC enforces policies based on both SPF and DKIM results.
Is relaxed mode safe for transactional emails?
Yes — it’s the recommended default. Transactional systems often route messages through multiple platforms, making relaxed mode more reliable.
Can I use MailTester to check list quality before setting up DKIM?
Yes — use MailTester’s bulk verification to remove invalid, catch-all, and disposable addresses. Clean lists improve sender reputation and DKIM trust.
What should I do if my DKIM record has no canonicalization flag?
Add 'a=relaxed; b=relaxed' to the record. The absence of explicit flags often defaults to simple, which can cause failures with standard email systems.
How does canonicalization affect email content after sending?
It doesn’t alter the content. It only defines how the message is normalized before signing, ensuring the signature remains valid after transit.