mailauth 4.3.2 → 4.3.4

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 CHANGED
@@ -295,11 +295,6 @@ const fetchPolicy = async (domain, opts) => {
295
295
  * @returns {Object|Boolean} Policy information or false
296
296
  */
297
297
  const getPolicy = async (domain, knownPolicy, opts) => {
298
- if (knownPolicy?.expires && new Date(knownPolicy?.expires) > new Date()) {
299
- // no need to check
300
- return { policy: knownPolicy, status: 'cached' };
301
- }
302
-
303
298
  let policyId;
304
299
  try {
305
300
  policyId = await resolvePolicy(domain, opts);
@@ -312,8 +307,8 @@ const getPolicy = async (domain, knownPolicy, opts) => {
312
307
  return { policy: { id: false, mode: 'none' }, status: 'not_found' };
313
308
  }
314
309
 
315
- if (knownPolicy && knownPolicy.id === policyId) {
316
- // no changes
310
+ if (knownPolicy && knownPolicy.id === policyId && !(knownPolicy?.expires && new Date(knownPolicy?.expires) > new Date())) {
311
+ // no changes, not expired
317
312
  return {
318
313
  policy: Object.assign({}, knownPolicy, {
319
314
  expires: new Date(Date.now() + knownPolicy.maxAge * 1000).toISOString()
package/lib/spf/index.js CHANGED
@@ -86,6 +86,13 @@ let limitedResolver = (resolver, maxResolveCount, maxVoidCount, ignoreFirst) =>
86
86
  };
87
87
  throw err;
88
88
 
89
+ case 'EREFUSED':
90
+ err.spfResult = {
91
+ error: 'temperror',
92
+ text: `DNS request refused by server when resolving ${domain}`
93
+ };
94
+ throw err;
95
+
89
96
  default:
90
97
  throw err;
91
98
  }
@@ -479,8 +479,15 @@ const spfVerify = async (domain, opts) => {
479
479
 
480
480
  try {
481
481
  let res = await getResult();
482
+
482
483
  if (res && spfRr) {
483
484
  res.rr = spfRr;
485
+ } else if (spfRr) {
486
+ res = {
487
+ // default is neutral
488
+ qualifier: '?',
489
+ rr: spfRr
490
+ };
484
491
  }
485
492
  return res;
486
493
  } catch (err) {
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.1.1 Amit Gupta (https://amitkumargupta.work/)
4
+ fast-xml-parser MIT git+https://github.com/NaturalIntelligence/fast-xml-parser.git 4.2.0 Amit Gupta (https://amitkumargupta.work/)
5
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.7.0 n/a
6
+ joi BSD-3-Clause git://github.com/hapijs/joi.git 17.9.1 n/a
7
7
  libmime MIT git://github.com/andris9/libmime.git 5.2.1 Andris Reinman <andris@kreata.ee>
8
8
  nodemailer MIT git+https://github.com/nodemailer/nodemailer.git 6.9.1 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.6.2 n/a
11
+ yargs MIT git+https://github.com/yargs/yargs.git 17.7.1 n/a
package/man/mailauth.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH "MAILAUTH" "1" "April 2023" "v4.3.2" "Mailauth Help"
1
+ .TH "MAILAUTH" "1" "April 2023" "v4.3.3" "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.3.2",
3
+ "version": "4.3.4",
4
4
  "description": "Email authentication library for Node.js",
5
5
  "main": "lib/mailauth.js",
6
6
  "scripts": {
@@ -33,7 +33,7 @@
33
33
  "homepage": "https://github.com/postalsys/mailauth",
34
34
  "devDependencies": {
35
35
  "chai": "4.3.7",
36
- "eslint": "8.37.0",
36
+ "eslint": "8.38.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
38
  "eslint-config-prettier": "8.8.0",
39
39
  "js-yaml": "4.1.0",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@postalsys/vmc": "1.0.6",
49
- "fast-xml-parser": "4.1.3",
49
+ "fast-xml-parser": "4.2.0",
50
50
  "ipaddr.js": "2.0.1",
51
51
  "joi": "17.9.1",
52
52
  "libmime": "5.2.1",