Mika56 / PHP-SPF-Check

Simple library to check an IP address against a domain's SPF record
MIT License
44 stars 25 forks source link

Failing SPF check #51

Closed bentleyo closed 1 year ago

bentleyo commented 1 year ago

Hi @Mika56 ,

I'm running into a problem with an SPF record that has +include:universalspf.org

If you look at the SPF record of universalspf.org it has a value of v=spf1 a:%{i}._o.%{o}.y.0.universalspf.org -all. I've never seen an SPF record like this and it seems to cause problems with this SPF checking library.

It gets to like 45 of MacroUtils.php and when it calls $query->getSender() the value is null and this causes explode to fail.

Screen Shot 2023-05-22 at 15 32 02
bentleyo commented 1 year ago

Sorry, my apologies, I wasn't specifying the sender parameter when I created a new Query instance.

I guess it could be nice if the library threw an exception if the sender is required and wasn't specified, instead of passing it to the explode method. Especially as sender is null by default.