@redsift/products 12.4.0 → 12.5.0-muiv7

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.
@@ -1522,8 +1522,31 @@ function getEmailComplianceState(dmarc) {
1522
1522
  if (!dmarc.alignDkim) return 'fail-dkim';
1523
1523
  return 'fail-spf';
1524
1524
  }
1525
- if (dmarc.result === 'none') return 'none';
1526
- if (dmarc.result === 'permerror') return 'permerror';
1525
+ // Subdomains may have result='none' (no own DMARC TXT record) but inherit
1526
+ // a policy from the organisational domain. When alignment data is available,
1527
+ // evaluate compliance based on it instead of returning 'none'.
1528
+ if (dmarc.result === 'none') {
1529
+ if (dmarc.policy) {
1530
+ if (dmarc.alignDkim || dmarc.alignSpf) return 'pass';
1531
+ if (dmarc.alignDkim === false && dmarc.alignSpf === false) return 'fail-both';
1532
+ if (dmarc.alignDkim === false) return 'fail-dkim';
1533
+ if (dmarc.alignSpf === false) return 'fail-spf';
1534
+ }
1535
+ return 'none';
1536
+ }
1537
+ if (dmarc.result === 'permerror') {
1538
+ var _dmarc$policy, _dmarc$policy$rua, _dmarc$raw;
1539
+ // RFC 7489 §6.6.3: when rua is present, receivers fall back to p=none.
1540
+ // Compliance CAN be determined — evaluate alignment normally.
1541
+ const hasRua = Boolean((_dmarc$policy = dmarc.policy) === null || _dmarc$policy === void 0 ? void 0 : (_dmarc$policy$rua = _dmarc$policy.rua) === null || _dmarc$policy$rua === void 0 ? void 0 : _dmarc$policy$rua.length) || /(?:^|;\s*)rua\s*=\s*mailto:/i.test((_dmarc$raw = dmarc.raw) !== null && _dmarc$raw !== void 0 ? _dmarc$raw : '');
1542
+ if (hasRua) {
1543
+ if (dmarc.alignDkim || dmarc.alignSpf) return 'pass';
1544
+ if (dmarc.alignDkim === false && dmarc.alignSpf === false) return 'fail-both';
1545
+ if (dmarc.alignDkim === false) return 'fail-dkim';
1546
+ if (dmarc.alignSpf === false) return 'fail-spf';
1547
+ }
1548
+ return 'permerror';
1549
+ }
1527
1550
  if (dmarc.result === 'temperror') return 'temperror';
1528
1551
  // Treat unexpected result values (neutral, policy, warning) as failures
1529
1552
  if (dmarc.result) return 'fail-both';
@@ -1537,7 +1560,9 @@ function getDomainPolicyState(dmarc) {
1537
1560
  if (!dmarc) return 'no-record';
1538
1561
  if (dmarc.result === 'temperror') return 'temperror';
1539
1562
  if (dmarc.result === 'permerror') return 'permerror';
1540
- if (dmarc.result === 'none') return 'no-record';
1563
+ // Subdomains may have result='none' (no own DMARC TXT record) but still
1564
+ // inherit a policy from the organisational domain. Only treat as no-record
1565
+ // when there is genuinely no policy object.
1541
1566
  if (!dmarc.policy) return 'no-record';
1542
1567
  const {
1543
1568
  p,
@@ -1690,7 +1715,7 @@ function hasReportWarnings(dmarc) {
1690
1715
  * On smaller viewports (≤765px) the boxes stack vertically.
1691
1716
  */
1692
1717
  function DmarcSummaryBoxes(_ref2) {
1693
- var _dmarc$policy$pct, _dmarc$policy;
1718
+ var _dmarc$policy$pct, _dmarc$policy2;
1694
1719
  let {
1695
1720
  dmarc,
1696
1721
  isDomainAnalyzer = false,
@@ -1699,7 +1724,7 @@ function DmarcSummaryBoxes(_ref2) {
1699
1724
  } = _ref2;
1700
1725
  const domainState = getDomainPolicyState(dmarc);
1701
1726
  const emailState = isDomainAnalyzer ? null : getEmailComplianceState(dmarc);
1702
- const pct = (_dmarc$policy$pct = dmarc === null || dmarc === void 0 ? void 0 : (_dmarc$policy = dmarc.policy) === null || _dmarc$policy === void 0 ? void 0 : _dmarc$policy.pct) !== null && _dmarc$policy$pct !== void 0 ? _dmarc$policy$pct : 100;
1727
+ const pct = (_dmarc$policy$pct = dmarc === null || dmarc === void 0 ? void 0 : (_dmarc$policy2 = dmarc.policy) === null || _dmarc$policy2 === void 0 ? void 0 : _dmarc$policy2.pct) !== null && _dmarc$policy$pct !== void 0 ? _dmarc$policy$pct : 100;
1703
1728
  const reportWarnings = hasReportWarnings(dmarc);
1704
1729
  const getDomainBody = state => {
1705
1730
  // When reject-full has report warnings, use a combined summary that replaces
@@ -1708,7 +1733,6 @@ function DmarcSummaryBoxes(_ref2) {
1708
1733
  return t('card.dmarc.summary-domain-reject-full-report-warning');
1709
1734
  }
1710
1735
  let body;
1711
- let isMarkdown = false;
1712
1736
  switch (state) {
1713
1737
  case 'reject-full':
1714
1738
  body = t('card.dmarc.summary-domain-reject-full');
@@ -1750,7 +1774,6 @@ function DmarcSummaryBoxes(_ref2) {
1750
1774
  break;
1751
1775
  case 'permerror':
1752
1776
  body = cardType === 'warning' ? t('card.dmarc.permerror-rua-fallback_md') : t('card.dmarc.permerror-no-rua_md');
1753
- isMarkdown = true;
1754
1777
  break;
1755
1778
  case 'temperror':
1756
1779
  body = t('card.dmarc.summary-domain-temperror');
@@ -1766,7 +1789,7 @@ function DmarcSummaryBoxes(_ref2) {
1766
1789
  }).join(' ');
1767
1790
  body = `${body} ${warnings}`;
1768
1791
  }
1769
- return isMarkdown ? parseGlossaryMarkdown(body) : body;
1792
+ return body;
1770
1793
  };
1771
1794
  const getEmailBody = state => {
1772
1795
  switch (state) {