From c226c2fcdfc78a06686715b4cf759448c75bb3cf Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Tue, 16 Jun 2026 16:07:03 +0200 Subject: [PATCH] fix(mail): cast SMTP pool options pour build TypeScript Docker Co-authored-by: Cursor --- backend/src/modules/mail/mail.service.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/backend/src/modules/mail/mail.service.ts b/backend/src/modules/mail/mail.service.ts index 0c2be27..2d96a6e 100644 --- a/backend/src/modules/mail/mail.service.ts +++ b/backend/src/modules/mail/mail.service.ts @@ -69,21 +69,17 @@ export class MailService { const smtpUser = this.configService.get('smtp_user'); const smtpPassword = this.configService.get('smtp_password'); - const transportConfig: SMTPTransport.Options = { + const transportConfig = { host: smtpHost, port: smtpPort, secure: smtpSecure, pool: true, maxConnections: 1, maxMessages: 100, - }; - - if (smtpAuthRequired && smtpUser && smtpPassword) { - transportConfig.auth = { - user: smtpUser, - pass: smtpPassword, - }; - } + ...(smtpAuthRequired && smtpUser && smtpPassword + ? { auth: { user: smtpUser, pass: smtpPassword } } + : {}), + } as SMTPTransport.Options; return transportConfig; }