diff --git a/apps/builder/pages/api/auth/[...nextauth].ts b/apps/builder/pages/api/auth/[...nextauth].ts index f06e5edb2..0ef1add7b 100644 --- a/apps/builder/pages/api/auth/[...nextauth].ts +++ b/apps/builder/pages/api/auth/[...nextauth].ts @@ -32,11 +32,13 @@ if (isNotEmpty(env('SMTP_FROM')) && process.env.SMTP_AUTH_DISABLED !== 'true') server: { host: process.env.SMTP_HOST, port: process.env.SMTP_PORT ? Number(process.env.SMTP_PORT) : 25, + secure: process.env.SMTP_SECURE + ? process.env.SMTP_SECURE === 'true' + : false, auth: { user: process.env.SMTP_USERNAME, pass: process.env.SMTP_PASSWORD, }, - ignoreTLS: process.env.SMTP_IGNORE_TLS === 'true', }, from: env('SMTP_FROM'), }) diff --git a/apps/docs/docs/self-hosting/configuration/builder.mdx b/apps/docs/docs/self-hosting/configuration/builder.mdx index 1136d82fb..594406eb9 100644 --- a/apps/docs/docs/self-hosting/configuration/builder.mdx +++ b/apps/docs/docs/self-hosting/configuration/builder.mdx @@ -22,15 +22,15 @@ import { SponsorButton } from '../../../src/js/SponsorButton.jsx' Used for sending email notifications and authentication -| Parameter | Default | Description | -| --------------------- | ------- | ------------------------------------------------------------------------------------------ | -| SMTP_USERNAME | -- | SMTP username | -| SMTP_PASSWORD | -- | SMTP password | -| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) | -| SMTP_PORT | 25 | SMTP port | -| NEXT_PUBLIC_SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' `) | -| SMTP_AUTH_DISABLED | false | To disable the authentication by email but still use the provided config for notifications | -| SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension | +| Parameter | Default | Description | +| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMTP_USERNAME | -- | SMTP username | +| SMTP_PASSWORD | -- | SMTP password | +| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) | +| SMTP_PORT | 25 | SMTP port | +| NEXT_PUBLIC_SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' `) | +| SMTP_SECURE | false | If true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false | +| SMTP_AUTH_DISABLED | false | To disable the authentication by email but still use the provided config for notifications | ## Google (Auth, Sheets, Fonts) diff --git a/apps/docs/docs/self-hosting/configuration/viewer.mdx b/apps/docs/docs/self-hosting/configuration/viewer.mdx index 2e126a5d2..cd2db8654 100644 --- a/apps/docs/docs/self-hosting/configuration/viewer.mdx +++ b/apps/docs/docs/self-hosting/configuration/viewer.mdx @@ -19,14 +19,14 @@ import { SponsorButton } from '../../../src/js/SponsorButton.jsx' Used for sending email notifications and authentication -| Parameter | Default | Description | -| --------------- | ------- | ------------------------------------------------------------------------------- | -| SMTP_USERNAME | -- | SMTP username | -| SMTP_PASSWORD | -- | SMTP password | -| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) | -| SMTP_PORT | 25 | SMTP port | -| SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' `) | -| SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension | +| Parameter | Default | Description | +| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMTP_USERNAME | -- | SMTP username | +| SMTP_PASSWORD | -- | SMTP password | +| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) | +| SMTP_PORT | 25 | SMTP port | +| SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' `) | +| SMTP_SECURE | false | If true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false | ## Google (Sheets) diff --git a/apps/viewer/pages/api/typebots/[typebotId]/integrations/email.ts b/apps/viewer/pages/api/typebots/[typebotId]/integrations/email.ts index ab29c3792..c4c2c88e5 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/integrations/email.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/integrations/email.ts @@ -32,11 +32,11 @@ const cors = initMiddleware(Cors()) const defaultTransportOptions = { host: process.env.SMTP_HOST, port: Number(process.env.SMTP_PORT), + secure: process.env.SMTP_SECURE ? process.env.SMTP_SECURE === 'true' : false, auth: { user: process.env.SMTP_USERNAME, pass: process.env.SMTP_PASSWORD, }, - ignoreTLS: process.env.SMTP_IGNORE_TLS === 'true', } const defaultFrom = {