mailauth 4.3.0 → 4.3.2
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.
- package/lib/mta-sts.js +18 -2
- package/lib/spf/index.js +1 -1
- package/man/mailauth.1 +1 -1
- package/package.json +5 -5
package/lib/mta-sts.js
CHANGED
|
@@ -300,8 +300,14 @@ const getPolicy = async (domain, knownPolicy, opts) => {
|
|
|
300
300
|
return { policy: knownPolicy, status: 'cached' };
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
let policyId;
|
|
304
|
+
try {
|
|
305
|
+
policyId = await resolvePolicy(domain, opts);
|
|
306
|
+
} catch (err) {
|
|
307
|
+
return { policy: { id: false, mode: 'none', error: err }, status: 'errored' };
|
|
308
|
+
}
|
|
309
|
+
|
|
303
310
|
try {
|
|
304
|
-
let policyId = await resolvePolicy(domain, opts);
|
|
305
311
|
if (!policyId) {
|
|
306
312
|
return { policy: { id: false, mode: 'none' }, status: 'not_found' };
|
|
307
313
|
}
|
|
@@ -335,7 +341,17 @@ const getPolicy = async (domain, knownPolicy, opts) => {
|
|
|
335
341
|
status: 'errored'
|
|
336
342
|
};
|
|
337
343
|
}
|
|
338
|
-
|
|
344
|
+
|
|
345
|
+
// prevent loading the policy for the next 1 hour and default to "none"
|
|
346
|
+
return {
|
|
347
|
+
policy: {
|
|
348
|
+
id: policyId,
|
|
349
|
+
mode: 'none',
|
|
350
|
+
expires: new Date(Date.now() + 1 * 3600 * 1000).toISOString(),
|
|
351
|
+
error: err
|
|
352
|
+
},
|
|
353
|
+
status: 'errored'
|
|
354
|
+
};
|
|
339
355
|
}
|
|
340
356
|
};
|
|
341
357
|
|
package/lib/spf/index.js
CHANGED
|
@@ -50,7 +50,7 @@ let limitedResolver = (resolver, maxResolveCount, maxVoidCount, ignoreFirst) =>
|
|
|
50
50
|
|
|
51
51
|
try {
|
|
52
52
|
// domain check is pretty lax, mostly to pass the test suite
|
|
53
|
-
if (!/^([\x20-\x2D\x2f-\x7e]+\.)+[a-z]+[a-z\-0-9]
|
|
53
|
+
if (!/^([\x20-\x2D\x2f-\x7e]+\.)+[a-z]+[a-z\-0-9]*$/i.test(domain)) {
|
|
54
54
|
throw new Error('Failed to validate domain');
|
|
55
55
|
}
|
|
56
56
|
} catch (err) {
|
package/man/mailauth.1
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailauth",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "Email authentication library for Node.js",
|
|
5
5
|
"main": "lib/mailauth.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
"homepage": "https://github.com/postalsys/mailauth",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"chai": "4.3.7",
|
|
36
|
-
"eslint": "8.
|
|
36
|
+
"eslint": "8.37.0",
|
|
37
37
|
"eslint-config-nodemailer": "1.2.0",
|
|
38
|
-
"eslint-config-prettier": "8.
|
|
38
|
+
"eslint-config-prettier": "8.8.0",
|
|
39
39
|
"js-yaml": "4.1.0",
|
|
40
40
|
"license-report": "6.3.0",
|
|
41
41
|
"marked": "0.7.0",
|
|
42
42
|
"marked-man": "0.7.0",
|
|
43
43
|
"mbox-reader": "1.1.5",
|
|
44
44
|
"mocha": "10.2.0",
|
|
45
|
-
"pkg": "5.8.
|
|
45
|
+
"pkg": "5.8.1"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@postalsys/vmc": "1.0.6",
|
|
49
49
|
"fast-xml-parser": "4.1.3",
|
|
50
50
|
"ipaddr.js": "2.0.1",
|
|
51
|
-
"joi": "17.
|
|
51
|
+
"joi": "17.9.1",
|
|
52
52
|
"libmime": "5.2.1",
|
|
53
53
|
"nodemailer": "6.9.1",
|
|
54
54
|
"psl": "1.9.0",
|