mailauth 2.3.1 → 2.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.
@@ -15,7 +15,7 @@ const matchIp = (addr, range) => {
15
15
  }
16
16
  };
17
17
 
18
- const parseCidrValue = (val, defaultValue) => {
18
+ const parseCidrValue = (val, defaultValue, type) => {
19
19
  val = val || '';
20
20
  let domain = '';
21
21
  let cidr4 = '';
@@ -29,8 +29,15 @@ const parseCidrValue = (val, defaultValue) => {
29
29
  throw err;
30
30
  }
31
31
  domain = cidrMatch[1] || '';
32
+
32
33
  cidr4 = cidrMatch[2] ? Number(cidrMatch[2].substr(1)) : '';
33
34
  cidr6 = cidrMatch[3] ? Number(cidrMatch[3].substr(2)) : '';
35
+
36
+ if (type === 'ip6' && cidr4 && !cidr6) {
37
+ // there is no dual cidr for IP addresses
38
+ cidr6 = cidr4;
39
+ cidr4 = '';
40
+ }
34
41
  }
35
42
 
36
43
  domain = domain.toLowerCase().trim() || defaultValue;
@@ -270,7 +277,7 @@ const spfVerify = async (domain, opts) => {
270
277
  case 'ip4':
271
278
  case 'ip6':
272
279
  {
273
- let { domain: range, cidr4, cidr6 } = parseCidrValue(val);
280
+ let { domain: range, cidr4, cidr6 } = parseCidrValue(val, false, type);
274
281
  if (!range) {
275
282
  let err = new Error('SPF failure');
276
283
  err.spfResult = { error: 'permerror', text: `bare IP address` };
@@ -315,7 +322,7 @@ const spfVerify = async (domain, opts) => {
315
322
 
316
323
  case 'a':
317
324
  {
318
- let { domain: a, cidr4, cidr6 } = parseCidrValue(val, domain);
325
+ let { domain: a, cidr4, cidr6 } = parseCidrValue(val, domain, type);
319
326
  let cidr = net.isIPv6(opts.ip) ? cidr6 : cidr4;
320
327
 
321
328
  a = macro(a, opts);
@@ -339,7 +346,7 @@ const spfVerify = async (domain, opts) => {
339
346
 
340
347
  case 'mx':
341
348
  {
342
- let { domain: mxDomain, cidr4, cidr6 } = parseCidrValue(val, domain);
349
+ let { domain: mxDomain, cidr4, cidr6 } = parseCidrValue(val, domain, type);
343
350
  let cidr = net.isIPv6(opts.ip) ? cidr6 : cidr4;
344
351
 
345
352
  try {
package/man/mailauth.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH "MAILAUTH" "1" "January 2022" "v2.3.0" "Mailauth Help"
1
+ .TH "MAILAUTH" "1" "April 2022" "v2.3.1" "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": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Email authentication library for Node.js",
5
5
  "main": "lib/mailauth.js",
6
6
  "scripts": {
@@ -31,28 +31,28 @@
31
31
  },
32
32
  "homepage": "https://github.com/postalsys/mailauth",
33
33
  "devDependencies": {
34
- "chai": "4.3.4",
35
- "eslint": "8.7.0",
34
+ "chai": "4.3.6",
35
+ "eslint": "8.14.0",
36
36
  "eslint-config-nodemailer": "1.2.0",
37
- "eslint-config-prettier": "8.3.0",
37
+ "eslint-config-prettier": "8.5.0",
38
38
  "js-yaml": "4.1.0",
39
- "license-report": "4.5.0",
39
+ "license-report": "5.0.2",
40
40
  "marked": "0.7.0",
41
41
  "marked-man": "0.7.0",
42
42
  "mbox-reader": "1.1.5",
43
- "mocha": "9.1.4",
44
- "pkg": "5.5.2"
43
+ "mocha": "9.2.2",
44
+ "pkg": "5.6.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@fidm/x509": "1.2.1",
48
48
  "ipaddr.js": "2.0.1",
49
- "joi": "17.5.0",
49
+ "joi": "17.6.0",
50
50
  "libmime": "5.0.0",
51
- "node-forge": "1.2.1",
52
- "nodemailer": "6.7.2",
51
+ "node-forge": "1.3.1",
52
+ "nodemailer": "6.7.3",
53
53
  "psl": "1.8.0",
54
54
  "punycode": "2.1.1",
55
- "yargs": "17.3.1"
55
+ "yargs": "17.4.1"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=14.0.0"
@@ -75,6 +75,6 @@
75
75
  "_targets": [
76
76
  "node16-macos-x64"
77
77
  ],
78
- "outputPath": "dist"
78
+ "outputPath": "ee-dist"
79
79
  }
80
80
  }
package/licenses.txt DELETED
@@ -1,11 +0,0 @@
1
- name license type link installed version author
2
- ---- ------------ ---- ----------------- ------
3
- @fidm/x509 MIT git+ssh://git@github.com/fidm/x509.git 1.2.1 n/a
4
- ipaddr.js MIT git://github.com/whitequark/ipaddr.js.git 2.0.1 whitequark
5
- joi BSD-3-Clause git://github.com/sideway/joi.git 17.5.0 n/a
6
- libmime MIT git://github.com/andris9/libmime.git 5.0.0 Andris Reinman
7
- node-forge (BSD-3-Clause OR GPL-2.0) git+https://github.com/digitalbazaar/forge.git 1.2.1 Digital Bazaar, Inc.
8
- nodemailer MIT git+https://github.com/nodemailer/nodemailer.git 6.7.2 Andris Reinman
9
- psl MIT git+ssh://git@github.com/lupomontero/psl.git 1.8.0 Lupo Montero
10
- punycode MIT git+https://github.com/bestiejs/punycode.js.git 2.1.1 Mathias Bynens
11
- yargs MIT git+https://github.com/yargs/yargs.git 17.3.1 n/a