diff --git a/mailpoet/lib/Services/AuthorizedSenderDomainController.php b/mailpoet/lib/Services/AuthorizedSenderDomainController.php index 4e298d4d3c..01f0de5062 100644 --- a/mailpoet/lib/Services/AuthorizedSenderDomainController.php +++ b/mailpoet/lib/Services/AuthorizedSenderDomainController.php @@ -133,7 +133,7 @@ class AuthorizedSenderDomainController { * otherwise returns `false` */ public function isDomainDmarcRetricted(string $domain): bool { - $result = $this->dmarcPolicyChecker->getDomainDmarcPolicy($domain); + $result = $this->getDmarcPolicyForDomain($domain); return $result !== DmarcPolicyChecker::POLICY_NONE; } diff --git a/mailpoet/lib/Util/DmarcPolicyChecker.php b/mailpoet/lib/Util/DmarcPolicyChecker.php index 06282ac097..0b18d7defc 100644 --- a/mailpoet/lib/Util/DmarcPolicyChecker.php +++ b/mailpoet/lib/Util/DmarcPolicyChecker.php @@ -51,7 +51,13 @@ class DmarcPolicyChecker { } // policy can either be reject or quarantine or none - $dmarcStatus = $dmarcInfo['sp'] ?? $dmarcInfo['p'] ?? self::POLICY_NONE; + $dmarcStatus = $dmarcInfo['p'] ?? self::POLICY_NONE; + // check for subdomain policy + $dmarcStatus = ( + isset($dmarcInfo['sp']) && + ($dmarcInfo['sp'] === self::POLICY_QUARANTINE || + $dmarcInfo['sp'] === self::POLICY_REJECT) + ) ? $dmarcInfo['sp'] : $dmarcStatus; return $dmarcStatus; }