SPF Bug

May 10, 2011 at 8:21 PM
Edited May 11, 2011 at 6:32 PM

Hey all... trying to get the SPF validadtion to work for me..  I think there is a bug but its late and maybe I'm doing something dumb.. first my spf record is v=spf1  a mx ip4:69.63.151.0/24 ~all  and I'm calling the following method.. 

 

SpfQualifier qualifier = SpfRecord.CheckHost(IPAddress.Parse("60.60.100.40"),"mail1.foo.com","mail1.foo.com", "foo.com", foobar@foo.com); 

it fails on the parse for txt.. after it checks for an inital v=spf1 it drop to the case statment and when it hits the ip4:mechaism it returns false and falls through..  am I missing somethign here?

 

Coordinator
May 11, 2011 at 4:31 PM

I can confirm that there is a bug.

I think, that I can provide a fixed version on the weekend. As a quick fix, you can replace the first Regex in the class SpfTerm with the following:

Regex regex = new Regex(@"^(\s)*(?<qualifier>[~+?-]?)(?<type>[a-z0-9]+)(:(?<domain>[^/]+))?(/(?<prefix>[0-9]+))?(//(?<prefix6>[0-9]+))?(\s)*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

May 11, 2011 at 6:34 PM

Yep..that seems to of fixed the issue and getting back results now as expected..  I havce a whole bunch of SPF test cases I can run throught - I'll let you know if i find anything else..  GREAT WORK this is good stuff...  put on the todo list processing of SenderID records - could be useful.

Coordinator
Jul 5, 2011 at 7:04 PM

Fix is provided in version 1.5.0, which I released a few minutes ago.

Coordinator
Jul 19, 2011 at 6:12 PM

Support for SenderID validation is included in version 1.6.0.