<?xml version="1.0" encoding="US-ASCII"?>
<!--  SMTP TLS HSTS Internet Draft  -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc1939 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1939.xml">
<!ENTITY rfc2449 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2449.xml">
<!ENTITY rfc2971 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2971.xml">
<!ENTITY rfc3207 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3207.xml">
<!ENTITY rfc3461 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3461.xml">
<!ENTITY rfc3156 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3156.xml">
<!ENTITY rfc3501 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml">
<!ENTITY rfc3864 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3864.xml">
<!ENTITY rfc5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY rfc5280 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY rfc5321 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5321.xml">
<!ENTITY rfc5322 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5322.xml">
<!ENTITY rfc5751 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5751.xml">
<!ENTITY rfc6125 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6125.xml">
<!ENTITY rfc6376 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6376.xml">
<!ENTITY rfc6698 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6698.xml">
<!ENTITY rfc6797 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6797.xml">
<!ENTITY rfc6962 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6962.xml">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> 
<?rfc toc="yes"?>
<rfc ipr="noDerivativesTrust200902" docName="draft-wchuang-msmd-00">
    <front>
        <title abbrev="MSMD">MSMD: Mandatory Secure Mail Delivery</title>
    
        <author initials="W." surname="Chuang"
                fullname="Weihaw Chuang">
            <organization>Google, Inc.</organization>
            <address>
                <postal>
                    <street>1600 Amphitheatre Parkway</street>
                    <city>Mountain View</city> <region>CA</region>
                    <code>94043</code>
                    <country>US</country>
                </postal>
                <email>weihaw@google.com</email>
            </address>
        </author>
        <author initials="N." surname="Lidzborkski"
                fullname="Nicolas Lidzborkski">
            <organization>Google, Inc.</organization>
                <address>
                <postal>
                    <street>1600 Amphitheatre Parkway</street>
                    <city>Mountain View</city> <region>CA</region>
                    <code>94043</code>
                    <country>US</country>
                </postal>
                <email>nlidz@google.com</email>
            </address>
        </author>
        <author initials="E." surname="Bursztein"
                fullname="Elie Bursztein">
            <organization>Google, Inc.</organization>
                <address>
                <postal>
                    <street>1600 Amphitheatre Parkway</street>
                    <city>Mountain View</city> <region>CA</region>
                    <code>94043</code>
                    <country>US</country>
                </postal>
                <email>elieb@google.com</email>
            </address>
        </author>
    
        <date month="October" year="2013" />
    
        <area>General</area>
        <workgroup>Application Area Working Group</workgroup>
        <keyword>RFC</keyword>
        <keyword>Request for Comments</keyword>
        <keyword>I-D</keyword>
    
        <keyword>Internet-Draft</keyword>
        <keyword>SMTP</keyword>
        <keyword>TLS</keyword>
        <keyword>Email</keyword>
        <keyword>Security</keyword>
        <keyword>Privacy</keyword>
        <abstract>
            <t>Opportunistic SMTP TLS does not enforce electronic mail
            delivery using TLS leading to potential loss of privacy
            and security.  We propose an optional mail header
            extension "mandatory-secure-mail-delivery:" and SMTP EHLO
            response extension "MSMD" that indicates mail must be
            delivered privately using TLS and with integrity using
            DKIM, and thereby provide a security guarantee to the
            user.  When mail is sent with the header indicating
            privacy and integrity and if the receiving party does not
            support this, the mail is instead bounced.  To protect the
            mail after delivery, the destination SMTP server must
            advertise its capabilities as part of the EHLO response,
            and the sender can choose whether the destination is able
            to honor the privacy requirements specified on the mail
            header.</t>
        </abstract>
    </front>
    <middle>
    <section anchor="intro" title="Introduction">
        <t>Opportunistic <xref target="RFC3207">SMTP TLS</xref> does
        not enforce electronic mail delivery using TLS.  This means
        that even if a user wishing to send mail has a provider that
        supports SMTP TLS, the provider does not necessarily deliver
        mail over TLS depending on whether the peer supports TLS or if
        the TLS negotiation fails.  Unfortunately our observation is
        that most mail providers do not support SMTP TLS.  These
        deployment problems are made worse because users typically do
        not have control over delivery and do not know whether their
        message will be delivered securely.  Also users have an
        assumption that their mail content will be delivered without
        modifications though in fact with traditional <xref
        target="RFC5321">SMTP</xref> there is no assurance of this.
        This combination diminishes trust amongst electronic mail
        users.</t>

        <t>We believe that finding a solution will become more
        important as recent news indicates that eavesdroppers will
        increasingly targeting electronic mail delivery as a likely
        point of attack (if not already).  <!--Various governments
        such as the <eref
        target="http://www.nytimes.com/2013/08/08/us/broader-sifting-of-data-abroad-is-seen-by-nsa.html">United
        States</eref> and <eref
        target="http://www.nytimes.com/2013/02/19/technology/chinas-army-is-seen-as-tied-to-hacking-against-us.html">China</eref>
        have explicitly targeted mail content for surveillance,
        motivated by national and domestic security concerns, economic
        interests, and other reasons.  The problem with such broad
        scoped secret surveillance is the lack of oversight, and that
        it will enable unmitigated abuse of this information. Mail
        delivery has become an attractive target for eavesdroppers
        since web client side security has steadily improved due to
        increasingly effective and deployed <eref
        target="http://googleonlinesecurity.blogspot.com/2011/11/protecting-data-for-long-term-with.html">encryption</eref>,
        while most mail delivery remains unencrypted.  --> This is
        motivated by the observation that web client side security has
        steadily improved due to increasingly effective and deployed
        <eref
        target="http://googleonlinesecurity.blogspot.com/2011/11/protecting-data-for-long-term-with.html">encryption</eref>
        while most mail delivery remains unencrypted.  Moreover SMTP
        TLS is more susceptible to active attack such as
        Man-in-the-Middle (MitM) than web client security.  Attacks
        such as certificate forgery or TLS downgrade have been
        mitigated with <eref
        target="https://www.imperialviolet.org/2011/05/04/pinning.html">certificate
        pinning</eref> and <xref target="RFC6797">HSTS</xref>.  No
        such mechanism exists today with SMTP TLS.  <!--While the
        authors are unaware of active MitM SMTP TLS attacks, recent
        <eref
        target="http://www.nytimes.com/2013/09/06/us/nsa-foils-much-internet-encryption.html">publication
        </eref> indicates that it is likely.--></t>

        <t>The main alternative is to use encrypted mail such as
        PGP/MIME and S/MIME which keep the mail body private during
        delivery.  However they do nothing to guarantee private mail
        delivery, and traditional SMTP transmits the sender and the
        recipient in the clear.  Thus even <xref
        target="RFC3156">PGP/MIME</xref> or <xref
        target="RFC5751">S/MIME</xref>
        encrypted mail is susceptible to meta-data surveillance.
        <!--Recent <eref
        target="http://www.nytimes.com/2013/09/29/us/nsa-examines-social-networks-of-us-citizens.html">publication</eref>
        indicates that meta-data is very much of interest to
        governments.--></t>

        <t>We propose optional mail extensions that indicates that
        mail delivery must be delivered privately using TLS, and must
        be signed with DKIM to indicate authenticity and integrity.
        The user or their provider can choose to set a new mail header
        "mandatory-secure-mail-delivery:" that indicates private mail
        distribution as described in <xref target="emailheader"/>.
        When mail is sent with this header, the SMTP client (sending
        SMTP server) checks if the receiving side supports encrypted
        and signed private delivery.  If not, the mail is bounced.
        The bounce message must be returned to sender securely as
        well, otherwise the message must be dropped.  A courtesy
        message may be sent to the recipient depending on the sender's
        settings.  Another concern is maintaining the security of the
        mail at the destination and beyond.  The SMTP server
        (destination SMTP server) must advertise it supports and
        enforces this protocol as part of the EHLO response using the
        extension "MSMD" which the sender will verify as described in
        <xref target="smtpexchange"/>.  Mail providers that honor this
        protocol should ensure that derivative mails created such as
        when forwarding and replying maintain the requested private
        mail delivery property by copying the security header to the
        new message.  This is not mandatory in the base protocol
        because honoring it would impose restrictions for all Mail
        User Agent interfaces that would be a substantial barrier to
        entry.  In the following sections, we show how we can elevate
        the "should" to "must" for securing derivative mails.  Thus
        with the base protocol at minimum a sender can be certain that
        a sent mail will be delivered privately and unaltered.</t>

        <t>The protocol can impose additional security requirement
        options via arguments on the message-header as
        described in <xref target="headeroption"/> that the SMTP
        client can verify.  As part of this verification process, the
        SMTP server can also advertise domain security capability
        options as part of the EHLO response as described in <xref
        target="domainoption"/>.  They can help insure the recipient's
        mail provider is just as capable of verifying the security
        requirements as the sender's provider.  Options enable the
        protocol to flexibly extend the definition of security to meet
        different needs, and to evolve as the security standing of the
        ecosystem improves.</t>

        <t>Options are particularly useful if the sender wishes to
        mandate enforcement of the protocol for the entire
        conversation meaning through all derived forwarded and replied
        mails.  We propose a Secure Conversation and Access (SCA)
        option that mandates for all mail messages so marked, all
        derived mail must also be so marked.  Any mail agent in the
        domain must honor and propagate the additional SCA protocol in
        addition to the base protocol.  This imposes a powerful and
        stringent requirement over all MUA such as IMAP or POP3 to
        support the protocol as described in <xref target="mua"/>, or
        not be able to access these messages.  SCA also requires that
        these clients must access these messages privately over an
        encrypted channel.  Thus a sender can be sure that a sent mail
        and its derivatives will be sent and accessed securely.</t>

        <t>Via options we can also specify TLS settings to improve
        security.  Of the threats to TLS, perhaps the most difficult
        to protect against is MitM since the adversary impersonates
        the endpoint.  To defend against this, we bundle various TLS
        settings into tiers corresponding to the capabilities of
        ecosystem that improves the ability to reject MitM peers.
        </t>

        <t>This example illustrates the message declaration, and that
        of the recipient i.e. the base protocol.  It also illustrates
        the verification by the sender.  We use the convention "C:"
        for client and "S:" for server.</t>
        <figure anchor="basicmsmd" title="Basic MSMD Protocol Example">
        <artwork>
   Some mail message has a private delivery request, which specifies the
   mail header: 
   mandatory-secure-mail-delivery:

   The SMTP exchange protocol appears as follows:
   S: &lt;waits for connection on TCP port 25>
   C: &lt;opens connection>
   S: 220 mail.server.org SMTP service ready
   C: EHLO mail.client.com
   S: 250-mail.server.org welcomes you
   S: 250-STARTTLS
   S: 250-MSMD
   S: 250 DSN
   C: STARTTLS
   S: 220 Go ahead
   C: &lt;starts TLS negotiation using default TLS requirements>
   C &amp; S: &lt;negotiate a TLS session>
   C: EHLO mail.client.com
   S: 250-mail.server.org welcomes you
   S: 250-MSMD
   S: 250 DSN
   C: &lt;Perform MSMD Requirements Check: On failure close the connection>
   C: DATA
   C: &lt;Send mail with DKIM signature> 

   Note: 1) TLS requirements are passed to the TLS setup 2) after the
   second EHLO, that there is a MSMD Requirements Check. The latter
   verifies that the TLS connection has started, and that the MSMD
   SMTP extension was presented on the second EHLO.
        </artwork>
        </figure>
        
    </section>

    <section anchor="specification" title="Mandatory Private Delivery Specification">
        <section anchor="emailheader" title="MSMD Mail Header">
            <t>We propose a new optional <xref target="RFC5322">mail
            header:</xref> "mandatory-secure-mail-delivery:" (MSMD) in
            accordance with <xref target="RFC3864"/>.  The MSMD header
            indicates that this message must be privately distributed
            using encryption.  It may have associated with it
            parameters that impose additional requirements on the
            delivery security and destination security.  The
            parameters will be discussed further in <xref
            target="headeroption"/>.  Requirements may only be applied
            if the user's mail provider can support those
            requirements.</t>

            <t>Mail messages derived from a mail message with the MSMD
            message header should copy this header along with any
            options, and those derived messages must honor the
            security protocol.  Examples of deriving the message are
            replying and forwarding the mail message.  If the Secure
            Conversation and Access option is specified, the derived
            message must copy the message header.  The user is free to
            download the content, or distribute the contents via GUI
            means such as cut or copy and paste without the header.
            The distinction is meant to protect mail content against
            accidental exposure via unencrypted mail delivery, but not
            stymie legitimate every day use of mail content.  Derived
            mail may add additional security requirements to the MSMD
            message header but must not remove any requirements.</t>
        </section>

        <section anchor="smtpexchange" title="MSMD SMTP Extension">
            <t>When delivering the mail message, the SMTP client must
            verify that the destination will honor maintaining the
            MSMD protocol once the message is delivered.  To support
            this, the SMTP server advertises that it supports the
            protocol via a MSMD <xref target="RFC5321">SMTP
            extension</xref>.  This means that during the EHLO
            response, there will be a "MSMD" keyword, and that it may
            be followed by parameters describing additional
            capabilities of the server.  The capabilities are
            described in <xref target="domainoption"/>.  The SMTP
            client verifies that the SMTP server has both MSMD and
            STARTTLS extensions, then establishes the TLS connection.
            As the connection at this point is encrypted and private,
            it redoes the EHLO, gathering any capabilities specified
            by the server.  Then it does the MSMD requirements check
            using the securely communicated capabilities values.  In
            the basic configuration meaning without any additional
            requirements or capabilities, SMTP client just verifies
            the connection is in TLS, and re-verifies that there is a
            MSMD SMTP extension.  Success allows mail delivery to
            continue, while failure causes a notification to be sent
            as described <xref target="failurenotify"/> and the TLS
            and SMTP connection is closed and reset.  Any other Mail
            Transfer Agent must support this protocol in a similar
            fashion or be prevent from transferring mails marked by
            the MSMD header.</t>
        </section>

        <section anchor="dkim" title="Domain Keys Identified Mail">
            <t>All MSMD market mails must be sent with <xref
            target="RFC6376">DKIM</xref> signatures to provide
            assurance for the integrity and authenticity of the mail
            message.  Similarly MSMD SMTP Servers must verify received
            DKIM messages.  In the MSMD context, how DKIM handles
            failed signature verification is up to the mail provider.
            MSMD mandates that at least the message body and
            "mandatory-secure-mail-delivery:" header be signed leaving
            the rest as implementation dependent.</t>
        </section>

        <section anchor="deployment" title="Deployment Concerns">
            <t>Though much of this proposal is concerned with security
            of SMTP mail delivery, the base protocol recommends that
            all other means of accessing the protected mail via Mail
            User Agents should be similarly protected.  This means all
            mail fetch mechanism should similarly honor the encrypted
            delivery requirement and should propagate the MSMD header
            to derived mails.</t>

            <t>If the Secure Conversation and Access option is given, the
            restrictions on MUA become mandatory.  Also to prevent
            eavesdropping during fetch, SCA places a further
            requirement to encrypt access.  If the MUA cannot insure
            propagating the MSMD protocol or provide private access,
            that they must be prevented from accessing user data
            marked with the MSMD security header.  Upon access failure
            these clients should use whatever error reporting
            mechanism built into the protocol to provide a
            notification indicating the cause and an alternative means
            of accessing the mail securely.
            </t>

            <t>Mailing list forwarders supporting the MSMD protocol
            must also check if each list recipient honors the protocol
            in the same way as a single recipient.  Failure to meet
            the security requirements results in the message not being
            delivered and may result in notification of delivery
            failure.  These forwarders must also insure that DKIM
            verification will succeed either by maintaining the exact
            same MSMD header and message body, or by re-generating the
            DKIM signature.</t>
        </section>

        <section anchor="failurenotify" title="Delivery Failure Notification">
            <t>For message delivery failure due to insufficient
            security, the sender will be notified via a <xref
            target="RFC3461">non-delivery notification
            message</xref>.  For diagnostics, these security bounce
            messages should include at least a description of the
            failure including which step of the SMTP handshake that
            failed, any missing requested options, and identifying
            information such as destination and subject.  Security
            bounce messages must be delivered with the same security
            guarantees as the originating message.  This means that
            the MSMD header is copied to the bounce message, and
            honored as with the original, and a DKIM signature placed
            on the message.  To prevent an endless notification loop,
            delivery failure of these security bounce messages due to
            MSMD protocol failure causes the message to be silently
            dropped.</t>
            
            <t>Upon security failure on delivery, the SMTP client may
            still sent a courtesy message to the recipient depending
            on the header options, to let them know that mail is
            missing due to security failure at delivery time.  The
            courtesy message is optional in case the sender insists on
            keeping private all meta-data that might be leaked by
            courtesy messages.  It differs from security bounce
            messages in that the security header is not propagated, and
            the information passed is more restricted.  The courtesy
            message should just provide enough to identify the message
            and cause but no more i.e. identifying information such as
            from: and subject: but not the body or any additional
            user identifying header information.</t>
        </section>

        <section anchor="mua" title="Mail User Agent Support">
            <t>Assuming that the Secure Conversation Mail option
            applies to the mail message, Mail User Agents such as IMAP
            or POP3 Clients must honor the MSMD security protocol, and
            clients must be able to prove to the servers they are
            capable of honoring the protocol.  Such MUA servers must
            be able to display the MSMD extension, and the MUA clients
            must be able present to the server its ability to honor
            the MSMD protocol.  If MUA clients does not display
            support for MSMD, then MSMD MUA servers must prevent
            access to MSMD marked and protected mail.</t>

            <section anchor="imapsupport" title="IMAP Extension">
                <t>In the case of <xref
                target="RFC3501">IMAP</xref>, it provides a
                CAPABILITY command to describe the server extensions.
                <!--While the <xref target="RFC2971">ID</xref>
                extension provides a capability that uniquely identify
                the client and its version, it is stated that that
                this information may not be used to qualify the
                behavior of the IMAP server.-->  We propose a
                new MSMD capability to IMAP where "MSMD" appears in
                the CAPABILITY response, and a new "MSMD"
                command that announces to the server that the client
                supports the MSMD protocol.</t>
            </section>

            <section anchor="pop3support" title="POP3 Extension">
                <t>Like IMAP, <xref target="RFC1939">POP3</xref>,
                it provides a <xref target="RFC2449">CAPA</xref>
                command to describe the server extensions.  We propose
                a new MSMD capability where "MSMD" appears in the CAPA
                response, and a new "MSMD" command so that the client can
                indicate to the server it supports the MSMD
                protocol.</t>
            </section>
        </section>

        <section anchor="compatibility" title="Compatibility">
            <t>Specification of the MSMD security header is on a per
            message basis.  This allows the sender to fallback
            to clear-text delivery for backwards compatibility for
            recipients that don't support the protocol and don't need
            the security it mandates.  In the expected case, when the
            sender starts composing the mail, they can check the GUI to
            see if the recipient can support MSMD, and if not then
            elect to send mail insecurely or not at all.  That said,
            we expect that over time as the ecosystem will upgrade its
            security capability meaning that MSMD support becomes the
            norm.  Once that happens, it is easy to imagine that a mail provider
            would make MSMD mandatory.</t>

            <t>The Secure Conversation and Access option also provides
            a significant increase in privacy by mandating restricted
            access after delivery.  This poses a policy issue, as the
            recipient has mandatory restriction placed on mail in
            their inbox that they may not want.  Thus we imagine that
            this option be used only in conversations where privacy is
            required such as by business need, and where all parties
            would not object to the restrictions.  With other
            conversations the sender could use the base MSMD protocol
            or even clear text delivery.  Also these restrictions are
            caused by infrastructure limitations that should improve
            over time.  Once MSMD and SCA support becomes universal
            then this restriction become moot.</t>
        </section>
    </section>

    <section anchor="tls" title="TLS">
        <t>TLS can be configured to significantly degrade
        eavesdropping and MitM.  They are organized into tiers
        corresponding to ability of the ecosystem to support the
        features, and are meant to evolve and be upgraded to draw
        upon improved techniques for stopping these threats.  The
        following list are the current TLS parameters that MSMD
        controls.
        <list style="hanging">
            <t hangText="TLS Version">Describes the TLS version.
            Currently this is restricted TLS only and version
            "1.0" (SSL version 3,1) or greater must be supported.
            </t>
            <t hangText="CipherSuite">Describes the TLS cipher as
            a selector based on the values from <xref
            target="RFC5246">IANA registry for TLS</xref>.
            Anonymous Diffie-Hellman key exchange and RC4 cipher
            shall not be allowed.</t>
            <t hangText="Public Key Size">Describes the SMTP
            client/server minimum TLS certificate CA certificate
            public key size.  MSMD requires that key sizes of
            1024, 2048, 4096 be supported for RSA, DSA and
            Diffie-Hellman based algorithms, and 250 for
            Elliptic-Curve Cryptography if supported.  It is
            recommended that larger sizes be supported as
            well.</t>
            <t hangText="Public Key Type">Describes the SMTP
            server <xref
            target="RFC5246">TLS</xref> public key type.  MSMD requires
            that RSA be supported, and others are optional.</t>
            <t hangText="Symmetric Key Size">Describes the SMTP
            server <xref target="RFC5246">TLS</xref> symmetric
            cipher key size.  Both 128 and 256 bits must be supported.</t>
            <t hangText = "Check Server Certificate">This
            specifies the mechanism by which the SMTP TLS server
            certificate are verified.  Ability to use <xref
            target="RFC5280">PKI verification of X.509
            certificate</xref> using "CA" (Certificate Authority)
            must be supported, though actual verification is
            recommended.  We recommend that certificate naming
            <xref target="RFC6125">standardize</xref> to setting
            the DNS-ID from the MX record host name.  We also
            recommend using improved PKI such as <xref
            target="RFC6962">Certificate
            Transparency</xref>.<!--Additional certificate
            authentication via "CT" (<eref
            target="http://www.certificate-transparency.org/">Certificate
            Transparency</eref>) is recommended.--></t>
            <!--<t hangText = "Check Client Certificate">This
            specifies the mechanism by which the SMTP TLS client
            certificate are verified.  Has the same verification methods
            as Check Server Certificate, and the same requirements.</t>-->
        </list>
        To reiterate, the baseline TLS constraints for all MSMD
        implementation with or without specifying the "tls"
        requirement option is the following:
        <list style="symbols">
            <t>TLS version >= "1.0"</t>
            <t>MSMD Public key exchange must support RSA.</t>
            <t>Public key exchange shall not use anonymous Diffie-Hellman.</t>
            <t>Cipher shall not use RC4.</t>
            <t>RSA/DSA/DH Public Key Size >= 1024 or ECC Public Key Size >= 250</t>
            <t>Symmetric Key Size >= 128</t>
            <t>Support for CA PKI verification of X.509
            certificate.</t>
        </list>
        If the "tls" requirement option is specified, then it must
        specify one of two tiers.  The tiers corresponding to what
        can be deployed today (circa 2013) with reasonable support
        from ecosystem.
        <list style="symbols">
            <t>Tier 1- Baseline strong TLS.  Assumes TLS baseline.
                <list style="symbols">
                    <t>TLS version >= "1.2"</t>
                    <t>Public key exchange must use ephemeral
                    Diffie-Hellman for perfect forward
                    secrecy.</t>
                    <t>RSA/DSA/DH Public Key Size >= 2048 or ECC
                    Public Key Size >= 250</t>
                </list>
            </t>
            <t>Tier 2- Resist MitM-  Assumes capabilities of tier 1.
                <list style="symbols">
                    <t>Check Server Certificate- should check
                    for: path, expiry, and trusted CA root.
                    Self-signed certificates shall not not verify.</t>
                    <t>DNSSEC- DNS name look up must look up and
                    verify security extensions.  In other words
                    the "ds" DNSSEC requirement option is
                    implicitly set, though it is recommended the
                    "ds" requirement should still be explicitly
                    appended for readability.</t>
                    <t>Require that certificate naming <xref
                    target="RFC6125">standardize</xref> to setting the DNS-ID
                    from the MX record host name.</t>
                </list>
            </t>
            <!--
            <t>Tier 3- Improved PKI-  Assumes capabilities of tier 2.
                <list style="symbols">
                    <t>Check Client Certificate == "CT"</t>
                    <t>Check Server Certificate == "CT"</t>
                </list>
            </t>
            -->
        </list>
        We anticipate more tiers being defined particularly to improve PKI.
        </t>
        <t>Certificate naming of identifiers for SMTP servers has
        been recently rigorously defined in <xref
        target="RFC6125"/>.  MSMD recommends (and at Tier 2
        requires) the use of this naming scheme for the
        certificate identifiers.  The certificate DNS-ID
        identifier contents should be the SMTP MX host name, and
        if there are more than one host name than multiple DNS-ID
        names may be specified.  The certificate common identifier
        CN-ID may also be set but with restrictions as noted in
        <xref target="RFC6125"/>.  There are also restrictions for
        identifier wild-cards '*'.  An example of the naming
        scheme is in <xref target="certnaming"/>.
        <figure anchor="certnaming" title="Certificate Naming for SMTP">
        <artwork>
    MX Record for gmail.com:
    gmail.com.		3600	IN	MX	10 alt1.gmail-smtp-in.l.google.com.
    gmail.com.		3600	IN	MX	5 gmail-smtp-in.l.google.com.

    SMTP X.509 Certificate recommended identifier bindings:
    DNS-ID: gmail-smtp-in.l.google.com
    DNS-ID: alt1.gmail-smtp-in.l.google.com.
        </artwork>
        </figure>
        </t>
    </section>

    <section anchor="optional" title="Optional Requirements and Capabilities">
        <t>To allow for different security requirements and to allow
        for future extension, this protocol supports options.  The
        MSMD message header may take additional arguments that act as
        requirements during the MSMD requirements check.  The
        requirements specify expressions that have values bound to it
        during the TLS setup and the expression must evaluate to true.
        Requirements may be interpreted by other mail components outside
        of mail delivery e.g. SCA.  The MSMD SMTP EHLO extension provides the
        means to display additional capabilities that the server can
        provide, and can bind values used for the requirements check.
        To summarize, options serve the following purposes:
        <list style="symbols">
            <t>Constraints on TLS</t>
            <t>Constraints on recipient- Ensure the recipient mail
            provider can maintain security when the message
            is forwarded or replied-to from that provider.</t>
            <t>Settings describing the treatment of the message
            outside of the mail delivery</t>
        </list>
        </t>

        <section anchor="headeroption" title="Mail Header Requirements">
            <t>To simplify the treatment of MSMD requirements, they
            are all treated as expressions with the following rules
            for the evaluation.  Requirement names are variables that
            may be bound to values from SMTP extension capabilities or
            bound to a default value as specified.  Three value types
            are currently allowed: boolean, integer or string.  They
            initially are bound to respectively False, 0, or "".  All
            may also be set to "undef" meaning not assigned which is
            treated as False.  Expressions support basic comparisons
            i.e. "==", "!=", "&lt;", ">", "&lt;=", and ">=". They also
            support composition with "AND", and "OR" and precedence
            group "()", as well as negation "NOT".  Operator order of
            precedence follows the Python language.  Requirement names
            and operators are case insensitive.  One syntactic sugar
            is allowed:
            <list style="numbers">
                <t>If multiple requirements are presented in a sequence
                separated only by white-space, they are treated as
                composed with "AND".</t>
            </list>
            </t>

            <t>The following list describes requirements that may be
            placed with "mandatory-secure-mail-delivery:" header.
            Each requirement has a short name and a longer description
            name.  The short name should be used in the mail header to
            save transmission resources.
            <list style="hanging">
                <t hangText = "sca">Secure Conversation and Access- as
                described in <xref target="deployment"/>. (type:
                boolean)</t>
                <t hangText = "ds">DNSSEC- Use DNSSEC for name service
                look-up.  Look-up must verify the signatures of DNS
                records.  (type: boolean)</t>
                <t hangText = "m">Message- After MSMD security
                check failure, forward to the destination a courtesy notice
                as specified in <xref target="failurenotify"/>. (type: boolean)</t>
                <t hangText = "v">Version- The version value for MSMD.  This
                starts at 0. (type: int)</t>
                <t hangText="tls">TLS Tier- As describes in <xref
                target="tls"/> one can specify bundles or tiers of TLS
                settings.  The allowed tiers are 1, and 2. (type:
                int)</t>
            </list>
            </t>
        </section>

        <!--
        <section anchor="values" title="TLS Values">
            <t>The TLS negotiation and connection setup may be
            influenced by the settings provided in the MSMD headers as
            constraints passed to TLS.  Some of the TLS settings have
            implicit default constraints that apply unless explicitly
            set by requirements.  Others lack a default value, and if
            not explicitly set, then no constraint is applied.
            <list style="hanging">
                <t hangText="tls">TLS Tier- As describes in <xref
                target="tls"/> one can specify bundles or tiers of TLS
                settings.  The allowed tiers are 1 and 2.  (type:
                int)</t>
            </list>
            <list style="hanging">
                <t hangText="tv">TLS Version- Describes the TLS
                version <xref target="RFC5246">RFC5246</xref>.
                Currently this is restricted TLS only and human
                readable version strings "1.0" (SSL version 3,1),
                "1.1" (SSL version 3,2) and "1.2" (SSL version 3,3).
                (type: string)</t>
                <t hangText="cs">CipherSuite- Describes the TLS cipher
                as a selector based on the values from IANA registry
                as specified in <xref
                target="RFC5246">RFC5246</xref>.  Though TLS
                treats the values as a pair of integers, they are
                treated as an opaque string for evaluation.  Legal
                values are verified before being passed to TLS though.
                Also acceptable are the description names.  (type:
                string)</t>
                <t hangText="pks">Public Key Size- Describes the SMTP
                server TLS certificate CA certificate public key size.
                MSMD requires that key sizes for RSA of 1024,
                2048, 4092 be supported, and recommends larger sizes
                be supported as well.  Key sizes for other signing
                algorithms may be supported.  (type: int, default: 2048)</t>
                <t hangText="pkt">Public Key Type- Describes the SMTP
                server TLS server certificate type in human readable
                form as described in <xref
                target="RFC5246">RFC5246</xref>.  MSMD required
                that RSA signing algorithm be supported, and others
                are optional.  The (type: string, default: "RSA")</t>
                <t hangText = "cv">Certificate Verification- This
                specifies the mechanism by which the SMTP TLS server
                certificate are verified.  Available options are "CT"
                (<eref
                target="http://www.certificate-transparency.org/">Certificate
                Transparency</eref>), "DANE" (<xref
                target="RFC6698">DANE TLSA</xref>, or "CA" (<xref
                target="RFC5246">Certificate Authority</xref>).
                Though CA is default, is desirable to move to "CT" or
                "DANE" as soon as possible.  (type: string, default:
                "CA").  </t>
            </list>
            After the TLS setup, the actual values are defined, and
            bound to the above variable names.  While the subsequent
            MSMD requirements check for TLS expressions should be
            redundant (due to the TLS constraints), they should be
            checked anyways.
            </t>
        </section>
            -->

        <section anchor="domainoption" title="SMTP MSMD Capabilities">
            <t>As part of the EHLO response, additional optional
            capabilities are advertised.  The capabilities names are
            variables bound effectively as key-value pairs.  These
            results become available in the MSMD requirements check
            evaluation.  Unadorned names are bound to "true", however
            if the name is followed by "=" and a value, then the name
            is bound to that value.  Capabilities are also case
            insensitive.
            <list style="hanging">
                <t hangText = "sca">Secure Conversation and Access-
                SMTP Server supports SCA.</t>
                <t hangText = "ds">DNSSEC- SMTP Server uses DNSSEC for
                name service look-up.</t>
                <t hangText = "m">Message- MSMD security
                check failure sends a courtesy notice.</t>
                <t hangText = "v">Version- The version number for
                MSMD.</t>
                <t hangText="tls">TLS Tier- The version number for TLS tiers</t>
            </list>
            </t>
        </section>

        <section anchor="advancedexample" title="Example with Requirements and Capabilities">
            <t>The following illustrates how the options would be
            used.  A company want mail delivery to their customers
            that mitigates eavesdropping and MitM attacks.  To do so,
            this company would like to specify the use of perfect
            forward secrecy, DNSSEC, and X.509 CA PKI certificates
            verification during mail delivery.  Currently the latter
            two requirements are not yet deployed for many mail
            providers, but will likely be available in the near
            future.  So today this company just uses MSMD with
            baseline TLS encryption settings for mail delivery as
            described in the earlier example in <xref
            target="basicmsmd"/>.  Later when supported, the company
            specifies those three properties for new mail messages
            using the MSMD requirement option "tls>=2".  This is
            illustrated in the following example in <xref
            target="advancedmsmd"/></t>

        <figure anchor="advancedmsmd" title="MSMD Options Example">
        <artwork>
   The mail message requests perfect forward secrecy, DNSSEC, and
   X.509 certificate verification by setting the header to:
   mandatory-secure-mail-delivery: tls>=2 ds

   S: &lt;waits for connection on TCP port 25>
   C: &lt;opens connection>
   S: 220 mail.server.org SMTP service ready
   C: EHLO mail.client.com
   S: 250-mail.server.org welcomes you
   S: 250-STARTTLS
   S: 250-MSMD sca m tls=2 ds
   S: 250 DSN
   C: STARTTLS
   S: 220 Go ahead
   C: &lt;starts TLS negotiation>
   C &amp; S: &lt;negotiate a TLS session w/ECDHE-RSA-AES128-SHA>
   C: EHLO mail.client.com
   S: 250-mail.server.org welcomes you
   S: 250-MSMD sca m tls=2 ds
   S: 250 DSN
   C: &lt;Perform MSMD Requirements Check: On failure close the connection>
   C: DATA
   C: &lt;Send mail with DKIM signature>

   During the MSMD Requirements check the requirements expands as follows:
   tls>=2 AND ds
   2>=2 AND true

   This evaluates true and passes, as does the baseline MSMD
   requirements check.  The passing MSMD requirements check indicates
   the recipient provider can maintain at least the same security as
   requested for this message.
        </artwork>
        </figure>
        </section>
    </section>

    <section anchor="recommendation" title="Recommendations">
        <t>Some recommendations that assist the effectiveness of this
        protocol:
        <list style="symbols">
            <t>During composition of the mail message that the user be
            able to control setting of MSMD header and SCA option though not
            necessarily the other options.</t>
            <t>GUI should assist the user in predicting whether
            delivery will succeed when the MSMD feature is selected
            using provider modeling and other means.</t>
        </list>
        </t>
    </section>

    <section anchor="secconsider" title="Security Considerations">
        <t>The ability of the protocol to maintain security of mail
        content depends on the effectiveness of peer mail systems
        implementation of this protocol.  Since enforcement is
        voluntary and easily subverted by bad implementations, we
        propose a blacklist list of mail providers that advertise
        support but are known to have flawed implementations.  This
        list would be maintained and adjudicated by a yet to be
        decided third party.  Implementations should obtain the
        blacklist, and prevent delivery of MSMD messages to these
        mail providers.</t>
    </section>

    <section anchor="acknowledgements" title="Acknowledgements">
        <t>The authors wish to acknowledge the very useful comments
        and suggestions from: Brandon Long, Adam Langley, Danesh
        Irani, Ian Fette, and Robert Chien.</t>
    </section>

    </middle>
    <back>
        <references>
            &rfc1939;
            &rfc2449;
            &rfc2971;
            &rfc3156;
            &rfc3207;
            &rfc3461;
            &rfc3501;
            &rfc3864;
            &rfc5246;
            &rfc5280;
            &rfc5321;
            &rfc5322;
            &rfc5751;
            &rfc6125;
            &rfc6376;
            &rfc6698;
            &rfc6797;
            &rfc6962;
<!--
            <reference anchor="refs.RFC1939">
              <front>
                <title>Post Office Protocol - Version 3</title>
                    <author initials="J." surname="Myers"
                            fullname="J. Myers">
                        <organization>
                        Carnegie Mellon
                        </organization>
                    </author>
                    <author initials="M." surname="Rose"
                            fullname="M. Rose">
                        <organization>
                        Dover Beach Consulting, Inc.
                        </organization>
                    </author>
                    <date month="May" year="1996" />
                </front>
                <seriesInfo name="RFC" value="1939" />
            </reference>
            <reference anchor="refs.RFC2449">
              <front>
                <title>POP3 Extension Mechanism</title>
                    <author initials="R." surname="Gellens"
                            fullname="R. Gellens">
                        <organization>
                        Qualcomm
                        </organization>
                    </author>
                    <author initials="C." surname="Newman"
                            fullname="C. Newman">
                        <organization>
                        Innosoft
                        </organization>
                    </author>
                    <author initials="L." surname="Lundblade"
                            fullname="L. Lundblade">
                        <organization>
                        Qualcomm
                        </organization>
                    </author>
                    <date month="November" year="1998" />
                </front>
                <seriesInfo name="RFC" value="2449" />
            </reference>
            <reference anchor="refs.RFC2971">
              <front>
                <title>IMAP4 ID Extension</title>
                    <author initials="T." surname="Showalter"
                            fullname="T. Showalter">
                        <organization>
                        Mirapoint, Inc
                        </organization>
                    </author>
                    <date month="October" year="2000" />
                </front>
                <seriesInfo name="RFC" value="2971" />
            </reference>

            <reference anchor="refs.RFC3207">
              <front>
                <title>SMTP Service Extension for Secure SMTP over
                Transport Layer Security</title>
                    <author initials="P." surname="Hoffman"
                            fullname="P. Hoffman">
                        <organization>
                        Internet Mail Consortium
                        </organization>
                    </author>
                    <date month="Februrary" year="2002" />
                </front>
                <seriesInfo name="RFC" value="3207" />
            </reference>
            <reference anchor="refs.RFC3461">
              <front>
                <title>Simple Mail Transfer Protocol (SMTP) Service Extension
                for Delivery Status Notifications (DSNs)</title>
                    <author initials="K." surname="Moore"
                            fullname="K. Moore">
                        <organization>
                        University of Tennessee
                        </organization>
                    </author>
                    <date month="January" year="2003" />
                </front>
                <seriesInfo name="RFC" value="3461" />
            </reference>
            <reference anchor="refs.RFC3501">
              <front>
                <title>INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1</title>
                    <author initials="M." surname="Crispin"
                            fullname="M. Crispin">
                        <organization>
                        University of Washington
                        </organization>
                    </author>
                    <date month="March" year="2003" />
                </front>
                <seriesInfo name="RFC" value="3501" />
            </reference>
            <reference anchor="refs.RFC3864">
              <front>
                <title>Registration Procedures for Message Header Fields</title>
                    <author initials="G." surname="Klyne"
                            fullname="G. Klyne">
                        <organization>
                        Nine by Nine
                        </organization>
                    </author>
                    <author initials="M." surname="Nottingham"
                            fullname="M. Nottingham">
                        <organization>
                        BEA
                        </organization>
                    </author>
                    <author initials="J." surname="Mogul"
                            fullname="J. Mogul">
                        <organization>
                        HP Labs
                        </organization>
                    </author>
                    <date month="September" year="2004" />
                </front>
                <seriesInfo name="RFC" value="3864" />
            </reference>
            <reference anchor="refs.RFC5246">
                <front>
                    <title>The Transport Layer Security (TLS) Protocol
                              Version 1.2</title>
                    <author initials="T." surname="Dierks"
                            fullname="T. Dierks">
                      <organization>
                      Independent
                      </organization>
                    </author>
                    <author initials="E." surname="Rescorla"
                            fullname="E. Rescorla">
                      <organization>
                      RTFM, Inc.
                      </organization>
                    </author>
                    <date month="August" year="2008" />
                </front>
                <seriesInfo name="RFC" value="5246" />
            </reference>
            <reference anchor="refs.RFC5321">
                <front>
                    <title>Simple Mail Transfer Protocol</title>
                    <author initials="J." surname="Klensin"
                            fullname="J. Klensin, Editor">
                    </author>
                    <date month="October" year="2008" />
                </front>
                <seriesInfo name="RFC" value="5321" />
            </reference>
            <reference anchor="refs.RFC5322">
                <front>
                    <title>Internet Message Format</title>
                    <author initials="P." surname="Resnick"
                            fullname="P. Resnick, Editor">
                      <organization>
                        QUALCOMM Incorporated
                      </organization>
                    </author>
                    <date month="October" year="2008" />
                </front>
                <seriesInfo name="RFC" value="5322" />
            </reference>
            <reference anchor="refs.RFC6376">
                <front>
                    <title>DomainKeys Identified Mail (DKIM) Signatures</title>
                    <author initials="D." surname="Crocker"
                            fullname="D. Crocker, Editor">
                      <organization>
                        Bradenburg InternetWorking
                      </organization>
                    </author>
                    <author initials="T." surname="Hansen"
                            fullname="T. Hansen">
                      <organization>
                        AT&amp;T
                      </organization>
                    </author>
                    <author initials="M." surname="Kucherawy"
                            fullname="M. Kucherawy">
                      <organization>
                        Cloudmark
                      </organization>
                    </author>
                    <date month="September" year="2011" />
                </front>
                <seriesInfo name="RFC" value="6376" />
            </reference>
            <reference anchor="refs.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>
                          VPN Consortium
                        </organization>
                    </author>
                    <author initials="J." surname="Schlyter"
                            fullname="J. Schlyter">
                        <organization>
                          Kirei AB
                        </organization>
                    </author>
                    <date month="Auguest" year="2012" />
                </front>
                <seriesInfo name="RFC" value="6698" />
            </reference>
            <reference anchor="refs.RFC6797">
              <front>
                <title>HTTP Strict Transport Security (HSTS)</title>
                    <author initials="J." surname="Hodges"
                            fullname="J. Hodges">
                        <organization>
                          PayPal
                        </organization>
                    </author>
                    <author initials="C." surname="Jackson"
                            fullname="C. Jackson">
                        <organization>
                          Carnegie Mellon University
                        </organization>
                    </author>
                    <author initials="A." surname="Barth"
                            fullname="A. Barth">
                        <organization>
                          Google, Inc.
                        </organization>
                    </author>
                    <date month="November" year="2012" />
                </front>
                <seriesInfo name="RFC" value="6797" />
            </reference>
            <reference anchor="refs.NSAAble">
              <front>
                <title>N.S.A. Able to Foil Basic Safeguards of Privacy on Web</title>
                    <author initials="N." surname="Perlroth"
                            fullname="N. Perlroth">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <author initials="J." surname="Larson"
                            fullname="J. Larson">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <author initials="S." surname="Shane"
                            fullname="S. Shane">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <date month="September" day="5" year="2013" />
                </front>
            </reference>
            <reference anchor="refs.NSASaid">
              <front>
                <title>N.S.A. Said to Search Content of Messages to and From U.S.</title>
                    <author initials="C." surname="Savage"
                            fullname="C. Savage">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <date month="August" day="8" year="2013" />
                </front>
            </reference>
            <reference anchor="refs.Mandiant">
              <front>
                <title>Chinese Army Unit Is Seen as Tied to Hacking Against U.S.</title>
                    <author initials="D." surname="Sanger"
                            fullname="D. Sanger">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <author initials="D." surname="Barboza"
                            fullname="D. Barboza">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <author initials="N." surname="Perlroth"
                            fullname="N. Perlroth">
                        <organization>
                        New York Times, Inc.
                        </organization>
                    </author>
                    <date month="February" day="18" year="2013" />
                </front>
            </reference>
            <reference anchor="refs.forward">
                <front>
                    <title>Protecting data for the long term with forward secrecy</title>
                    <author initials="A." surname="Langley"
                            fullname="A. Langley">
                      <organization>
                      Google Inc
                      </organization>
                    </author>
                    <date month="November" day="22" year="2011" />
                </front>
            </reference>
-->
        </references>
    </back>
</rfc>
