mailauth 4.6.6 → 4.6.7
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/CHANGELOG.md +7 -0
- package/lib/dmarc/get-dmarc-record.js +2 -2
- package/lib/dmarc/verify.js +3 -3
- package/lib/mta-sts.js +1 -1
- package/lib/spf/spf-verify.js +1 -1
- package/lib/tools.js +5 -5
- package/man/mailauth.1 +1 -1
- package/package.json +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.6.7](https://github.com/postalsys/mailauth/compare/v4.6.6...v4.6.7) (2024-05-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **psl:** Replaced psl module with tldts for up to date public suffix list ([cab894b](https://github.com/postalsys/mailauth/commit/cab894b54a3544b33a641f377783db67a43bec0e))
|
|
9
|
+
|
|
3
10
|
## [4.6.6](https://github.com/postalsys/mailauth/compare/v4.6.5...v4.6.6) (2024-05-13)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const tldts = require('tldts');
|
|
4
4
|
const dns = require('node:dns').promises;
|
|
5
5
|
|
|
6
6
|
const resolveTxt = async (domain, resolver) => {
|
|
@@ -33,7 +33,7 @@ const getDmarcRecord = async (domain, resolver) => {
|
|
|
33
33
|
let isOrgRecord = false;
|
|
34
34
|
|
|
35
35
|
if (!txt) {
|
|
36
|
-
let orgDomain =
|
|
36
|
+
let orgDomain = tldts.getDomain(domain);
|
|
37
37
|
if (orgDomain !== domain) {
|
|
38
38
|
// try org domain as well
|
|
39
39
|
txt = await resolveTxt(orgDomain, resolver);
|
package/lib/dmarc/verify.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const dns = require('node:dns').promises;
|
|
4
|
-
const punycode = require('punycode
|
|
5
|
-
const
|
|
4
|
+
const punycode = require('punycode.js');
|
|
5
|
+
const tldts = require('tldts');
|
|
6
6
|
const { formatAuthHeaderRow, getAlignment } = require('../tools');
|
|
7
7
|
const getDmarcRecord = require('./get-dmarc-record');
|
|
8
8
|
|
|
@@ -41,7 +41,7 @@ const verifyDmarc = async opts => {
|
|
|
41
41
|
return response;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
let orgDomain =
|
|
44
|
+
let orgDomain = tldts.getDomain(domain);
|
|
45
45
|
|
|
46
46
|
let status = {
|
|
47
47
|
result: 'neutral',
|
package/lib/mta-sts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { Buffer } = require('node:buffer');
|
|
4
|
-
const punycode = require('punycode
|
|
4
|
+
const punycode = require('punycode.js');
|
|
5
5
|
const dns = require('node:dns');
|
|
6
6
|
const parseDkimHeaders = require('./parse-dkim-headers');
|
|
7
7
|
const https = require('node:https');
|
package/lib/spf/spf-verify.js
CHANGED
package/lib/tools.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
const { Buffer } = require('node:buffer');
|
|
6
|
-
const punycode = require('punycode
|
|
6
|
+
const punycode = require('punycode.js');
|
|
7
7
|
const libmime = require('libmime');
|
|
8
8
|
const dns = require('node:dns').promises;
|
|
9
9
|
const crypto = require('node:crypto');
|
|
10
10
|
const https = require('node:https');
|
|
11
11
|
const packageData = require('../package');
|
|
12
12
|
const parseDkimHeaders = require('./parse-dkim-headers');
|
|
13
|
-
const
|
|
13
|
+
const tldts = require('tldts');
|
|
14
14
|
const Joi = require('joi');
|
|
15
15
|
const base64Schema = Joi.string().base64({ paddingRequired: false });
|
|
16
16
|
|
|
@@ -483,7 +483,7 @@ const getAlignment = (fromDomain, domainList, strict) => {
|
|
|
483
483
|
if (strict) {
|
|
484
484
|
fromDomain = formatDomain(fromDomain);
|
|
485
485
|
for (let entry of domainList) {
|
|
486
|
-
let domain = formatDomain(
|
|
486
|
+
let domain = formatDomain(tldts.getDomain(entry.domain) || entry.domain);
|
|
487
487
|
if (formatDomain(domain) === fromDomain) {
|
|
488
488
|
return entry;
|
|
489
489
|
}
|
|
@@ -491,9 +491,9 @@ const getAlignment = (fromDomain, domainList, strict) => {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
// match org domains
|
|
494
|
-
fromDomain = formatDomain(
|
|
494
|
+
fromDomain = formatDomain(tldts.getDomain(fromDomain) || fromDomain);
|
|
495
495
|
for (let entry of domainList) {
|
|
496
|
-
let domain = formatDomain(
|
|
496
|
+
let domain = formatDomain(tldts.getDomain(entry.domain) || entry.domain);
|
|
497
497
|
if (domain === fromDomain) {
|
|
498
498
|
return entry;
|
|
499
499
|
}
|
package/man/mailauth.1
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailauth",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.7",
|
|
4
4
|
"description": "Email authentication library for Node.js",
|
|
5
5
|
"main": "lib/mailauth.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build-source": "rm -rf node_modules package-lock.json && npm install && npm run man && npm run licenses && rm -rf node_modules package-lock.json && npm install --production && rm -rf package-lock.json",
|
|
11
11
|
"build-dist": "npx pkg --compress Brotli package.json && rm -rf package-lock.json && npm install",
|
|
12
12
|
"licenses": "license-report --only=prod --output=table --config license-report-config.json > licenses.txt",
|
|
13
|
-
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
|
|
13
|
+
"update": "rm -rf node_modules package-lock.json && npx ncu -u && npm install"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -42,18 +42,17 @@
|
|
|
42
42
|
"marked": "0.7.0",
|
|
43
43
|
"marked-man": "0.7.0",
|
|
44
44
|
"mbox-reader": "1.1.5",
|
|
45
|
-
"mocha": "10.4.0"
|
|
46
|
-
"npm-check-updates": "16.14.20"
|
|
45
|
+
"mocha": "10.4.0"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
48
|
"@postalsys/vmc": "1.0.8",
|
|
50
|
-
"fast-xml-parser": "4.
|
|
49
|
+
"fast-xml-parser": "4.4.0",
|
|
51
50
|
"ipaddr.js": "2.2.0",
|
|
52
51
|
"joi": "17.13.1",
|
|
53
52
|
"libmime": "5.3.5",
|
|
54
53
|
"nodemailer": "6.9.13",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
54
|
+
"punycode.js": "2.3.1",
|
|
55
|
+
"tldts": "6.1.23",
|
|
57
56
|
"undici": "5.28.4",
|
|
58
57
|
"uuid": "9.0.1",
|
|
59
58
|
"yargs": "17.7.2"
|
|
@@ -74,10 +73,10 @@
|
|
|
74
73
|
"LICENSE.txt"
|
|
75
74
|
],
|
|
76
75
|
"targets": [
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
76
|
+
"latest-linux-x64",
|
|
77
|
+
"latest-macos-x64",
|
|
78
|
+
"latest-macos-arm64",
|
|
79
|
+
"latest-win-x64"
|
|
81
80
|
],
|
|
82
81
|
"outputPath": "ee-dist"
|
|
83
82
|
}
|