Repository navigation
DKIM: try every known key for the selector (DNS via Google + Cloudflare, all archived keys) - #25
Conversation
…S, all archived keys) @zk-email/helpers resolves the key once: Google DoH, and only if that lookup fails, the first archive record. A key rotated under a reused selector, or an archive with several keys per selector, gave 'bad signature' although the signing key is known. Site and CLI now try all candidates and report the key source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its 429 archive.prove.email allows 10 requests/min per IP and answers 429 with an error object (the helper's own fallback crashes on it). Fetch archived keys only for key-related failures (not body-hash mismatches), retry once after retryAfterSeconds, and name the rate limit in the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…min limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Web check: I ran the site's own modules in headless Chromium against a local dev server.
🤖 Generated with Claude Code |
Stacked on #24. Merge order: #21 → #23 → #24 → this.
Problem
@zk-email/helpers'verifyDKIMSignaturelooks the key up only once:So an email fails with "bad signature" even though its signing key is known when:
There is also a rate-limit problem. The archive allows 10 requests per minute per IP and answers a 429 with an error object. The helper's own fallback then crashes with
data.find is not a function.Fix
New
src/utils/dkimKeys.tsfor the site, with a copy in the CLI:p=, and revoked records (emptyp=) are dropped.retryAfterSeconds. If that also fails, the error names the rate limit.keySourcefield (dns:google/dns:cloudflare/archive).inspect --jsonshows it, andprovenotes when the key came from the archive.verifyDKIMSignature. The key modulus is read with WebCrypto, so there is no node-forge dependency.This doesn't accept anything new in kind: the archive was already a fallback, and
verifychecks the proof's key hash against DNS and the archive on its own.Tests
tests/dkim-keys.test.ts: 6 tests, using a synthetic email, throwaway keys, and stubbed DNS and archive.keySource: archive.tscpasses, andvite buildpasses.Real corpus (DKIM step only, on a separate Linux box)
Only the 73 emails that failed DKIM with the old lookup were re-run. Archive calls were spaced 6.5 s apart.
🤖 Generated with Claude Code