Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Jan 28, 2026

Closes #817, swaps from using mailparser to using postal-mime which is actually meant to be used anywhere, without any dependencies. It has much, much fewer downloads, but socket gives it a good score, as well as the publisher for it is the same person as for mailparser, so I think we're safe to trust it.

The tests pass, and I've tried using it with a real email template and things seem to work properly.


Summary by cubic

Switched email parsing to PostalMime to support Cloudflare Workers and other non‑Node runtimes. Standardized attachment handling to base64 for consistent processing.

  • Dependencies

    • Replace mailparser with postal-mime.
  • Refactors

    • Parse raw emails with PostalMime.parse in receiving.ts using attachmentEncoding: "base64".
    • Update attachment fields: content is base64, content_type uses mimeType.

Written for commit 0fafb2a. Summary will update on new commits.

@gabrielmfern gabrielmfern self-assigned this Jan 28, 2026
@gabrielmfern gabrielmfern requested a review from a team as a code owner January 28, 2026 15:02
@socket-security
Copy link

socket-security bot commented Jan 28, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpostal-mime@​2.7.39910010092100

View full report

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/resend/resend-node/resend@820

commit: 0fafb2a

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@gabrielmfern gabrielmfern changed the title fix: support for Cloudflare Workers, and other non Node environments fix: support for Cloudflare Workers, and other non-Node environments Jan 30, 2026
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

Successfully merging this pull request may close these issues.

Adding mailparser in v6.9.0 requires nodejs_compat on Cloudflare workers

2 participants