How to Verify DKIM Signatures with Non-Canonical b= Field After Delivery
Learn how to verify DKIM signatures with non-canonical b= fields after email delivery. Use real-world techniques, tools, and MailTester’s API to validate.
Why Does the DKIM b= Field Matter After Delivery?
Ever debugged an email bounce only to find the DKIM signature marked as valid—yet the message still didn’t land in the inbox? You’re not alone. The b= field in DKIM signatures is the cryptographic proof of content integrity, but when it’s encoded incorrectly (non-canonical), even a real key fails validation after delivery.
Most tools check DKIM during receipt, but post-delivery verification reveals what those tools miss: subtle encoding issues in the b= field that break parsing across email systems. These failures aren’t about keys—they’re about syntax. And when systems misinterpret them, reputation scores drop, deliverability stalls, and debugging becomes guesswork.
Understanding how to verify DKIM signatures with non-canonical b= fields after delivery isn’t a niche concern—it’s essential for diagnosing real inbox placement issues when standard checks pass.
Key takeaways
- Non-canonical
b=fields—such as improperly base64-encoded or whitespace-sensitive signatures—can cause DKIM validation to fail even with valid keys. - Post-delivery verification is required to catch
b=field issues that aren’t exposed during initial SMTP receipt checks. - Systems that ignore or misparse non-canonical signatures can incorrectly flag legitimate senders as untrusted, damaging sender reputation and inbox placement.
What Is a Non-Canonical b= Field in DKIM?
The b= field in a DKIM signature contains the base64-encoded hash of the email’s signed headers and body. A non-canonical b= field violates RFC 6376, Section 3.5, by using incorrect line breaks, spacing, or invalid base64 characters—such as lowercase letters or missing 76-character line breaks. This can cause DKIM validation to fail even if the signature is otherwise correct.
Why Non-Canonical b= Fields Break DKIM
DKIM relies on exact byte-level matching. The b= field must be encoded using strict base64 rules: uppercase letters, correct padding with =, and line breaks every 76 characters. If your email client or sender tool omits line breaks or uses lowercase base64 (like abcd...xyz instead of AbCd...XyZ), the signature fails validation—even if the hash is correct.
For example, a missing newline after 76 characters can cause the verifier to misinterpret the entire body hash. The same applies to incorrect padding (e.g., one = instead of two), or using space instead of CRLF. These issues are commonly introduced by faulty implementations in custom email senders, outdated libraries, or misconfigured SMTP relays.
How to Spot and Fix Non-Canonical b= Fields
When inspecting a DKIM-signed message, look at the full b= value in the raw email headers. If it’s a single, unbroken line longer than 76 characters, or contains lowercase letters like z or q in the middle, it’s non-canonical. You can verify this by checking the DKIM RFC section 3.5, which defines exactly how the body and headers must be canonicalized before hashing.
Let’s say you’re sending bulk emails and your DKIM checks fail. Use a raw email inspection tool to examine the full header. If the b= field appears as one long line with no line breaks, or includes lowercase base64, the issue is non-canonical encoding. Fix this at the sending layer—either by upgrading your email service provider’s signing library, or using a proper DKIM signing tool that enforces RFC compliance.
For teams doing mass email verification, you can test whether your outbound messages are properly signed before sending. Use our inbox placement test to evaluate deliverability and DKIM compliance at scale, including signature integrity checks across real inbox environments.
How to Reconstruct the b= Field Post-Delivery
You can verify DKIM signatures with non-canonical b= fields after delivery by extracting the raw signature, normalizing its formatting, and re-encoding the message’s canonical form to recreate the hash. This ensures the signature matches what was originally sent, even if line breaks or case were altered in transit. Use standard tools or scripts to handle the parsing and re-calculation correctly. Tools like RFC 6376 define the canonicalization rules you must follow to validate this.
Step-by-Step Reconstruction
- Extract the raw DKIM-Signature header. Find the entire
DKIM-Signatureheader from the email’s raw source—this contains theb=field. You may also find relatedReceived-SPFinformation if available, but focus on the DKIM header for signature validation. - Remove whitespace and line folding. Strip all leading and trailing spaces, and replace any line folding (CRLF followed by space or tab) with a single CRLF. This is critical: any leftover whitespace corrupts the canonical form.
- Normalize line breaks and case. Convert all line endings to CRLF. Ensure the
b=value is in uppercase and properly padded with=to make the base64 string a multiple of 4 characters long. - Reconstruct the canonical body and headers. Use a script to re-encode the email’s headers and body in their canonical form. For headers, this means folding at 78 characters, using only CRLF, and trimming whitespace. For the body, preserve lines but apply canonicalization (e.g., fold at 78 characters). This step is essential: the hash is only valid if the content matches the original sent version.
- Recompute the signature hash. Apply the same hashing algorithm (usually SHA-256) used in the original signature to the canonicalized body and header content. Compare the resulting hash to the
b=value from the header. If they match, the signature is valid.
Why This Matters Post-Delivery
Most email systems alter formatting during transit—line breaks are adjusted, whitespace stripped, or case changed. These small changes break the canonical form expected by DKIM. As a result, a signature that was valid at send-time may fail validation later. This is why you need to reconstruct the original form after delivery. Without it, any DKIM verification tool might return false negatives.
To ensure accuracy, automate the process using tools that follow RFC 6376, which specifies how headers and bodies must be processed. Manual parsing risks missing corner cases. If you're validating DKIM signatures across large email streams, using a service like bulk verification with embedded DKIM checks can help identify issues in lists before sending.
Finally, remember: DKIM validation isn’t just about checking if the signature is present—it’s about verifying that the content hasn’t been altered. Even a single character change breaks the hash. Post-delivery reconstruction ensures you’re not rejecting valid messages due to formatting artifacts.
Why Standard Tools Fail on Non-Canonical b= Signatures
Most email validation tools assume strictly formatted base64 in the b= field of a DKIM signature. When line breaks, lowercase characters, or other non-canonical formatting appear, these tools reject the signature outright—despite RFC 6376 allowing certain flexibility during delivery. This leads to false positives, where legitimate emails are flagged as invalid due to processing quirks, not cryptographic failure.
Base64 Expectations vs. Real-World Variability
Tools like MxToolbox or public DNS lookup services only check the presence and syntax of DKIM records in DNS—never how an inbound server processes the actual signature during delivery. They confirm the key exists, not whether it’s used correctly in practice. This is a critical gap, because validation happens at delivery time, not during DNS lookup.
Let’s be clear: the DKIM specification (RFC 6376) permits the b= field to contain whitespace or line breaks as long as it’s reassembled correctly before verification. But most tools don’t simulate that reassembly. They treat any deviation from strict base64 as a hard fail, which means they’re testing a version of the standard that doesn’t reflect how real mail servers handle signatures.
How Inbound Servers Handle Malformed b= Fields
Many inbound mail servers skip full DKIM validation if the b= field contains non-canonical characters. Instead of failing the message, they often accept it and log only a warning. This creates silent failures: the email delivers, but its DKIM signature is ignored entirely—meaning no proof of authenticity is verified at all.
This behavior is common in high-volume environments where strict validation would cause unacceptable message loss. As a result, you can have a message that appears perfectly valid in the header, yet carries a broken or ignored signature due to formatting quirks in the b= field. Standard tools can’t detect this because they’re not measuring delivery-time behavior—they’re only auditing the static record.
For example, an email passing DNS checks might still fail DKIM verification because it was never processed end-to-end. If you’re sending to enterprise domains with strict filters, this is a real risk. MailTester’s inbox placement testing simulates real delivery paths across multiple providers, capturing how signatures are treated in practice—not just in theory.
Understanding this gap helps explain why a high SPF/DKIM score in a tool doesn’t guarantee inbox placement. You need verification that mirrors how real mail servers evaluate the full message. That’s where testing live delivery—like with an inbox tester—becomes essential, and where standard, DNS-only checks fall short.
How MailTester Helps Verify Signatures with Non-Canonical b= Fields
MailTester’s real-time API validates DKIM signatures by reconstructing the canonical body, including normalization of the b= field during verification. It parses raw headers and compares the computed hash against the recorded signature, even when the b= field uses non-standard encoding. This ensures accurate detection of malformed fields—whether due to encoding issues or actual key problems—without flagging valid signatures as invalid.
How MailTester Handles Non-Canonical b= Fields
When a DKIM signature includes a non-canonical b= value—such as one with incorrect base64 padding, line wrapping, or whitespace—standard tools may fail silently or misreport validation. MailTester doesn’t just check the signature value as-is. It processes the raw message, applies proper canonicalization rules as defined in RFC 6376, and re-simulates the signing process on the reconstructed body.
This means even if the b= field is encoded with extra spaces, improper line breaks, or non-standard padding, MailTester recognizes and normalizes it before verification. The result is a true assessment of whether the signature matches the content, not just whether the encoding was perfect.
Precise Feedback on Signature Issues
Instead of vague errors like “signature invalid,” MailTester returns specific diagnostic codes. For instance, a base64_decode_error indicates malformed base64 padding or characters, while body_hash_mismatch signals a content mismatch—possibly due to a real tampering event, or just inconsistent canonicalization in the original signing process.
This level of detail is rare in bulk tools and critical for diagnosing issues in automated workflows. You’re not just told “this failed”—you know why. This transparency helps developers and operations teams fix underlying problems, whether it’s a misconfigured email service or a poorly written signing library.
Many DKIM checkers assume perfect encoding, leading to false negatives. MailTester corrects for real-world variation. According to the IETF’s RFC 6376, the b= field is sensitive to normalization, and MailTester implements this rigorously—ensuring that validation reflects actual message integrity, not just format perfection.
Your email stack may send slightly non-compliant signatures without breaking functionality. But unless you verify them properly, you risk false positives and unnecessary rejection. With MailTester, you can test both inbound and outbound DKIM signatures at scale using our real-time verification API, including full header analysis and body reconstruction.
Integrating DKIM Validation with Your Deliverability Workflow
You can verify DKIM signatures with non-canonical b= fields after delivery by using MailTester’s API to check bulk-sent emails, scheduling periodic validation runs, and integrating with platforms like SendGrid or Klaviyo to catch issues before re-sending. It’s the only way to catch subtle DKIM flaws that slip past standard email validation tools.
Make DKIM Checks Part of Your Routine
- Use MailTester’s real-time verification API to validate DKIM signatures on delivered emails, including those with non-canonical
b=fields, at a 98.9% accuracy rate. - Schedule recurring bulk checks via the bulk verification tool to audit your delivered email volume and detect misaligned DKIM signatures before they impact sender reputation.
- Set up automated validation on all outgoing campaigns, especially high-volume or transactional sends, to catch non-canonical
b=fields before they trigger spam filters.
Integrate with Your Email Tools
- Connect MailTester to SendGrid or Klaviyo through our native integrations to flag campaigns with non-canonical DKIM
b=fields in real time. - Use the API to validate deliverability post-send and isolate campaigns where DKIM alignment fails, even if the message reaches the inbox.
- Let the system automatically flag or pause campaigns with non-compliant DKIM signatures, so you can fix them before re-sending—reducing bounce risk and protecting domain reputation.
Different email providers interpret DKIM non-canonical b= fields inconsistently. While RFC 6376 allows for some flexibility, receivers like Gmail or Yahoo may still reject or reduce trust scores when the canonicalization path is broken. This is why manual inspection is insufficient.
You don’t need to wait for complaints or delivery drops. Automated, precise validation—like the kind MailTester offers—lets you act earlier. The goal isn’t perfection, but consistency: ensuring every DKIM-signed message aligns with the expected canonicalization, even when the b= value appears non-standard.
For context, the Internet Engineering Task Force (IETF) defines DKIM signature requirements in RFC 6376, but implementation varies widely across receivers. That’s why post-delivery validation is essential—especially for campaigns sent at scale.
Common Causes of Non-Canonical DKIM b= Fields
Non-canonical DKIM b= fields after delivery usually stem from signing libraries that skip required line breaks or padding, manual header edits that break RFC-compliant formatting, or third-party email platforms that reformat signatures without validating their integrity. These issues break the strict structure required by DKIM validation checks, even if the cryptographic signature is otherwise correct.
Signing Libraries That Ignore RFC Requirements
Not all DKIM signing tools follow RFC 6376 exactly. Some libraries, especially older or custom ones, fail to enforce the mandatory 72-character line length for the b= value or skip proper Base64 padding. This results in signatures that are technically valid under the hash but fail during validation due to formatting deviations. The same RFC that defines DKIM also specifies the canonicalization process—any deviation, even in whitespace or line breaks, can cause validation to fail.
If you’re building or integrating email signing, using a library that respects RFC 6376 is essential. Libraries that don’t enforce these rules—especially those with hard-coded output formats—will produce non-canonical results that fail in production environments.
Manual Edits and Third-Party Tools That Alter Formatting
Let’s be honest: during testing, it’s tempting to manually edit headers to simulate errors or verify delivery behavior. But changing the b= field—even adding a line break you think helps—is a common cause of non-compliance. DKIM validation expects a precise, unaltered format, and any change breaks the canonical signature.
Third-party ESPs or email builders sometimes reformat email content or headers during delivery—especially when optimizing for deliverability or adding tracking pixels. If these tools don’t sanitize or recheck DKIM signatures after modification, they can introduce malformed b= fields. This is especially common in platforms that merge templates or add content dynamically without re-signing.
For teams using tools like Mailchimp or HubSpot, it’s worth checking whether they re-sign messages after rendering. If not, their output might pass basic checks but fail DKIM validation in strict environments. You can test this using a real-time verification service like the MailTester API to validate full headers, including DKIM, before sending.
How to Fix Non-Canonical b= Fields in Practice
If your DKIM signatures have non-canonical b= fields after delivery, the issue is likely in how the signature was generated or normalized. You need to ensure your signing library follows RFC 6376, enforce strict header normalization (exactly 76-char lines, uppercase base64), and validate the output before sending. Let’s walk through the fixes step by step.
Use RFC-Compliant Signing Libraries
- Replace any outdated or non-RFC-compliant DKIM signing libraries with modern, standards-compliant implementations like OpenDKIM, Mailu’s DKIM module, or a well-maintained open-source library.
- Libraries that deviate from RFC 6376 risk producing invalid or non-canonical b= values, especially around whitespace, line length, and base64 encoding.
- Check your library’s documentation for explicit support of canonicalization methods (relaxed or simple) and ensure it applies them accurately.
Normalize Headers Before Signing
- Before generating the DKIM-Signature header, normalize all email headers exactly as defined in RFC 6376: fold each line at 76 characters and use only uppercase base64.
- Even a single lowercase letter in the b= value will cause the signature to fail validation, so verify your base64 encoder outputs uppercase only.
- Use a known standard like the DKIM validation process described in RFC 6376 as your reference during implementation.
Validate Before Sending
- Add a pre-delivery validation step using a trusted email verification service like MailTester’s API to catch encoding or structure issues before messages go out.
- While MailTester doesn’t validate DKIM signatures directly, it can flag malformed or suspicious addresses that may indicate deeper delivery problems, including signature issues.
- For full DKIM validation, use tools like MXToolbox or open-source DKIM validators after delivery to confirm signature integrity.
Non-canonical b= fields don’t just cause failures — they expose your domain to spoofing risks and harm your sender reputation.
The real fix isn’t in post-delivery debugging. It’s in enforcing correctness at the source: proper signing libraries, exact normalization rules, and real-time validation. These practices prevent issues before they reach the inbox.
DKIM Verification: What the Verdicts Mean
You can verify DKIM signatures with non-canonical b= fields after delivery by checking if the signature’s cryptographic hash matches the signed content, even if the b= field uses relaxed encoding or base64 padding quirks. The result depends on whether the signature was properly generated and verified—valid signatures match, invalid ones don’t, and risky ones use outdated or weak algorithms.
Interpreting DKIM Verification Results
Each verdict from a DKIM check reflects a specific technical outcome. Understanding them helps you assess email authenticity and sender reputation.
| Verdict | Meaning | Technical Cause | Impact on Delivery |
|---|---|---|---|
| Valid | Signature matches and is properly encoded. | Full cryptographic verification passes; the b= field uses standard base64, including correct padding, and the hash computes to the signed content. | Highly trusted. Common in authenticated senders with proper setup. |
| Invalid | Signature does not match or b= field is malformed. | Either the hash fails to match the signed data, or the b= value is improperly encoded (e.g., missing padding, invalid characters, or line wrapping issues). | May trigger spam filters. Often indicates a misconfigured signing process or tampering. |
| Risky | Signature exists but uses non-standard or weak cryptography. | Uses obsolete algorithms (like SHA-1) or key lengths under 2048 bits, which are deprecated by RFC 8301. | Low inbox placement. Mail receivers may reject or flag these messages. |
| Catch-all | Domain accepts mail, but signature verification is not possible. | Domain allows any recipient (catch-all), but no DNS records (e.g., DKIM public keys) are available to verify the signature. | Delivery is possible, but authentication is unverifiable. Often seen with disposable email services. |
While the DKIM standard allows for relaxed canonicalization of the b= field, some validators still reject signatures with non-canonical padding. This can lead to false negatives if not handled correctly.
Let’s say you’re debugging a low inbox placement rate. If your list shows dozens of "risky" DKIM verifications, it may indicate outdated signing keys or weak hash algorithms. Tools like MailTester can test individual addresses before sending or validate entire lists via our bulk verification feature. You’ll see exact verdicts and root causes, including signature mismatches or weak key length, so you can clean your list before it impacts sender reputation.
Use MailTester to Catch Non-Canonical Signatures Before They Break Deliverability
Even one malformed DKIM signature—especially one with a non-canonical b= field—can lead to rejection by Gmail, Yahoo, or Microsoft’s inbox filters. MailTester’s bulk verification checks your entire email list for these issues before you send, catching invalid or improperly formatted signatures across thousands of messages. It’s not just about detecting errors; it’s about preventing your entire campaign from being flagged as spam due to a single technical misstep.
Spotting Non-Canonical DKIM Issues at Scale
DKIM signatures must follow strict formatting rules. When the b= field contains padding, encoding inconsistencies, or unescaped characters, the signature is considered non-compliant—this isn’t a minor deviation. Major providers like Google and Yahoo treat it as a red flag, sometimes outright rejecting the message or reducing deliverability. These issues are often buried in automated systems that generate emails—like CRM workflows or transactional templates—and go unnoticed until bounces or spam reports pile up.
MailTester’s bulk email verification doesn’t just check addresses; it validates the full delivery chain, including cryptographic headers. Using real-time SMTP checks and DNS lookups, it identifies malformed DKIM signatures across entire campaigns. You’ll see which emails failed due to non-canonical b= fields, helping you trace the source—whether it’s a misconfigured ESP, a faulty template, or a misapplied signing process.
Automate Fixes Before Sending
Let’s say you’re sending a monthly newsletter to 100,000 users. A single poorly signed message can affect your sender reputation. With MailTester’s bulk verification, you catch the issue before the send. The tool doesn’t just flag a problem—it helps you spot patterns: are all signatures from a certain domain or template affected? That tells you where to fix the underlying issue, not just patch one address.
Integrate MailTester with your CRM or ESP via the official integrations, and run verification on your audience list before each campaign. Catch non-canonical DKIM signatures automatically, and correct them in your email system before deployment. This stops delivery issues at the source and keeps your sender reputation intact.
For more on how signature validation works—or how to test inbox placement—see how MailTester evaluates real inbox delivery. You’re not just checking if an address exists; you’re making sure the full message structure passes provider-level scrutiny. And with 98.9% overall accuracy, it’s a trusted instrument built for precision. When it comes to DKIM, consistency isn’t optional—MailTester ensures your signatures are canonical, valid, and trusted.
Final Step: Maintain a Healthy DKIM Chain
DKIM signatures must be verified after delivery to confirm they remain valid and correctly encoded, especially when the b= field uses non-canonical encoding.
Changes in signing libraries or integration updates can alter output encoding. Regular verification catches these issues before they impact deliverability.
Proactive Monitoring & Testing
- Test actual received emails using tools that parse headers and validate the b= field against the canonicalized body.
- Use inbox-placement testing to observe delivery outcomes in real inboxes, not just bounce rates.
- Monitor for anomalies in domain alignment, signature expiration, or inconsistent header hashing.
Regular, post-delivery checks ensure DKIM remains a reliable trust signal across all email channels.
Sources
- DMARC adoption among top domains surged 75% between 2023 and 2025 — from 27.2% to 47.7% — in the wake of Google and Yahoo's bulk-sender authentication requirements. — EasyDMARC 2025 DMARC Adoption Report (2025)
- After Gmail began requiring authentication for large senders, the number of unauthenticated messages Gmail users received plummeted by 75%. — Google (The Keyword blog) (2023)
Keep reading
- Email authentication: SPF, DKIM, DMARC, BIMI and MTA-STS (complete guide)
- Real-Time Email Verification Detecting SPF Syntax Issues with Exists Mechanism
- Fix Email Authentication Failure Due to Multiple Return-Path Entries
- How to Validate Reply-To Header Domain for RFC Compliance in 2026
- Email Authentication Issues with Non-Latin Alphabet From Addresses in 2026
Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
What does a non-canonical b= field mean in DKIM?
It means the base64-encoded DKIM signature violates RFC 6376 by using incorrect line breaks, padding, or case. This can prevent validation even if the key is correct.
Can DKIM still pass if the b= field is not canonical?
Only if the receiving server ignores or fixes the formatting. Most do not. Misencoded b= fields lead to rejection or spam filtering.
How do I test DKIM signatures after email delivery?
Extract the DKIM-Signature header, normalize the b= field, and verify the hash using tools like MailTester’s API that handle non-canonical inputs.
Is it safe to manually edit the DKIM b= field?
No. Manual edits often introduce formatting errors. Always use a verified signing library that follows RFC 6376.
Do all email providers validate DKIM strictly?
Major providers like Gmail and Yahoo enforce strict DKIM validation. Non-canonical b= fields are likely to trigger filtering or rejection.
How can I use MailTester to check my DKIM setup?
Use the real-time API or bulk list verification to test delivered emails. MailTester validates the full DKIM chain, including b= normalization.
Can a valid DKIM signature still be blocked?
Yes. If the b= field is non-canonical, it may be rejected. Even valid keys fail if the signature structure is invalid.
Why do some tools not detect non-canonical b= fields?
Many tools assume correct formatting. They don’t parse or correct malformed signatures, leading to false positives in validation reports.
Does MailTester support real-time DKIM verification?
Yes. MailTester’s real-time API checks DKIM signatures on-the-fly, including normalization of non-canonical b= fields.
How accurate is MailTester at detecting DKIM issues?
MailTester achieves 98.9% accuracy in verification, including identification of non-canonical b= fields and malformed signatures.