Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

nodemailer 10.6.1 also signs the second unsubscribe header

Table of contents · 9 items

Member notices, newsletters, booking and purchase confirmations. nodemailer is sometimes used for the part of a Node.js system that sends email. Promotional emails can carry headers that let recipients stop delivery with a single click.

On November 20, nodemailer released 10.6.1, adding List-Unsubscribe-Post to the default headers covered by DKIM signatures. RFC 8058, which defines one-click unsubscribe, requires senders to include a valid DKIM signature covering both List-Unsubscribe and List-Unsubscribe-Post, and states that receivers SHOULD NOT offer one-click unsubscribe for emails without such a signature. According to the description of the fix, nodemailer's default list previously included only the former, so emails carrying both headers were sent with signatures that could not be trusted for one-click unsubscribe.

Drawing on the changes in the nodemailer repository, RFC 8058, the Gmail and Yahoo sender guidelines, and the results of comparing signatures from multiple versions in a test environment, this article outlines which systems are affected and how to respond.

The two headers and the signature

One-click unsubscribe uses the following two headers.

List-Unsubscribe: <https://example.com/u/123>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

A DKIM signature shows the receiver which headers and body the sending domain sent without tampering. The headers a signature covers are listed in the h= of the DKIM-Signature. What changed with nodemailer's fix is the default list in this h=.

How this relates to the Gmail and Yahoo guidelines

Gmail's sender guidelines require senders who send more than 5,000 messages a day to Gmail accounts to support one-click unsubscribe for marketing and subscription messages, citing the two headers above as an example. The guidelines' FAQ page says to implement it in line with RFC 8058 and excludes transactional messages, such as password resets and booking confirmations, from this requirement. It also says that even when the headers are present, Gmail shows an unsubscribe button at the top of the screen only for messages that pass its automated checks.

Yahoo's sender requirements likewise ask bulk senders for a List-Unsubscribe that supports one-click unsubscribe, and strongly recommend the POST method of RFC 8058. Neither page directly states that the DKIM signature must cover List-Unsubscribe-Post; both refer to RFC 8058 instead.

The Postmaster Tools API v2 definition published by Google (the November 19 revision) also includes oneClickUnsubscribeVerdict, which returns whether a sender meets the "one-click unsubscribe requirement." We covered Postmaster Tools API v2 in our article on the v1 shutdown and v2 migration.

Comparing signatures across versions

In a test environment (Node.js v22.23.5), we installed nodemailer 6.10.1, 9.1.1, 10.6.0, and 10.6.1 and built the same email with each. We did not send it; we extracted the generated message on the spot. The DKIM key was created for testing, and the addresses use example.com. We verified the signatures with mailauth 8.1.0, supplying the public key through a test name lookup (one run each).

Diagram comparing DKIM signatures across nodemailer versions. In 6.10.1, 9.1.1, and 10.6.0, List-Unsubscribe was covered by the signature but List-Unsubscribe-Post was not. In 10.6.1, both were covered. In 6.10.1, specifying headerFieldNames also covered both. All signatures verified successfully

  • 6.10.1, 9.1.1, 10.6.0: List-Unsubscribe was covered by the signature, but List-Unsubscribe-Post was not
  • 10.6.1: Both were covered
  • Signature verification: Succeeded for every version. The signatures themselves are valid; only the range they cover differs
  • 7.x and 8.x: The default lists in the 7.0.13 and 8.0.11 packages were also List-Unsubscribe:List-Subscribe:List-Post and did not include List-Unsubscribe-Post (checked in the source; not run)

As of November 30, only 10.6.1 in the 10.x line includes the fix. The last releases of the 6.x–9.x lines (6.10.1, 7.0.13, 8.0.11, 9.1.1) do not.

Conditions for affected systems

You are affected if nodemailer applies the DKIM signature. You can tell by whether you have written dkim (domainName, keySelector, privateKey) in the createTransport() settings.

If you send through Gmail in Google Workspace or through an email delivery service's SMTP and leave signing to them, nodemailer's default list is not used. In that case, check which headers the signature applied on their side covers. Display the original headers of a received email and check whether list-unsubscribe-post appears in the h= of the DKIM-Signature (editorial suggestion).

The other condition is that you send with List-Unsubscribe-Post. nodemailer's list.unsubscribe setting adds List-Unsubscribe, and List-Unsubscribe-Post is added via headers. The tests for the fix are written this way too.

await transporter.sendMail({
  from: 'news@example.com',
  to: 'user@example.com',
  subject: 'お知らせ',
  text: '本文',
  list: { unsubscribe: 'https://example.com/u/123' },
  headers: { 'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click' },
});

The 6.x–9.x lines no longer get security fixes either

nodemailer's security policy (SECURITY.md) states: "Security fixes are released only against the latest major version. We do not backport patches to older majors". Fixes are released only for the latest major version (10.x) and are not ported to older lines.

Applying the affected ranges of the security advisories published in the nodemailer repository to the last release of each line gives the following (as of November 30; none for 10.6.0 or 10.6.1).

ReleaseAdvisories in the affected rangeOf which HIGH severity
6.10.1235
7.0.13214
8.0.11164
9.1.1143

The HIGH-severity ones include denial-of-service issues in which processing stalls for a long time while detecting the SMTP authentication method or parsing addresses (GHSA-4ffr-jq9g-5ffx, GHSA-v53p-9fqp-m79j, and others). Closer to the unsubscribe headers, an issue in which inserting line breaks into comment in the list settings allows arbitrary headers to be added (GHSA-268h-hp4c-crq3, fixed in 8.0.9) remains in 6.10.1 and 7.0.13. It applies if you pass user-entered values to this comment. In DKIM signing as well, an issue in which heavily folded headers stall processing for a long time (GHSA-39m8-27wv-hr27, fixed in 10.0.10) remains in all four versions.

For this reason, this article recommends upgrading to 10.6.1 first. The headerFieldNames in the next section is a stopgap that addresses only the signature's coverage until you upgrade to 10.x (editorial suggestion).

Stopgap measures until you upgrade to 10.x

If you cannot upgrade to 10.6.1 right away, specify the list of headers to sign yourself with headerFieldNames in the DKIM settings. In our test, adding this setting to 6.10.1 brought List-Unsubscribe-Post under the signature, and verification also succeeded.

const transporter = nodemailer.createTransport({
  host: 'smtp.example.com',
  port: 587,
  dkim: {
    domainName: 'example.com',
    keySelector: 'mail',
    privateKey: process.env.DKIM_PRIVATE_KEY,
    headerFieldNames:
      'From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:' +
      'List-Unsubscribe:List-Unsubscribe-Post',
  },
});

When you specify headerFieldNames, only this list is used instead of the default list. The example above is the minimal list for testing; add the other headers included in the emails you send, such as Reply-To and Cc, to the list. You can check the default list in 10.6.1 in src/dkim/sign.ts in the repository.

What to check before upgrading (editorial proposal)

  1. Check where signing takes place. See whether nodemailer has a dkim setting, or whether the server or service you send through signs messages
  2. Check the h= of a sent email. Send one to yourself and confirm that the h= of the DKIM-Signature contains both list-unsubscribe and list-unsubscribe-post
  3. Upgrade to 10.6.1. The 10.x line requires Node.js 20 or later. Moving from 6.x–9.x to 10.x is a major version upgrade, and 10.0.0 also includes a rewrite in TypeScript, so review the changes before upgrading. Until you upgrade, use headerFieldNames to fill the gap in signature coverage
  4. Check that the unsubscribe URL actually stops delivery. Adding the headers does not stop delivery unless a POST to that URL triggers processing that stops it. As for how quickly to stop, Gmail recommends within 48 hours, and Yahoo lists within 2 days as a requirement

We covered the limits and how to split bulk promotional emails sent from Google Workspace in our article on Gmail sending limits.

Scope of verification

On November 30, 2026, we reviewed the nodemailer/nodemailer repository (CHANGELOG.md, tag v10.6.1, the description and diff of commit f91077c5, src/dkim/sign.ts, SECURITY.md, and the list of the repository's security advisories and their listings in the GitHub Advisory Database), the npm publication dates and the 10.6.1 package, lib/dkim/sign.js in the 7.0.13 and 8.0.11 packages, the original text of RFC 8058, Gmail's sender guidelines and their FAQ, Yahoo's sender requirements, and the Gmail Postmaster Tools API v2 Discovery document (revision 20261119) (desk research). In addition, on November 30, in a test environment, we signed and verified messages with a test key using Node.js v22.23.5, nodemailer 6.10.1, 9.1.1, 10.6.0, and 10.6.1, and mailauth 8.1.0 (hands-on testing; one run each, with nothing sent). We did not check actual sending, display and handling on the receiving side such as Gmail, running 7.0.13 or 8.0.11, or whether each advisory applies to how your own systems use the library.

For maintenance of business systems that send email or a review of your email delivery setup, please contact us via Development, AI, and automation consultation.

References

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email