<?xml version="1.0" encoding="US-ASCII" ?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc rfcedstyle="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc toc='yes'?>

<rfc submissionType="IETF" category="std" consensus="yes" ipr="trust200902" number="6857">

<front>
  <title abbrev="POP or IMAP Downgrade">
    Post-Delivery Message Downgrading for Internationalized Email Messages
  </title>
  <author initials="K.F." surname="Fujiwara" fullname="Kazunori Fujiwara">
    <organization abbrev="JPRS">Japan Registry Services Co., Ltd.</organization>
    <address>
	<postal>
	<street>Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda</street>
	<city>Chiyoda-ku</city>
	<region>Tokyo</region>
	<code>101-0065</code>
	<country>Japan</country>
	</postal>
	<phone>+81 3 5215 8451</phone>
	<email>fujiwara@jprs.co.jp</email>
    </address>
  </author>

  <date  month="February" year="2013" />
  <area>Applications</area>
  <workgroup>Email Address Internationalization (EAI)</workgroup>

  <keyword>EAI</keyword>
  <keyword>Email Address Internationalization</keyword>
  <keyword>Downgrade</keyword>
  <keyword>MAIL</keyword>


  <abstract>
    <t>
        The Email Address Internationalization (SMTPUTF8)
        extension to SMTP allows Unicode characters encoded in
        UTF-8 and outside the ASCII repertoire in mail header
        fields.
	Upgraded POP and IMAP servers support internationalized messages.

	If a POP or IMAP client does not support Email Address Internationalization,
	a POP or IMAP server cannot deliver internationalized messages to the client
	and cannot remove the message.

	To avoid that situation,
	this document describes a mechanism
	for converting internationalized messages into the traditional message format.
	As part of the conversion process, message elements that require
	internationalized treatment are recoded or removed,
        and receivers are able to recognize that they received messages containing such
	elements, even if they cannot process the internationalized elements.
    </t>
  </abstract>
</front>

<middle>
  <section title="Introduction" anchor="intro">
    <section title="Problem Statement">
    <t>
	Traditional (legacy) mail systems, which are defined by the Internet
Message Format <xref target="RFC5322" /> and other specifications,
	allow only ASCII characters in mail header field values.
	The SMTPUTF8 extension
		<xref target="RFC6530" />
		<xref target="RFC6531" />
		<xref target="RFC6532" />
	allows raw UTF&nbhy;8 (&lt;UTF8-non-ascii&gt;) <xref target="RFC3629"
/> in these mail header fields.

    </t>
    <t>
If a header field contains non&nbhy;ASCII strings,
a POP or IMAP server cannot deliver internationalized messages to
legacy clients that do not send UTF8 commands or have UTF8 capability.
Also, because they have no obvious or standardized way to explain what
is going on to clients, a POP or IMAP server cannot even safely discard the message.
    </t>
    </section>
    <section title="Possible Solutions">
      <t>
	There
        are four plausible approaches to the problem.  The preferred approach
        depends on the particular circumstances and relationship
        among the delivery SMTP server, the mail store, the POP or IMAP
        server, and the users and their Mail User Agent (MUA) clients.  The
four approaches are as follows:
        <list style="numbers">
           <t>If the delivery Mail Transport Agent (MTA) has sufficient knowledge about the POP
                  or IMAP server and the clients being used, the message
                  may be rejected as undeliverable.</t>
           <t>The message may be downgraded by the POP or IMAP server in a
              way that preserves maximum information at the expense of
              some complexity and that does not create security or operational
              problems in the mail system.
           </t>
           <t>Some intermediate downgrading may be applied that balances
                  additional information loss against lower complexity and greater
                  ease of implementation.</t>
           <t>The POP or IMAP server may fabricate a message that is
                  intended to notify the client that an internationalized
                  message is waiting but cannot be delivered until an
                  upgraded client is available.</t>
        </list>
      </t>
    </section>
    <section title="Approach Taken in This Specification">
      <t> This specification describes the second of these options.  It
        is worth noting that, at least in the general case, none of
        these options preserves sufficient information to guarantee that
        it is possible to reply to an incoming message without loss of
        information, so the choice may be considered one of the available "least
        bad" options.
	While this document specifies a well&nbhy;designed mechanism,
        it is only an interim solution while clients are being upgraded
        <xref target="RFC6855" />
        <xref target="RFC6856" />.
     </t>
<t>This message downgrading mechanism converts mail header fields to an
all&nbhy;ASCII representation.  The POP or IMAP server can use the
downgrading mechanism and then deliver the internationalized message in
a traditional form, which allows receivers to know whether a message is
internationalized or unknown or broken.
       </t>
    <t>
The Internationalized Mail Header specification <xref target="RFC6532" />
allows UTF&nbhy;8 characters (see <xref target="terms" />) to be used in
mail header fields and MIME header fields.
The Internationalized Mail Transport specification <xref target="RFC6531" />
allows UTF&nbhy;8 characters to be used in
some trace header fields.
The message downgrading mechanism specified here describes 
	the method by which
	internationalized messages <xref target="RFC6530" />
		<xref target="RFC6532" />
	are converted to traditional email messages
	<xref target="RFC5322" />.
</t>
	<t>
	This document provides a precise definition of the
	minimum-information-loss message downgrading process.
 	</t>
	<t>
	Downgrading consists of the following two parts:
	<vspace blankLines="1" />
	<list style="symbols">
	<t>Email header field downgrading</t>
	<t>MIME header field downgrading</t>
	</list>
A delivery status notification may contain non&nbhy;ASCII addresses. Delivery status
notification downgrading is described in <xref target="DSNdowngrading" />. 

    </t>
    <t>
	Email header field downgrading is described in <xref target="HeaderDowngrading" />.
	It generates ASCII&nbhy;only header fields.
    </t>
    <t>
	Header fields starting with Downgraded- are introduced in <xref target="DowngradeEncap" />.
	They preserve the information that appeared in the original
	header fields.
	</t>
    <t>
	The definition of MIME header fields in internationalized messages
	is described in RFC 6532.
	MIME header field downgrading is described in <xref target="MIMEheaderdowngrading" />.
	It generates ASCII&nbhy;only MIME header fields.
    </t>
    <t>
	Displaying downgraded messages that originally contained
	internationalized header fields is out of scope of this
	document. A POP or IMAP client that does not support UTF8
	extensions as defined for POP3 "UTF8 command"
	and IMAP "ENABLE UTF8=ACCEPT command"
	does not recognize the internationalized message format
	<xref target="RFC6532" />.
    </t>
    </section>
  </section>

  <section anchor="terms" title="Terminology">
    <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 RFC
      2119 <xref target="RFC2119" />.
    </t>
    <t>
   Many of the specialized terms used in this specification are defined in other
documents. They include "Overview and Framework for Internationalized Email"
   <xref target="RFC6530" />, the Internet Message Format specification <xref
target="RFC5322" />, and some of the basic MIME documents 
<xref target="RFC2045" /> <xref target="RFC2183" />.  This specification makes
extensive use of the MIME Message Header Extensions <xref
target="RFC2047" /> and extended MIME parameter encodings <xref
target="RFC2231" />.  For convenience, both are described as "encoded&nbhy;words" or
"encoded&nbhy;word encoding".  All of the encoded&nbhy;words generated
according to this specification use UTF-8 as their charset. 
</t>
<t>
   The terms "U&nbhy;label", "A&nbhy;label", and "IDNA" are used as defined in the IDNA
Definitions document <xref target="RFC5890" />.
   The terms "ASCII address", "non&nbhy;ASCII address", "SMTPUTF8", "message", and
"internationalized message" are used as defined RFC 6530.
   The term "non&nbhy;ASCII string"
   is used with the definition provided in the Internationalized Email Headers
document <xref target="RFC6532" />. The term "UTF&nbhy;8 character" is used
informally in this document to denote a Unicode character outside the ASCII
repertoire and encoded in UTF&nbhy;8. </t>

<t>This document refers to the Augmented Backus-Naur Form (ABNF) <xref
target="RFC5234" /> elements that appear in RFC 5322 and RFC 2045.</t>

<t>Some additional terms are defined locally
in&nbhy;line below. 
    </t>
  </section>

  <section title="Email Message Header Field Downgrading" anchor="HeaderDowngrading">
    <t>
	This section defines the method for converting each header field
	that may contain non-ASCII strings into ASCII.

	<xref target="DowngradeElements" /> describes the methods for rewriting
each ABNF element.

	<xref target="DowngradeEachHeader" /> describes the methods for
rewriting each header field. 

<xref target="MIMEdowngrading" /> describes the header fields for MIME body
parts. 

    </t>
    <section title="Downgrading Method for Each ABNF Element" anchor="DowngradeElements">

    <t>
	Header field downgrading is defined below for each ABNF element.
	Conversion of the header field terminates when no characters other than
those in the ASCII repertoire remain in the header field.
    </t>
    <t>
	The Internet Message Format <xref target="RFC5322" /> describes the
ABNF elements &lt;CFWS&gt;, &lt;comment&gt;, &lt;display&nbhy;name&gt;, &lt;group&gt;,
&lt;id&nbhy;left&gt;, &lt;id&nbhy;right&gt;,
	&lt;mailbox&gt;, &lt;quoted&nbhy;string&gt;, &lt;unstructured&gt;, and &lt;word&gt;.
	The MIME Format of Internet Message Bodies <xref target="RFC2045" /> describes the ABNF element &lt;value&gt;.
	Section 3.3 of the Internationalized Mail Transport specification
<xref target="RFC6531" /> and
Section 3.2 of the Internationalized Email Headers document <xref
target="RFC6532" /> updated &lt;domain&gt; to allow non&nbhy;ASCII characters.
    </t>

    <section title="Unstructured Downgrading" anchor="element:unstructured">

	<t>If the header field has an &lt;unstructured&gt; field that
	contains non&nbhy;ASCII strings,
	apply encoded-word encoding.
    </t></section>

    <section title="Word Downgrading" anchor="element:word">
	<t>If the header field has any &lt;word&gt;
	fields that contain non&nbhy;ASCII strings,
	apply encoded-word encoding.
    </t></section>

    <section title="Comment Downgrading" anchor="element:comment">
	<t>If the header field has any &lt;comment&gt;
	fields that contain non&nbhy;ASCII strings,
	apply encoded-word encoding.
    </t></section>


    <section title="MIME-Value Downgrading" anchor="element:mimevalue">

	<t>If the header field has any &lt;value&gt; elements <xref target="RFC2045" />
	that contain non&nbhy;ASCII strings,
	encode the &lt;value&gt; elements
	as encoded-words and leave the language information empty.
	If the &lt;value&gt; element is &lt;quoted&nbhy;string&gt;
		and it contains &lt;CFWS&gt; outside the DQUOTE <xref
target="RFC5234" />,
	remove the &lt;CFWS&gt; before this conversion.

    </t></section>

    <section title="Display-Name Downgrading" anchor="element:display-name">
	<t>
		If the header field has any &lt;address&gt;
	(&lt;mailbox&gt; or &lt;group&gt;) elements, and
	they have &lt;display&nbhy;name&gt; elements that contain non&nbhy;ASCII strings,
	encode the &lt;display&nbhy;name&gt; elements
	as encoded-words.
	Display&nbhy;Name downgrading uses the same algorithm as Word downgrading.
    </t></section>

    <section title="Domain Downgrading" anchor="element:domain">
	<t>
	If the header field has any &lt;domain&gt; elements
	that contain U&nbhy;labels,
	rewrite the non&nbhy;ASCII domain name into an ASCII domain name using A&nbhy;labels
	<xref target="RFC5891" />.
	</t>
	<t>
	</t>
    </section>

    <section title="Group Downgrading" anchor="element:group">
	<t>
	&lt;group&gt; is defined in Section 3.4 of the Internet Message Format specification <xref target="RFC5322" />.
	The &lt;group&gt; element may contain &lt;mailbox&gt; elements that contain non&nbhy;ASCII addresses.
	</t>
	<t>
	If a &lt;group&gt; element contains &lt;mailbox&gt; elements and one of those &lt;mailbox&gt; elements contains a non&nbhy;ASCII &lt;local&nbhy;part&gt;,
	rewrite the &lt;group&gt; element as
<figure>
<artwork>
<![CDATA[
display-name " " ENCODED_WORD " :;"
]]>
</artwork>
</figure>
where the &lt;ENCODED_WORD&gt; is the original &lt;group&nbhy;list&gt; encoded
as encoded-words.
	</t>
	<t>
	Otherwise, the &lt;group&gt; element contains an ASCII-only 
&lt;local&nbhy;part&gt;.
	If the &lt;group&gt; element contains non&nbhy;ASCII &lt;mailbox&gt; elements,
	they contain non&nbhy;ASCII domain names.
	Rewrite the non&nbhy;ASCII domain names into ASCII domain names using A&nbhy;labels
	<xref target="RFC5891" />.
	Generated &lt;mailbox&gt; elements contain ASCII addresses only.
	</t>
    </section>

    <section title="Mailbox Downgrading" anchor="element:mailbox">
	<t>
	If the &lt;local&nbhy;part&gt; of the &lt;mailbox&gt; element contains no
characters other than
   those in the ASCII repertoire,
	the &lt;domain&gt; element may contain non&nbhy;ASCII characters.

	Rewrite the non&nbhy;ASCII domain names into ASCII domain names using A&nbhy;labels
	<xref target="RFC5891" />.
	</t>
	<t>
	Otherwise, the &lt;local&nbhy;part&gt; may contain non&nbhy;ASCII characters.
	The &lt;local&nbhy;part&gt; that contains characters outside the ASCII
repertoire has no equivalent format for ASCII addresses.
	The &lt;addr&nbhy;spec&gt; element that contains non&nbhy;ASCII strings may
appear in two forms as:
	</t>
<figure>
<artwork>
<![CDATA[
"<" addr-spec ">"

or 

addr-spec
]]>
</artwork>
</figure>
	<t>
	Rewrite both as:
	</t>
<figure>
<artwork>
<![CDATA[
ENCODED-WORD " :;"
]]>
</artwork>
</figure>
	<t>where the &lt;ENCODED&nbhy;WORD&gt; is the original
&lt;addr&nbhy;spec&gt; encoded as encoded-words.
        </t>
    </section>

    <section title="Type-Addr Downgrading">
<t>     If the header field contains &lt;utf&nbhy;8&nbhy;type&nbhy;addr&gt;
	and the &lt;utf&nbhy;8&nbhy;type&nbhy;addr&gt; contains raw
non&nbhy;ASCII strings (&lt;UTF8-non-ascii&gt;), 
	it is in utf&nbhy;8&nbhy;address form <xref target="RFC6533" />. 
Convert it to utf&nbhy;8&nbhy;addr&nbhy;xtext form <xref target="RFC6533" />.
	Comment downgrading is also performed in this case.
	If the address type is unrecognized and the header field contains non&nbhy;ASCII strings,
	then fall back to using Encapsulation on the entire header field as
	specified in <xref target="DowngradeEncap" />.
    </t>
    </section>
    <section title="Encapsulation: A Last Resort" anchor="DowngradeEncap">
	<t>
   As a last resort, when header fields cannot be converted as
   discussed in the previous subsection, the fields are deleted
   and replaced by specialized new header fields.  Those fields
   are defined to preserve, in encoded form, as much
   information as possible from the header field values of the
   incoming message.  This mechanism is known as Encapsulation downgrading in
this specification because it preserves the original information in a different
form.  The syntax of these new header fields is:
	</t>
    <figure>
      <artwork>
<![CDATA[
fields                   =/ downgraded

downgraded =  "Downgraded-Message-Id:"         unstructured CRLF /
              "Downgraded-Resent-Message-Id:"  unstructured CRLF /
              "Downgraded-In-Reply-To:"        unstructured CRLF /
              "Downgraded-References:"         unstructured CRLF /
              "Downgraded-Original-Recipient:" unstructured CRLF /
              "Downgraded-Final-Recipient:"    unstructured CRLF 
]]>
      </artwork>
    </figure>
	<t>Applying this procedure to the "Received:" header field is
	prohibited.  Encapsulation downgrading is allowed for
	"Message&nbhy;ID:", "In&nbhy;Reply&nbhy;To:", "References:",
	"Original&nbhy;Recipient:", and "Final&nbhy;Recipient:" header fields.
        </t>
	<t>To preserve a header field in a Downgraded- header field:
	<list style="numbers">
	<t>Generate a new header field.
	  <list style="symbols">
	   <t>The field name is a concatenation of Downgraded- and the original field name.</t>
	   <t>The initial new field value is the original header field value.</t>
	 </list>
        </t>
	<t>
	  Treat the initial new header field value as if it were unstructured,
      and then apply the encoded-word encoding as necessary so that the resulting new header field value
	is completely in ASCII.
       </t>
       <t>
	Remove the original header field.
       </t>
	</list>
       </t>
    </section>
    </section>

    <vspace blankLines="100" />
    <section title="Downgrading Method for Each Header Field" anchor="DowngradeEachHeader">
    <t>
	The Mail and MIME Header Fields document <xref target="RFC4021" /> establishes a registry of header fields.
	This section describes the downgrading method for each header field
listed in that registry as of the date of publication of
this specification.
    </t>
    <t>
	If the entire mail header field contains no characters other than those
in the ASCII repertoire,
	email header field downgrading is not required.
	Each header field's downgrading method is described below.
    </t>
    <section title="Address Header Fields That Contain <address> Elements"
	anchor="header:address">
	<t>
<?rfc subcompact="yes" ?>
<vspace blankLines="1" />
	<list style="hanging">
	<t hangText="From:" />
	<t hangText="Sender:" />
	<t hangText="To:" />
	<t hangText="Cc:" />
	<t hangText="Bcc:" />
	<t hangText="Reply-To:" />
	<t hangText="Resent-From:" />
	<t hangText="Resent-Sender:" />
	<t hangText="Resent-To:" />
	<t hangText="Resent-Cc:" />
	<t hangText="Resent-Bcc:" />
	<t hangText="Resent-Reply-To:" />
	<t hangText="Return-Path:" />
	<t hangText="Disposition-Notification-To:" />
	</list>
<?rfc subcompact="no" ?>
	</t>
	<t>
	If the header field contains non&nbhy;ASCII characters, first perform
	Comment downgrading and Display&nbhy;Name downgrading as
	described in the corresponding subsections of
	<xref target="DowngradeElements" />.

	If the header field still contains non&nbhy;ASCII characters,
	complete the following two steps:
	<list style="numbers">
	<t>If the header field contains &lt;group&gt; elements
	   that contain non&nbhy;ASCII addresses,
	   perform Group downgrading on those elements.
        </t>
	<t>
	   If the header field contains &lt;mailbox&gt; elements
	   that contain non&nbhy;ASCII addresses,
	   perform Mailbox downgrading on those elements.
	</t>
	</list>
        </t>
	<t>
	This procedure may generate empty &lt;group&gt; elements in the "From:" and "Sender:" header fields.
	The Group Syntax document <xref target="RFC6854" /> updates the
Internet Message Format specification <xref target="RFC5322" />
	to allow (empty) &lt;group&gt; elements in the "From:" and "Sender:"
header fields.
	</t>
    </section>
    <vspace blankLines="100" />
    <section title="Non-ASCII Strings in <comment> Elements"
	     anchor="header:comments">
	<t>
	<?rfc subcompact="yes" ?>
	<vspace blankLines="1" />
	<list style="hanging">
	<t hangText="Date:" />
	<t hangText="Resent-Date:" />
	<t hangText="MIME-Version:" />
	<t hangText="Content-ID:" />
	<t hangText="Content-Transfer-Encoding:" />
	<t hangText="Content-Language:" />
	<t hangText="Accept-Language:" />
	<t hangText="Auto-Submitted:" />
	</list>
	<?rfc subcompact="no" ?>
	</t>
	<t>Except in comments, these header fields do not contain characters other than those in
the ASCII repertoire.
	If the header field contains UTF&nbhy;8 characters in comments, perform Comment downgrading.
    </t></section>
    <section title="Message-ID Header Fields" anchor="header:msgid">
	<t>
        <?rfc subcompact="yes" ?>
        <vspace blankLines="1" />
	<list style="hanging">
	<t hangText="Message-ID:" />
	<t hangText="Resent-Message-ID:" />
	<t hangText="In-Reply-To:" />
	<t hangText="References:" />
	</list>
	<?rfc subcompact="no" ?>
	</t>
	<t>If there are non-ASCII strings in &lt;id-left&gt; or
&lt;id-right&gt; elements,
perform Encapsulation.  Otherwise, the header field contains UTF-8 characters
in comments and Comment downgrading should be performed.

</t>
    </section>

    <section title="Received Header Field" anchor="header:received">
	<t>
	<?rfc subcompact="yes" ?>
	<vspace blankLines="1" />
	<list style="hanging">
	<t hangText="Received:" />
	</list>
	<?rfc subcompact="no" ?>
	<vspace blankLines="1" />
	If &lt;domain&gt; elements or &lt;mailbox&gt; elements contain U&nbhy;labels, perform Domain downgrading as specified in <xref target="element:domain" />.
	Comments may contain non&nbhy;ASCII strings; if so, perform Comment downgrading.
	</t>
	<t>
	After the Domain downgrading and the Comment downgrading,
	if the "FOR" clause contains a non&nbhy;ASCII &lt;local&nbhy;part&gt;, remove the
FOR clause.
	If the "ID" clause contains a non&nbhy;ASCII value, remove the ID clause.
	</t>
    </section>
    <vspace blankLines="100" />
    <section title="MIME Content Header Fields" anchor="header:mime">
	<t>
	<?rfc subcompact="yes" ?>
	<vspace blankLines="1" />
	<list style="hanging">
	<t hangText="Content-Type:" />
	<t hangText="Content-Disposition:" />
	</list>
	<?rfc subcompact="no" ?>
	<vspace blankLines="1" />
	Perform MIME&nbhy;Value and Comment downgrading.
        </t>
    </section>
    <section title="Non-ASCII Characters in <unstructured> Elements" anchor="header:unstructured">
	<t>
	<?rfc subcompact="yes" ?>
	<vspace blankLines="1" />
	<list style="hanging">
	<t hangText="Subject:" />
	<t hangText="Comments:" />
	<t hangText="Content-Description:" />
	</list>
	<?rfc subcompact="no" ?>
	<vspace blankLines="1" />
	Perform Unstructured downgrading.
        </t>
    </section>
    <section title="Non-ASCII Characters in <phrase> Elements" anchor="header:phrase"><t>
	<list style="hanging">
	<t hangText="Keywords:" />
	</list>
	Perform Word downgrading.
    </t></section>

    <section title="Other Header Fields" anchor="header:undefined">
	<t>Other header fields that are not covered in this document (such as
  implementation&nbhy;specific or user&nbhy;defined fields) might also contain
  non&nbhy;ASCII strings.  Any header field that does not have a conversion
  method defined above will be in this category and treated as follows.</t>
	<t>Perform Unstructured downgrading.</t>

	<t>If the software understands the header field's structure and a downgrading
algorithm other than Unstructured is applicable, that software SHOULD use
that algorithm; Unstructured downgrading is used when there is no other option.
</t>

	<t>Mailing list header fields (those that start in "List-")
	are part of this category.</t>
    </section>
    </section>
  </section>

  <section title="MIME Body Parts and Delivery Status Notifications" anchor="MIMEdowngrading">
    <t>
      Both the MIME body part header fields <xref target="RFC2045" /> <xref target="RFC6532" /> and the contents of a delivery
status notification <xref target="RFC6533" /> may contain non&nbhy;ASCII characters.
    </t>
    <section title="MIME Body Part Header Field Downgrading" anchor="MIMEheaderdowngrading">
    <t>
RFC 6532 specifies an extension that permits MIME header fields, including body
part header fields, to contain non&nbhy;ASCII strings.

	This section defines the conversion method to ASCII&nbhy;only header fields
	 for each MIME header field that contains non&nbhy;ASCII strings.
	Parse the message body's MIME structure at all levels and
	check each MIME header field to see whether it contains non&nbhy;ASCII strings.
	If the header field contains non&nbhy;ASCII strings in the header field value,
	the header field is a target of the MIME body part header field's downgrading.
	Each MIME header field's downgrading method is described below.
	Comment downgrading, MIME&nbhy;Value downgrading, and Unstructured downgrading
	are described in <xref target="HeaderDowngrading" />.

	<list style="hanging">
	<?rfc subcompact="yes" ?>
	<vspace blankLines="1" />
	<t hangText="Content-ID:">
	  <vspace />
	  Except in comments, the "Content-ID:" header field contains no characters other than
those in the ASCII repertoire.
	  If the header field contains
	  UTF&nbhy;8 characters in comments, perform Comment downgrading.
	</t>
	<vspace blankLines="1" />
	<t hangText="Content-Type:" />
	<t hangText="Content-Disposition:">
	        <vspace />
		Perform MIME&nbhy;Value downgrading and
		Comment downgrading.
	</t>
	<vspace blankLines="1" />
	<t hangText="Content-Description:">
	        <vspace />
		Perform Unstructured downgrading.
	</t>
	<?rfc subcompact="no" ?>
	</list>
    </t>
    </section>
    <section title="Delivery Status Notification Downgrading" anchor="DSNdowngrading">
	<t>
	If the message contains a delivery status notification
	(see Section 6 of the SMTP DSN Extension <xref target="RFC3461" />),
	perform the following tests and conversions.
	</t>
	<t>If there are "Original&nbhy;Recipient:" and "Final&nbhy;Recipient:" header fields,
           and the header fields contain non&nbhy;ASCII strings, perform
Type&nbhy;Addr downgrading. 
    </t></section>
  </section>

	<section title="Security Considerations" anchor="security">
	<t>
	The purpose of post&nbhy;delivery message downgrading is to allow
	POP and IMAP servers to deliver internationalized messages
	to traditional POP and IMAP clients
	and to permit the clients to display those messages.
	Users that receive such messages can know that they were
	internationalized.
	It does not permit receivers to read the messages in their
	original form and, in general, will not permit generating
	replies, at least without significant user intervention.
	</t>
	<t>
        After downgrading as specified in this document, the
        header fields of a message will contain ASCII characters
        only, some of them in encoded&nbhy;word form.  Nothing in
        this document or other SMTPUTF8 specifications <xref target="RFC6530" />
        <xref target="RFC6531" /> alters the basic properties of MIME that allow
        characters outside the ASCII repertoire in encodings as
        specified for them.  Thus,
	this document inherits the security considerations associated with
	MIME&nbhy;encoded header fields as specified in RFC 2047 <xref
target="RFC2047" /> and with UTF-8 itself as specified in RFC 3629 <xref
target="RFC3629" />.
	</t>
	<t>
	Rewriting header fields increases the opportunities for
	undetected spoofing by malicious senders.
	However, the rewritten header field values are
	preserved in equivalent MIME form
	or in newly defined header fields for which traditional MUAs have no special processing procedures.
	</t>
	<t>
	The techniques described here may invalidate methods that depend
	on digital signatures over any part of the message,
	which includes the top&nbhy;level header fields and body part header fields.
	Depending on the specific message being downgraded, at least the
	following techniques are likely to break: DomainKeys Identified
	Mail (DKIM) and possibly S/MIME and Pretty Good Privacy (PGP).
	The downgrade
	mechanism SHOULD NOT remove signatures even if the signatures
	will fail validation after downgrading.  As much of the information as
	possible from the original message SHOULD be preserved.
	</t>
	<t>
   While information in any email header field should usually be treated with
   some suspicion, current email systems commonly employ various
   mechanisms and protocols to make the information more trustworthy.
   Information in the new Downgraded&nbhy;* header fields is
   not inspected by traditional MUAs and may be even less trustworthy
   than the traditional header fields.
   Note that the Downgraded&nbhy;* header fields could have been inserted with malicious intent
   (and with content unrelated to the traditional header fields); however,
   traditional MUAs do not evaluate Downgraded&nbhy;* header fields.
	</t>
	<t>
  In addition, if an "Authentication&nbhy;Results:" header field <xref target="RFC5451" /> is
  present, traditional MUAs may consider the digital signatures to be
  valid.

	</t>
    <t>
See the Security Considerations sections in the Group Syntax document <xref
target="RFC6854"/> and the Internationalized Email Framework <xref target="RFC6530"/> for more discussion.
    </t>
  </section>

  <section title="Implementation Note: Encoded-Word Encoding">
    <t>
While the specification of encoded-words includes specific rules for dealing
with whitespace in adjacent encoded words <xref target="RFC2047" />, there are
a number of deployed implementations 
  that fail to implement the algorithm correctly.  As a result, whitespace
  behavior is somewhat unpredictable, in practice, when multiple encoded words
  are used. 
</t>
<t>
While RFC 5322 states that implementations SHOULD limit lines
  to 78 characters or less, implementations MAY choose to allow
  overly long encoded words to work around faulty implementations of
encoded-words.  Implementations that choose to do so SHOULD have an
  optional mechanism to limit line length to 78 characters.
     </t>
  </section>

  <section title="IANA Considerations" anchor="iana">

   <t>
   The experimental specification from which this document was partially
derived <xref target="RFC5504" /> specifies that no new
header fields beginning with Downgraded- are to be registered.  That
restriction is now lifted, and this document 
   makes a new set of registrations, replacing the experimental fields with
   standard ones.
   </t>
   <section title="Obsolescence of Existing Downgraded-* Header Fields">
   <t>
   The Downgraded&nbhy;* header fields that were registered as experimental
   fields in RFC 5504 are no longer in use.  IANA has changed the status
   from "experimental" to "obsoleted" for every name in the "Permanent Message
   Header Field Names" registry that began with Downgraded-.
   </t>
   </section>
   <section title="Registration of New Downgraded-* Header Fields">

   <t>
	 The following header fields have been registered in the
	 "Permanent Message Header Field Names" registry, in accordance with the
         procedures set out in the Header Field Registration document <xref target="RFC3864" />.
   </t>
   <t>
<?rfc subcompact="yes" ?>
<vspace blankLines="1" />
    <list style="hanging">
	<t hangText="Header field name:">Downgraded-Message-Id</t>
	<t hangText="Applicable protocol:">mail</t>
	<t hangText="Status:">standard</t>
	<t hangText="Author/change controller:">IETF</t>
	<t hangText="Specification document(s):">This document (<xref target="DowngradeEncap" />)</t>
    </list>
<vspace blankLines="1" />
    <list style="hanging">
	<t hangText="Header field name:">Downgraded-In-Reply-To</t>
	<t hangText="Applicable protocol:">mail</t>
	<t hangText="Status:">standard</t>
	<t hangText="Author/change controller:">IETF</t>
	<t hangText="Specification document(s):">This document (<xref target="DowngradeEncap" />)</t>
    </list>
<vspace blankLines="1" />
    <list style="hanging">
	<t hangText="Header field name:">Downgraded-References</t>
	<t hangText="Applicable protocol:">mail</t>
	<t hangText="Status:">standard</t>
	<t hangText="Author/change controller:">IETF</t>
	<t hangText="Specification document(s):">This document (<xref target="DowngradeEncap" />)</t>
    </list>
<vspace blankLines="1" />
    <list style="hanging">
	<t hangText="Header field name:">Downgraded-Original-Recipient</t>
	<t hangText="Applicable protocol:">mail</t>
	<t hangText="Status:">standard</t>
	<t hangText="Author/change controller:">IETF</t>
	<t hangText="Specification document(s):">This document (<xref target="DowngradeEncap" />)</t>
    </list>
<vspace blankLines="1" />
    <list style="hanging">
	<t hangText="Header field name:">Downgraded-Final-Recipient</t>
	<t hangText="Applicable protocol:">mail</t>
	<t hangText="Status:">standard</t>
	<t hangText="Author/change controller:">IETF</t>
	<t hangText="Specification document(s):">This document (<xref target="DowngradeEncap" />)</t>
    </list>
<?rfc subcompact="no" ?>
    </t>
    </section>
  </section>

  <section title="Acknowledgements">
    <t>
	This document draws heavily from the experimental in&nbhy;transit
	message downgrading procedure described RFC 5504.  The contributions of the coauthor
	of that earlier document, Y. Yoneya, are gratefully
	acknowledged.
	Significant comments and suggestions were received from John
	Klensin, Barry Leiba, Randall Gellens, Pete Resnick, Martin J. Durst,
	and other WG participants.
    </t>
  </section>

</middle>

<back>
  <references title="Normative References">
    <?rfc include="reference.RFC.2045" ?>
    <?rfc include="reference.RFC.2047" ?>
    <?rfc include="reference.RFC.2119" ?>
    <?rfc include="reference.RFC.2183" ?>
    <?rfc include="reference.RFC.2231" ?>
    <?rfc include="reference.RFC.3461" ?>
    <?rfc include="reference.RFC.3629" ?>
    <?rfc include="reference.RFC.3864" ?>
    <?rfc include="reference.RFC.4021" ?>
    <?rfc include="reference.RFC.5322" ?>
    <?rfc include="reference.RFC.5890" ?>
    <?rfc include="reference.RFC.5891" ?>
    <?rfc include="reference.RFC.6530" ?>
    <?rfc include="reference.RFC.6531" ?>
    <?rfc include="reference.RFC.6532" ?>
    <?rfc include="reference.RFC.6533" ?>


<!--    I-D.draft-leiba-5322upd-from-group"  -->



<reference anchor='RFC6854'>
<front>
<title>Update to Internet Message Format to Allow Group Syntax in the "From:" and "Sender:" Header Fields</title>

<author initials='B' surname='Leiba' fullname='Barry Leiba'>
    <organization />
</author>

<date month='January' year='2013' />

<abstract><t>The Internet Message Format (RFC 5322) allows "group" syntax in some email header fields, such as "To:" and "CC:", but not in "From:" nor "Sender:".  This document updates RFC 5322 to relax that restriction, allowing group syntax in those latter fields, as well as in "Resent- From:" and "Resent&nbhy;Sender:", in certain situations.</t></abstract>

</front>

<seriesInfo name='RFC' value='6854' />

</reference>

<!--    I-D.draft-ietf-eai-rfc5721bis"  -->




<reference anchor='RFC6856'>
<front>
<title>Post Office Protocol Version 3 (POP3) Support for UTF-8</title>

<author initials='R' surname='Randy' fullname='Randy'>
    <organization />
</author>

<author initials='C' surname='Newman' fullname='Chris Newman'>
    <organization />
</author>

<author initials='J' surname='Yao' fullname='Jiankang Yao'>
    <organization />
</author>

<author initials='K' surname='Fujiwara' fullname='Kazunori Fujiwara'>
    <organization />
</author>

<date month='January' year='2013' />

<abstract><t>This specification extends the Post Office Protocol version 3 (POP3) to support UTF-8 encoded international string in user names, passwords, mail addresses, message headers, and protocol-level textual strings.</t></abstract>

</front>

<seriesInfo name='RFC' value='6856' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-eai-rfc5721bis-08.txt' />
</reference>


<!--    I-D.draft-ietf-eai-5738bis"  -->

<reference anchor='RFC6855'>
<front>
<title>IMAP Support for UTF-8</title>

<author initials='P' surname='Resnick' fullname='Pete Resnick'>
    <organization />
</author>

<author initials='C' surname='Newman' fullname='Chris Newman'>
    <organization />
</author>

<author initials='S' surname='Shen' fullname='Sean Shen'>
    <organization />
</author>

<date month='February'  year='2013' />

<abstract><t>This specification extends the Internet Message Access Protocol version 4rev1 (IMAP4rev1) to support UTF-8 encoded international characters in user names, mail addresses and message headers.  This specification replaces RFC 5738.</t></abstract>

</front>

<seriesInfo name='RFC' value='6855' />

</reference>





  </references>
  <references title="Informative References">
    <?rfc include="reference.RFC.5234" ?>
    <?rfc include="reference.RFC.5451" ?>
    <?rfc include="reference.RFC.5504" ?>

  </references>

  <section title="Downgrading Example">
	<t>
	This appendix shows a message downgrading example.
	Consider a received mail message where:
	<list style="symbols">
	  <t>
	    The sender address is a non&nbhy;ASCII address, "NON&nbhy;ASCII&nbhy;LOCAL@example.com". Its display&nbhy;name is "DISPLAY&nbhy;LOCAL".
	  </t>
	  <t>
	    The "To:" header field contains two non&nbhy;ASCII addresses, "NON&nbhy;ASCII&nbhy;REMOTE1@example.net" and "NON&nbhy;ASCII&nbhy;REMOTE2@example.com" Its display&nbhy;names are "DISPLAY&nbhy;REMOTE1" and "DISPLAY&nbhy;REMOTE2".
	  </t>
	  <t>
	    The "Cc:" header field contains a non&nbhy;ASCII address, "NON&nbhy;ASCII&nbhy;REMOTE3@example.org".
		Its display&nbhy;name is "DISPLAY&nbhy;REMOTE3".
	  </t>
	  <t>Four display&nbhy;names contain non&nbhy;ASCII characters.</t>
	  <t>
	    The "Subject:" header field is "NON&nbhy;ASCII&nbhy;SUBJECT", which contains non&nbhy;ASCII strings.
	  </t>
	  <t>
	    The "Message&nbhy;Id:" header field contains "NON&nbhy;ASCII&nbhy;MESSAGE_ID",
	    which contains non&nbhy;ASCII strings.
	  </t>
	  <t>
	    There is an unknown header field "X&nbhy;Unknown&nbhy;Header:", which  contains non&nbhy;ASCII strings.
	  </t>
	</list>
	</t>

	<t>
	<figure title="Received Message in a Maildrop" anchor="example-originaleaismtpsession">


	  <artwork>
<![CDATA[
Return-Path: <NON-ASCII-LOCAL@example.com>
Received: from ... by ... for <NON-ASCII-REMOTE1@example.net>
Received: from ... by ... for <NON-ASCII-REMOTE1@example.net>
From: DISPLAY-LOCAL <NON-ASCII-LOCAL@example.com>
To: DISPLAY-REMOTE1 <NON-ASCII-REMOTE1@example.net>,
    DISPLAY-REMOTE2 <NON-ASCII-REMOTE2@example.com>
Cc: DISPLAY-REMOTE3 <NON-ASCII-REMOTE3@example.org>
Subject: NON-ASCII-SUBJECT
Date: Mon, 30 Jul 2012 01:23:45 -0000
Message-Id: NON-ASCII-MESSAGE_ID
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Unknown-Header: NON-ASCII-CHARACTERS

MAIL_BODY
]]>
	  </artwork>
	</figure>
	</t>
<t>
   The downgraded message is shown in Figure 2.  "Return&nbhy;Path:",
   "From:", "To:", and "Cc:" header fields are rewritten.  "Subject:"
   and "X&nbhy;Unknown&nbhy;Header:" header fields are encoded as encoded&nbhy;words.
   The "Message&nbhy;Id:" header field is encapsulated as a "Downgraded&nbhy;Message&nbhy;Id:" header field.
</t>

<t>
<figure title="Downgraded Message" anchor="example-downgrading">
<artwork>
<![CDATA[
Return-Path: =?UTF-8?Q?NON-ASCII-LOCAL@example.com?= :;
Received: from ... by ...
Received: from ... by ...
From: =?UTF-8?Q?DISPLAY-LOCAL?=
      =?UTF-8?Q?NON-ASCII-LOCAL@example.com?= :;
To:   =?UTF-8?Q?DISPLAY-REMOTE1?=
      =?UTF-8?Q?NON-ASCII-REMOTE1@example.net?= :;,
      =?UTF-8?Q?DISPLAY-REMOTE2?=
      =?UTF-8?Q?NON-ASCII-REMOTE2@example.com?= :;,
Cc:   =?UTF-8?Q?DISPLAY-REMOTE3?=
      =?UTF-8?Q?NON-ASCII-REMOTE3@example.org?= :;
Subject: =?UTF-8?Q?NON-ASCII-SUBJECT?=
Date: Mon, 30 Jul 2012 01:23:45 -0000
Downgraded-Message-Id: =?UTF-8?Q?MESSAGE_ID?=
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Unknown-Header: =?UTF-8?Q?NON-ASCII-CHARACTERS?=

MAIL_BODY
]]>
</artwork>
</figure>
      </t>
  </section>

</back>
</rfc>
