<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY I-D.kucherawy-dmarc-base  PUBLIC '' 'http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.kucherawy-dmarc-base.xml'>
<!ENTITY I-D.kucherawy-original-authres PUBLIC '' 'http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.kucherawy-original-authres.xml'>
<!ENTITY I-D.ietf-dane-smtp-with-dane  PUBLIC '' 'http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dane-smtp-with-dane.xml'>
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc compact="yes" ?>
<?rfc subcompact="yes" ?>
<?rfc toc="yes" ?>
<?rfc tocindent="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc iprnotified="yes" ?>
<?rfc autobreaks="no"?>
<?rfc strict="yes" ?>

<rfc category="exp" docName="draft-otis-tpa-label-01" ipr="trust200902">
  <front>
    <title abbrev="TPA-Label">Third-Party Authorization Label</title>

    <author fullname="Douglas Otis" initials="D." surname="Otis">
      <organization>Trend Micro</organization>
      <address>
        <postal>
          <street>10101 N. De Anza Blvd</street>
          <city>Cupertino</city>
          <region>CA</region>
          <code>95014</code>
          <country>USA</country>
        </postal>
        <phone>+1.408.257-1500</phone>
        <email>doug_otis@trendmicro.com</email>
      </address>
    </author>

    <author fullname="Daniel Black" initials="D." surname="Black">
      <organization/>
      <address>
        <postal>
          <street/>
          <region>Canberra ACT</region>
          <country>Australia</country>
        </postal>
        <email>daniel.subs@internode.on.net</email>
      </address>
    </author>

    <date month="May" year="2014"/>
    <area>Internet Area</area>
    <workgroup>Appsawg</workgroup>
    <keyword>TPA-Label</keyword>
    <keyword>Draft</keyword>

    <abstract>
      <t>This experimental specification proposes a Third-Party Authorization Label (TPA-Label) as a
        DNS-based method that allows Trusted Domains an efficient means to authorize acceptable
        Third-Party Domains. This method permits autonomous unilateral authorizations and uses
        scalable individual DNS transactions.</t>

      <t>A TPA-Label Resource Record transaction asserts an alignment exception to convey informally
        Federated Domains. It affords recipients a practical and safe means to extend Domain
        Alignment. Exceptions are managed by either the Trusted Domain, or their agent, seeking to
        avoid disruption of informal services enjoyed by their users. Third-Party Authorization of a
        Federated Domain eliminates a need to share private credentials.<vspace blankLines="1"/></t>
    </abstract>
    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
        "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
          <xref target="RFC2119"/>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>A TPA-Label Resource Record supports an authorization of separately validated domains. This
        added authorization step avoids a need to share private credentials. Also, it ensures each
        domain remains apparent and open to validation when establishing an informal federation of
        domains protecting Federated Domain Identities. To improve security, authorization records
        may also limit how they are to be applied.</t>

      <t>With TPA-Label Resource Records, mailing lists, among similar Third-Party Domain services,
        can indirectly assert protection of identities when the source domain is within an
        informally Federated Domain. Since mailing-lists receive differently formatted messages, a
        common practice is to convert multi-party conversations into consistent and compact formats
        facilitating the organization of the many multi-party conversations. Such processing often
        breaks any meaningful message signature. With the proposed scheme, trusting the federated
        message source can supersede broken alignment validation.</t>

      <t>Trusted Domains can seek to ensure the domains they federate protect the Federated
        Identity. In situations where the Trusted Domain cannot be confirmed, TPA-Labels are able to
        signal which domains are within the Trusted Domain's informally established federation. When
        a user wishes to utilize an informal Third-Party Domain service, it is both logical and
        desirable to retain the original Federated Identity to better convey who substantially
        created message content. Not retaining this identity would otherwise prohibit subsequent
        review of prior exchanges. However, when recipients wish to determine whether to trust the
        Federated Identity, Domain Alignment with the validated source may not exist. TPA-Labels can
        indicate whether the source domain has been informally federated by the Trusted Domain.</t>
    </section>
    <section title="Terminology" anchor="terms">
      <t>Please see <xref target="RFC5598"/> for general email terminology.</t>
      <t>The following additional terms are used:</t>
      <t>
        <list style="hanging">
          <t anchor="D-TDA" hangText="Transparent Domain Authorization:"> Third-Party Domains
            validating as the Trusted Domain represent a type of transparent authorization. This
            method normally depends on securely sharing private details between domain owners and
            providers. However, private sharing between different administrative domains is
            expensive and carries some risk a security breach may result in the wrong administration
            being held accountable or more resources being placed in peril.<vspace blankLines="2"
            /></t>

          <t anchor="D-TD" hangText="Trusted Domain:"> Often a visible domain that acts as a basis
            for acceptance and/or subsequent actions. For DMARC, this is the fully qualified domain
            name found in the From header field.<vspace blankLines="2"/></t>

          <t anchor="D-AD" hangText="Author Domain:"> See Section 3 of DMARC (<xref
              target="I-D.kucherawy-dmarc-base"/> specifying the domain of the From header field
            which represents the Trusted Domain.<vspace blankLines="2"/></t>

          <t anchor="D-FD" hangText="Federated Domain:"> A domain (among possibly others) working in
            concert with the Trusted Domain authorized as protecting Federated Identifiers.<vspace
              blankLines="2"/></t>

          <t anchor="D-FI" hangText="Federated Identity:"> Identity protected by a Federated Domain.
            In the case of DMARC, this identity is contained in the From header field. <vspace
              blankLines="2"/></t>

          <t anchor="D-DA" hangText="Domain Alignment:"> Strict alignment requires matching the
            Trusted Domain. Relaxed alignment allows source domains to be a sub-domain of the
            Trusted Domain.<vspace blankLines="2"/></t>

          <t anchor="D-TPA" hangText="Third-Party Authorization:"> A different domain authorized by
            the Trusted Domain.<vspace blankLines="2"/></t>

          <t anchor="D-ITPS" hangText="Informal Third-Party Service:"> A Service not by the Trusted
            Domain that does not require administrative cooperation for users to independently
            establish their own access credentials.<vspace blankLines="2"/></t>

          <t anchor="D-TPS" hangText="Third-Party Service:"> A Service not by the Trusted Domain.
              <vspace blankLines="2"/></t>

          <t anchor="D-TPD" hangText="Third-Party Domain:"> A domain that is not the Trusted
              Domain.<vspace blankLines="2"/></t>

          <t anchor="D-TPALA" hangText="TPA-Label Authorization:"> The referencing domain which
            meets the validation and header field content requirements of the resolved TPA-Label
            Resource Record is thereby authorized by the Trusted Domain.<vspace blankLines="2"/></t>

          <t anchor="D-TLLD" hangText="TPA-Label Listed Domain, TPA-LLD:"> TPA-Label Listed Domain,
            TPA-LLD, is a TXT Resource Record referenced with the hash value of the domain being
            authorized. This Resource Record is published within a Trusted Domain. When a "tpa" tag
            exists, the referencing domain (the domain used to generate the label) must be within
            the listed domains. When the "tpa" tag does not exist, the referenced domain is
            presumed. The "scope" tag may stipulate a required existence of additional header
            fields, or indicate alternate domain validation methods to be applied against specific
              elements.<vspace blankLines="2"/></t>
        </list></t>
    </section>

    <section title="Domain Validation Issues">
      <t>Changing the validated domain, the one referenced by SPF <xref target="RFC7208"/>, or the
        one adding a DKIM <xref target="RFC6376"/> signature, is not a problem since it is rare for
        acceptance to be based on From header field Domain Alignment. However, when acceptance is
        based on the From header field alignment, as in the case of DMARC <xref
          target="I-D.kucherawy-dmarc-base"/> using either SPF or DKIM, this can disrupt many
        Third-Party Services. The disruption becomes egregious when messages from the domain's own
        users are rejected based on the level of this domain's asserted alignment practices. At the
        strictest alignment level, an erroneous assertion not only disrupts messages from their
        users, it can also affect subscriptions for other users of the Third-Party Service.</t>

      <t>DKIM, unlike SPF, permits better retention of From/signature alignment where only the From
        header field could be signed. Nevertheless, the integrity of the original DKIM signature is
        likely affected by message flattening, inclusion of Subject tags, or appended list footer
        information. Just signing the From header field is not a practical solution, because it
        would expose this message fragment to replay abuse, even when given short signature
        expiry.</t>

      <t>TPA-Label authorization may individually authorize domain validation methods. This may
        either increase or decrease the number of validation methods normally used. For example, a
        virtual server may share an IP address with thousands of different domains. Its
        authorization may need to exclude IP addresses as a basis for validation. In the TPA-Label
        scheme, unless a validation method is asserted, no changes to the domain validation process
        should be assumed.</t>
    </section>

    <section title="Incomplete Assertions Not Congruent with SMTP">
      <t>A few large domains have had a high percentage of user accounts compromised. These events
        have given malefactors access to prior private exchanges and contact lists. Even after
        accounts had been reclaimed, malefactors continue sending convincing spoofed messages from
        other sources. To mitigate harm, some domains have asserted Domain Alignment practices
        similar to those used by domains that only emit transactional messaging where a
        recommendation is normally heeded. In addition, some domains also recommended "reject"
        rather than "quarantine" as a misalignment response. In conjunction with misleading
        alignment assertions, rejection becomes a highly disruptive choice.</t>

      <t>It is unfair to place a burden on receivers and expect them to be cooperative. Trusted
        Domains have access to information that receivers do not. This information is necessary to
        prevent the disruption of otherwise legitimate messages from their users, and it can be
        passed on to receivers using TPA-Labels. Prior to making alignment assertions that are
        likely to disrupt services carrying legitimate messages, Trusted Domains should publish
        TPA-Labels that list their compilation of Third-Party Domains conveying their users'
        messages. When Trusted Domains proactively guard against disruption of legitimate messages,
        receivers are then more likely to cooperate with their recommendations.</t>
    </section>

    <section title="Why DMARC">
      <t>Deterrents based upon reputation and/or path based scoring strategies that utilize a
        variety of originating header fields has proved ineffective. The header fields often remain
        invisible to recipients, and contain domains exploited for periods measured in hours, to
        avoid any Whack-A-Mole like response. Even long term reputations have issues due to an
        intermix of messages from compromised accounts. Content filtering is unable to keep up with
        the polymorphic abuse. Few recipients will inspect the stack of message header fields, or be
        able to draw useful conclusions from a profusion of unfriendly information. As a result,
        many recipients deal with abuse by sorting messages into groups based on assumed sources
        found in a few originating header fields.</t>

      <t>DMARC represents an open registry that offers domain specific guidance for DKIM/SPF
        alignment sending practices to determine whether messages should be delivered, quarantined,
        or refused. However, appropriate actions become unclear whenever Third-Party Services are
        involved. Although DMARC warns of a potential for disruption, the specific handling
        requested by DMARC is very limited. DMARC expects receivers to devise their own special
        handling to mitigate disruptions that DMARC assertions might cause for legitimate messaging.
        This is unfortunate, since the necessary feedback is given to the Trusted Domain and not to
        the cooperating receivers. TPA-Labels can ensure recipients are provided this necessary
        information.</t>

      <t>Administrative domains, that assert all of their outbound message sources can be validated
        as having aligned domains, offer significant forensic value. However, messages where domains
        are not in alignment remain a potential issue. Only domains offering messages of a
        transactional nature do not benefit from the use of TPA-Labels.</t>

      <t>This document describes how any Trusted Domain publishing DMARC records can autonomously
        authorize other validated domains. TPA-Labels offer secondary compliance options whenever
        authorized exceptions are needed to permit the use of Third-Party Domains. The intended
        purpose of TPA-Label Resource Records is to improve acceptance rates of genuine messages, to
        minimize DNS use, to minimize success rates for phishing, to improve sorting protections,
        and to minimize a recipient's administrative costs.</t>

      <t>TPA-Label Resource Records authorize Third-Party Domains and services to extend compliance
        options for asserted practices defined by <xref target="I-D.kucherawy-dmarc-base"/>.
        Domains, that both reference and are listed, and also comply with a TPA-Label resource
        record, should be considered equivalent to the authorizing Trusted Domain when assessing
        compliance with DMARC asserted practices.</t>
    </section>

    <section title="TPA-Label Listed Domain, TPA-LLD,">
      <t>TPA-Label Listed Domain, TPA-LLD, is a TXT resource record referenced with a TPA-Label
        published within a Trusted Domain. When a "tpa" tag exists within the TXT resource record
        located at the TPA-Label, the referencing domain (the domain used to generate the label)
        must be within the listed domain. When the "tpa" tag does not exist, the referenced domain
        is presumed listed. The "scope" tag may stipulate existence of additional header fields, or
        indicate alternate validation methods applied against specific email elements.</t>

      <t>Third-Party Domain validation might use a DKIM signature or confirm the Authorized Domain
        using specific methods with various path related email elements. The default assertion for
        scope is 'd' and 'm', indicating DKIM or the Mail From parameter processed by SPF confirms
        the Authorized Domain when no other method is specified. The 'S' and 'L' scope does not
        confirm the domain, but requires at least one Sender or List-ID header field to hold the
        identity of the Authorized Domain respectively. The 'e', 'h', and 't' indicate specific
        alternative methods using message elements to confirm the Authorized Domain. When any method
        scope is asserted (denoted by a lower case letter), methods not listed should not be
        considered to provide valid results. Being compliant with TPA-LLD allows the referencing
        domain to informally act on behalf of the Trusted Domain. Per <xref target="RFC5321"/>,
        domain name comparisons, as well as TPA-Labels, are case insensitive.</t>
    </section>

    <section title="TPA-Label Resource Record Authorization Considerations">
      <t>When a Trusted Domain is not within a DKIM or SPF validated domain, the TPA-LLD scheme can
        extend Domain Alignment compliance. The TPA-LLD scheme with an 'S', or 'L' scope requires
        the respective Sender header field or a List-ID identifier of the List-ID header field to
        exist for at least one of the scopes, and to contain a domain within the TPA-LLD for
        authorization to be valid. The 'd' scope permits validations based upon the DKIM signing
        domain. The 'm' scope permits validations based upon the return path (Mail From) domain. The
        'e', 'h', and 't' scopes permit acceptance based upon validation of the client hostname
        (EHLO/HELO). </t>

      <t>The 'S' and 'L' scopes support message sorting. Any matching header field with a domain
        within the TPA-LLD allows recipients to differentiate sources, which satisfies requirements
        for any other 'S' or 'L' scope. The 'S' and 'L' scopes provide Trusted Domains a means to
        limit domain authorizations.</t>

      <t>The TPA-LLD scheme plays the role of only qualifying acceptable domains with the goal of
        improving delivery acceptance, such as messages from specific mailing-lists. The TPA-LLD
        authorization scheme only requires that DNS publications be made by the Trusted Domain, even
        when the sending domains and the Trusted Domain differ. This approach eliminates a need to
        exchange private information thus protecting the domain's integrity. Before TPA-LLD
        authorization is deployed, the Trusted Domain should be assured by domains being authorized
        that appropriate measures are in place to validate those submitting messages and ensure the
        Federated Identity is protected.</t>

      <t>Retaining validation and authorization for the From, Sender, and List-ID header fields, and
        being able to ensure Third-party inclusion of a Sender or List-ID header fields, enhances
        protections afforded by message sorting. This protection reduces susceptibility to deceptive
        look-alike phishing attempts. Use of subdomains that assert less stringent practices might
        inadvertently combine with those having more stringent practices when sorting is based upon
        parent domains. Consistently using the same domain prevents possible confusion that could be
        exploited to deceive recipients.</t>

      <t>TPA-Label authorization will not ensure all possible spoofing is prevented. However, by
        permitting broader use of strict alignment practices, this should generally reduce the level
        of spoofing over what might be otherwise allowed. Authorized third party messages SHOULD NOT
        receive annotations that indicate the message contains validated identities. The TPA-LLD
        scope SHOULD include the 'S' or 'L' scope where appropriate to allow recipients a means to
        isolate and distinguish different message sources.<vspace blankLines="100"/></t>
    </section>

    <section anchor="eval-3p-tpa-domain" title="Evaluating the Third-Party Domain">
      <t>A Trusted Domain deploying a TPA-Label Resource Record does so on a trust basis. Reasons
        for deploying TPA-Label Resource Records might be to allow deployment of more stringent
        DMARC records while also utilizing Third-Party Services.</t>

      <t>When an authorized Third Party domain does not employ DKIM or SPF or does not include
        Authentication-Results header fields <xref target="RFC7001"/> or perhaps <xref
          target="I-D.kucherawy-original-authres"/> or its "X-" version could allow authorizations
        to be exploited.</t>

      <t>While conceivably Domain Alignment might just rely on the content of the
        Original-Authentication-Results header, whether to trust this, or any other message content
        can not be based on the mere acceptance of the message alone. Whether false content even
        effects message acceptance would be difficult to determine. Only the Trusted Domain is able
        to make this type of determination which they can then share in their TPA-Label.</t>

      <section title="Third Party Authorization - Closed Mailing List Example">
        <t>The Trusted Domain wants to deploy a TPA-Label Resource Record for a mailing list with a
          closed posting policy. The mailing list redistributes email which breaks the Trusted
          Domain Alignment, and the mailing list offers a means to validate the mailing list domain
          and includes an Authentication-Results header field for posted messages. The closed
          posting policy can be enforced by requiring subscribers to validate control of their
          Author Addresses by responding to encoded "pingback" email sent to these addresses.</t>

        <t>Since the mailing list validates their domain as indicated in the TPA-Label, and
          validates control of the posted message Author Address, and includes
          Authentication-Results header fields, and includes a List-ID header field, the referenced
          TPA-Label Resource Record can include an 'L' scope value to stipulate that the Third-Party
          Domain messages contain an authorized List-ID domain.</t>
      </section>

      <section title="Third Party Authorization - Open Mailing List Example">
        <t>The Trusted Domain wants to deploy a TPA-Label Resource Record for a mailing list with an
          open posting policy. The mailing list redistributes email in a way that breaks Trusted
          Domain alignment, does not post from an Author Address not in compliance with DMARC,
          offers a means to validate the mailing list domain, and it includes an
          Authentication-Results header field for posted messages.</t>

        <t>Since the mailing list validates the domain as indicated in the TPA-Label, and is
          configured to include Authentication-Results header fields and possibly the
          Original-Authentication-Results <xref target="I-D.kucherawy-original-authres"/>, and
          includes a List-ID header field, the referenced TPA-Label Resource Record can include an
          'L' scope value to stipulate the Third-Party Domain messages contain an authorized List-ID
          domain.</t>
      </section>

      <section title="Third Party Authorization Example - Sender Header Field">
        <t>Trusted Domain "example.com" wishes to temporarily employ the service agency
          "temp.example.org" to handle overflow secretarial support. The agency "temp.example.org"
          sends email on behalf of the executive staff of "example.com" and adds the Sender header
          field of "secretary@temp.example.org" in the email.</t>

        <t>Since "temp.example.org" only allows its own staff to email through its server which adds
          "temp.example.org" DKIM signatures, a TPA-LLD can include the "temp.example.org" domain
          with an 'S' and 'd' scope to specifically authorize DKIM signed messages containing the
          Sender header field, to help ensure these messages are not handled as phishing
          attempts.</t>
      </section>

      <section title="Services Lacking DKIM Signatures">
        <section title="Abuse and DSN Reporting">
          <t>There is likely little interest for an otherwise uninvolved domain to receive a massive
            number of bogus messages being returned as feedback. Often the purpose of feedback is to
            discover compromised systems or accounts actively being exploited in some manner. Unless
            the Trusted Domain is confirmed as having handled or authorized the handling of the
            message, only statistics and samples should be reported to the associated Autonomous
            System <xref target="RFC1930"/>, and perhaps to the Trusted Domain when interest is
            expressed.</t>

          <t>The 'd', 'e', 'h', 'm', and 't' scope options within the TPA-LLD records allow the
            Trusted Domain to be associated through various methods. In this case, appropriate DSN
            or abuse reporting to the Trusted Domain is better assured as well.</t>
        </section>

        <section title="Third Party Authorization Example - SMTP Host">
          <t>Trusted Domain "example.com" makes use of invite services. This service does not
            utilize DKIM, where the host name given by the EHLO command is "invite.example.net". The
            Trusted Domain can authorize the domain "invite.example.net" or "example.net" with the
            scope of 'e' to improve acceptance of messages that are sent on behalf of "example.com"
            from this outbound server.<vspace blankLines="1"/></t>
        </section>

        <section title="Third Party Authorization Example - Return Path">
          <t>Trusted Domain "example.com" makes use of tell-a-friend services. This service does not
            utilize DKIM with its own return path as "customer@taf.example.net" in the SMTP
            exchange. The Trusted Domain can authorize the domain "taf.example.net" with the scope
            of 'm' to improve acceptance of messages that are sent on behalf of "example.com" from
            this outbound server.<vspace blankLines="1"/></t>
        </section>

        <section title="Use of Path Authorization">
          <t>Those using validations related to 'e', 'h', 'm' scope options should not authorize
            domains requiring more than an average number of network transactions. Those
            implementing DMARC should also limit the number of DNS transactions attempted, otherwise
            this could negatively impact unrelated domains when evaluating path related
              validation.<vspace blankLines="1"/>
            <list>
              <t>Methods that create subsequent transactions based upon the macro expansion of
                email-address local-parts should not be used. Libraries that process SPF <xref
                  target="RFC7208"/> record scripts may invoke a large number of DNS transactions
                from cached records, and target unrelated domains with queries modulated by the
                local-part component through receiver macro expansion.</t>
            </list></t>
        </section>
      </section>
    </section>

    <section title="DNS Representation">
      <t>The receiver obtains domain authorizations with a DNS query for an IN class TXT TPA-Label
        Resource Record located below the "_smtp._tpa.&lt;Trusted-Domain&gt;" location. The
        TPA-Label itself is generated by processing the domain in question, which normally matches
        the DKIM signature's "d=" parameter. The Trusted Domain provides authorization for other
        domains with the existence of a TPA-Label TXT resource record. When a "tpa" tag value
        exists, it MUST include the referenced domain before authorization is valid. This represents
        an informal authorization on behalf of the Trusted Domain which can be limited by the
        "scope" tag value for specific message elements.</t>

      <t>A Trusted Domain may wish to delegate the listing of Third-Party Services to a different
        administrative domain. Ideally, this would be accomplished by delegating the
        _tpa.&lt;Trusted-Domain&gt; zone to the administrative entity handling publication of
        TPA-Label Resource Records. This delegation could also be done unilaterally with a DNAME
          <xref target="RFC6672"/> resource record published at
        _smtp._tpa.&lt;Trusted-Domain&gt;.</t>

      <t>Character-strings contained within the TXT resource record are concatenated into forming a
        single string. A character-string, as defined in <xref target="RFC1035"/> Section 3.3 for
        resource records, is a single length octet followed by that number of characters treated as
        binary information. <vspace blankLines="1"/></t>

      <t>The TPA-Label Resource Records should be located at these domains:<list>
          <t/>
          <t>&lt;TPA-Label&gt;._smtp._tpa.&lt;Trusted-Domain&gt;.</t>
        </list>
      </t>
    </section>

    <section title="TPA-Label and Tag Syntax Definitions">
      <t>Augmented BNF for Syntax Specifications:</t>
      <figure title="">
        <artwork name="" type="" height="" width="" xml:space="preserve">
          asterisk = %x2A ; "*"
          dash = %x2D ; "-"
          dot = %x2E ; "."
          underscore = %x5F ; "_"
          ANY = asterisk dot ; "*."
          dns-char = ALPHA / DIGIT / dash
          id-prefix = ALPHA / DIGIT
          label = id-prefix [*61dns-char id-prefix]
          sldn = label dot label
          base-char = (dns-char / underscore)
          domain = *(label dot) sldn

          FWS       =  ([*WSP CRLF] 1*WSP) ; omits RFC5322 obs-FWS
          tag-list  =  tag-spec 0*( ";" tag-spec ) [ ";" ]
          tag-spec  =  [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS]
          tag-name  =  ALPHA 0*ALNUMPUNC / "v" / "scope" / "tpa"
          tag-value =  [ tval 0*( 1*(WSP / FWS) tval ) ]
                          ; WSP and FWS prohibited at beginning and end
          tval      =  1*VALCHAR
          VALCHAR   =  %x21-3A / %x3C-7E
                          ; EXCLAMATION to TILDE except SEMICOLON
          ALNUMPUNC =  ALPHA / DIGIT / "_"
        </artwork>
      </figure>
    </section>

    <section title="TPA-Label Generation">
      <t>The TPA-Label is generated by nesting functions as follows:</t>
      <t><list>
          <t>"base32" function is defined in <xref target="RFC4648"/>.<vspace blankLines="1"/></t>
          <t>"sha1" function is defined in <xref target="FIPS.180-2.2002"/>.<vspace blankLines="1"
            /></t>
          <t>"lcase" converts upper-case ALPHA characters to lower-case.<vspace blankLines="1"/></t>
          <t>"tpa-domain" is normally the "d=" tag value defined in Section 3.5 of <xref
              target="RFC6376"/>.<vspace blankLines="1"/></t>
          <t> &lpar;underscore&rpar; base32&lpar; sha1&lpar; lcase&lpar;tpa-domain&rpar;&rpar;&rpar;
          </t>
        </list><vspace blankLines="0"/></t>

      <t>The TPA-Label is created from the hash value returned by the "sha1" function of the
        tpa-domain expressed in lower case ASCII. Any terminating period is not included with the
        tpa-domain, as indicated by the ABNF definition.<vspace blankLines="1"/><list>
          <t>Note: No newline character, 0x0A, is to be appended to the end of the domain name, as
            might occur with the command line generation of sha1 values. For example, these command
            line appended newlines can be avoided by using the 'echo -n" option.</t>
        </list></t>
      <t>The label encoding process inputs the hash as a byte stream of four 40-bit data blocks
        where each data block outputs 8 encoded characters. Proceeding from left to right, a 40-bit
        input group is formed by concatenating 5 bytes. The 40-bit input is then treated as 8
        concatenated 5-bit groups, each of which is translated into a single digit of the base32
        alphabet. The bit stream is ordered with the most-significant-bit first, being the
        high-order bit of the first byte. The entire output is then concatenated first to last, left
        to right, into 32 characters prefixed with an underscore.</t>
    </section>

    <section anchor="tpalabel-rr" title="TPA-Label TXT Resource Record Structure">
      <t>Every TPA-Label TXT resource record MUST start with the version tag, so the first six
        characters of the record are lowercase "v=tpa1", TPA-Label syntax descriptions for
        additional tags follow the tag-value syntax described in Section 3.2 of <xref
          target="RFC6376"/>. Unrecognized tags and tags with illegal values MUST be ignored. In the
        ABNF below, the WSP token is inherited from <xref target="RFC5322"/>. The ALPHA and DIGIT
        tokens are imported from <xref target="RFC5234"/>.</t>

      <t>The tags used in TPA-Label Resource Records are as follows:</t>

      <texttable title="TPA-Label Tags">
        <ttcol align="center" width="16%">Tag</ttcol>
        <ttcol align="left">Function</ttcol>
        <!--  -->
        <c>v</c>
        <c>Label Version (version-tag)</c>
        <!--  -->
        <c>scope</c>
        <c>Authorization Scope List (scope-tag)</c>
        <!--  -->
        <c>tpa</c>
        <c>Authorized Domains List (tpa-tag)</c>
        <!--  -->
      </texttable>

      <t><vspace blankLines="100"/></t>

      <texttable title="TPA-Label Scope Values">
        <ttcol align="center" width="10%">scope values</ttcol>
        <ttcol align="left">Field or Parameter</ttcol>
        <ttcol align="left">Method</ttcol>
        <!--  -->
        <c>L</c>
        <c>List-ID Header Field</c>
        <c>Match List-ID Identifier</c>
        <!--  -->
        <c>S</c>
        <c>Sender Header Field</c>
        <c>Match Address Domain</c>
        <!--  -->
        <c>d</c>
        <c>DKIM Signature</c>
        <c>Match Signature Domain</c>
        <!--  -->
        <c>e</c>
        <c>SMTP Hostname</c>
        <c>Resolve Hostname IP Addr</c>
        <!--  -->
        <c>h</c>
        <c>SMTP Hostname</c>
        <c>Pass SPF with Hostname</c>
        <!--  -->
        <c>m</c>
        <c>MailFrom</c>
        <c>Pass SPF with MailFrom</c>
        <!--  -->
        <c>t</c>
        <c>SMTP Hostname</c>
        <c>Cert of Hostname</c>
      </texttable>
    </section>

    <section anchor="tpalabelrr-defn" title="TPA-Label Resource Record Definition">
      <t>Tags in the TPA-Label Resourse Record are shown below. The ver-tag MUST be present as the
        left most tag. Unrecognized tags MUST be ignored.</t>
      <t>TPA-Label Resource Record Definition<list>

          <t>tpalabelrr = v-tag [";"] 0*( 1*(WSP) tag-list) ] </t>
        </list>
      </t>
    </section>

    <section anchor="v-defn" title="TPA-Label Resource Record Version">
      <t>Label Version (Required). This tag defined the version of the TPA-Label. Only recognized
        scope values offer any form of DMARC authorization.</t>
      <t>"scope" tag <list>
          <t>v-tag = %76.3d.74.70.61.31 ; "v=tpa1"</t>
        </list>
      </t>
    </section>

    <section anchor="scope-defn" title="TPA-Label Resource Record Scope Syntax">
      <t>Authorization Scope List (Optional). This tag defines a list of scoping assertions for
        various email-address locations within the message. Only recognized scope values offer any
        form of DMARC authorization.</t>
      <t>"scope" tag <list>
          <t>as_val = "L" / "S" / "d" / "e" / "h" / "m" / "t"</t>
          <t>as-list = %x73.63.6f.70.65 *WSP "=" [ as_val 0*( 1*(WSP) as_val )]</t>
        </list>
      </t>

      <section anchor="tpa-defn" title="Authorized Validated Domains">
        <t>Authorized validated domain list. (optional) This tag, when present, MUST repeat all or
          portions of the domain encoded within the TPA-Label Resource Record. This option ensures
          the proper handling of possible hash collisions. When a domain is prefixed with the "*."
          ANY label, then all subdomains of this domain are to be considered included within the
          list. When the 'tpa' tag is not present or has no value, it should be assumed to compare
          with the domain used to generate the TPA-Label. The purpose of the ANY label is to reduce
          the size of the resource records. Containing the entire string to confirm hostnames or
          List-ID content is unnecessary. The hash label must still be an exact match of the domain
          authorized.</t>

        <t>Use of the ANY label is not intended to support wildcards for referencing hash labels. No
          wildcard labels are to be used below the "_tpa." label to access DNS resources.</t>

        <t>"tpa" tag <list>
            <t>ad_val = [ANY] domain</t>
            <t>ad-list = %x74.70.61 *WSP "=" [ ad_val 0*( 1*(WSP) ad_val )]</t>
          </list>
        </t>
      </section>

      <section title="Header Dependent Authorizations">
        <section anchor="scopeL-defn" title="List-ID Header Field">
          <t>The "L" scope asserts that authorization is valid only when a List-ID identifier of the
            List-ID header field <xref target="RFC2919"/> contains a domain that is within a domain
            listed in the TPA-LLD "tpa" tag.</t>
          <t>The syntax of the List-Id header field is as follows:<list>
              <t>list-id-header = "List-ID:" [phrase] "&lt;"identifier"&gt;"CRLF<vspace
                  blankLines="1"/></t>
            </list></t>
        </section>

        <section anchor="scopeS-defn" title="Sender Header Field">
          <t>The "S" scope asserts that authorization is valid only when the domain in the Sender
            header field is within the TPA-LLD.<vspace blankLines="1"/></t>
        </section>

        <section title="Combined 'L' or 'S' Scopes">
          <t>When combined, the scopes 'L' and 'S' require that either a List-ID identifier of the
            List-ID header field or the Sender header field must contain a domain within the TPA-LLD
            for the authorization to be valid.</t>
        </section>
      </section>

      <section anchor="scopeD-defn" title="DKIM signed domain">
        <section title="DKIM signed">
          <t>The "d" scope asserts that messages carrying the Trusted Domain within the From header
            field are authorized to be signed by the TPA-LLD.<vspace blankLines="1"/></t>
        </section>
      </section>

      <section anchor="scopeE-defn" title="SMTP Host domains">
        <t>The "e" scope asserts that host names given in <xref target="RFC5321"/> EHLO or HELO
          commands within TPA-LLD is authorized when the hostname resolves the server's IP address.
            <vspace blankLines="1"/>
        </t>
      </section>

      <section anchor="scopeH-defn" title="SMTP Host domains">
        <t>The "h" scope asserts that host names given in <xref target="RFC5321"/> EHLO or HELO
          commands within TPA-LLD is authorized only when this hostname submitted to an SPF <xref
            target="RFC7208"/> process returns pass. <vspace blankLines="1"/></t>
      </section>
      <section anchor="scopeM-defn" title="MailFrom Parameter">
        <t> The "m" scope asserts that an email-address domain in the <xref target="RFC5321"/> MAIL
          command within a TPA-LLD is authorized only when this email-address submitted to an SPF
            <xref target="RFC7208"/> process returns pass. <vspace blankLines="1"/>
        </t>
      </section>

      <section anchor="scopeT-defn" title="SMTP Host domains">
        <t>The "t" scope asserts that host names given in <xref target="RFC5321"/> EHLO command
          after <xref target="RFC3207"/> negotiation where the Cert DNS-ID domain is within TPA-LLD
          is authorized. It will also be interesting to see whether <xref
            target="I-D.ietf-dane-smtp-with-dane"/> establishes a way to authenticate sending
          domains. </t>

        <t>Note to RFC Editor: Remove this comment before publishing.<list>
            <t>Currently, no general practice employs certificates to confirm the domain of the
              client initiating a connection. This may be needed for clients within IPv6 IP address
              space where tunneling, carrier grade NATs, and rapid space assignment without any
              practical reverse mapping reduces the effectiveness of IP address based
              reputations.</t>

            <t>There is an existing TLS option for SMTP and an ongoing effort to standardize
              automated server confirmation. It might be possible to leverage this effort to
              establish practices used at the client. See conversations defined in <xref
                target="RFC4954"/> Section 4. For information related to ongoing server related
              efforts see:</t>
            <t><xref target="RFC6125"/> and <xref target="RFC6698"/>
            </t>
          </list></t>
      </section>
    </section>

    <section anchor="tpa-qt" title="TPA-Label Resource Record Query Transactions">
      <t>The discovery of TPA-Label Resource Records need not be subsequent to the discovery of the
        DMARC record. However, when no DMARC record is discovered which includes the tag value of
        "tpa", the verifier MAY assume no TPA-Label Resource Records have been published. Otherwise,
        when there is no Trusted Domain validation, the discovery of TPA-Label Resource Records
        should be attempted. </t>
    </section>

    <section anchor="auth-meaning" title="TPA-Label Resource Record Compliance Extension">
      <t>The signing practice compliance assessment of Third Party Signatures is a discretionary
        operation performed by the verifier. For messages that do not have valid Trusted Domain
        alignment, a verifier may decide to assess compliance for Third Party messages when there is
        a DMARC tag of "tpa". Elements then referenced in the TPA-Label scope values of "d", "m",
        "e", "h", "t" are to be checked in their listed succession. One of the following sets of
        conditions MUST be met for the result to be considered a pass:</t>

      <t>For Third Party DKIM signatures, the following represents the set of conditions to be
        checked:</t>
      <t>
        <list style="symbols">
          <t>The Third Party Signature MUST validate according to <xref target="RFC6376"/>.</t>
          <t>A TXT resource record, referenced by a TPA-Label created by the DKIM signature "d="
            tag, MUST exist in DNS.</t>
          <t>The discovered TPA-Label Resource Record structure MUST be valid.</t>
          <t>The domain that created the TPA-Label MUST be within the TPA-LLD.</t>
          <t>Where a scope of 'd' is specified, the Trusted Domain MUST have an authorized DKIM
            signature.</t>
          <t>Where a scope of 'L' or 'S' is specified, a List-ID identifier in the List-ID header
            field or a Sender header field MUST contain a domain within the TPA-LLD. This provides
            Third-Party services a reason to ensure their outbound messages do not spoof these
            associated header fields.</t>
        </list></t>

      <t>For non-DKIM validations, the TXT record discovery process continues until a TPA-Label
        Resource Record structure is found where:</t>

      <t>One of the three possible TXT resource records is checked in their listed succession. Each
        would be referenced by an 'h' or 'e' or 't' related domain given by <xref target="RFC5321"/>
        EHLO or HELO command, this domain with left-most label omitted, or by an 'm' related
        email-address domain within the <xref target="RFC5321"/> MAIL command.<vspace blankLines="1"
        /></t>

      <t><list style="symbols">
          <t>The discovered TPA-Label Resource Record Structure is valid.</t>
          <t>The domain that created the TPA-Label is within the TPA-LLD.</t>
          <t>The domain that created the TPA-Label corresponds with a listed scope of 'e', 'h' or
            'm' or 't'.</t>
          <t>Where a scope of 'L' or 'S' is specified, either the domain in List-ID given by <xref
              target="RFC2919"/> in the List-ID header field is within the TPA-LLD, or a Sender
            header field contains a domain within the TPA-LLD respectively.</t>

          <t>Once these four conditions have been met, for 'h' or 'm' scopes the domain MUST be
            confirmed by submitting the domain to an SPF process that then returns pass. The 'e'
            scope MUST be confirmed by a forward DNS reference that resolves the address of the SMTP
            client. The 't' scope MUST be confirmed by the DNS-ID in the client certificate. </t>
        </list></t>
      <t><vspace blankLines="0"/></t>

      <t>When the TPA-Label Resource Record can not be retrieved due to some error that is likely
        transient in nature, such as "SERVFAIL" for example, the result of the TPA-Label Resource
        Record compliance assessment is "temperror".</t>

      <t>When the TPA-Label Resource Record retrieval returns a DNS "NOERROR", but not with a single
        record, the result of the TPA-Label Resource Record compliance assessment is
        "permerror".</t>

      <t>When the TPA-Label Resource Record can not be retrieved with a DNS "NXDOMAIN" response, the
        result of the TPA-Label Resource Record compliance assessment is "nxdomain".<vspace
          blankLines="1"/></t>
    </section>

    <section title="Privacy Considerations">
      <t>As with other authorization schemes that utilize DNS, relationships are publicly revealed.
        This is the nature of SPF authorization which reveals first party services being used. A
        TPA-Label on the other hand can resolve a hash obscured Third-Party Service. Unlike SPF, a
        TPA-Label does not include any user identity related parameters and does not reveal any
        users specific relationships. In addition, these relationships are accessed with a hash of
        the entire domain. Use of a few random subdomains can inhibit discovery of these
        relationships. However, the low latency of DNS means resource records can not be assumed to
        remain secret.</t>

      <t>Even so, disclosures of Third-Party Services might be justified by dissuading malefactors
        who have compromised the Trusted Domain and then are able to subsequently spoof the
        discovered personal relationships. Such spoofing might be seen as causing getter harm then
        public knowledge of possible Third-Party Services used by the Trusted Domain's users.</t>

      <t>Overhead associated with managing a "_tpa." zone is fairly small and is offset by the
        squelching of DMARC feedback generation and the remediation of a loss of legitimate
        messages. Alternatives to TPA-Labels are likely to be the dissemination of plaintext lists
        of domains known to cause alignment failures, although operating in full compliance with
        SMTP protocols and practices.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <section title="Moving RFC6541 to historic">

        <t>This document is seeking to replace <xref target="RFC6541"/> and to move it to
          historic.</t>
      </section>
      <section title="TPA-Label (TPA-LLD) Parameters">
        <t>To accommodate the extensions to <xref target="RFC7001"/> needs the following elements to
          be added:</t>

        <!-- http://www.iana.org/assignments/tpa-parameters/tpa-parameters.xhtml -->
        <texttable title="TPA-Label Resource Record validation Method">
          <ttcol align="center">Type</ttcol>
          <ttcol align="center">Reference</ttcol>
          <c>tpa</c>
          <c>(this document)</c>
        </texttable>
        <t>
          <vspace blankLines="100"/>
        </t>
      </section>
      <section title="Email Authentication Method Registry">
        <t>To accommodate the method derived from TPA-Label Resource Record processing, the IANA
          Registry "Email Authentication Method" defined by Section 6.2 of <xref target="RFC7001"/>
          needs the following elements to be added:</t>

        <!-- http://www.iana.org/assignments/email-auth/email-auth.xhtml#email-auth-methods -->

        <texttable title="TPA-Label Resource Record validation Method">
          <ttcol align="left">Method</ttcol>
          <ttcol align="center" width="10%">Defined</ttcol>
          <ttcol align="center" width="10%">ptype</ttcol>
          <ttcol align="left">property</ttcol>
          <ttcol align="left">value</ttcol>
          <c>tpa-lld</c>
          <c>(this document)</c>
          <c>domain</c>
          <c>3p-dom</c>
          <c>Domain evaluated. The method results from <xref target="RFC7001"/> should also be
            included in a Authenticated Results header field.</c>
          <!--  -->
          <c/>
          <!-- spanx ?? -->
          <c/>
          <c/>
          <c>scope</c>
          <c>value of <xref target="scope-registry">scope</xref> tag. (When 'scope' contains 'e',
            'h' or 'm', the <xref target="RFC7001">iprev</xref> (Section 3) method results should
            also be included in the Authenticated-Results header field to capture the SMTP client IP
            address.</c>
          <c/>
          <!-- spanx ?? -->
          <c/>
          <c/>
          <c>ca-scope</c>
          <c>The <xref target="scope-registry">scopes</xref> with a compliance assessment as
            pass</c>
          <c/>
          <!-- spanx ?? -->
          <c/>
          <c/>
          <c>tpa</c>
          <c>Value of <xref target="tpa-defn">tpa</xref> tag at time of compliance assessment</c>
        </texttable>
        <t>
          <vspace blankLines="100"/>
        </t>
      </section>

      <section title="Email Authentication Result Names Registry">
        <t>To accommodate the results derived from TPA-Label Resource Record processing, the IANA
          Registry "Email Authentication Method" defined by Section 6.3 of <xref target="RFC7001"/>
          needs the following elements added:</t>

        <!--  http://www.iana.org/assignments/email-auth/email-auth.xhtml#email-auth-result-names -->

        <texttable title="TPA-Label Resource Record complaince assessment Results">
          <ttcol align="center" width="12%">code</ttcol>
          <ttcol align="center" width="12%">method</ttcol>
          <ttcol align="left">meaning</ttcol>
          <c>none</c>
          <c>tpa-lld</c>
          <c>No TPA-Label was published</c>
          <!--  -->
          <c>pass</c>
          <c>tpa-lld</c>
          <c><xref target="auth-meaning"/></c>
          <!--  -->
          <c>tempfail</c>
          <c>tpa-lld</c>
          <c><xref target="auth-meaning"/></c>
          <!--  -->
          <c>permfail</c>
          <c>tpa-lld</c>
          <c><xref target="auth-meaning"/></c>
          <!--  -->
          <c>hdrfail</c>
          <c>tpa-lld</c>
          <c>The TPA-Label Resource Record scope values of "S" or "L" failed to match.</c>
          <!--  -->
          <c>nxdomain</c>
          <c>tpa-lld</c>
          <c>When obtaining the TPA-Label Resource Record, DNS indicated this domain does not exist.
          </c>
        </texttable>
      </section>

      <section title="Third Party Authorizations Labels Registry">
        <t>Names of tags that are valid in TPA-Label Resource Records with the exception of
          experimental tags <xref target="tpalabel-rr"/> MUST be registered in this created IANA
          registry.</t>

        <t>New entries are assigned only for values that have been documented in a published RFC
          that has had IETF Review, per <xref target="RFC5226">IANA CONSIDERATIONS</xref>.</t>

        <t>Each tag registered must correspond to a definition.</t>
        <t>The initial set of values for this registry is:</t>
        <texttable title="TPA-Label Resource Record compliance assessment Results">
          <ttcol align="center" width="12%">tag</ttcol>
          <ttcol align="left" width="18%">defined</ttcol>
          <ttcol align="left">definition</ttcol>
          <c>v</c>
          <c>
            <xref target="tpalabel-rr"/>
          </c>
          <c>Label Version</c>
          <!--  -->
          <c>scope</c>
          <c>
            <xref target="scope-defn"/>
          </c>
          <c>
            <xref target="scope-registry"/>
          </c>
          <!--  -->
          <c>tpa</c>
          <c>
            <xref target="tpa-defn"/>
          </c>
          <c>List of Authorized Domains or Identifiers </c>
        </texttable>
      </section>
      <section anchor="scope-registry" title="Third Party Authorizations Scope Registry">
        <t>Values that correspond to <xref target="scope-defn"/> MUST be registered in this created
          registry:</t>

        <t>New entries are assigned only for values that have been documented in a published RFC
          that has had IETF Review, per <xref target="RFC5226">IANA CONSIDERATIONS</xref>.</t>

        <t>Each value registered must correspond to a definition.</t>
        <t>The initial set of values for this registry is:</t>
        <texttable title="TPA-Label Resource Record compliance assessment Results">
          <ttcol align="center" width="15%">value</ttcol>
          <ttcol align="left">defined</ttcol>
          <!--  -->
          <c>L</c>
          <c>
            <xref target="scopeL-defn"/>
          </c>
          <!--  -->
          <c>S</c>
          <c>
            <xref target="scopeS-defn"/>
          </c>
          <!--  -->
          <c>d</c>
          <c>
            <xref target="scopeD-defn"/>
          </c>
          <!--  -->
          <c>h</c>
          <c>
            <xref target="scopeH-defn"/>
          </c>
          <!--  -->
          <c>e</c>
          <c>
            <xref target="scopeE-defn"/>
          </c>
          <!--  -->
          <c>m</c>
          <c>
            <xref target="scopeM-defn"/>
          </c>
          <!--  -->
          <c>t</c>
          <c>
            <xref target="scopeT-defn"/>
          </c>
        </texttable>
      </section>
    </section>
    <section anchor="Security" title="Security Considerations">
      <t>This draft extends Domain Alignment validation practices that depend on DKIM <xref
          target="RFC6376"/> or SPF <xref target="RFC7208"/>. Most related security matters are
        discussed in those specifications. Additional considerations are also included in <xref
          target="RFC6377"/>. Security considerations for the TPA-LLD scheme are mostly related to
        attempts on the part of malefactors to falsely represent themselves as others, often in an
        attempt to defraud either the recipient or the alleged originator. Some receivers mistakenly
        bypass validation of the <xref target="RFC5322"/> header fields because a signature from a
        Trusted Domain had been confirmed as perhaps suggested in <xref target="RFC5863"/>. Do not
        omit the validation of header fields unless the message is not accepted for other
        reasons.</t>

      <t>Additional security considerations regarding DKIM signing practices may be found in the
        DKIM threat analysis <xref target="RFC4686"/>.</t>

      <section title="Benefits to Recipients">
        <t>The verifier, after validating a Federated Domain, will have significantly greater
          confidence in the Third-Party, than when no TPA-Label Resource Record is obtained. This
          enhanced confidence may, at the recipients' discretion, cause a message to be delivered to
          the recipient with less stringent assessments.</t>
      </section>

      <section title="Risks to Recipients">
        <t>The decisions a recipient makes in regard to message filtering based on TPA-Label
          Resource Records are likely to depend on the system integrity of the Third Party with
          respect to the validation methods determined by authorization scope labels. When the 'e',
          'h', or 'm' scoped domain is not confirmed, or the Third-Party Domain does not validate
          the submitter, there is a risk of accepting potentially spoofed messages.
          Authentication-Results header fields then play an important role when there is no
          out-of-band validations confirming the submitter. Without proper Authentication-Results
          handling by the Third-Party, there is also risk of accepting potentially spoofed
          messages.</t>

        <t>With the TPA-Label specification, third party validation provides verifiable value.
          Implementers should consider the possibility a malefactor will send a message having a
          large number of valid DKIM Signatures. Verifying all the signatures may consume a large
          amount of processing resources. As such, it might be worth checking for the existence of a
          TPA-Label Resource Record first to minimize network amplification concerns. <xref
            target="tpa-qt"/> describes a quick check to see if TPA-Label Resource Records may
          exist. Additionally, validating DKIM signatures and obtaining related resource records
          might be limited to known trustworthy domains.</t>

        <t>Services that depend only upon path authorizations might permit the Trusted Domain to be
          spoofed and yet obtain acceptance. During such events, the Trusted Domain might need to
          retract its authorization from the service. For this reason, path related validation based
          on IP addresses should only be used as a carefully monitored interim solution.</t>
      </section>

      <section title="Benefits to Trusted Domains">
        <t>TPA-Label Resource Records can replace domain delegations, selector/key record mirroring,
          or key exchanges. A significant number of details are associated with selector/key
          records. These details include user limitations, suitable services, key resource record's
          Time-To-Live, revocation and update procedures, and how the DKIM Signature header field's
          'i=' semantics are to be applied. In addition, services that depend upon DKIM keys are
          better secured by not delegating these DKIM keys, where instead the TPA-LLD scheme allows
          Trusted Domains an ability to limit the scope of their authorizations, while also not
          being mistaken for having validated the entity submitting the message.</t>

        <t>TPA-Label Resource Records convey which domains are authoritative even when they are not
          the Trusted Domain. However, Authorized Domains are unable to utilize the DKIM signature's
          'i=' semantics to directly assert which identifiers on whose behalf a signature was added.
          As such, no domain should be authorized unless it is trusted to ensure the Federated
          Identity of an email undergoes validation that offers acceptable protections for the
          Trusted Domain. For example, such validation might ensure submitting entities have
          demonstrated receipt of "pingback" messages sent to the Federated Identity (Author's
          address) contained within the messages being signed.</t>

        <t>By deploying TPA-Label Resource Records, Trusted Domains benefit when recipients assess
          signing practice compliance by using the TPA-LLD scheme. These recipients will be less
          likely to drop the Trusted Domain's genuine messages, whenever the Trusted Domain attempts
          to restrict acceptance. Restricting acceptance of non-compliant messages is the basic
          motivation for publishing DMARC records. In addition, recipients are more likely to
          validate signatures by an Authorized Domain.</t>

        <t>Broader use of strict DMARC alignment assertions provides a greater likelihood of being
          able to eliminate a broader range of non-compliant messages, in addition to improving
          acceptance from authorized sources. TPA-Labels also allow Trusted Domains to control
          message Sender and List-ID attributes, to exclude problematic validation methods or
          include others as they become available.</t>

        <t>Trusted Domains having good reputations might extend limited compliance assessment
          resources to otherwise unknown domains or SMTP Clients that are referenced by their
          TPA-LLD.</t>
      </section>

      <section title="Risks to Trusted Domains">
        <t>As indicated in <xref target="eval-3p-tpa-domain"/>, it is ultimately an issue of
          trusting the Third Party Domain to do the right thing and not generate, or allow others to
          generate, messages that falsely appear to be from the Trusted Domain. The validation
          methods in place for different email elements need to be carefully reflected in the scope
          of the TPA-LLD.</t>

        <t>Authorization of mailing lists with TPA-LLD could cause a loss of confidentiality in
          mailing list participation by the Trusted Domain. This might help malefactors deduce which
          subscription related email the Trusted Domain may receive. Because of the hashing function
          in generating the TPA-Label, anyone wishing to discover which domains are being
          authorized, has to probe each TPA-Label based on the exact domain. In addition, service
          organizations or community groups are able to share comprehensive lists. Such possible
          sharing means even though a domain has been authorized, that in itself does not mean the
          Trusted Domain is exchanging messages with the Authorized Domain.</t>
      </section>

      <section title="Benefits to Third Party Signers">
        <t>Third Party Signers benefit by allowing those using their service, the autonomy to
          authorize their service without needing to exchange DKIM key related details. This is
          particularly useful for mailing lists.</t>
      </section>

      <section title="Risks caused by Third Party Signers">
        <t>As mentioned before, Authorized Third Party Signers need to validate messages from
          Trusted Domains. This validation provides a safety mechanism for the Trusted Domain and
          their recipients. The Third Party may not be aware of the validation value or the message
          elements involved, and as a result make changes without understanding the impact this may
          have on Trusted Domains and their recipients. For example, the Third Party might stop DKIM
          signing or stop applying Authentication-Results header fields. The unexpected exposure
          that this might enable could allow abuse and prove detrimental for both the Trusted Domain
          and their recipients.</t>
      </section>

      <section title="SHA-1 Collisions">
        <t>The use of the SHA-1 hash algorithm does not represent a security concern. The hash
          simply ensures a deterministic domain-name size is achieved. Unexpected collisions can be
          detected and handled by using the extended TPA-Label Resource Record "tpa=" option. The
          use of TPA-Label Resource Records without the TPA-Label "tpa=" options does present an
          opportunity for an adversary to attempt to find a hash collision. Message spoofing outside
          the realm of DKIM protection is likely easier to achieve than finding hash collisions.
          There is minimal risk of TPA-Labels colliding. Listing 3 x 10^45 domains has less than a
          0.1 percent risk of any two domain labels colliding.</t>
      </section>

      <section anchor="DNS" title="DNS Limits">
        <t>Use of the TPA-Label Resource Records, rather than simply listing the Authorized Domain,
          ensures the DNS record size is independent of the Third Party Domain. The typical domain
          name size has been steadily increasing. This increase has been caused by domain names that
          encode international character sets. Perhaps, soon there will be a further increase
          spurred by an expanse of TLDs having larger international labels.</t>

        <t>The maximum domain name size allowed, per <xref target="RFC1034"/> Section 3, is 255
          bytes (or octets). Each label has a byte for its length. Every domain name adds an
          additional byte by having a right-most label that represents the root "." signified as a
          zero length label. A labeling scheme that combines together a listed domain with the
          publishing domain separated by some label for this convention, reduces the maximal domain
          name in half, where the convention label reduces this further.</t>

        <t>If "_smtp._tpa." were used as the convention label with a simple listing method, the
          maximum domain name size this supports would be 128 bytes. The suffix for TPA-Labels is
          "_smtp._tpa." which consumes 11 bytes. The TPA-Label itself consumes 34 bytes. A domain
          that publishes the TPA-Labels in its domain would then have 122 bytes available for their
          Trusted Domain. This permits the authorization of any domain having a valid length with a
          deterministic amount of space available for resource records. </t>

        <t>Normally, DNS messages should not exceed 512 bytes as per Section 2.3.4 of <xref
            target="RFC1035"/>. Using TPA-Label Resource Records in the DNS, as described by this
          document, consumes a consistent 50 bytes, in addition to the domain name publishing the
          TPA-Labels. With this being constant, a limit can be determined as a constraint to
          resource record size, to ensure a response does not exceed the maximum DNS message size.
          DNS servers that add additional resource records, for nameservers as an example, will
          further reduce available resource record capacity. Domains publishing TPA-Labels exceeding
          the DNS message limit will need to rely on recipients using TCP for DNS retrieval, or
          EDNS0 <xref target="RFC6891"/> for extended DNS lengths. <vspace blankLines="1"/></t>
      </section>
    </section>
    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>Jeff MacDonald, Michael Deutschmann, Frank Ellermann, Murray Kucherawy, Wietse Venema,
        Alessandro Vesely, and John Leslie.<vspace blankLines="5"/></t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="RFC2119">
        <front>
          <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement
            Levels</title>
          <author initials="S." surname="Bradner" fullname="Scott Bradner">
            <organization>Harvard University</organization>
            <address><postal><street>1350 Mass. Ave.</street><street>Cambridge</street>
              <street>MA 02138</street></postal><phone>- +1 617 495 3864</phone>
              <email>sob@harvard.edu</email></address>
          </author>
          <date year="1997" month="March"/>
          <area>General</area>
          <keyword>keyword</keyword>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <format type="TXT" octets="4723" target="http://www.rfc-editor.org/rfc/rfc2119.txt"/>
        <format type="HTML" octets="17970"
          target="http://xml.resource.org/public/rfc/html/rfc2119.html"/>
        <format type="XML" octets="5777" target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"
        />
      </reference>
      <reference anchor="RFC2919">
        <front>
          <title>List-Id: A Structured Field and Namespace for the Identification of Mailing
            Lists</title>
          <author initials="R." surname="Chandhok" fullname="R. Chandhok">
            <organization/>
          </author>
          <author initials="G." surname="Wenger" fullname="G. Wenger">
            <organization/>
          </author>
          <date year="2001" month="March"/>
        </front>
        <seriesInfo name="RFC" value="2919"/>
        <format type="TXT" octets="18480" target="http://www.rfc-editor.org/rfc/rfc2919.txt"/>
      </reference>
      <reference anchor="RFC3207">
        <front>
          <title>SMTP Service Extension for Secure SMTP over Transport Layer Security</title>
          <author initials="P." surname="Hoffman" fullname="P. Hoffman">
            <organization/>
          </author>
          <date year="2002" month="February"/>
        </front>
        <seriesInfo name="RFC" value="3207"/>
        <format type="TXT" octets="18679" target="http://www.rfc-editor.org/rfc/rfc3207.txt"/>
      </reference>
      <reference anchor="RFC4648">
        <front>
          <title>The Base16, Base32, and Base64 Data Encodings</title>
          <author initials="S." surname="Josefsson" fullname="S. Josefsson">
            <organization/>
          </author>
          <date year="2006" month="October"/>
        </front>
        <seriesInfo name="RFC" value="4648"/>
        <format type="TXT" octets="35491" target="http://www.rfc-editor.org/rfc/rfc4648.txt"/>
      </reference>
      <reference anchor="RFC5234">
        <front>
          <title>Augmented BNF for Syntax Specifications: ABNF</title>
          <author initials="D." surname="Crocker" fullname="D. Crocker">
            <organization/>
          </author>
          <author initials="P." surname="Overell" fullname="P. Overell">
            <organization/>
          </author>
          <date year="2008" month="January"/>
        </front>
        <seriesInfo name="STD" value="68"/>
        <seriesInfo name="RFC" value="5234"/>
        <format type="TXT" octets="26359" target="http://www.rfc-editor.org/rfc/rfc5234.txt"/>
      </reference>
      <reference anchor="RFC5321">
        <front>
          <title>Simple Mail Transfer Protocol</title>
          <author initials="J." surname="Klensin" fullname="J. Klensin">
            <organization/>
          </author>
          <date year="2008" month="October"/>
        </front>
        <seriesInfo name="RFC" value="5321"/>
        <format type="TXT" octets="225929" target="http://www.rfc-editor.org/rfc/rfc5321.txt"/>
      </reference>
      <reference anchor="RFC5322">
        <front>
          <title>Internet Message Format</title>
          <author initials="P." surname="Resnick" fullname="Peter W.  Resnick" role="editor">
            <organization>Qualcomm Incorporated</organization>
            <address><postal><street>5775 Morehouse Drive</street><city>San Diego</city>
              <region>CA</region><code>92121-1714</code><country>US</country></postal>
              <phone>+1 858 651 4478</phone><email>presnick@qualcomm.com</email>
              <uri>http://www.qualcomm.com/~presnick/</uri></address>
          </author>
          <date year="2008" month="October"/>
        </front>
        <seriesInfo name="RFC" value="5322"/>
        <format type="TXT" octets="122322" target="http://www.rfc-editor.org/rfc/rfc5322.txt"/>
        <format type="HTML" octets="213393"
          target="http://xml.resource.org/public/rfc/html/rfc5322.html"/>
        <format type="XML" octets="174234"
          target="http://xml.resource.org/public/rfc/xml/rfc5322.xml"/>
      </reference>
      <reference anchor="RFC5598">
        <front>
          <title>Internet Mail Architecture</title>
          <author initials="D." surname="Crocker" fullname="D. Crocker">
            <organization/>
          </author>
          <date year="2009" month="July"/>
        </front>
        <seriesInfo name="RFC" value="5598"/>
        <format type="TXT" octets="115741" target="http://www.rfc-editor.org/rfc/rfc5598.txt"/>
        <format type="PDF" octets="342738" target="http://www.rfc-editor.org/rfc/rfc5598.pdf"/>
      </reference>
      <reference anchor="RFC6125">
        <front>
          <title>Representation and Verification of Domain-Based Application Service Identity within
            Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of
            Transport Layer Security (TLS)</title>
          <author initials="P." surname="Saint-Andre" fullname="P. Saint-Andre">
            <organization/>
          </author>
          <author initials="J." surname="Hodges" fullname="J. Hodges">
            <organization/>
          </author>
          <date year="2011" month="March"/>
        </front>
        <seriesInfo name="RFC" value="6125"/>
        <format type="TXT" octets="136507" target="http://www.rfc-editor.org/rfc/rfc6125.txt"/>
      </reference>
      <reference anchor="RFC6376">
        <front>
          <title>DomainKeys Identified Mail (DKIM) Signatures</title>
          <author initials="D." surname="Crocker" fullname="D. Crocker">
            <organization/>
          </author>
          <author initials="T." surname="Hansen" fullname="T. Hansen">
            <organization/>
          </author>
          <author initials="M." surname="Kucherawy" fullname="M. Kucherawy">
            <organization/>
          </author>
          <date year="2011" month="September"/>
        </front>
        <seriesInfo name="STD" value="76"/>
        <seriesInfo name="RFC" value="6376"/>
        <format type="TXT" octets="176999" target="http://www.rfc-editor.org/rfc/rfc6376.txt"/>
      </reference>
      <reference anchor="RFC6891">
        <front>
          <title>Extension Mechanisms for DNS (EDNS(0))</title>
          <author initials="J." surname="Damas" fullname="J. Damas">
            <organization/>
          </author>
          <author initials="M." surname="Graff" fullname="M. Graff">
            <organization/>
          </author>
          <author initials="P." surname="Vixie" fullname="P. Vixie">
            <organization/>
          </author>
          <date year="2013" month="April"/>
        </front>
        <seriesInfo name="STD" value="75"/>
        <seriesInfo name="RFC" value="6891"/>
        <format type="TXT" octets="32856" target="http://www.rfc-editor.org/rfc/rfc6891.txt"/>
      </reference>
      <reference anchor="RFC7001">
        <front>
          <title>Message Header Field for Indicating Message Authentication Status</title>
          <author initials="M." surname="Kucherawy" fullname="M. Kucherawy">
            <organization/>
          </author>
          <date year="2013" month="September"/>
        </front>
        <seriesInfo name="RFC" value="7001"/>
        <format type="TXT" octets="101316" target="http://www.rfc-editor.org/rfc/rfc7001.txt"/>
      </reference>
      <reference anchor="FIPS.180-2.2002"
        target="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf">
        <front>
          <title>Secure Hash Standard</title>
          <author>
            <organization>National Institute of Standards and Technology</organization>
          </author>
          <date month="August" year="2002"/>
        </front>
        <seriesInfo name="FIPS" value="PUB 180-2"/>
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="RFC1034">
        <front>
          <title abbrev="Domain Concepts and Facilities">Domain names - concepts and
            facilities</title>
          <author initials="P." surname="Mockapetris" fullname="P. Mockapetris">
            <organization>Information Sciences Institute (ISI)</organization>
          </author>
          <date year="1987" day="1" month="November"/>
        </front>
        <seriesInfo name="STD" value="13"/>
        <seriesInfo name="RFC" value="1034"/>
        <format type="TXT" octets="129180" target="http://www.rfc-editor.org/rfc/rfc1034.txt"/>
      </reference>
      <reference anchor="RFC1035">
        <front>
          <title abbrev="Domain Implementation and Specification">Domain names - implementation and
            specification</title>
          <author initials="P." surname="Mockapetris" fullname="P. Mockapetris">
            <organization>USC/ISI</organization>
            <address><postal><street>4676 Admiralty Way</street><city>Marina del Rey</city>
              <region>CA</region><code>90291</code><country>US</country>
            </postal><phone>+1 213 822 1511</phone>
            </address>
          </author>
          <date year="1987" day="1" month="November"/>
        </front>
        <seriesInfo name="STD" value="13"/>
        <seriesInfo name="RFC" value="1035"/>
        <format type="TXT" octets="125626" target="http://www.rfc-editor.org/rfc/rfc1035.txt"/>
      </reference>
      <reference anchor="RFC1930">
        <front>
          <title abbrev="Guidelines for creation of an AS">Guidelines for creation, selection, and
            registration of an Autonomous System (AS)</title>
          <author initials="J." surname="Hawkinson" fullname="John Hawkinson">
            <organization>BBN Planet Corporation</organization>
            <address><postal><street>150 CambridgePark Drive</street>
              <city>Cambridge</city>
              <region>MA</region>
              <code>02139</code>
              <country>US</country>
            </postal><phone>+1 617 873 3180</phone>
              <email>jhawk@bbnplanet.com</email></address>
          </author>
          <author initials="T." surname="Bates" fullname="Tony Bates">
            <organization>MCI</organization>
            <address><postal><street>2100 Reston Parkway</street>
              <city>Reston</city><region>VA</region><code>22094</code><country>US</country>
            </postal><phone>+1 703 715 7521</phone><email>Tony.Bates@mci.net</email></address>
          </author>
          <date year="1996" month="March"/>
        </front>
        <seriesInfo name="BCP" value="6"/>
        <seriesInfo name="RFC" value="1930"/>
        <format type="TXT" octets="22073" target="http://www.rfc-editor.org/rfc/rfc1930.txt"/>
      </reference>
      <reference anchor="RFC6672">
        <front>
          <title>DNAME Redirection in the DNS</title>
          <author initials="S." surname="Rose" fullname="S. Rose">
            <organization/>
          </author>
          <author initials="W." surname="Wijngaards" fullname="W. Wijngaards">
            <organization/>
          </author>
          <date year="2012" month="June"/>
        </front>
        <seriesInfo name="RFC" value="6672"/>
        <format type="TXT" octets="45704" target="http://www.rfc-editor.org/rfc/rfc6672.txt"/>
      </reference>
      <reference anchor="RFC4686">
        <front>
          <title>Analysis of Threats Motivating DomainKeys Identified Mail (DKIM)</title>
          <author initials="J." surname="Fenton" fullname="J. Fenton">
            <organization/>
          </author>
          <date year="2006" month="September"/>
        </front>
        <seriesInfo name="RFC" value="4686"/>
        <format type="TXT" octets="70382" target="http://www.rfc-editor.org/rfc/rfc4686.txt"/>
      </reference>
      <reference anchor="RFC4954">
        <front>
          <title>SMTP Service Extension for Authentication</title>
          <author initials="R." surname="Siemborski" fullname="R. Siemborski">
            <organization/>
          </author>
          <author initials="A." surname="Melnikov" fullname="A. Melnikov">
            <organization/>
          </author>
          <date year="2007" month="July"/>
        </front>
        <seriesInfo name="RFC" value="4954"/>
        <format type="TXT" octets="43493" target="http://www.rfc-editor.org/rfc/rfc4954.txt"/>
      </reference>
      <reference anchor="RFC5226">
        <front>
          <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
          <author initials="T." surname="Narten" fullname="T. Narten">
            <organization/>
          </author>
          <author initials="H." surname="Alvestrand" fullname="H. Alvestrand">
            <organization/>
          </author>
          <date year="2008" month="May"/>
        </front>
        <seriesInfo name="BCP" value="26"/>
        <seriesInfo name="RFC" value="5226"/>
        <format type="TXT" octets="66160" target="http://www.rfc-editor.org/rfc/rfc5226.txt"/>
      </reference>
      <reference anchor="RFC5518">
        <front>
          <title>Vouch By Reference</title>
          <author initials="P." surname="Hoffman" fullname="P. Hoffman">
            <organization/>
          </author>
          <author initials="J." surname="Levine" fullname="J. Levine">
            <organization/>
          </author>
          <author initials="A." surname="Hathcock" fullname="A. Hathcock">
            <organization/>
          </author>
          <date year="2009" month="April"/>
        </front>
        <seriesInfo name="RFC" value="5518"/>
        <format type="TXT" octets="23730" target="http://www.rfc-editor.org/rfc/rfc5518.txt"/>
      </reference>
      <reference anchor="RFC5863">
        <front>
          <title>DomainKeys Identified Mail (DKIM) Development, Deployment, and Operations</title>
          <author initials="T." surname="Hansen" fullname="T. Hansen">
            <organization/>
          </author>
          <author initials="E." surname="Siegel" fullname="E. Siegel">
            <organization/>
          </author>
          <author initials="P." surname="Hallam-Baker" fullname="P. Hallam-Baker">
            <organization/>
          </author>
          <author initials="D." surname="Crocker" fullname="D. Crocker">
            <organization/>
          </author>
          <date year="2010" month="May"/>
        </front>
        <seriesInfo name="RFC" value="5863"/>
        <format type="TXT" octets="126915" target="http://www.rfc-editor.org/rfc/rfc5863.txt"/>
      </reference>
      <reference anchor="RFC6377">
        <front>
          <title>DomainKeys Identified Mail (DKIM) and Mailing Lists</title>
          <author initials="M." surname="Kucherawy" fullname="M. Kucherawy">
            <organization/>
          </author>
          <date year="2011" month="September"/>
        </front>
        <seriesInfo name="BCP" value="167"/>
        <seriesInfo name="RFC" value="6377"/>
        <format type="TXT" octets="61792" target="http://www.rfc-editor.org/rfc/rfc6377.txt"/>
      </reference>
      <reference anchor="RFC6541">
        <front>
          <title>DomainKeys Identified Mail (DKIM) Authorized Third-Party Signatures</title>
          <author initials="M." surname="Kucherawy" fullname="M. Kucherawy">
            <organization/>
          </author>
          <date year="2012" month="February"/>
        </front>
        <seriesInfo name="RFC" value="6541"/>
        <format type="TXT" octets="31655" target="http://www.rfc-editor.org/rfc/rfc6541.txt"/>
      </reference>
      <reference anchor="RFC6698">
        <front>
          <title>The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security
            (TLS) Protocol: TLSA</title>
          <author initials="P." surname="Hoffman" fullname="P. Hoffman">
            <organization/>
          </author>
          <author initials="J." surname="Schlyter" fullname="J. Schlyter">
            <organization/>
          </author>
          <date year="2012" month="August"/>
        </front>
        <seriesInfo name="RFC" value="6698"/>
        <format type="TXT" octets="84034" target="http://www.rfc-editor.org/rfc/rfc6698.txt"/>
      </reference>
      <reference anchor="RFC7208">
        <front>
          <title>Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version
            1</title>
          <author initials="S." surname="Kitterman" fullname="S. Kitterman">
            <organization/>
          </author>
          <date year="2014" month="April"/>
        </front>
        <seriesInfo name="RFC" value="7208"/>
        <format type="TXT" octets="144189" target="http://www.rfc-editor.org/rfc/rfc7208.txt"/>
      </reference> &I-D.ietf-dane-smtp-with-dane; &I-D.kucherawy-dmarc-base;
      &I-D.kucherawy-original-authres; </references>

    <section title="DNS Example of TPA-Label Resource Record placement" toc="default">
      <figure title="">
        <artwork name="" type="" height="" width="" xml:space="preserve">
####          
# Practices for Example.com email domain using example.com, isp.com,
# and example.com.isp.com as signing domains.
####

#### 5322.From authorization for 3P domains ####

## "isp.com" TPA-Label Resource Record ##
_HTIE4SWL3L7G4TKAFAUA7UYJSS2BTEOV._smtp._tpa.example.com. IN TXT
  "v=tpa1 tpa=isp.com; scope=d;"

#### 5322.Sender/List-ID authorization for 3P domains ####

## "example.com.isp.com" TPA-Label Resource Record ##
_6MEHLQLKWAL5HQREXWDN2TBXAJ6VZ44B._smtp._tpa.example.com.  IN TXT
  "v=tpa1 tpa=*.isp.com; scope=d L S;"
     </artwork>
      </figure>
      <t>
        <vspace blankLines="100"/>
      </t>
    </section>
    <section title="C code for label generation">
      <t>The following utility can be compiled as TPA-Label.c using the following:</t>
      <t>gcc -lcrypto TPA-Label.c -o TPA-Label</t>
      <!--<CODE BEGIN>-->
      <figure title="">
        <artwork name="" type="" height="" width="" xml:space="preserve">
&lt;CODE BEGIN&gt;
/*
 * TPA-Label generation utility
 * Copyright (c) 2010 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
 * (http://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.  Code Components extracted from this document must
 * include Simplified BSD License text as described in Section 4.e of
 * the Trust Legal Provisions and are provided without warranty as
 * described in the Simplified BSD License.
 *
 * This document and the information contained herein are provided on an
 * "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
 * OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
 * THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
 * THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
 * WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 */
#include &lt;stdio.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;stddef.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;ctype.h&gt;
#include &lt;unistd.h&gt;
#include &lt;fcntl.h&gt;
#include &lt;errno.h&gt;
#include &lt;openssl/sha.h&gt;

#define TPA_LABEL_VERSION   102
#define MAX_DOMAIN_NAME     256
#define MAX_FILE_NAME       1024

static char base32[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
static char sign_on[] =
{"%s v%d.%02d Copyright (C) (2014)  The IETF Trust\n"};
char err_cmd[] =\
 "ERR: Command error with [%s]\n";
char use_txt[]=\
 "Usage: TPA-Label [-i domain_input_file] [-o label_output_file][-v]\n";
char help_txt[]=\
 "The options are as follows:\n"\
 "-i  domain name input. Defaults to stdin. Removes trailing '.'\n"\
 "-o  TPA-Label output.  Defaults to stdout.\n"\
 "-v  Specifies Verbose Mode.\n\n";

static void usage(void);
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

static void
usage(void)
{
    (void) fprintf(stderr, "\n%s%s", use_txt, help_txt);
    exit(1);
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

int 
main (int argc, char * argv[])
{
    int  ret_val, in_mode, out_mode, verbose, done, i, j, k;
    char ch;
    unsigned int len;
    unsigned long b_5;
    char in_fn[MAX_FILE_NAME], out_fn[MAX_FILE_NAME];
    unsigned char in_buf[MAX_DOMAIN_NAME + 2];
    unsigned char sha_res[20], tpa_label[33];
    FILE *in_file, *out_file;

    ret_val = in_mode = out_mode = verbose = done = 0;
    len = 0;

    while ((ch = getopt(argc, argv, "i:o:v")) != -1)
    {
        switch (ch) 
        {
            case 'i':
                in_mode = 1;          /* input from file */
                (void) strncpy(in_fn, optarg, sizeof(in_fn));
                in_fn[sizeof(in_fn) - 1] = '\0';
                break;
            case 'o':
                out_mode = 1;         /* out to file */
                (void) strncpy(out_fn, optarg, sizeof(out_fn));
                out_fn[sizeof(out_fn) - 1] = '\0';
                break;
            case 'v':
                verbose = 1;
                break;
            case '?':
            default:
                (void) usage();
                break;
        }
    };

    if (in_mode)
    {
        if ((in_file = fopen(in_fn, "r")) == NULL)
        {
            (void) fprintf(stderr,
                           "ERR: Error opening [%s] input file.\n",
                           in_fn);
            exit(2);
        }
    }
    else
    {
        in_file = stdin;
    }

    if (out_mode)
    {
        if ((out_file = fopen(out_fn, "w")) == NULL)
        {
            (void) fprintf(stderr, 
                           "ERR: Error opening [%s] output file.\n",
                           out_fn);
            exit(3);
        }
    }
    else
    {
        out_file = stdout;
    }

    if (out_mode &amp;&amp; verbose)
    {
        (void) printf(sign_on, "TPA-Label utility",
                      TPA_LABEL_VERSION / 100,
                      TPA_LABEL_VERSION % 100);
    }

    for (i = 0; i &lt; MAX_DOMAIN_NAME &amp;&amp; !done; i++)
    {
        if ((ch = fgetc(in_file)) == EOF)
        {
            ch = 0;
        }
        else  if (ch == '\n' || ch == '\r')
        {
            ch = 0;
        }

        in_buf[i] = tolower(ch);

        if (ch == 0) 
        {
            len = i;         /* string length */
            done = 1;     
        }
    }

    if (!done)
    {
        (void) fprintf(stderr, "ERR: Domain name too long.\n");
        exit (4);
    }

    if (len &amp;&amp; in_buf[len - 1] == '.')    /* remove any trailing "." */
    {
        len--;
        in_buf[len] = 0;     /* replace trailing "." with 0 */
    }

    in_buf[len] = 0;         /* terminate string */  

    if (len &lt; 2)
    {
        (void) 
        fprintf(stderr,
                "ERR: Domain name [%s] too short with %d length.\n",
                in_buf,
                len);
        exit (5);
    }

    SHA1(in_buf, len, sha_res);

    if (verbose)
    {
        printf("Normalized Domain = [%s] %d, SHA-1 = ", in_buf, len);

        for (i = 0; i &lt; 20; i++)
        {
            printf("%02x", sha_res[i]);
        }
        printf("\nTPA-Label 5 bit intervals left to right.\n");
    }

    /* process sha1 results 4 times by 40 bits (160 bits) */
    for (i = 0, j = 0; i &lt; 4 ; i++)         
    {
        b_5 =  (unsigned long long) sha_res[(i * 5)] &lt;&lt; 32;
        b_5 |= (unsigned long long) sha_res[(i * 5) + 1] &lt;&lt; 24;
        b_5 |= (unsigned long long) sha_res[(i * 5) + 2] &lt;&lt; 16;
        b_5 |= (unsigned long long) sha_res[(i * 5) + 3] &lt;&lt; 8;
        b_5 |= (unsigned long long) sha_res[(i * 5) + 4];

        if (verbose)
        {
            printf(" {%010llX}-&gt;", b_5);
        }

        for (k = 35; k &gt;= 0; k-= 5, j++)    /* convert 40 bits (5x8) */
        {
            tpa_label[j] = base32[(b_5 &gt;&gt; k) &amp; 0x1F];

            if (verbose)
            {
                printf(" %02X:%c", 
                       (unsigned int)(b_5 &gt;&gt; k) &amp; 0x1F,
                       tpa_label[j]);
            }
        }
        if (verbose)
        {
            printf ("\n");
        }
    }
    if (verbose)
    {
        printf("\n");
    }
    tpa_label[j] = 0;   /* terminate label string */
    fprintf(out_file, "_%s", tpa_label);
    printf("\n");

    /* close */
    if (out_mode)
    {
        if (fclose (out_file) != 0)
        {
            (void) fprintf(stderr,
                           "ERR: Unable to close %s output file.\n",
                           out_fn);
            ret_val = 6;
        }
    }
    if (in_mode)
    {
        if (fclose (in_file) != 0)
        {
            (void) fprintf(stderr,
                           "ERR: Unable to close %s input file.\n",
                           in_fn);
            ret_val = 7;
        }
    }
    return (ret_val);
 }
 &lt;CODE ENDS&gt;
        </artwork>
      </figure>
      <!--<CODE ENDS>-->
    </section>
    <section title="History of Prior Efforts">

      <t>To withstand asserting strict alignment practices, a scheme was devised that transferred
        the burden of a resulting disruption from receivers back to the Trusted Domains making the
        stringent requests. As such, a method to authorize other validated domains to establish
        informally Federated Third-Party Services, such as mailing-lists was developed. This initial
        scheme was then modified and proposed by ATPS <xref target="RFC6541"/>. Unlike the initial
        scheme, ATPS required Third-Party Services to use specific non-standard DKIM signatures to
        signal use of the ATPS authorization strategy. ATPS also required the DKIM signatures used
        by Third-Party Services to somehow determine the different label encoding employed by the
        many Trusted Domains without any defined discovery or exchange method.</t>

      <t>Both of these changes made deployment impractical by impacting systems not benefiting from
        additional alignment requirements. Third-parties have often been offering free services for
        decades. Even renaming From headers would impair normal handling. Those offering these
        services should not be expected to carry the burden of enabling a new Trusted Domain
        compliance scheme. Trusted Domains should offer the information needed to avoid disrupting
        these services instead, which is the purpose of TPA-Labels.</t>

      <t>Rather, the Trusted Domain seeking cooperative handling and receiving receiver feedback
        necessary to mitigate disruption should handle this burden instead. It is the Trusted Domain
        that directly benefits after all. There should not be unnecessary and problematic encoding
        schemes or assertions of delivery chains being expected of any Third-Party Service. Such
        matters are simply not their concern nor in their benefit.</t>

      <t>It seems the added complexities found in ATPS were to defend against a single DNS
        transaction. However, before this transaction occurs, the Third-Party must permit the
        validation of their own domain. Even then, a Third-Party checking transactions only occur
        after the domain is not within the Trusted Domain's alignment assertions. An assertion that
        can always be removed at any point. It is clearly in the interest of the Trusted Domain
        where the checking transaction represents a very minor contribution in support of desired
        receiver cooperation.</t>

      <t>Tailoring their TPA-Label list to suit their own users should discourage non-cooperative
        references to their domain. As more domains reference a common "_tpa." zone, the clout of
        that zone increases at a very moderate cost. This additional clout better ensures timely
        responses to abuse notifications. In this manner, DMARC/TPA-Labels would be helping to
        improve anti-abuse cooperation. In that light, TPA-Labels should be considered a sound
        investment and not an unwanted burden.</t>

      <t>ATPS required new tags be included in Third-Party DKIM signatures. These were "atps" and
        "atpsh" to construct a chain of "d=" and "atps=". This added complexity without any
        immediate benefit. Determining optional label encoding without any defined discovery method
        overlooks that authorization is only possible after the Third-Party Domain has been
        validated. A complete lack of ATPS deployment should have been expected since necessary
        changes did not align with benefits.</t>

      <t>In contrast, TPA-Labels do not require ANY change be made by authorized third-parties.
        Disrupting legitimate communications imposes inordinate support costs as a result of
        erroneously asserting strict alignment practices. The resulting disruption will eventually
        cause the domain's assertions to be ignored. If this disruption becomes endemic, assertions
        of other domains will become ignored as well. Domains wishing to benefit from their handling
        advice being employed while sending legitimate messages that may not retain their asserted
        alignment practices, should be offering the needed TPA-Label exception information. This
        information is essential and is only known by the Trusted Domain through their DMARC
        feedback.</t>

      <t>At this time, it is not practical for large ISPs to make strict DMARC assertions. Strict
        alignment assertions exclude normal Third-Party Services that modify the requisite
        alignment. TPA-Label lists specifically tailored to handle their users' desired Third-Party
        Services will permit their users to have normal email use. While entailing some
        administrative effort, TPA-Labels will generally be of benefit to their users by widely
        discouraging any spoofing of their messages. This affords greater protection for the users
        and the user's recipients.</t>

      <t>SPF purported to provide an anti-spoofing feature for an unseen parameter. Nevertheless,
        its strict IP address authorization causes problems and is largely disregarded for anything
        other than limiting the sending of DSNs or the scoring of messages. Many institutions will
        benefit by ensuring their strict DMARC assertions are not disruptive. Exercising this care
        will help retain recipient's trust in their assertions and the veracity of their messages.
        TPA-Labels would allow these institutions a means to use informal Third-Party Services with
        minimal administrative effort. Rather than using subdomains that lack DMARC restrictions,
        suitable Third-Party Services can be authorized by TPA-Labels. This approach offers a
        proactive method for recipients to better filter possible phishing attempts by not exposing
        them to unrestricted subdomain abuse.</t>

      <t>TPA-Label publishing is similar to VBR (<xref target="RFC5518"/>). However, it leverages
        Third-Party validation confirmed by labels held in the Trusted Domain. DNS also permits the
        information to be transparently made available from other domains whenever desired. TPA
        enables domains a means to protect their recipients. By implementing DMARC/TPA-Labels, these
        domains should be better able to stand on their own merit.</t>
    </section>
  </back>
</rfc>
