Open BrianWalczak opened 1 month ago
For now, a temporary solution would be to remove the darn
field from the email data (in text format), and then convert it back to a Buffer.
const email = `Received: by mail-il1-f180.google.com with SMTP id...`; // Replace with your email data
const modifiedEmail = email.replace(/darn=[^;]+;/g, ''); // Replace occurrence of `darn` field
const emailBuffer = Buffer.from(modifiedEmail, 'utf-8'); // Turn email string back into Buffer
await dkim.verify(emailBuffer); // Continue as usual...
Hi Brian, yeah Google started implementing a draft spec of Replay Resistant Authenticated Receiver Chain, which adds dara
and darn
tags to DKIM signatures or ARC seals.
This has recently been fixed in https://github.com/jhermsmeier/node-dkim-signature/pull/3, but not incorporated into this module yet, because I found a slew of bugs when I did, and started rewriting this (and dkim-key
and dkim-signature
in the process).
Not too far from done now, I can put up an alpha, if you'd like to try it out? It should fix header & body canonicalization, as well as verification with multiple signatures and a bunch of other stuff, but also has quite a few breaking changes.
When utilizing the
dkim.verify()
method after receiving an email that was sent by Gmail, the following error is received:This type of error does not occur, however, when you attempt to verify an email from Zoho Mail, Outlook, etc.