@bobfrankston/rmfmail 1.2.270 → 1.2.272

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.
@@ -1382,9 +1382,20 @@ function displayNameClaimsOtherAddress(name, address) {
1382
1382
  const m = n.match(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g);
1383
1383
  if (!m)
1384
1384
  return null;
1385
+ const realDomain = real.split("@").pop() || "";
1385
1386
  for (const claimed of m) {
1386
- if (claimed.toLowerCase() !== real)
1387
- return claimed;
1387
+ if (claimed.toLowerCase() === real)
1388
+ continue;
1389
+ const claimedDomain = claimed.toLowerCase().split("@").pop() || "";
1390
+ if (claimedDomain && realDomain) {
1391
+ if (claimedDomain === realDomain)
1392
+ continue;
1393
+ if (claimedDomain.endsWith("." + realDomain))
1394
+ continue;
1395
+ if (realDomain.endsWith("." + claimedDomain))
1396
+ continue;
1397
+ }
1398
+ return claimed;
1388
1399
  }
1389
1400
  return null;
1390
1401
  }