Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too long URLs in the List-Unsubscribe header causes the DKIM signature verification to fail #1654

Open
PlanetIrata opened this issue May 7, 2024 · 0 comments

Comments

@PlanetIrata
Copy link

When Nodemailer format the List-Unsubscribe header on more than one line, it may cause a DKIM signature verification failure. This is the case with my SMTP server. Note that I do NOT use the dkim parameters of Nodemailer, the DKIM signature is generated by my own SMTP server, and as soon as the List-Unsubscribe header is generated on two lines, the DKIM signature verification is reported as fail, but pass until the List-Unsubscribe is kept on one line. Tested on a Gmail recipient.

This works (one line List-Unsubscribe because the url is short):

Authentication-Results: mx.google.com;
       dkim=pass (...)
List-Unsubscribe: <http://example.com/campaign/unsubscribe?dummy=short>

This fails (two or more lines for the List-Unsubscribe because the url is longer):

Authentication-Results: mx.google.com;
       dkim=fail (...)
List-Unsubscribe:
 <http://example.com/campaign/unsubscribe?dummy=longer_url_with_several_params>

Workaround: I generate the List-Unsubscribe header myself with the headersprops of Nodemailer, it is generated on one line and the DKIM verification works again for any URL:

  headers: {
      "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
      "List-Unsubscribe": {
        prepared: true,
        value: '<http://example.com/campaign/unsubscribe?dummy=longer_url_with_several_params>',
      },
  },

Maybe that this header specific parameter List-Unsubscribe should not be prepared by Nodemailer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant