mailauth 4.3.3 → 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/licenses.txt CHANGED
@@ -1,7 +1,7 @@
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.3 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
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailauth",
3
- "version": "4.3.3",
3
+ "version": "4.3.4",
4
4
  "description": "Email authentication library for Node.js",
5
5
  "main": "lib/mailauth.js",
6
6
  "scripts": {