@lowdefy/connection-smtp 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,10 +56,19 @@ function getBareEmail(entry) {
|
|
|
56
56
|
function getDomain(email) {
|
|
57
57
|
return email.slice(email.lastIndexOf('@') + 1);
|
|
58
58
|
}
|
|
59
|
+
// A loop, not /\.+$/: that regex takes quadratic time on a long run of dots, and the domain comes
|
|
60
|
+
// from the request.
|
|
61
|
+
function trimTrailingDots(domain) {
|
|
62
|
+
let end = domain.length;
|
|
63
|
+
while(end > 0 && domain[end - 1] === '.'){
|
|
64
|
+
end -= 1;
|
|
65
|
+
}
|
|
66
|
+
return domain.slice(0, end);
|
|
67
|
+
}
|
|
59
68
|
// .invalid is reserved and never resolves (RFC 6761). A trailing dot is the fully qualified
|
|
60
69
|
// form of the same domain.
|
|
61
70
|
function isInvalid(entry) {
|
|
62
|
-
const domain = getDomain(getBareEmail(entry))
|
|
71
|
+
const domain = trimTrailingDots(getDomain(getBareEmail(entry)));
|
|
63
72
|
return domain === 'invalid' || domain.endsWith('.invalid');
|
|
64
73
|
}
|
|
65
74
|
// Returns the field as written when nothing is dropped, so mail without .invalid recipients
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-smtp",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@lowdefy/helpers": "7.
|
|
43
|
+
"@lowdefy/helpers": "7.1.0",
|
|
44
44
|
"nodemailer": "10.0.13"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jest/globals": "28.1.3",
|
|
48
|
-
"@lowdefy/ajv": "7.
|
|
48
|
+
"@lowdefy/ajv": "7.1.0",
|
|
49
49
|
"@swc/cli": "0.8.1",
|
|
50
50
|
"@swc/core": "1.15.32",
|
|
51
51
|
"@swc/jest": "0.2.39",
|