unstale

npm / mailparser

mailparser

What changed in mailparser 3, from its official release notes, upgrade guides and advisories. Also covers @types/mailparser. Sources checked 2026-11-30.

2 breaking4 security6 new APIs and options1 performance18 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

mailparser 331 changes

Breaking changes 2

  • Schemaless hosts with a port are no longer linked.

    3.14.5release notes

  • Comments are dropped from Content-Type and Content-Disposition entries in the headers map.

    3.12.3release notes

Security 4

  • Bounds scanning of untrusted text bodies.

    3.9.16release notes

  • Prevents RFC 2047 encoded words from fabricating addresses during address decoding.

    3.9.4release notes

  • mailparser vulnerable to Cross-site Scripting

    3.9.3security advisory

  • URLs and link text are now escaped to prevent XSS.

    3.9.3release notes

New APIs and options 6

  • Exports parseOtpToken so OTP-Token values can be read outside the parser.

    3.14.0release notes

  • The simpleParser result and MailParser instance expose the one-time passcode as otp: { code, origin } when the message has exactly one valid OTP-Token header.

    3.13.0release notes

  • parseAddressHeader() accepts decodePunycode: false to keep IDN domains in ASCII form.

    3.12.0release notes

  • Accepts false to skip hashing attachments.

    3.11.0release notes

  • Exported for parsing an address header value.

    3.11.0release notes

  • The package now provides ES module and CommonJS builds after migrating to TypeScript.

    3.10.0release notes

Performance 1

  • Builds the HTML and text forms only when they are read, avoiding unnecessary work.

    3.12.1release notes

Fixes and other changes 18

  • Closing quotes and guillemets after a URL are no longer included in the generated link.

    3.14.5release notes

  • URLs with bracketed IPv6 hosts are now linked.

    3.14.5release notes

  • A mailto link in a text body links the address rather than including the href attribute name.

    3.14.5release notes

  • RFC 2231 parameters are distinguished using what libmime decoded, rather than a second scan of the header.

    3.12.3release notes

  • The lazily built html and text forms can be assigned again.

    3.12.2release notes

  • Text bodies are decoded with libmime's decode stream.

    3.11.0release notes

  • A decoded display name is no longer turned into an address.

    3.9.40release notes

  • The message is kept when its HTML cannot be converted to text.

    3.9.40release notes

  • An unavailable checksum algorithm is reported as a parser error.

    3.9.33release notes

  • Honours backpressure when handling attachments.

    3.9.30release notes

  • Caps inlined CID images.

    3.9.30release notes

  • Reports errors from the splitter that occur late.

    3.9.30release notes

  • Derives partId from the part number.

    3.9.30release notes

  • Ensures settlement happens only once.

    3.9.30release notes

  • Declares the Node 20 minimum requirement that the package already had, helping developers identify the required runtime.

    3.9.22release notes

  • Decode iso-8859-8-i and iso-8859-8-e charsets as iso-8859-8.

    3.9.12release notes

  • False values are filtered from empty References headers.

    3.9.4release notes

  • Parsing of unquoted commas in display names is fixed, so addresses with those display names can be parsed correctly.

    3.9.4release notes