From 8fbbb1dd4bc201d030d57f7c1429aca2da812dfb Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Wed, 29 Apr 2026 15:42:02 -0400 Subject: [PATCH] Revert "refactor(email): set From at transport level instead of per-message" This reverts commit baa4d693aeb44dc2c7ed2eb7f0a5a5db578807a6. --- server/src/service/infrastructure/emailService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/service/infrastructure/emailService.ts b/server/src/service/infrastructure/emailService.ts index 137bd9e2b..4428b0477 100755 --- a/server/src/service/infrastructure/emailService.ts +++ b/server/src/service/infrastructure/emailService.ts @@ -127,9 +127,6 @@ export class EmailService implements IEmailService { systemEmailRejectUnauthorized, } = config; - const trimmedDisplayName = systemEmailDisplayName?.trim(); - const from = trimmedDisplayName && systemEmailAddress ? { name: trimmedDisplayName, address: systemEmailAddress } : systemEmailAddress; - const emailConfig = { host: systemEmailHost, port: Number(systemEmailPort), @@ -141,7 +138,6 @@ export class EmailService implements IEmailService { name: systemEmailConnectionHost || "localhost", connectionTimeout: 5000, pool: systemEmailPool, - from, tls: { rejectUnauthorized: systemEmailRejectUnauthorized, ignoreTLS: systemEmailIgnoreTLS, @@ -163,9 +159,13 @@ export class EmailService implements IEmailService { return false; } + const trimmedDisplayName = systemEmailDisplayName?.trim(); + const from = trimmedDisplayName && systemEmailAddress ? { name: trimmedDisplayName, address: systemEmailAddress } : systemEmailAddress; + try { const info = await this.transporter.sendMail({ to: to, + from: from, subject: subject, html: html, });