fix: omit empty cc/bcc from Email/set so server does not emit bare Cc: header #301

This commit is contained in:
Linus Rath
2026-05-18 16:36:45 +02:00
parent 40f36baf94
commit fa261fecfd
3 changed files with 30 additions and 8 deletions
+4 -4
View File
@@ -409,8 +409,8 @@ export class DemoJMAPClient implements IJMAPClient {
receivedAt: new Date().toISOString(),
from: [{ name: 'Demo User', email: 'demo@example.com' }],
to: to.map(e => ({ email: e })),
cc: cc?.map(e => ({ email: e })),
bcc: bcc?.map(e => ({ email: e })),
cc: cc?.length ? cc.map(e => ({ email: e })) : undefined,
bcc: bcc?.length ? bcc.map(e => ({ email: e })) : undefined,
subject,
sentAt: new Date().toISOString(),
preview: body.substring(0, 200),
@@ -463,8 +463,8 @@ export class DemoJMAPClient implements IJMAPClient {
receivedAt: new Date().toISOString(),
from: [{ name: 'Demo User', email: 'demo@example.com' }],
to: to.map(e => ({ email: e })),
cc: cc?.map(e => ({ email: e })),
bcc: bcc?.map(e => ({ email: e })),
cc: cc?.length ? cc.map(e => ({ email: e })) : undefined,
bcc: bcc?.length ? bcc.map(e => ({ email: e })) : undefined,
subject,
sentAt: new Date().toISOString(),
preview: body.substring(0, 200),