Skip to content

Commit

Permalink
Add SMTP support for AWS SES and docs for it
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Jan 13, 2023
1 parent 0f151fc commit 29592a1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
8 changes: 7 additions & 1 deletion backend/src/services/smtp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ if (SMTP_SECURE) {
}
break;
default:
mailOpts.secure = true;
if (SMTP_HOST.includes('amazonaws.com')) {
mailOpts.tls = {
ciphers: 'TLSv1.2'
}
} else {
mailOpts.secure = true;
}
break;
}
}
Expand Down
Binary file added docs/images/email-aws-ses-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/email-aws-ses-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 25 additions & 3 deletions docs/self-hosting/configuration/email.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SMTP_FROM_NAME=Infisical
```

<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>

## Mailgun
Expand All @@ -70,6 +70,28 @@ [email protected] # your email address being used to send out em
SMTP_FROM_NAME=Infisical
```

## 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.
2. Create an IAM user for SMTP authentication and obtain SMTP credentials in SMTP settings > Create SMTP credentials

![opening AWS SES console](../../images/email-aws-ses-console.png)

![creating AWS IAM SES user](../../images/email-aws-ses-user.png)

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_USERNAME=xxx # your SMTP username
SMTP_PASSWORD=xxx # your SMTP password
SMTP_PORT=587
SMTP_SECURE=true
[email protected] # your email address being used to send out emails
SMTP_FROM_NAME=Infisical
```

<Info>
Remember that you will need to restart Infisical for this to work properly.
</Info>
Remember that you will need to restart Infisical for this to work properly.
</Info>

0 comments on commit 29592a1

Please sign in to comment.