Skip to content

Commit

Permalink
refactor: remove unused Nodemailer env vars (#253)
Browse files Browse the repository at this point in the history
The following environment variables are deprecated by Nodemailer and no lnoger in use in production
* SES_RATE
* SES_RATELIMIT

Additionally addressed linting issues in the deployment setup Markdown
file.
  • Loading branch information
liangyuanruo authored Sep 2, 2020
1 parent f67732c commit 19216a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
12 changes: 5 additions & 7 deletions docs/DEPLOYMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This document details what is needed to create an environment to run FormSG in AWS.

### Build and run your nodejs app
## Build and run your NodeJS app

```
$ npm install
```bash
npm install
$ npm run build
$ npm start
```
Expand All @@ -25,7 +25,7 @@ As a prerequisite for EB deployment, make sure you have already created your AWS

### Dockerrun.aws.json

```
```json
{
"AWSEBDockerrunVersion": "1",
"Image": {
Expand All @@ -52,7 +52,7 @@ FormSG supports storing of users' Twilio API credentials using AWS Secret Manage

Firstly, name the secret with a unique secret name and store the secret value in the following format:

```
```json
{
"accountSid": "",
"apiKey": "",
Expand Down Expand Up @@ -147,8 +147,6 @@ The following env variables are set in Travis:
| `SES_PASS` | SMTP password. |
| `SES_MAX_MESSAGES` | Nodemailer configuration. Connection removed and new one created when this limit is reached. This helps to keep the connection up-to-date for long-running email messaging. Defaults to `100`. |
| `SES_POOL` | Connection pool to send email in parallel to the SMTP server. Defaults to `38`. |
| `SES_RATE` | Maximum email to send per second, or per `rateDelta` if supplied. |
| `SES_RATEDELTA` | Defines the time measuring period in milliseconds for rate limiting. Defaults to `1000`. |
| `MAIL_FROM` | Sender email address. Defaults to `'[email protected]'`. | |
| `MAIL_SOCKET_TIMEOUT` | Milliseconds of inactivity to allow before killing a connection. This helps to keep the connection up-to-date for long-running email messaging. Defaults to `600000`. |
| `MAIL_LOGGER` | If set to true then logs to console. If value is not set or is false then nothing is logged. |
Expand Down
9 changes: 0 additions & 9 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,6 @@ const mailConfig: MailConfig = (function () {
// If set to true, then logs SMTP traffic, otherwise logs only transaction
// events.
debug: String(process.env.MAIL_DEBUG).toLowerCase() === 'true',
// Per second, or per rateDelta if supplied.
rateLimit: process.env.SES_RATE
? Number(process.env.SES_RATE)
: undefined,
// Defines the time measuring period in milliseconds (defaults to 1000)
// for rate limiting.
rateDelta: process.env.SES_RATEDELTA
? Number(process.env.SES_RATEDELTA)
: undefined,
}

transporter = nodemailer.createTransport(options)
Expand Down

0 comments on commit 19216a0

Please sign in to comment.