Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple strings in a single DNS TXT record #168

Closed
aykevl opened this issue Aug 9, 2017 · 6 comments
Closed

Multiple strings in a single DNS TXT record #168

aykevl opened this issue Aug 9, 2017 · 6 comments

Comments

@aykevl
Copy link
Contributor

aykevl commented Aug 9, 2017

The current draft has this to say about multiple TXT records for a single domain:

If multiple TXT records for _mta-sts are returned by the resolver, records
which do not begin with v=STSv1; are discarded. If the number of resulting
records is not one, senders MUST assume the recipient domain does not implement
MTA-STS and skip the remaining steps of policy discovery.

But what if multiple strings are returned within a single TXT record? This is what SPF has to say about it:

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..."

SPF or TXT records containing multiple strings are useful in
constructing records that would exceed the 255-byte maximum length of
a string within a single TXT or SPF RR record.

And this is what DKIM has to say about it:

Strings in a TXT RR MUST be concatenated together before use with no
intervening whitespace.  TXT RRs MUST be unique for a particular
selector name; that is, if there are multiple records in an RRset,
the results are undefined.

Nothing like it has yet been defined in the STS spec.


Just for fun, I'm working on a small tool to check whether a domain has a valid MTA-STS setup. I noticed this problem while working on the DNS part.

@danmarg
Copy link
Collaborator

danmarg commented Aug 9, 2017 via email

@aykevl
Copy link
Contributor Author

aykevl commented Aug 10, 2017

The same goes for the reporting side of the draft.

@danmarg
Copy link
Collaborator

danmarg commented Aug 10, 2017

@abrotman fyi.

@danmarg
Copy link
Collaborator

danmarg commented Aug 20, 2017

0f696b6

@danmarg danmarg closed this as completed Aug 20, 2017
@abrotman
Copy link
Collaborator

TLSRPT already has this section:

"If multiple TXT records for _smtp-tlsrpt are returned by the resolver, records
which do not begin with v=TLSRPTv1; are discarded. If the number of resulting
records is not one, senders MUST assume the recipient domain does not implement
TLSRPT. If the resulting TXT record contains multiple strings, then the record
MUST be treated as if those strings are concatenated together without adding
spaces."

Which I believe covers the concern.

@aykevl
Copy link
Contributor Author

aykevl commented Aug 31, 2017

@abrotman yes that has been added since I created this issue (0f696b6). I consider it to be fixed now.

There is still a small possible ambiguity wrt a record like this:

IN	TXT	"v=TLSR" "PTv1; rua=..."

because of the sentence "if the resulting TXT record contains multiple strings...", the result after a sender has tested for the record starting with v=TLSRPTv1.
But I think this isn't really an issue. I don't know who whould write such records (they're usually only split after 255 bytes) and I hope senders would concatenate the strings before testing for v=TLSRPTv1 anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants