<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY RFC2119 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.2119.xml">
  <!ENTITY RFC3629 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.3629.xml">
  <!ENTITY RFC5234 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.5234.xml">
  <!ENTITY RFC5322 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.5322.xml">
  <!ENTITY RFC5890 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.5890.xml">
  <!ENTITY RFC5891 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.5891.xml">
  <!ENTITY RFC6376 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.6376.xml">
  <!ENTITY RFC6530 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.6530.xml">
  <!ENTITY RFC6531 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.6531.xml">
  <!ENTITY RFC6532 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.6532.xml">
  <!ENTITY RFC7208 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.7208.xml">
  <!ENTITY RFC7489 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.7489.xml">
  <!ENTITY RFC8174 PUBLIC "" "http://rfc-editor.org/refs/bibxml/reference.RFC.8174.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc toc="yes" ?>
<?rfc tocindent="yes" ?>
<?rfc tocdepth="2" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>

<rfc category="std" updates="6376, 7208, 7489" number="8616" ipr="trust200902" submissionType="IETF" consensus="yes">
  <front>
    <title abbrev="EAI Authentication">Email Authentication for Internationalized Mail</title>

    <author fullname="John Levine" initials="J." surname="Levine">
      <organization>Taughannock Networks</organization>

      <address>
        <postal>
          <street>PO Box 727</street>
          <city>Trumansburg</city>
          <code>14886</code>
          <region>NY</region>
          <country>United States of America</country>
        </postal>
        <email>standards@taugh.com</email>
        <uri>http://jl.ly</uri>
      </address>
    </author>

    <date month="June" year="2019" />

    <area>Applications</area>

    <keyword>email</keyword>
    <keyword>internationalization</keyword>

    <abstract>
       <t>
	  Sender Policy Framework (SPF) (RFC 7208), DomainKeys Identified Mail
	  (DKIM) (RFC 6376), and Domain-based Message Authentication,
	  Reporting, and Conformance (DMARC) (RFC 7489) enable a domain owner
	  to publish email authentication
	  and policy information in the DNS.  In internationalized email, domain
	  names can occur both as U-labels and A-labels.
	  This specification updates the SPF, DKIM, and DMARC specifications
	  to clarify which form of internationalized domain names to use
	  in those specifications.
       </t>
    </abstract>
  </front>
  <middle>
     <section title="Introduction">
	<t>
	  <xref target="RFC7208">SPF</xref>, <xref target="RFC6376">DKIM</xref>, and
	  <xref target="RFC7489">DMARC</xref> enable a domain owner to publish email
	  authentication
	  and policy information in the DNS. SPF primarily publishes information
	  about what host addresses are authorized to send mail for a domain.  DKIM
	  places cryptographic signatures on email messages, with the validation
	  keys published in the DNS.  DMARC publishes policy information related
	  to the domain in the From: header field of email messages.
	</t>
	<t>
	   In conventional email, all domain names are ASCII in all contexts, so
	   there is no question about the representation of the domain names.
	   All internationalized domain names are represented as
	   <xref target="RFC5890">A-labels</xref> in message header fields, SMTP
	   sessions, and the DNS.
	</t><t>
	   <xref target="RFC6530">Internationalized mail</xref>
	   (generally called "EAI" for
	   Email Address Internationalization) allows U-labels in
	   <xref target="RFC6531">SMTP sessions</xref>
	   and <xref target="RFC6532">message header fields</xref>.
	</t>
	<t>
	   Every U-label is equivalent to an A-label, so in principle, the
	   choice of label format will not cause ambiguities.  

   But in practice,
   consistent use of label formats will make it more likely that code for
   mail senders and receivers interoperates.

	</t>
	<t>Internationalized mail also allows UTF-8-encoded Unicode characters in
	   the local parts of mailbox names, which were historically only
	   ASCII.
	</t>

     </section>
     <section anchor="definitions" title="Definitions">
	<t>
	      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
              NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
              "MAY", and "OPTIONAL" in this document are to be interpreted as
              described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
              when, and only when, they appear in all capitals, as shown here.
 	   </t>
	   <t>
	      The term "IDN", for Internationalized Domain Name, refers
	      to a domain name containing either U-labels or A-labels.
	   </t>
	   <t>
	      Since DMARC is not currently a Standards Track protocol,
	      this specification offers advice rather than requirements
	      for DMARC.
	   </t>

     </section>

     <section title="General Principles">
	<t>In headers in EAI mail messages, domain names that were restricted to ASCII
	   can be U-labels, and mailbox local parts can be UTF-8.
	   Header field names and other text intended primarily to be interpreted by computers
	   rather than read by people remains ASCII.
	</t><t>
	   Strings stored in DNS records remain ASCII since there is no way to tell
	   whether a client retrieving a DNS record expects an EAI or an ASCII result.
	   When a domain name found in a mail header field includes U-labels, those labels
	   are translated to A-labels before being looked up in the DNS, as described
	   in <xref target="RFC5891" />.
	</t>
     </section>
     <section title="SPF and Internationalized Mail">
	<t>
	   <xref target="RFC7208">SPF</xref> uses two identities from the
	   SMTP session: the host name in the EHLO command and the domain
	   in the address in the MAIL FROM command.
	   Since the EHLO command precedes the server response that tells whether the server supports
	   the SMTPUTF8 extension, an IDN host name 
	   MUST be represented as A-labels.
	   An IDN in MAIL FROM can be either U-labels or A-labels.
	</t>
	<t>
	   All U-labels MUST be converted to A-labels before being used for
	   an SPF validation.
           This includes both the labels in the name used for the original DNS lookup,
	   described in Section 3 of <xref target="RFC7208"/>, and those used in the macro
	   expansion of domain-spec, described in Section 7.  Section 4.3
	   of <xref target="RFC7208"/> states that all IDNs in an SPF
	   DNS record MUST be A-labels; this rule is unchanged since any SPF
	   record can be used to authorize either EAI or
	   conventional mail.
	</t>
	<t>
	   SPF macros %{s} and %{l} expand the local part of the sender's mailbox.
	   If the local part contains non-ASCII characters, terms that include
	   %{s} or %{l} do not match anything,
	   because non-ASCII local parts cannot
	   be used as the DNS labels the macros are intended to match.
	   Since these macros are rarely used, this is unlikely to be
	   an issue in practice.
	</t>
     </section>

     <section title="DKIM and Internationalized Mail">
	<t>
	   <xref target="RFC6376">DKIM</xref> specifies a mail header field that
	   contains a cryptographic message signature and a DNS record that
	   contains the validation key.
	</t>

	<t>Section 2.11 of <xref target="RFC6376"/> defines dkim-quoted-printable.
	   Its definition is modified in messages with internationalized header fields
	   so that non-ASCII
	   UTF-8 characters need not be quoted.  The ABNF <xref target="RFC5234"/> for dkim-safe-char in
	   those messages is replaced by the following, adding non-ASCII
	   UTF-8 characters from <xref target="RFC3629"/>:
	</t>

	   <figure><artwork type="abnf"><![CDATA[
dkim-safe-char        =  %x21-3A / %x3C / %x3E-7E /
                                    UTF8-2 / UTF8-3 / UTF8-4
                         ; '!' - ':', '<', '>' - '~', non-ASCII

UTF8-2                = <Defined in Section 4 of RFC 3629>

UTF8-3                = <Defined in Section 4 of RFC 3629>

UTF8-4                = <Defined in Section 4 of RFC 3629>
]]></artwork></figure>

	<t>Section 3.5 of <xref target="RFC6376"/> states that IDNs in the d=,
	   i=, and s= tags of a DKIM-Signature header field MUST be encoded as
	   A-labels.
	   This rule is relaxed only for
	   <xref target="RFC6532">internationalized message header fields</xref>, so IDNs SHOULD
	   be represented as U-labels.
	   This provides improved consistency with other header fields.
	   (A-labels remain valid to allow a transition from older software.)
	   The set of allowable characters in the local part of an i= tag is extended
	   in the same fashion as local parts of email addresses as described in Section 3.2 of
	   <xref target="RFC6532"/>.

	   When computing or verifying the hash in a DKIM signature as described
	   in Section 3.7 of <xref target="RFC6376"/>, the hash MUST
	   use the domain name in the format it occurs in the header field.
	</t>
	<t>
	   Section 3.4.2 of <xref target="RFC6376"/> describes relaxed header
	   canonicalization.  Its first step converts all header field names
	   from uppercase to lowercase.  Field names are restricted to printable
	   ASCII (see <xref target="RFC5322"/>, Section 3.6.8), so this case conversion
	   remains ASCII case conversion.
	</t>
	<t>
	   DKIM key records, described in Section 3.6.1 of <xref target="RFC6376"/>, do not contain domain
	   names, so there is no change to their specification.
	</t>
     </section>
     
     <section title="DMARC and Internationalized Mail">
	<t>
	  <xref target="RFC7489">DMARC</xref> defines a policy language that
	  domain owners can specify for the domain of the address in an
	  RFC5322.From header field.
	</t>
	<t>
	   Section 6.6.1 of <xref target="RFC7489"/> specifies, somewhat imprecisely, how IDNs in the
	   RFC5322.From address domain are to
	   be handled. That section is updated to say that all U-labels in
	   the domain are converted to A-labels before further processing.
	   Section 7.1 of <xref target="RFC7489"/> is similarly updated to say that all U-labels
	   in domains being handled are converted to A-labels before further processing.
	</t>
	<t>
	   DMARC policy records, described in Sections 6.3 and 7.1 of <xref target="RFC7489"/>, can contain email
	   addresses in the "rua" and "ruf" tags.
	   Since a policy record can be used for both internationalized and
	   conventional mail, those addresses still have to be conventional addresses,
	   not internationalized addresses.	   
	</t>
     </section>

     <section title="IANA Considerations">
	<t>
	   This document has no IANA actions.
	</t>
     </section>
     <section title="Security Considerations">
	<t>
	   Email is subject to a vast range of threats and abuses.
	   This document attempts to slightly mitigate some of them but does
	   not, as far as the author knows, add any new ones.
	   The updates to SPF, DKIM, and DMARC are intended to allow the respective
	   specifications to work as reliably on internationalized mail as they do on
	   ASCII mail, so that applications that use them, such as some kinds of
	   mail filters that catch spam and phish, can work more reliably on internationalized mail.
	</t>
     </section>
  </middle>

  <back>
    <references title="Normative References">
       &RFC2119;
       &RFC8174;
       &RFC3629;
       &RFC5234;
       &RFC5890;
       &RFC5891;
       &RFC6376;
       &RFC6530;
       &RFC6531;
       &RFC5322;
       &RFC6532;
       &RFC7208;
       &RFC7489;
    </references>

  </back>
</rfc>
