Open malohtie opened 3 years ago
Hi, Quick and dirty solution: create a class implementing DNSRecordGetterInterface, or extend DNSRecordGetter to override a domain:
<?php
use Mika56\SPFCheck\DNSRecordGetter;
use Mika56\SPFCheck\SPFCheck;
class DNSRecordGetterOverride extends DNSRecordGetter
{
private $spfRecord;
public function __construct(string $spfRecord)
{
$this->spfRecord = $spfRecord;
}
public function getSPFRecordForDomain($domain)
{
if($domain === 'example.com') {
return $this->spfRecord;
}
return parent::getSPFRecordForDomain($domain);
}
}
$checker = new SPFCheck(new DNSRecordGetterOverride('v=spf1 ip4:35.190....'));
var_dump($checker->isIPAllowed('108.177.8.0', 'example.com'));
I'm keeping your issue opened because that's a feature that's relevant to add
Hi, is it possible to check manuelly the spf by comparing string and ip and get result if pass or fail or none ...
exemple :