Skip to content

fix: restore outbound CID attachment support#171

Open
R44VC0RP wants to merge 2 commits into
mainfrom
fix/outbound-cid-support
Open

fix: restore outbound CID attachment support#171
R44VC0RP wants to merge 2 commits into
mainfrom
fix/outbound-cid-support

Conversation

@R44VC0RP

@R44VC0RP R44VC0RP commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restore outbound content_id support for send and reply attachment schemas
  • preserve CID metadata for queued sends and route replies through the CID-aware multipart MIME builder
  • harden attachment URL fetching, MIME header construction, quoted-printable encoding, and API-key logging

Verification

  • bun test app/api/e2/helper/email-builder.test.ts
  • bunx biome lint app/api/e2/emails/send.ts app/api/e2/emails/reply.ts app/api/e2/helper/attachment-processor.ts app/api/e2/helper/email-builder.ts app/api/e2/helper/email-builder.test.ts app/api/e2/helper/main.ts app/api/e2/lib/auth.ts lib/api-types.ts
  • bun run generate:openapi
  • git diff --check origin/main...HEAD

Notes

  • Full-repository bun run lint still reports existing diagnostics outside this change set.

Note

Medium Risk
Changes affect production email send/reply and MIME construction (SSRF, header injection, encoding); mitigations are tested but any MIME regression could break delivery or threading.

Overview
Restores inline CID attachments (content_id) on send/reply APIs and keeps CID metadata through processing, storage, and multipart/related MIME via the shared buildRawEmailMessage path (reply no longer builds raw MIME inline).

Security and correctness on the outbound pipeline: SSRF checks and no redirects for remote attachment URLs, stricter content_id validation, pre-decode base64 size limits, header/MIME injection sanitization and real quoted-printable encoding in email-builder, plus API key values redacted in logs. Shared imports/types tightened (ProcessedAttachment, schedule parsing).

Adds email-builder.test.ts covering CID MIME, injection hardening, and QP encoding; updates public AttachmentInput types.

Reviewed by Cursor Bugbot for commit 6b94cfe. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inbound.new Ready Ready Preview, Comment Jun 3, 2026 2:18pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1cf9e8b. Configure here.

Comment thread app/api/e2/helper/attachment-processor.ts
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.

1 participant