RFC 8904 | DNSWL Email Auth Method Extension | September 2020 |
Vesely | Informational | [Page] |
This document describes an additional email authentication method compliant with RFC 8601. The method consists of looking up the sender's IP address in a DNS whitelist. This document provides information in case the method is seen in the field, suggests a useful practice, and registers the relevant keywords.¶
This document does not consider blacklists.¶
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not candidates for any level of Internet Standard; see Section 2 of RFC 7841.¶
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8904.¶
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
One of the many checks that mail servers carry out is to query DNS whitelists (DNSWLs). That method is fully discussed in [RFC5782]. The DNS [RFC1034] lookup is based on the connecting client's IP address, IPv4 or IPv6, and returns zero or more A records. The latter are IPv4 IP addresses in the range 127.0.0.0/8. Depending on the query, TXT records with varying content can also be retrieved. Query examples are given in Appendix A.¶
Since the IP address is known as soon as the connection is accepted, this check can occur very early in an SMTP transaction. Its result can be used to counterweight policies that typically occur at early stages too, such as the Sender Policy Framework (SPF) (the last paragraph of Appendix D.3 of [RFC7208] is also illustrated in Appendix A). In addition, the result of a DNSWL lookup can be used at later stages; for example, a delivery agent can use it to learn the trustworthiness of a mail relay in order to estimate the spamminess of an email message. The latter possibility needs a place to collect query results for downstream use, which is precisely what the Authentication-Results header field aims to provide.¶
Results often contain additional data, encoded according to DNSWL-specific criteria. The method described in this document considers only whitelists -- one of the major branches described by [RFC5782]. There are also blacklists/blocklists, DNSBL, and combined lists. Since they all have the same structure, the abbreviation DNSxL is used to mean any. The core procedures of a Mail Transfer Agent (MTA) tend to be quite general, leaving particular cases to be handled by add-on modules. In the case of combined lists, the boundary MTA (see [RFC5598]), which carries out the check and possibly stores the result, has to be able to discern at least the color of each entry, as that is required to make accept/reject decisions. This document provides for storing the result when the DNSxL record to be reported is a whitelisting one.¶
Data conveyed in A and TXT records can be stored as method's properties. The meaning of such data varies widely at the mercy of the list operator; hence, the queried zone has to be stored as well. Mail site operators who configure their MTAs to query specific DNWSLs marry the policies of those lists, as, in effect, they become tantamount to local policies, albeit outsourced. Downstream agents who know DNSWL-specific encoding and understand the meaning of that datum can use it to make delivery or display decisions. For example, a mail filter that detects heuristic evidence of a scam can counterweight such information with the trustworthiness score encoded in the A response so as to protect against false positives. Mail User Agents (MUAs) can display those results or use them to decide how to report abusive messages, if configured to do so.¶
This document describes a usage of TXT fields consistent with other authentication methods, namely to serve the domain name in the TXT record. That way, a downstream filter could also consider whether the sending agent is aligned with the author domain, with semantics similar to [RFC7489].¶
At the time of this writing, this method is implemented by Courier-MTA [Courier-MTA]. An outline of the implementation is given in Appendix B.¶
The result of the method states how the query did, up to the interpretation of the returned data.¶
The method has four possible results:¶
Note that there is no "fail" result.¶
The following ptype.property items define how the data provided by the whitelist lookup can be saved.¶
This is a generic property stating whether the relevant data was validated using DNSSEC [RFC4033]. For the present method, the relevant data consists of the reported policy properties above or, if the method result is "none", their nonexistence. This property has three possible values:¶
According to [RFC5782], TXT records describe the reason why IP addresses are listed in a DNSWL. An example of a DNSWL whose TXT records contain the domain name of the organization assignee of the sending IP is given in Appendix B. The domain name would correspond to the DNS domain name used by or within the Administrative Management Domain (ADMD) operating the relevant MTA, sometimes called the "organizational domain". In that case, the authentication provided by this method is equivalent to a DomainKeys Identified Mail (DKIM) signature [RFC6376] or an SPF check host [RFC7208], if the DNSWL is trusted.¶
According to a DNSWL's policy, attributing responsibility of an IP address to an organization may require something more than a mere PTR record consistency. If no domain names can be responsibly associated to a given IP address, for example, because the IP address was added without direct involvement of the organization concerned, DNSWLs can use a subdomain of .INVALID [RFC2606] where the leftmost label hints at why an address is whitelisted. For example, if the address 192.0.2.38 was added by the list managers solely based on their knowledge, the corresponding TXT record might be AUTOPROMOTED.INVALID so as to avoid explicitly identifying an entity that didn't opt in.¶
Following the example of Multicast DNS (see the second paragraph of Section 16 of [RFC6762]), names containing non-ASCII characters can be encoded in UTF-8 [RFC3629] using the normalization form canonical composition (NFC), as described in "Unicode Format for Network Interchange" [RFC5198]. Inclusion of unaltered UTF-8 TXT values in the header entails an environment compatible with Email Address Internationalization (EAI) [RFC6530].¶
DNS queries with a QTYPE of ANY may lead to inconsistent replies, depending on the cache status. In addition, ANY is not "all", and the provisions for queries that have QTYPE=ANY [RFC8482] don't cover DNSxLs. A mail server can issue two simultaneous queries, A and TXT. Otherwise, a downstream filter can issue a TXT query on its own, if it knows that an A query was successful and that the DNSWL serves useful TXT records. It is unlikely that TXT records exist if a query for QTYPE A brought a result of "none".¶
IANA maintains the "Email Authentication Parameters" registry with several subregistries. IANA has made the assignments set out in the following sections.¶
IANA has created four new entries in the "Email Authentication Methods" registry as follows.¶
Method | Definition | ptype | property | Value | Status | Version |
---|---|---|---|---|---|---|
dnswl | RFC 8904 | dns | zone |
DNSWL publicly accessible query root domain¶ |
active | 1 |
dnswl | RFC 8904 | policy | ip |
type A response received (or a quoted, comma-separated list thereof)¶ |
active | 1 |
dnswl | RFC 8904 | policy | txt | type TXT query response | active | 1 |
dnswl | RFC 8904 | dns | sec | one of "yes" for DNSSEC authenticated data, "no" for not signed, or "na" for not applicable | active | 1 |
IANA has created a new entry in the "Email Authentication Property Types" registry as follows.¶
ptype | Definition | Description |
---|---|---|
dns | RFC 8904 | The property being reported belongs to the Domain Name System. |
IANA has created four new entries in the "Email Authentication Result Names" registry as follows.¶
Auth Method | Code | Specification | Status |
---|---|---|---|
dnswl | pass | RFC 8904 | active |
dnswl | none | RFC 8904 | active |
dnswl | temperror | RFC 8904 | active |
dnswl | permerror | RFC 8904 | active |
Some DNSWLs that provide for free access below a given quota are known to return special codes to signal that the quota has been exceeded (for example, 127.0.0.255). If the MTA cannot interpret that value, that case results in a false positive. It can accept messages that it would otherwise reject. A DNSWL-specific module would realize this fact and call for human intervention.¶
Returning an RCODE 5 (REFUSED) conveys the concept that the query is "unauthorized" and human intervention required.¶
The dns.sec property is meant to be as secure as DNSSEC results. It makes sense to use it in an environment where the DNSSEC validation can succeed.¶
Section 7 of [RFC4033] examines various ways of setting up a stub resolver which either validates DNSSEC locally or trusts the validation provided through a secure channel. For a different class, it is possible to set up a dedicated, caching, dnssec-enabled resolver reachable by the mail server through interprocess communication on 127.0.0.1. In such cases, the property dns.sec=yes corresponds to the Authenticated Data (AD) bit in the DNS response header.¶
When the response contains no DNSSEC data, a security-aware resolver seeks a signed proof of the nonexistence of a DS record at some delegation point. If no error is returned, the zone is unsigned and dns.sec=no can be set. The Security Considerations section of [RFC3225] states:¶
The absence of DNSSEC data in response to a query with the DO bit set MUST NOT be taken to mean no security information is available for that zone as the response may be forged or a non-forged response of an altered (DO bit cleared) query.¶
If the application verifies the DNSSEC signatures on its own, it effectively behaves like a validating stub resolver and hence can set dns.sec correspondingly.¶
When the data are downloaded in bulk and made available on a trusted channel without using DNSSEC, set dns.sec=na or not at all. DNSWLs that publish bulk versions of their data can also sign that data, for example, using OpenPGP [RFC4880]. It is the responsibility of system administrators to authenticate the data by downloading and validating the signature. The result of such validation is not reported using dns.sec.¶
For DNSSEC, the considerations of Section 12 of [RFC4033] apply.¶
All of the considerations described in Section 7 of [RFC8601] apply. That includes securing against tampering all the channels after the production of the Authentication-Results header field.¶
In addition, the usual caveats apply about importing text from external online sources. Although queried DNSWLs are well-known, trusted entities, it is suggested that TXT records be reported only if, upon inspection, their content is deemed actionable and their format compatible with the computing environment.¶
The message went through a third party, fwd.example, which forwarded it to the final MTA. The mail path was not arranged beforehand with the involved MTAs; it emerged spontaneously. This message would not have made it to the target without whitelisting, because:¶
However, the target also implemented the last paragraph of Appendix D.3 of [RFC7208]. Its behavior hinges on the following DNS entries:¶
If mail.fwd.example had connected from address 192.0.2.1, then the query name would have been 1.2.0.192.list.dnswl.example. See full description in [RFC5782].¶
At connection time, because the remote IP address is whitelisted, the target MTA did not reject the message before DATA. Instead, it recorded the SPF fail result and indicated the local policy mechanism that was applied in order to override that result. Subsequent filtering verified DKIM [RFC6376].¶
At later stages, mail filters can reject or quarantine the message based on its content. A deeper knowledge of the policy values obtained from dnswl.example allows interpreting the values of policy.ip and weighing them against other factors so as to make better decisions.¶
Implementation details mentioned in this section have been stable for several years. Yet, this description is necessarily superficial, version dependent, and subject to change.¶
Courier-MTA [Courier-MTA] can be configured to look up DNSBL and DNSWL, with similar command-line switches:¶
-block=zone[=displayzone][,var[/n.n.n.n][,msg]] -allow=zone[=displayzone][,var[/n.n.n.n[,]]]¶
"zone" is the zone to be queried.¶
"displayzone" is only used for -allow; it is the value to be set in the dns.zone property.¶
"var" stands for the environment variable whose existence triggers a special action. The default variable names result in a conventional behavior implemented by Courier-MTA. By setting different environment variables, users can customize the behavior. Conventional behavior differs widely between -block and -allow. The former rejects the message; the latter produces Authentication-Results header fields.¶
The n.n.n.n IP address requires a precise A record response. If not given, any response results in setting the corresponding variable. If given, variables are set only if the response matches exactly. Such syntax provides for a very limited interpretation of the information encoded in A records. However, it is considered to be too complicated already. Even specifying a range, an enumeration of values, or a regular expression would require something beyond what a normal user would be willing to manage.¶
Finally, the trailing message, which overrides the 5xx SMTP reply for -block, is not used for -allow, except that its mere presence requires querying TXT records to be registered in policy.txt.¶
SPF is part of Courier-MTA's core. It is configured separately and provides for an "allowok" keyword to indicate to override rejection in case of SPF failure and -allow whitelisting.¶
A customary whitelist is defined in [DNSWL]. It serves A records encoded as follows:¶
They also serve TXT records containing the domain name followed by a URL pointing to further information about the relevant organization, such as what other IP addresses of theirs are being whitelisted. They don't use UTF-8.¶
[DNSWL] provides for free registration and free access below 100,000 queries per day. They use the special return code 127.0.0.255 exemplified above to signal that the quota has been exceeded. Although Courier-MTA itself does not recognize it, it has a mail filter (zdkimfilter, named after its main usage) where recognition of that code, as well as that of trustworthiness in the 4th octet, are hard-coded.¶
The description of the new ptype proposed in Section 4.2 says, "The property being reported belongs to the Domain Name System." That definition can broadly include any tag found in a domain's TXT record. For example, designers of authentication methods can agree that within a resinfo of a given method, any dns ptype refers to tags in the relevant DNS record, unless otherwise specified. So one could have, say:¶
Authentication-Results: example.com; spf=pass smtp.mailfrom=example.net dns.sec=y; dkim=pass header.i=@example.org header.b=jIvx30NG dns.s=tlsrpt¶
While dns.sec is defined above, albeit not for the spf method, the use of tlsrpt in the DKIM record is exemplified in Section 3 of [RFC8460]. The tag s= is part of the DKIM TXT record, not to be confused with the selector s=, which is part of a DKIM signature. Just like the latter can be reported as header.s because the DKIM header field is in the message header, it may make sense to report the former as dns.s because the DKIM DNS record is in the DNS.¶
NOTE: This is only a hint at what may become a consistent naming convention around the new ptype. In any case, any new property using this ptype requires its own formal definition. This document does NOT define the property dns.s=, let alone the service tlsrpt.¶