mailauth 4.6.6 → 4.6.8

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.6.8](https://github.com/postalsys/mailauth/compare/v4.6.7...v4.6.8) (2024-06-04)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **dmarc-alignment:** Fixed tldts usage to allow private domains ([cc7dfa8](https://github.com/postalsys/mailauth/commit/cc7dfa8d820c1a4112602340192010354d51cd52))
9
+
10
+ ## [4.6.7](https://github.com/postalsys/mailauth/compare/v4.6.6...v4.6.7) (2024-05-30)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **psl:** Replaced psl module with tldts for up to date public suffix list ([cab894b](https://github.com/postalsys/mailauth/commit/cab894b54a3544b33a641f377783db67a43bec0e))
16
+
3
17
  ## [4.6.6](https://github.com/postalsys/mailauth/compare/v4.6.5...v4.6.6) (2024-05-13)
4
18
 
5
19
 
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const psl = require('psl');
4
3
  const dns = require('node:dns').promises;
4
+ const tldts = require('tldts');
5
+ const { TLDTS_OPTS } = require('../tools');
5
6
 
6
7
  const resolveTxt = async (domain, resolver) => {
7
8
  try {
@@ -33,7 +34,7 @@ const getDmarcRecord = async (domain, resolver) => {
33
34
  let isOrgRecord = false;
34
35
 
35
36
  if (!txt) {
36
- let orgDomain = psl.get(domain);
37
+ let orgDomain = tldts.getDomain(domain, TLDTS_OPTS);
37
38
  if (orgDomain !== domain) {
38
39
  // try org domain as well
39
40
  txt = await resolveTxt(orgDomain, resolver);
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const dns = require('node:dns').promises;
4
- const punycode = require('punycode/');
5
- const psl = require('psl');
6
- const { formatAuthHeaderRow, getAlignment } = require('../tools');
4
+ const punycode = require('punycode.js');
5
+ const tldts = require('tldts');
6
+ const { formatAuthHeaderRow, getAlignment, TLDTS_OPTS } = require('../tools');
7
7
  const getDmarcRecord = require('./get-dmarc-record');
8
8
 
9
9
  const verifyDmarc = async opts => {
@@ -41,7 +41,7 @@ const verifyDmarc = async opts => {
41
41
  return response;
42
42
  };
43
43
 
44
- let orgDomain = psl.get(domain);
44
+ let orgDomain = tldts.getDomain(domain, TLDTS_OPTS);
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');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const punycode = require('punycode/');
3
+ const punycode = require('punycode.js');
4
4
  const net = require('net');
5
5
  const macro = require('./macro');
6
6
  const dns = require('node:dns').promises;
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 psl = require('psl');
13
+ const tldts = require('tldts');
14
14
  const Joi = require('joi');
15
15
  const base64Schema = Joi.string().base64({ paddingRequired: false });
16
16
 
@@ -29,6 +29,11 @@ const keyOrderingDKIM = ['v', 'a', 'c', 'd', 'h', 'i', 'l', 'q', 's', 't', 'x',
29
29
  const keyOrderingARC = ['i', 'a', 'c', 'd', 'h', 'l', 'q', 's', 't', 'x', 'z', 'bh', 'b'];
30
30
  const keyOrderingAS = ['i', 'a', 't', 'cv', 'd', 's', 'b'];
31
31
 
32
+ const TLDTS_OPTS = {
33
+ allowIcannDomains: true,
34
+ allowPrivateDomains: true
35
+ };
36
+
32
37
  const writeToStream = async (stream, input, chunkSize) => {
33
38
  chunkSize = chunkSize || 64 * 1024;
34
39
 
@@ -483,7 +488,7 @@ const getAlignment = (fromDomain, domainList, strict) => {
483
488
  if (strict) {
484
489
  fromDomain = formatDomain(fromDomain);
485
490
  for (let entry of domainList) {
486
- let domain = formatDomain(psl.get(entry.domain) || entry.domain);
491
+ let domain = formatDomain(tldts.getDomain(entry.domain, TLDTS_OPTS) || entry.domain);
487
492
  if (formatDomain(domain) === fromDomain) {
488
493
  return entry;
489
494
  }
@@ -491,9 +496,9 @@ const getAlignment = (fromDomain, domainList, strict) => {
491
496
  }
492
497
 
493
498
  // match org domains
494
- fromDomain = formatDomain(psl.get(fromDomain) || fromDomain);
499
+ fromDomain = formatDomain(tldts.getDomain(fromDomain, TLDTS_OPTS) || fromDomain);
495
500
  for (let entry of domainList) {
496
- let domain = formatDomain(psl.get(entry.domain) || entry.domain);
501
+ let domain = formatDomain(tldts.getDomain(entry.domain, TLDTS_OPTS) || entry.domain);
497
502
  if (domain === fromDomain) {
498
503
  return entry;
499
504
  }
@@ -591,5 +596,7 @@ module.exports = {
591
596
 
592
597
  getPtrHostname,
593
598
 
594
- getCurTime
599
+ getCurTime,
600
+
601
+ TLDTS_OPTS
595
602
  };
package/man/mailauth.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH "MAILAUTH" "1" "May 2024" "v4.6.6" "Mailauth Help"
1
+ .TH "MAILAUTH" "1" "June 2024" "v4.6.8" "Mailauth Help"
2
2
  .SH "NAME"
3
3
  \fBmailauth\fR
4
4
  .QP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailauth",
3
- "version": "4.6.6",
3
+ "version": "4.6.8",
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",
@@ -41,19 +41,18 @@
41
41
  "license-report": "6.5.0",
42
42
  "marked": "0.7.0",
43
43
  "marked-man": "0.7.0",
44
- "mbox-reader": "1.1.5",
45
- "mocha": "10.4.0",
46
- "npm-check-updates": "16.14.20"
44
+ "mbox-reader": "1.2.0",
45
+ "mocha": "10.4.0"
47
46
  },
48
47
  "dependencies": {
49
48
  "@postalsys/vmc": "1.0.8",
50
- "fast-xml-parser": "4.3.6",
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
- "psl": "1.9.0",
56
- "punycode": "2.3.1",
54
+ "punycode.js": "2.3.1",
55
+ "tldts": "6.1.24",
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
- "node18-linux-x64",
78
- "node18-macos-x64",
79
- "node18-macos-arm64",
80
- "node18-win-x64"
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
  }