Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 54fcb9b

Browse files
committed
fix: optimize lookup, bump deps
1 parent cb1cd80 commit 54fcb9b

File tree

6 files changed

+686
-1286
lines changed

6 files changed

+686
-1286
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ Read our [Terms](https://forwardemail.net/terms).
6868
[Business Source License 1.1](LICENSE) © [Niftylettuce, LLC.](https://niftylettuce.com/)
6969

7070

71-
##
71+
##
7272

7373
<a href="#"><img src="https://raw.githubusercontent.com/forwardemail/free-email-forwarding/master/media/footer.png" alt="#" /></a>

SELF-HOSTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You'll also need the following dependencies installed:
2222

2323
* [Redis][] (v4.x+) - this is a fast key-value store database used for rate-limiting and preventing spammers
2424

25-
> _NOTE_: You can pass `rateLimit: false` as an option to your `ForwardEmail` instance to disable the Redis requirement (e.g. `const forwardEmail = new ForwardEmail({ rateLimit: false });`
25+
> *NOTE*: You can pass `rateLimit: false` as an option to your `ForwardEmail` instance to disable the Redis requirement (e.g. `const forwardEmail = new ForwardEmail({ rateLimit: false });`
2626
2727
* Mac (via [brew][]): `brew install redis && brew services start redis`
2828
* Ubuntu:
@@ -64,7 +64,6 @@ You'll also need the following dependencies installed:
6464
sudo apt-get install libstemmer-dev libstemmer-tools
6565
```
6666

67-
6867
* [authbind][] - for allowing non-root users to run on restricted ports
6968

7069
* Ubuntu:
@@ -178,7 +177,7 @@ See the [app.js](app.js) and [ecosystem.json](ecosystem.json) files for more ins
178177
[Business Source License 1.1](LICENSE) © [Niftylettuce, LLC.](https://niftylettuce.com/)
179178

180179

181-
##
180+
##
182181

183182
[npm]: https://www.npmjs.com/
184183

helpers/message-splitter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class MessageSplitter extends Transform {
2121
this.headerChunks = [];
2222
this.rawHeaders = false;
2323
this.dataBytes = 0;
24-
this._maxBytes = (options.maxBytes && Number(options.maxBytes)) || Infinity;
24+
this._maxBytes =
25+
(options.maxBytes && Number(options.maxBytes)) ||
26+
Number.POSITIVE_INFINITY;
2527
this.sizeExceeded = false;
2628
}
2729

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,11 @@ class ForwardEmail {
24102410
);
24112411
}
24122412

2413+
// check if we have a specific redirect and store global redirects (if any)
2414+
// get username from recipient email address
2415+
// (e.g. hello@niftylettuce.com => hello)
2416+
const username = this.parseUsername(address);
2417+
24132418
if (verifications.length > 0) {
24142419
if (verifications.length > 1)
24152420
throw new CustomError(
@@ -2420,7 +2425,7 @@ class ForwardEmail {
24202425
try {
24212426
const { body } = await superagent
24222427
.get(`${this.config.apiEndpoint}/v1/lookup`)
2423-
.query({ verification_record: verifications[0] })
2428+
.query({ domain, username, verification_record: verifications[0] })
24242429
.set('Accept', 'json')
24252430
.set('User-Agent', this.config.userAgent)
24262431
.auth(this.config.apiSecrets[0])
@@ -2478,11 +2483,6 @@ class ForwardEmail {
24782483
// store if we have a global redirect or not
24792484
const globalForwardingAddresses = [];
24802485

2481-
// check if we have a specific redirect and store global redirects (if any)
2482-
// get username from recipient email address
2483-
// (e.g. hello@niftylettuce.com => hello)
2484-
const username = this.parseUsername(address);
2485-
24862486
for (const element of addresses) {
24872487
// convert addresses to lowercase
24882488
const lowerCaseAddress = element.toLowerCase();

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"@ladjs/graceful": "^1.0.5",
3030
"@ladjs/proxy": "^2.0.3",
3131
"@ladjs/redis": "^1.0.7",
32-
"@ladjs/shared-config": "^3.0.9",
33-
"@slack/web-api": "^5.14.0",
32+
"@ladjs/shared-config": "^3.0.10",
33+
"@slack/web-api": "^6.0.0",
3434
"array-join-conjunction": "^1.0.0",
3535
"authheaders": "^2.0.2",
36-
"axe": "^7.0.2",
36+
"axe": "^8.0.0",
3737
"boolean": "^3.0.2",
3838
"bytes": "^3.1.0",
3939
"common-tags": "^1.8.0",
@@ -49,12 +49,12 @@
4949
"is-string-and-not-blank": "^0.0.2",
5050
"lodash": "^4.17.20",
5151
"mailparser": "^3.0.1",
52-
"mailsplit": "^5.0.0",
52+
"mailsplit": "^5.0.1",
5353
"ms": "^2.1.3",
5454
"mx-connect": "^1.2.0",
55-
"nodemailer": "^6.4.16",
55+
"nodemailer": "^6.4.17",
5656
"pify": "^5.0.0",
57-
"pino": "^6.7.0",
57+
"pino": "^6.11.0",
5858
"punycode": "^2.1.1",
5959
"ratelimiter": "^3.4.1",
6060
"re2": "^1.15.9",
@@ -72,21 +72,21 @@
7272
"devDependencies": {
7373
"@commitlint/cli": "^11.0.0",
7474
"@commitlint/config-conventional": "^11.0.0",
75-
"ava": "^3.14.0",
75+
"ava": "^3.15.0",
7676
"codecov": "^3.8.1",
7777
"cross-env": "^7.0.3",
78-
"eslint": "^7.15.0",
78+
"eslint": "^7.18.0",
7979
"eslint-config-xo-lass": "^1.0.4",
80-
"fixpack": "^3.0.6",
81-
"husky": "^4.3.5",
82-
"ioredis": "^4.19.2",
80+
"fixpack": "^4.0.0",
81+
"husky": "^4.3.8",
82+
"ioredis": "^4.19.4",
8383
"is-ci": "^2.0.0",
8484
"lint-staged": "^10.5.3",
8585
"nyc": "^15.1.0",
8686
"remark-cli": "^9.0.0",
8787
"remark-preset-github": "^4.0.1",
8888
"uuid": "^8.3.2",
89-
"xo": "^0.36.1"
89+
"xo": "^0.37.1"
9090
},
9191
"engines": {
9292
"node": ">=12"
@@ -157,7 +157,8 @@
157157
"config.js"
158158
],
159159
"rules": {
160-
"no-use-extend-native/no-use-extend-native": "off"
160+
"no-use-extend-native/no-use-extend-native": "off",
161+
"unicorn/prevent-abbreviations": "off"
161162
}
162163
}
163164
}

0 commit comments

Comments
 (0)