<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-nurpmeso-smtp-tls-srv-04"
  ipr="trust200902"
  obsoletes=""
  updates="3207 5321"
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!--
     [CHECK]  FIXME
       * category should be one of std, bcp, info, exp, historic
       * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
       * updates can be an RFC number as NNNN
       * obsoletes can be an RFC number as NNNN
-->
  <front>

   <title>Secure SMTP/TLS SRV Announcement</title>

   <seriesInfo name="Internet-Draft" value="draft-nurpmeso-smtp-tls-srv-04"/>

    <author fullname="Steffen Nurpmeso" initials="S" role="editor" surname="Nurpmeso">
      <address><email>steffen@sdaoden.eu</email></address>
    </author>

    <date year="2025" month="02" day="03"/>

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>SMTP</keyword>
    <keyword>TLS</keyword>
    <keyword>Secure SMTP</keyword>
    <keyword>STARTTLS</keyword>
    <keyword>SRV</keyword>

    <abstract><t>
      This document specifies a
      DNS (RFC 1035)
      service name in order to enable
      SRV (RFC 2782)
      records announce the availability of
      TLS (RFC 9325) enabled
      Secure SMTP (RFC 3207, RFC 5321),
      including Implicit TLS.
    </t></abstract>

  </front>
  <middle>

    <section>
      <name>Introduction</name>
      <t>
        <xref target="RFC2782"/>
        defines a widely adopted DNS-based service discovery protocol.
        <xref target="RFC6186"/>
        is a specification of
        SRV<xref target="RFC2782"/>
        records for the email protocols
        IMAP<xref target="RFC9051"/>,
        POP3<xref target="RFC1939"/>,
        and
        SUBMISSION<xref target="RFC6409"/>.
        This includes DNS service names for Implicit TLS protocol variants.
        SMTP<xref target="RFC5321"/>
        connections to MTAs
        (<xref target="RFC5598"/>)
        are yet excluded from their share on the widely supported SRV
        record, at least from the IETF point of view.
        (According usage however exists for many years,
        see for example the German De-Mail definition law;
        and in recent years notable Open Source MTA implementations
        gained support for SRV lookups.)
        Additionally no Implicit TLS SMTP protocol variant has ever been
        specified by the IETF, even though the achievable packet roundtrip
        savings for the SMTP protocol are immense,
        and despite the fact that many (most open source) SMTP software
        implementations already have, or can easily implement,
        built-in support for this mode.
        This specification adds a SMTP/TLS service name for
        SRV<xref target="RFC2782"/>
        records.
      </t>

      <section>
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
          "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT
          RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
          interpreted as described in BCP 14 <xref target="RFC2119"/>
          <xref target="RFC8174"/> when, and only when, they appear in
          all capitals, as shown here.</t>
        <t>
          The term "Implicit TLS" refers to the automatic negotiation of
          TLS whenever a TCP connection is made on a particular TCP port
          that is used exclusively by that server for TLS connections.
          The term "Implicit TLS" is intended to contrast with the use
          of the STARTTLS command in SMTP that is used by the client
          and the server to explicitly negotiate TLS on an established
          cleartext TCP connection.
        </t>
      </section>
    </section>

    <section>
      <name>SMTP/TLS SRV Service Name</name>
      <t>
        The service name for
        TLS<xref target="RFC9325"/>
        enabled
        Secure<xref target="RFC3207"/>
        SMTP<xref target="RFC5321"/>
        is smtps, the resulting DNS label _smtps.
      </t><dl newline="true">
        <dt>STARTTLS</dt><dd>
          Whenever a domain publishes an according DNS
          SRV<xref target="RFC2782"/>
          resource record it asserts availability of Secure SMTP,
          that is, of the
          STARTTLS<xref target="RFC3207"/>
          SMTP service extension on the normal
          SMTP<xref target="RFC5321"/>
          port, specified by IANA as port 25.
          The port number <bcp14>MUST</bcp14> be given as 25.
        </dd><dt>Implicit TLS</dt><dd>
          If the port number of the published SRV resource record does
          not equal the IANA port 25,
          then the domain announces support for Implicit TLS on the
          given port in addition to
          STARTTLS<xref target="RFC3207"/>
          support on the IANA port.
          Servers <bcp14>SHOULD NOT</bcp14> announce STARTTLS in the
          EHLO command response of an Implicit TLS connection.
          If a client issues a
          STARTTLS<xref target="RFC3207"/>
          extension command during an Implicit TLS connection,
          the SMTP reply code 554 <bcp14>SHOULD</bcp14> be returned, if
          enhanced status codes<xref target="RFC3463"/>
          are used, 5.5.1 <bcp14>SHOULD</bcp14> be used.
          <!-- this behaviour reflects IMAP RFC9051 -->
        </dd>
      </dl><t>
        DNS SRV RRs <bcp14>MUST</bcp14> take priority over
        MX<xref target="RFC5321"/>
        ones: no MX lookup <bcp14>SHOULD</bcp14> be performed,
        and no otherwise available MX RR <bcp14>MUST</bcp14> be used
        in the presence of a SRV RR.
        After a successful _smtps DNS SRV lookup clients
        <bcp14>SHOULD NOT</bcp14> fallback to cleartext communication.
        Servers and clients which make use of the _smtps DNS SRV
        <bcp14>SHOULD</bcp14> follow the guidelines of
        TLS<xref target="RFC9325"/>.
      </t>
    </section>

    <section>
      <name>Example: service record</name>
      <t>
        Here are two examples, the first announcing to support the STARTTLS
        SMTP service extension,
        the second specifying the port number 26 to indicate an additional
        Implicit TLS port.
      </t><sourcecode><![CDATA[
_smtps._tcp     SRV 0 1 25 mail1.example.com.

_smtps._tcp     SRV 0 1 26 mail2.example.com.
      ]]></sourcecode>
    </section>

    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
      <name>IANA Considerations</name>
      <t>
        The author does not expect IANA to add a dedicated port for
        "Implicit TLS SMTP",
        given that it has registered according ones for other email
        protocols,
        for example POP3S,
        no sooner but 1999, a quarter of a century ago.
        The author nonetheless asks for assigning a dedicated port for
        Implicit TLS SMTP,
        and suggests port 26
        (which, at the time of this writing, was already successfully
        used for that purpose)
        in the privileged port range.
        The author wants to point out that the contra arguments given
        in section 7 of
        <xref target="RFC2595"/>
        that created according POP3S and IMAPS
        assignments in 1999 are contradicted by operational reality
        in the internet,
        and here that includes the IETF by means of
        <xref target="RFC8314"/>.
        A dedicated port enables administrators to apply strict policies,
        for example in firewalls.
      </t>
    </section>

    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>
        This specification avoids downgrade attacks on the
        opportunistic approach of STARTTLS,
        accomplished via the mechanism used for many other IETF standardized
        protocols, most notably
        <xref target="RFC2782"/>
        (IMAP, POP3, SUBMISSION).
        With its Implicit TLS capability it grants the SMTP protocol the same
        level of confidentiality through
        TLS<xref target="RFC9325"/>
        as is already standardized for the other email protocols;
        this is considered a value by itself,
        even for the possibly lesser sensitive MTA to MTA communication.
        Implicit TLS reduces the number of packet roundtrips,
        that at a protocol stage where the widely used
        command pipelining<xref target="RFC2920"/>
        performance improvement extension cannot be used;
        it must be said that today these roundtrips are anachronistic
        (also environmentally): for example the about 4.2 million known
        DANE for SMTP<xref target="RFC7672"/>
        enabled domains at the time of this writing alone,
        which must use TLS by standard definition,
        likely generate (several) billion(s) of useless sequential
        and blocking roundtrip packets each and every day.
        The security of
        DNS<xref target="RFC1035"/>
        is out of scope for this specification, but
        DNSSEC<xref target="RFC4033"/><xref target="RFC4034"/><xref target="RFC4035"/>
        and secure
        DNS transport<xref target="RFC7858"/><xref target="RFC8094"/><xref target="RFC8310"/><xref target="RFC8484"/><xref target="RFC9250"/>
        etc exists.
        Selection of the appropriate transport layer security protocol
        is out of scope for this specification, please see for example
        TLS<xref target="RFC9325"/>.
      </t>
    </section>

  </middle>
  <back>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2782.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3207.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3463.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5321.xml"/>
      </references>

      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.1939.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2595.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2920.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4035.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5598.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6186.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6409.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6698.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7250.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7672.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8094.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8310.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8314.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8461.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8484.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9051.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9250.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9325.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9460.xml"/>
      </references>
    </references>

    <section anchor="Rationale">
      <name>Rationale</name>
      <t>
        Plenty of methods have been standardized by the IETF to perform
        service TLS capability discovery for SMTP.
        They have in common that they represent SMTP specific solutions
        to a problem that other protocols address by means this document
        thus reiterates for SMTP.
        They represent further development effort and error surfaces.
        They also impose increased permanent administration effort,
        and, due to this, are inaccessible to a large number, if not
        the majority, of private email server operators:
        either through additional costs, the impossibility to set up
        a dedicated name server, if so required,
        and, also as a superset of the former,
        restrictive web interfaces that support only a minimal set of
        DNS<xref target="RFC1035"/>
        resource record types.
        Regardless the fact that several of these extensions switch the
        SMTP protocol to a MUST usage of TLS, they still require the
        additional STARTTLS plus HELO roundtrips that for example
        <xref target="RFC8314"/>
        disregards; and even though that RFC explicitly refers to
        DANE for SMTP<xref target="RFC7672"/>,
        giving no reason for why SMTP "requires a different approach",
        except for the TLS certificate discovery that could and should
        be hoped for as a general solution, including for clients for
        any sort of network protocol, DANE falls in this category, too:
        what this specification tries to achieve is therefore not
        counteracting <xref target="RFC7672"/>,
        but accompanying it;
        the author wants to state again that according mechanisms
        already exist in active use,
        and that many SMTP client/server software implementations
        already support SRV RR lookups:
        activating this existing code base by standard means
        is only a consequence.
      </t><t>
        The other extension that
        <xref target="RFC8314"/>
        mentions,
        MTA-STS<xref target="RFC8461"/>,
        requires SMTP operators to install and maintain an additional
        HTTP protocol server,
        accessible on the usual HTTP/S ports
        and the same domain as the email service.
        Dependent on the software this may require non-trivial and error
        prone path access policy server rules.
        It is an approach that is complicated to implement, and that brings
        the complexity of another network protocol in the SMTP path;
        given that several different HTTP protocols exist, which in turn
        base upon several different transport protocols,
        the complexity and protocol is alien to SMTP.
        The
        SVCB<xref target="RFC9460"/>
        DNS approach would not bring additional value to the problem in
        question,
        but on the other hand requires additional implementation efforts as
        email protocols do not make any use of it as of today.
      </t><t>
        Coming back to
        DANE for SMTP<xref target="RFC7672"/>
        it must be said that unfortunately
        DNSSEC<xref target="RFC4033"/><xref target="RFC4034"/><xref target="RFC4035"/>
        is still consciously unsupported by major players as of today.
        Furthermore provider web interfaces do often not allow users
        creation of the necessary DANE TLSA resource records:
        not always can the answer be "run your own name server",
        also letting aside the administrative effort of doing so.
        However, discovering an Implicit TLS enabled email service via
        the _smtps._tcp SRV record,
        thereafter checking for applicability of
        DNS-Based Authentication of Named Entities (DANE)<xref target="RFC6698"/>,
        possibly even
        Using Raw Public Keys in Transport Layer Security (TLS)<xref target="RFC7250"/>
        would be a bright future that addresses possibly all of today's issues.
      </t>
    </section>

    <section anchor="Acknowledgements">
      <name>Acknowledgements</name>
      <t>
        Thanks to Jan Ingvoldstad for remarks on the missing rationale.
        Thanks to Jeremy Harris for spending time and revealing the many
        problems of early draft variants, we well as comments on how to
        do it better;
        very special thanks to him for a kickstart implementation of this
        very draft in the widely used exim Open Source MTA.
        Jeremy Harris, Viktor Dukhovni and Wietse Venema commented on the
        initial odd usage of port 0 for the STARTTLS discovery case.
        Thanks to Jonas Stalder for corrections and further assistance.
      </t>
    </section>

 </back>
</rfc>
<!-- vim:set tw=1000:s-ts-mode -->
