Skip to content

Commit

Permalink
🧑‍💻 (smtp) Use secure prop instead of ignoreTLS
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The SMTP_IGNORE_TLS environment has been removed in favore of SMTP_SECURE. If
SMTP_SECURE is 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
  • Loading branch information
baptisteArno committed Sep 1, 2022
1 parent 42bf93e commit cf07cfe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
4 changes: 3 additions & 1 deletion apps/builder/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
})
Expand Down
18 changes: 9 additions & 9 deletions apps/docs/docs/self-hosting/configuration/builder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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' <[email protected]>`) |
| 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' <[email protected]>`) |
| 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)

Expand Down
16 changes: 8 additions & 8 deletions apps/docs/docs/self-hosting/configuration/viewer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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' <[email protected]>`) |
| 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' <[email protected]>`) |
| 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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit cf07cfe

Please sign in to comment.