From a453585e2d3922ecefd25b1ac37cfbb8db073b20 Mon Sep 17 00:00:00 2001 From: Matthieu MALVACHE Date: Thu, 2 Oct 2025 13:11:27 +0200 Subject: [PATCH] fix: Remove partId from attachment objects to comply with JMAP spec JMAP spec states "The client may specify a partId OR a blobId, but not both." We were incorrectly including both fields, causing "Cannot specify both partId and blobId" errors when creating drafts with attachments. Fixed by removing partId and size fields from attachment objects. The server calculates size automatically from the blob content. --- lib/jmap/client.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/jmap/client.ts b/lib/jmap/client.ts index b8fb1ff..26b5f2a 100644 --- a/lib/jmap/client.ts +++ b/lib/jmap/client.ts @@ -600,13 +600,11 @@ export class JMAPClient { // Add attachments if provided if (attachments && attachments.length > 0) { - emailData.attachments = attachments.map((att, index) => ({ + emailData.attachments = attachments.map(att => ({ blobId: att.blobId, type: att.type, name: att.name, - size: att.size, disposition: "attachment", - partId: `att-${index}`, })); }