mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add support and docs for SocketLabs email SMTP
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
import nodemailer from 'nodemailer';
|
import nodemailer from 'nodemailer';
|
||||||
import { SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SECURE } from '../config';
|
import { SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SECURE } from '../config';
|
||||||
import { SMTP_HOST_SENDGRID, SMTP_HOST_MAILGUN } from '../variables';
|
import {
|
||||||
|
SMTP_HOST_SENDGRID,
|
||||||
|
SMTP_HOST_MAILGUN,
|
||||||
|
SMTP_HOST_SOCKETLABS
|
||||||
|
} from '../variables';
|
||||||
import SMTPConnection from 'nodemailer/lib/smtp-connection';
|
import SMTPConnection from 'nodemailer/lib/smtp-connection';
|
||||||
import * as Sentry from '@sentry/node';
|
import * as Sentry from '@sentry/node';
|
||||||
|
|
||||||
@@ -27,6 +31,12 @@ if (SMTP_SECURE) {
|
|||||||
ciphers: 'TLSv1.2'
|
ciphers: 'TLSv1.2'
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SMTP_HOST_SOCKETLABS:
|
||||||
|
mailOpts.requireTLS = true;
|
||||||
|
mailOpts.tls = {
|
||||||
|
ciphers: 'TLSv1.2'
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (SMTP_HOST.includes('amazonaws.com')) {
|
if (SMTP_HOST.includes('amazonaws.com')) {
|
||||||
mailOpts.tls = {
|
mailOpts.tls = {
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ import {
|
|||||||
ACTION_DELETE_SECRETS,
|
ACTION_DELETE_SECRETS,
|
||||||
ACTION_READ_SECRETS
|
ACTION_READ_SECRETS
|
||||||
} from './action';
|
} from './action';
|
||||||
import { SMTP_HOST_SENDGRID, SMTP_HOST_MAILGUN } from './smtp';
|
import {
|
||||||
|
SMTP_HOST_SENDGRID,
|
||||||
|
SMTP_HOST_MAILGUN,
|
||||||
|
SMTP_HOST_SOCKETLABS
|
||||||
|
} from './smtp';
|
||||||
import { PLAN_STARTER, PLAN_PRO } from './stripe';
|
import { PLAN_STARTER, PLAN_PRO } from './stripe';
|
||||||
import {
|
import {
|
||||||
MFA_METHOD_EMAIL
|
MFA_METHOD_EMAIL
|
||||||
@@ -101,6 +105,7 @@ export {
|
|||||||
INTEGRATION_OPTIONS,
|
INTEGRATION_OPTIONS,
|
||||||
SMTP_HOST_SENDGRID,
|
SMTP_HOST_SENDGRID,
|
||||||
SMTP_HOST_MAILGUN,
|
SMTP_HOST_MAILGUN,
|
||||||
|
SMTP_HOST_SOCKETLABS,
|
||||||
PLAN_STARTER,
|
PLAN_STARTER,
|
||||||
PLAN_PRO,
|
PLAN_PRO,
|
||||||
MFA_METHOD_EMAIL,
|
MFA_METHOD_EMAIL,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
const SMTP_HOST_SENDGRID = 'smtp.sendgrid.net';
|
const SMTP_HOST_SENDGRID = 'smtp.sendgrid.net';
|
||||||
const SMTP_HOST_MAILGUN = 'smtp.mailgun.org';
|
const SMTP_HOST_MAILGUN = 'smtp.mailgun.org';
|
||||||
|
const SMTP_HOST_SOCKETLABS = 'smtp.socketlabs.com';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
SMTP_HOST_SENDGRID,
|
SMTP_HOST_SENDGRID,
|
||||||
SMTP_HOST_MAILGUN
|
SMTP_HOST_MAILGUN,
|
||||||
|
SMTP_HOST_SOCKETLABS
|
||||||
}
|
}
|
||||||
BIN
docs/images/email-socketlabs-credentials.png
Normal file
BIN
docs/images/email-socketlabs-credentials.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 315 KiB |
BIN
docs/images/email-socketlabs-dashboard.png
Normal file
BIN
docs/images/email-socketlabs-dashboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 468 KiB |
BIN
docs/images/email-socketlabs-domains.png
Normal file
BIN
docs/images/email-socketlabs-domains.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 332 KiB |
@@ -25,7 +25,8 @@ By default, you need to configure the following SMTP [environment variables](htt
|
|||||||
|
|
||||||
Below you will find details on how to configure common email providers (not in any particular order).
|
Below you will find details on how to configure common email providers (not in any particular order).
|
||||||
|
|
||||||
## Twilio SendGrid
|
<AccordionGroup>
|
||||||
|
<Accordion title="Twilio SendGrid">
|
||||||
|
|
||||||
1. Create an account and configure [SendGrid](https://sendgrid.com) to send emails.
|
1. Create an account and configure [SendGrid](https://sendgrid.com) to send emails.
|
||||||
2. Create a SendGrid API Key under Settings > [API Keys](https://app.sendgrid.com/settings/api_keys)
|
2. Create a SendGrid API Key under Settings > [API Keys](https://app.sendgrid.com/settings/api_keys)
|
||||||
@@ -47,11 +48,12 @@ SMTP_FROM_ADDRESS=hey@example.com # your email address being used to send out em
|
|||||||
SMTP_FROM_NAME=Infisical
|
SMTP_FROM_NAME=Infisical
|
||||||
```
|
```
|
||||||
|
|
||||||
<Info>
|
<Info>
|
||||||
Remember that you will need to restart Infisical for this to work properly.
|
Remember that you will need to restart Infisical for this to work properly.
|
||||||
</Info>
|
</Info>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
## Mailgun
|
<Accordion title="Mailgun">
|
||||||
|
|
||||||
1. Create an account and configure [Mailgun](https://www.mailgun.com) to send emails.
|
1. Create an account and configure [Mailgun](https://www.mailgun.com) to send emails.
|
||||||
2. Obtain your Mailgun credentials in Sending > Overview > SMTP
|
2. Obtain your Mailgun credentials in Sending > Overview > SMTP
|
||||||
@@ -70,7 +72,9 @@ SMTP_FROM_ADDRESS=hey@example.com # your email address being used to send out em
|
|||||||
SMTP_FROM_NAME=Infisical
|
SMTP_FROM_NAME=Infisical
|
||||||
```
|
```
|
||||||
|
|
||||||
## AWS SES
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="AWS SES">
|
||||||
|
|
||||||
1. Create an account and [configure AWS SES](https://aws.amazon.com/premiumsupport/knowledge-center/ses-set-up-connect-smtp/) to send emails in the Amazon SES console.
|
1. Create an account and [configure AWS SES](https://aws.amazon.com/premiumsupport/knowledge-center/ses-set-up-connect-smtp/) to send emails in the Amazon SES console.
|
||||||
2. Create an IAM user for SMTP authentication and obtain SMTP credentials in SMTP settings > Create SMTP credentials
|
2. Create an IAM user for SMTP authentication and obtain SMTP credentials in SMTP settings > Create SMTP credentials
|
||||||
@@ -82,7 +86,6 @@ SMTP_FROM_NAME=Infisical
|
|||||||
3. With your AWS SES SMTP credentials, you can now set up your SMTP environment variables:
|
3. With your AWS SES SMTP credentials, you can now set up your SMTP environment variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
SMTP_HOST=smtp.mailgun.org # obtained from credentials page
|
|
||||||
SMTP_HOST=email-smtp.ap-northeast-1.amazonaws.com # SMTP endpoint obtained from SMTP settings
|
SMTP_HOST=email-smtp.ap-northeast-1.amazonaws.com # SMTP endpoint obtained from SMTP settings
|
||||||
SMTP_USERNAME=xxx # your SMTP username
|
SMTP_USERNAME=xxx # your SMTP username
|
||||||
SMTP_PASSWORD=xxx # your SMTP password
|
SMTP_PASSWORD=xxx # your SMTP password
|
||||||
@@ -95,3 +98,40 @@ SMTP_FROM_NAME=Infisical
|
|||||||
<Info>
|
<Info>
|
||||||
Remember that you will need to restart Infisical for this to work properly.
|
Remember that you will need to restart Infisical for this to work properly.
|
||||||
</Info>
|
</Info>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="SocketLabs">
|
||||||
|
|
||||||
|
1. Create an account and configure [SocketLabs](https://www.socketlabs.com/) to send emails.
|
||||||
|
2. From the dashboard, navigate to SMTP Credentials > SMTP & APIs > SMTP Credentials to obtain your SocketLabs SMTP credentials.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. With your SocketLabs SMTP credentials, you can now set up your SMTP environment variables:
|
||||||
|
|
||||||
|
```
|
||||||
|
SMTP_HOST=smtp.socketlabs.com
|
||||||
|
SMTP_USERNAME=username # obtained from your credentials
|
||||||
|
SMTP_PASSWORD=password # obtained from your credentials
|
||||||
|
SMTP_PORT=587
|
||||||
|
SMTP_SECURE=true
|
||||||
|
SMTP_FROM_ADDRESS=hey@example.com # your email address being used to send out emails
|
||||||
|
SMTP_FROM_NAME=Infisical
|
||||||
|
```
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
The `SMTP_FROM_ADDRESS` environment variable should be an email for an
|
||||||
|
authenticated domain under Configuration > Domain Management in SocketLabs.
|
||||||
|
For example, if you're using SocketLabs in sandbox mode, then you may use an
|
||||||
|
email like `team@sandbox.socketlabs.dev`.
|
||||||
|
</Note>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<Info>
|
||||||
|
Remember that you will need to restart Infisical for this to work properly.
|
||||||
|
</Info>
|
||||||
|
</Accordion>
|
||||||
|
</AccordionGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user