This commit is contained in:
Lucas Gaitzsch
2026-05-20 20:00:17 +02:00
parent 1e8bd40b93
commit 7e15782fb3
2 changed files with 6 additions and 3 deletions
@@ -226,6 +226,7 @@ describe('JMAPClient.sendEmail threading headers', () => {
email: 'user@example.com',
parameters: { HOLDFOR: expect.stringMatching(/^\d+$/) },
},
rcptTo: [{ email: 'recipient@example.com' }],
},
},
});
+5 -3
View File
@@ -2242,14 +2242,16 @@ export class JMAPClient implements IJMAPClient {
const buildSubmissionCreate = (submissionId: string): Record<string, unknown> => {
const create: Record<string, unknown> = { emailId: `#${emailId}`, identityId: finalIdentityId };
if (holdForSeconds || envelopeMailFrom) {
const envelopeRecipients = [...to, ...(cc || []), ...(bcc || [])]
.map((email) => email.trim())
.filter(Boolean)
.map((email) => ({ email }));
create.envelope = {
mailFrom: {
email: envelopeMailFrom || fromEmail || this.username,
...(holdForSeconds ? { parameters: { HOLDFOR: String(holdForSeconds) } } : {}),
},
...(envelopeMailFrom
? { rcptTo: [...to, ...(cc || []), ...(bcc || [])].map((email) => ({ email })) }
: {}),
rcptTo: envelopeRecipients,
};
}
return { [submissionId]: create };