mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 18:28:12 +00:00
Merge pull request #550 from Infisical/gmail-smtp-support
Add support for Gmail SMTP + docs
This commit is contained in:
@@ -3,7 +3,8 @@ import {
|
|||||||
SMTP_HOST_SENDGRID,
|
SMTP_HOST_SENDGRID,
|
||||||
SMTP_HOST_MAILGUN,
|
SMTP_HOST_MAILGUN,
|
||||||
SMTP_HOST_SOCKETLABS,
|
SMTP_HOST_SOCKETLABS,
|
||||||
SMTP_HOST_ZOHOMAIL
|
SMTP_HOST_ZOHOMAIL,
|
||||||
|
SMTP_HOST_GMAIL
|
||||||
} from '../variables';
|
} 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';
|
||||||
@@ -46,6 +47,12 @@ export const initSmtp = async () => {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SMTP_HOST_ZOHOMAIL:
|
case SMTP_HOST_ZOHOMAIL:
|
||||||
|
mailOpts.requireTLS = true;
|
||||||
|
mailOpts.tls = {
|
||||||
|
ciphers: 'TLSv1.2'
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMTP_HOST_GMAIL:
|
||||||
mailOpts.requireTLS = true;
|
mailOpts.requireTLS = true;
|
||||||
mailOpts.tls = {
|
mailOpts.tls = {
|
||||||
ciphers: 'TLSv1.2'
|
ciphers: 'TLSv1.2'
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ import {
|
|||||||
SMTP_HOST_SENDGRID,
|
SMTP_HOST_SENDGRID,
|
||||||
SMTP_HOST_MAILGUN,
|
SMTP_HOST_MAILGUN,
|
||||||
SMTP_HOST_SOCKETLABS,
|
SMTP_HOST_SOCKETLABS,
|
||||||
SMTP_HOST_ZOHOMAIL
|
SMTP_HOST_ZOHOMAIL,
|
||||||
|
SMTP_HOST_GMAIL
|
||||||
} from './smtp';
|
} from './smtp';
|
||||||
import { PLAN_STARTER, PLAN_PRO } from './stripe';
|
import { PLAN_STARTER, PLAN_PRO } from './stripe';
|
||||||
import {
|
import {
|
||||||
@@ -138,6 +139,7 @@ export {
|
|||||||
SMTP_HOST_MAILGUN,
|
SMTP_HOST_MAILGUN,
|
||||||
SMTP_HOST_SOCKETLABS,
|
SMTP_HOST_SOCKETLABS,
|
||||||
SMTP_HOST_ZOHOMAIL,
|
SMTP_HOST_ZOHOMAIL,
|
||||||
|
SMTP_HOST_GMAIL,
|
||||||
PLAN_STARTER,
|
PLAN_STARTER,
|
||||||
PLAN_PRO,
|
PLAN_PRO,
|
||||||
MFA_METHOD_EMAIL,
|
MFA_METHOD_EMAIL,
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ 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';
|
const SMTP_HOST_SOCKETLABS = 'smtp.socketlabs.com';
|
||||||
const SMTP_HOST_ZOHOMAIL = 'smtp.zoho.com';
|
const SMTP_HOST_ZOHOMAIL = 'smtp.zoho.com';
|
||||||
|
const SMTP_HOST_GMAIL = 'smtp.gmail.com';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
SMTP_HOST_SENDGRID,
|
SMTP_HOST_SENDGRID,
|
||||||
SMTP_HOST_MAILGUN,
|
SMTP_HOST_MAILGUN,
|
||||||
SMTP_HOST_SOCKETLABS,
|
SMTP_HOST_SOCKETLABS,
|
||||||
SMTP_HOST_ZOHOMAIL
|
SMTP_HOST_ZOHOMAIL,
|
||||||
|
SMTP_HOST_GMAIL
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -23,7 +23,7 @@ By default, you need to configure the following SMTP [environment variables](htt
|
|||||||
- `SMTP_FROM_ADDRESS`: Email address to be used for sending emails (e.g. [email protected]).
|
- `SMTP_FROM_ADDRESS`: Email address to be used for sending emails (e.g. [email protected]).
|
||||||
- `SMTP_FROM_NAME`: Name label to be used in `From` field (e.g. Team).
|
- `SMTP_FROM_NAME`: Name label to be used in `From` field (e.g. Team).
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
<AccordionGroup>
|
<AccordionGroup>
|
||||||
<Accordion title="Twilio SendGrid">
|
<Accordion title="Twilio SendGrid">
|
||||||
@@ -135,6 +135,34 @@ SMTP_FROM_NAME=Infisical
|
|||||||
</Info>
|
</Info>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="Gmail">
|
||||||
|
|
||||||
|
Create an account and enable "less secure app access" in Gmail Account Settings > Security. This will allow
|
||||||
|
applications like Infisical to authenticate with Gmail via your username and password.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
With your Gmail username and password, you can set your SMTP environment variables:
|
||||||
|
|
||||||
|
```
|
||||||
|
SMTP_HOST=smtp.gmail.com
|
||||||
|
[email protected] # your email
|
||||||
|
SMTP_PASSWORD=password # your password
|
||||||
|
SMTP_PORT=587
|
||||||
|
SMTP_SECURE=true
|
||||||
|
[email protected]
|
||||||
|
SMTP_FROM_NAME=Infisical
|
||||||
|
```
|
||||||
|
|
||||||
|
<Warning>
|
||||||
|
As per the [notice](https://support.google.com/accounts/answer/6010255?hl=en) by Google, you should note that using Gmail credentials for SMTP configuration
|
||||||
|
will only work for Google Workspace or Google Cloud Identity customers as of May 30, 2022.
|
||||||
|
|
||||||
|
Put differently, the SMTP configuration is only possible with business (not personal) Gmail credentials.
|
||||||
|
</Warning>
|
||||||
|
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="Zoho Mail">
|
<Accordion title="Zoho Mail">
|
||||||
|
|
||||||
1. Create an account and configure [Zoho Mail](https://www.zoho.com/mail/) to send emails.
|
1. Create an account and configure [Zoho Mail](https://www.zoho.com/mail/) to send emails.
|
||||||
|
|||||||
Reference in New Issue
Block a user