This project is read-only.
1
Vote

Seperate strings combined does not work

description

Hi,

I recently had an issue with a domain that publishes it's dns so

"v=spf1 " "mx" " a:192.168.0.1" etc.

According to the rfc


3.1.3. Multiple Strings in a Single DNS record
As defined in RFC1035 sections 3.3.14 and 3.3, a single text DNS
record (either TXT or SPF RR types) can be composed of more than one
string.


If a published record contains multiple strings, then the
record MUST be treated as if those strings are concatenated together
without adding spaces. For example:
IN TXT "v=spf1 .... first" "second string..."
MUST be treated as equivalent to
IN TXT "v=spf1 .... firstsecond string..."


But when trying to validate via the control, if you look at the spf string returned, you just get

v=spf1

and the spf fails to validate, although valie.

It looks like it is considering the first string only the whole spf?

file attachments

comments

lbgaus wrote Dec 20, 2014 at 5:15 PM

Hello,

I noticed this problem myself today, and modified the source code a bit to fix this problem.

In InterPC.SPF\Dns\RecordReader.cs, the method ReadString() currently has
short length = this.ReadByte();

StringBuilder name = new StringBuilder();
for(int intI=0;intI<length;intI++)
    name.Append(ReadChar());
return name.ToString();
It needs to be changed to
StringBuilder name = new StringBuilder();
while (m_Position < m_Data.Length)
{
    short length = this.ReadByte();

    for (int intI = 0; intI < length; intI++)
        name.Append(ReadChar());
}
return name.ToString();
I have included a fixed InterPC.SPF.dll file if you don't want to recompile the project yourself.

Hope this helps.

Landon