mailauth 4.4.0 → 4.4.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/bimi/index.js CHANGED
@@ -14,6 +14,8 @@ const http = require('http');
14
14
  const { vmc } = require('@postalsys/vmc');
15
15
  const { validateSvg } = require('./validate-svg');
16
16
 
17
+ const HTTP_REQUEST_TIMEOUT = 15 * 1000;
18
+
17
19
  const lookup = async data => {
18
20
  let { dmarc, headers, resolver, bimiWithAlignedDkim } = data;
19
21
  let headerRows = (headers && headers.parsed) || [];
@@ -197,7 +199,9 @@ const downloadPromise = (url, cachedFile) => {
197
199
  port: 443,
198
200
  path: parsedUrl.pathname,
199
201
  method: 'GET',
200
- rejectUnauthorized: true
202
+ rejectUnauthorized: true,
203
+
204
+ timeout: HTTP_REQUEST_TIMEOUT
201
205
  };
202
206
 
203
207
  return new Promise((resolve, reject) => {
@@ -240,6 +244,13 @@ const downloadPromise = (url, cachedFile) => {
240
244
  res.on('error', err => reject(err));
241
245
  });
242
246
 
247
+ req.on('timeout', () => {
248
+ req.destroy(); // cancel request
249
+ let error = new Error(`Request timeout for ${parsedUrl.href}`);
250
+ error.code = 'HTTP_SOCKET_TIMEOUT';
251
+ reject(error);
252
+ });
253
+
243
254
  req.on('error', err => {
244
255
  reject(err);
245
256
  });
package/lib/mta-sts.js CHANGED
@@ -5,6 +5,8 @@ const dns = require('dns');
5
5
  const parseDkimHeaders = require('./parse-dkim-headers');
6
6
  const https = require('https');
7
7
 
8
+ const HTTP_REQUEST_TIMEOUT = 15 * 1000;
9
+
8
10
  /**
9
11
  * Resolve MTA-STS policy ID
10
12
  * @param {String} address Either email address or a domain name
@@ -247,7 +249,9 @@ const fetchPolicy = async (domain, opts) => {
247
249
  port: 443,
248
250
  path,
249
251
  method: 'GET',
250
- rejectUnauthorized: true
252
+ rejectUnauthorized: true,
253
+
254
+ timeout: HTTP_REQUEST_TIMEOUT
251
255
  };
252
256
 
253
257
  let data = await new Promise((resolve, reject) => {
@@ -273,6 +277,13 @@ const fetchPolicy = async (domain, opts) => {
273
277
  res.on('error', err => reject(err));
274
278
  });
275
279
 
280
+ req.on('timeout', () => {
281
+ req.destroy(); // cancel request
282
+ let error = new Error(`Request timeout for https://${servername}${path}`);
283
+ error.code = 'HTTP_SOCKET_TIMEOUT';
284
+ reject(error);
285
+ });
286
+
276
287
  req.on('error', err => {
277
288
  reject(err);
278
289
  });
package/licenses.txt CHANGED
@@ -1,11 +1,11 @@
1
1
  name license type link installed version author
2
2
  ---- ------------ ---- ----------------- ------
3
3
  @postalsys/vmc MIT https://registry.npmjs.org/@postalsys/vmc/-/vmc-1.0.6.tgz 1.0.6 Postal Systems OÜ
4
- fast-xml-parser MIT git+https://github.com/NaturalIntelligence/fast-xml-parser.git 4.2.0 Amit Gupta (https://amitkumargupta.work/)
5
- ipaddr.js MIT git://github.com/whitequark/ipaddr.js.git 2.0.1 whitequark <whitequark@whitequark.org>
6
- joi BSD-3-Clause git://github.com/hapijs/joi.git 17.9.1 n/a
4
+ fast-xml-parser MIT git+https://github.com/NaturalIntelligence/fast-xml-parser.git 4.2.4 Amit Gupta (https://amitkumargupta.work/)
5
+ ipaddr.js MIT git://github.com/whitequark/ipaddr.js.git 2.1.0 whitequark <whitequark@whitequark.org>
6
+ joi BSD-3-Clause git://github.com/hapijs/joi.git 17.9.2 n/a
7
7
  libmime MIT git://github.com/andris9/libmime.git 5.2.1 Andris Reinman <andris@kreata.ee>
8
- nodemailer MIT git+https://github.com/nodemailer/nodemailer.git 6.9.1 Andris Reinman
8
+ nodemailer MIT-0 git+https://github.com/nodemailer/nodemailer.git 6.9.3 Andris Reinman
9
9
  psl MIT git+ssh://git@github.com/lupomontero/psl.git 1.9.0 Lupo Montero <lupomontero@gmail.com> (https://lupomontero.com/)
10
10
  punycode MIT git+https://github.com/mathiasbynens/punycode.js.git 2.3.0 Mathias Bynens https://mathiasbynens.be/
11
- yargs MIT git+https://github.com/yargs/yargs.git 17.7.1 n/a
11
+ yargs MIT git+https://github.com/yargs/yargs.git 17.7.2 n/a
package/man/mailauth.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH "MAILAUTH" "1" "June 2023" "v4.3.4" "Mailauth Help"
1
+ .TH "MAILAUTH" "1" "July 2023" "v4.4.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": "4.4.0",
3
+ "version": "4.4.2",
4
4
  "description": "Email authentication library for Node.js",
5
5
  "main": "lib/mailauth.js",
6
6
  "scripts": {
@@ -33,9 +33,9 @@
33
33
  "homepage": "https://github.com/postalsys/mailauth",
34
34
  "devDependencies": {
35
35
  "chai": "4.3.7",
36
- "eslint": "8.42.0",
36
+ "eslint": "8.45.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
- "eslint-config-prettier": "8.8.0",
38
+ "eslint-config-prettier": "8.9.0",
39
39
  "js-yaml": "4.1.0",
40
40
  "license-report": "6.4.0",
41
41
  "marked": "0.7.0",
@@ -46,11 +46,11 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@postalsys/vmc": "1.0.6",
49
- "fast-xml-parser": "4.2.4",
49
+ "fast-xml-parser": "4.2.6",
50
50
  "ipaddr.js": "2.1.0",
51
51
  "joi": "17.9.2",
52
52
  "libmime": "5.2.1",
53
- "nodemailer": "6.9.3",
53
+ "nodemailer": "6.9.4",
54
54
  "psl": "1.9.0",
55
55
  "punycode": "2.3.0",
56
56
  "yargs": "17.7.2"
@@ -73,6 +73,7 @@
73
73
  "targets": [
74
74
  "node16-linux-x64",
75
75
  "node16-macos-x64",
76
+ "node18-macos-arm64",
76
77
  "node16-win-x64"
77
78
  ],
78
79
  "outputPath": "ee-dist"