<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc ipr="trust200902" category="std" docName='draft-melnikov-smtp-rememberme-00'>
  <front>
    <title abbrev="SMTP REMEMBERME">
      SMTP REMEMBERME extension for quick reauthentication token generation
    </title>
<!--
    <author initials="I." surname="Somebody" fullname="Someone Somebody">
      <organization></organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country></country>
        </postal>
        <email></email>
      </address>
    </author>
-->
    <author initials="A." surname="Melnikov" fullname="Alexey Melnikov">
      <organization>Isode Ltd</organization>
      <address>
        <postal>
          <street>14 Castle Mews</street>
          <city>Hampton</city>
          <region>Middlesex</region>
          <code>TW12 2NP</code>
          <country>UK</country>
        </postal>
        <email>alexey.melnikov@isode.com</email>
      </address>
    </author>
    <date year="2026"/>
    
    <!--One or more extra keywords which don't appear in the title-->
    <keyword></keyword>
      
    <abstract>

    <t>
      This document specifies an SMTP extension for generating quick
      reauthentication tokens that allow clients to re-login without
      user interaction, once authentication using a strong SASL mechanism
      is completed.
    </t>
	
    </abstract>
    
  </front>
  <middle>

    <section title="Introduction">

        <t>
          This document specifies an SMTP <xref target="RFC5321"/> (update to rfc5321bis, once published) extension
          which is a protocol specific extension to
          Simple Authentication and Security Layer (SASL) <xref target="RFC4422"/>
          framework for generation of proof-of-posession reauthentication tokens.
          Such tokens can be used for subsequent 1 roundtrip reauthentication
          <!--///Add Informative References-->
          using SASL mechanisms such as REMEMBERME and HT2-*.
        </t>

        <t>
        The typical sequence of events is going to be like this:

        <list style='numbers'>

          <t>
          Client establishes SMTP connection protected by TLS on Connection 1.
          </t>
          
          <t>
          On Connection 1 the client authenticates using a strong SASL mechanism, which might be CPU intensive,
          <!--///Add Informative References-->          
          and most likely requires user interaction, e.g., SCRAM with 2FA extension, PASSKEY, OAUTH with 2FA.
          </t>
          
          <t>
          On Connection 1 the client requests reauthentication token using REMEMBERME command.
          </t>
          
          <t>
          &lt;Connection gets interrupted or closed due to inactivity&gt;
          </t>

          <t>
          Client establishes another SMTP connection protected by TLS on Connection N.
          The client then uses a previous issues quick reauthentication token
          with one of 1 round trip SASL mechanisms such as REMEMBERME and HT2-*.
          The same token is reusable on other SMTP connections until it is replaced or revoked.
          </t>

        </list>
      </t>

      <t>
      SMTP servers advertise support for this extension by returning one or more &lt;token-type&gt;
      in the EHLO REMEMBERME response.
      </t>
      
      <!--
      <t>
      ///Add Informative References
      This extension will become a part of SMTP-specific extension for SASL2.
      </t>
      -->
      
    </section>
    
    <section title="Conventions Used in This Document">
      
      <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>


    </section>

    <section title="REMEMBERME command">

      <!--///Spell out error conditions and corresponding status codes?-->

      <t>The REMEMBERME command is used to request a reauthentication token that is suitable for
      1 round trip SASL authentication mechanisms.
      The REMEMBERME command takes 1 parameter which is token type name. See <xref target="iana-reg"/>
      for the list of registered tokens types.</t>

      <t>
      This command is only allowed after a successfully completed AUTH command <xref target="RFC4954"/>.
      </t>

      <t>
      Upon receipt of REMEMBERME command the SMTP server checks that the specified token type
      is recognized and supported. If it is, it generates a new token of the requested type
      and returns it in the 235 response, that might also contain the 2.7.X enhanced status code.
      </t>

      <artwork name="" type="" align="left" alt="">
        <![CDATA[
  S: 220-smtp.example.com ESMTP Server
  C: EHLO client.example.com
  S: 250-smtp.example.com Hello client.example.com
  S: 250-AUTH GSSAPI PASSKEY SCRAM-SHA-256
  S: 250-ENHANCEDSTATUSCODES
  S: 250 STARTTLS
  C: STARTTLS
  S: 220 Ready to start TLS
    ... TLS negotiation proceeds, further commands
        protected by TLS layer ...
  C: EHLO client.example.com
  S: 250-smtp.example.com Hello client.example.com
  S: 250-AUTH GSSAPI PASSKEY SCRAM-SHA-256 PLAIN
  S: 250 REMEMBERME JWT RANDOM
  C: AUTH SCRAM-SHA-256 ...
   <SASL exchange>
  S: 235 2.7.0 Authentication successful
     ... later in the same session ...
  C: REMEMBERME JWT
  S: 235 2.7.X <base64-encoded token>
]]>
      </artwork>

      <t>Note that in the above example list of capabilities returned in EHLO response changes
      after STARTTLS. Also note that the order of AUTH and REMEMBERME lines in EHLO response can be arbitrary.</t>

    </section>

    <section title="Formal Syntax">

      <sourcecode type="abnf">
        <![CDATA[
rememberme-cmd = "REMEMBERME" SP token-type

token-type     = atom
                    ;; SHOULD be registered with IANA

rememberme-rsp = "235" [SP 2.7.X] SP base64-token
                    ;; Successful response to REMEMBERME command
                    ;; contains a base64-encoded token.
                    ;; An optional enhanced status code might preceed the token.

base64-token        = base64]]>
      </sourcecode>

    </section>
    
    
    <section title="IANA Considerations" anchor="iana-reg">

      <t>TBD. Register the SMTP capabilities and create a separate registry of token types?
      The separate registry will be shared with the IMAP REMEMBERME document.</t>

      <t>Also request assignment of 2.7.X from https://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml</t>

    </section>

    <section title="Security Considerations" anchor="seccons">

      <t>TBD.</t>

    </section>
    
  </middle>
  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?> <!-- Keywords, part 1 -->
      <?rfc include="reference.RFC.8174"?> <!-- Keywords, part 2 -->

      <reference anchor="ABNF">
        <front>
          <title>Augmented BNF for Syntax Specifications: ABNF</title>
          <author initials="D" surname="Crocker" fullname="Dave Crocker" role="editor">
            <organization />
          </author>
          <author initials="P" surname="Overell" fullname="Paul Overell" role="editor">
            <organization />
          </author>
          <date year="2008" month="January"/>
        </front>
        <seriesInfo name="RFC" value="5234" />
        <format type="TXT" target="https://www.rfc-editor.org/info/rfc5234" />
      </reference>

      <?rfc include="reference.RFC.4422"?> <!-- SASL -->
      <?rfc include="reference.RFC.4954"?> <!-- SMTP AUTH -->
      <?rfc include="reference.RFC.5321"?> <!-- SMTP -->

    </references>

<!--    
    <references title="Informative References">
    </references>
-->

<!--
    <section title="Acknowledgements">
	
      <t>Thank you to Steve Kille and David Wilson for suggestions, comments and corrections on this document.</t>

      <t>David Wilson came up with the idea of defining a new Content-Type header field parameter to distinguish
      forwarded messages from inner header field protection constructs.</t>
      
    </section>
-->    
    
  </back>
</rfc>
