@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.
@@ -2861,9 +2861,20 @@ function displayNameClaimsOtherAddress(name, address) {
2861
2861
  const m = n.match(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g);
2862
2862
  if (!m)
2863
2863
  return null;
2864
+ const realDomain = real.split("@").pop() || "";
2864
2865
  for (const claimed of m) {
2865
- if (claimed.toLowerCase() !== real)
2866
- return claimed;
2866
+ if (claimed.toLowerCase() === real)
2867
+ continue;
2868
+ const claimedDomain = claimed.toLowerCase().split("@").pop() || "";
2869
+ if (claimedDomain && realDomain) {
2870
+ if (claimedDomain === realDomain)
2871
+ continue;
2872
+ if (claimedDomain.endsWith("." + realDomain))
2873
+ continue;
2874
+ if (realDomain.endsWith("." + claimedDomain))
2875
+ continue;
2876
+ }
2877
+ return claimed;
2867
2878
  }
2868
2879
  return null;
2869
2880
  }