Files
maildev-maildev/.changeset/fix-cid-attachment-url.md
T
dualfroz 8dceaec54a fix: build CID attachment URLs against the API route and base path
replaceCidReferences rewrote cid: references to /email/:id/attachment/:file,
which matches no route: attachments are served from the API server, mounted
at ${basePath}/api. When MailDev sits under a subpath the prefix was missing
as well, which is the setup described in #439.

Emit ${basePath}/api/email/:id/attachment/:file, root-relative by default, and
thread the API server's basePath through getEmailHtml. baseUrl still prefixes
//host for a caller that passes it.

On the current code this does not change what the web UI shows for a typical
message: mailparser already inlines related parts as data: URIs, and a cid:
that survives parsing is one that matches no attachment. replaceCidReferences
is exported from @maildev/smtp, though, so the URL it builds should resolve.

Refs #439
2026-09-13 15:31:28 +02:00

411 B

@maildev/smtp, @maildev/api
@maildev/smtp @maildev/api
patch patch

Fix the URL that replaceCidReferences rewrites inline (CID) attachments to. It built /email/:id/attachment/:file, which matches no route: the attachment is served from /api/email/:id/attachment/:file, under the configured base path. The URL is now root-relative and includes both parts, so it resolves at the root and under a subpath such as /mail.