I'm attempting to parse an SPF record that is longer than 255 characters which results which in a SourceLengthExceeded
error.
TXT records containing multiple strings are useful in constructing
records that would exceed the 255-octet maximum length of a
character-string within a single TXT record.
I'm guessing that the TXT record length limit is where the 255 number comes from, but section 3.4 says:
3.4 Record Size
The published SPF record for a given domain name SHOULD remain small
enough that the results of a query for it will fit within 512 octets.
Otherwise, there is a possibility of exceeding a DNS protocol limit.
It feels like the string length here should be increased to at least 512 characters, even then, it's only a SHOULD
and some DNS implementations could be returning more characters.
Does a length check need to exist here at all? Perhaps a warning about the potential record lengths in the documentation is enough, with links to what the RFC has to say on the matter.