<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!DOCTYPE rfc [
<!ENTITY nbsp "&#160;">
<!ENTITY zwsp "&#8203;">
<!ENTITY nbhy "&#8209;">
<!ENTITY wj "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="info" docName="draft-eggert-mailflagcolors-00" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" version="3">
  <front>
    <title abbrev="Abbreviated Title">IMAP "$MailFlagBit" Keywords</title>
    <seriesInfo name="Internet-Draft" value="draft-eggert-mailflagcolors-00"/>
    <author fullname="Daniel Eggert" initials="D." role="editor" surname="Eggert">
      <organization>Apple Inc</organization>
      <address>
        <postal>
          <street>One Apple Park Way</street>
          <city>Cupertino</city>
          <code>CA 95014</code>
          <country>USA</country>
        </postal>
        <email>deggert@apple.com</email>
        <uri>https://www.apple.com</uri>
      </address>
    </author>
    
    <date year="2024"/>
    
    <area>Art</area>
    <workgroup>MailMaint</workgroup>
    <keyword>IMAP</keyword>
    <keyword>JMAP</keyword>
    
    <abstract>
      <t>This document defines 3 new IMAP/JMAP keywords: $MailFlagBit0, $MailFlagBit1, and $MailFlagBit2 for specifying flag colors. It registers them with IANA to avoid name collisions.</t>
    </abstract>
    
  </front>
  
  <middle>
    
    <section>
      <name>Introduction</name>
      <t>The Internet Message Access Protocol (IMAP) specification <xref target="RFC9051"/> defines the use of message keywords, and an "IMAP Keywords" registry is created in <xref target="RFC5788"/>.  <xref target="RFC9051"/> defines a <tt>\Flagged</tt> system flag to mark a message for urgent/special attention. The new keywords defined in this document allow such a flagged message to have that flag be of one of 7 colors.</t>
      <t>This document does the following:</t>
      <ul spacing="normal">
        <li>defines 3 new message keywords, <tt>$MailFlagBit0</tt>, <tt>$MailFlagBit1</tt>, and <tt>$MailFlagBit2</tt>, to apply to any message that has the <tt>\Flagged</tt> keyword set;</li>
        <li>registers these <tt>$MailFlagBit0</tt>, <tt>$MailFlagBit1</tt>, and <tt>$MailFlagBit2</tt> keywords in the "IMAP Keywords" registry;</li>
        <li>defines which combination of these flags correspond to which colors.</li>
      </ul>
    </section>
    
    <section>
      <name>Requirements Language</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" 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>
      <name>Definition of the MailFlagBit Message Keyword</name>
      <t>The 3 flag color keywords <tt>$MailFlagBit0</tt>, <tt>$MailFlagBit1</tt>, and <tt>$MailFlagBit2</tt> make up a bit pattern that defined the color of the flag as such:</t>
      <table>
        <thead>
          <tr>
            <th>Bit 0</th>
            <th>Bit 1</th>
            <th>Bit 2</th>
            <th>Color</th>
          </tr>
        </thead>
        <tbody>
          <tr><td>0</td><td>0</td><td>0</td><td>red</td></tr>
          <tr><td>1</td><td>0</td><td>0</td><td>orange</td></tr>
          <tr><td>0</td><td>1</td><td>0</td><td>yellow</td></tr>
          <tr><td>0</td><td>1</td><td>1</td><td>green</td></tr>
          <tr><td>0</td><td>0</td><td>1</td><td>blue</td></tr>
          <tr><td>1</td><td>0</td><td>1</td><td>purple</td></tr>
          <tr><td>0</td><td>1</td><td>1</td><td>gray</td></tr>
        </tbody>
      </table>
      <t>These flags <bcp14>SHOULD</bcp14> be ignored if the <tt>\Flagged</tt> system flag is not set. If the <tt>\Flagged</tt> system flag is set, the flagged status <bcp14>MAY</bcp14> be displayed to the user in the color corresponding to the combination of the 3 flag color keywords.</t>
    </section>
    
    <section>
      <name>Implementation Notes</name>
      <t>A mail client that is aware of these flag color keywords <bcp14>SHOULD</bcp14> clear all 3 flag color keywords when the user unflags the message, i.e. when unsetting the <tt>\Flagged</tt> system flag, all 3 flag color keywords <bcp14>SHOULD</bcp14> also be unset.</t>
    </section>
    
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>3 IMAP/JMAP keywords are registered in the IMAP/JMAP keywords registry, as established in RFC5788.</t>
    </section>
    
    <section anchor="imap-jmap-keyword-registrations"><name>IMAP/JMAP Keyword Registrations</name>
      
      <section anchor="bit0-keyword-registration"><name>$MailFlagBit0 keyword registration</name>
          <dl spacing="normal">
            <dt>IMAP/JMAP keyword name:</dt><dd><tt>$MailFlagBit0</tt></dd>
            <dt>Purpose:</dt><dd>0 bit part of a 3-bit bitmask that defines the color of the flag when the has the system flag <tt>\Flagged</tt> set</dd>
            <dt>Private or Shared on a server:</dt><dd>SHARED</dd>
            <dt>Is it an advisory keyword or may it cause an automatic action:</dt><dd>No</dd>
            <dt>When/by whom the keyword is set/cleared:</dt><dd>This keyword is set by an IMAP or JMAP client as the result of a user action to "flag" a message for urgent/special attention.</dd>
        <dt>Related keywords:</dt><dd><tt>$MailFlagBit1</tt>, <tt>$MailFlagBit2</tt></dd>
        <dt>Related IMAP capabilities:</dt><dd>None</dd>
        <dt>Security considerations:</dt><dd>None</dd>
        <dt>Published specification:</dt><dd>This document</dd>
        <dt>Intended usage:</dt><dd>COMMON</dd>
        <dt>Owner/Change controller:</dt><dd>IESG</dd>
          </dl>
      </section>
      
      <section anchor="bit1-keyword-registration"><name>$MailFlagBit1 keyword registration</name>
          <dl spacing="normal">
            <dt>IMAP/JMAP keyword name:</dt><dd><tt>$MailFlagBit1</tt></dd>
            <dt>Purpose:</dt><dd>0 bit part of a 3-bit bitmask that defines the color of the flag when the has the system flag <tt>\Flagged</tt> set</dd>
            <dt>Private or Shared on a server:</dt><dd>SHARED</dd>
            <dt>Is it an advisory keyword or may it cause an automatic action:</dt><dd>No</dd>
            <dt>When/by whom the keyword is set/cleared:</dt><dd>This keyword is set by an IMAP or JMAP client as the result of a user action to "flag" a message for urgent/special attention.</dd>
        <dt>Related keywords:</dt><dd><tt>$MailFlagBit0</tt>, <tt>$MailFlagBit2</tt></dd>
        <dt>Related IMAP capabilities:</dt><dd>None</dd>
        <dt>Security considerations:</dt><dd>None</dd>
        <dt>Published specification:</dt><dd>This document</dd>
        <dt>Intended usage:</dt><dd>COMMON</dd>
        <dt>Owner/Change controller:</dt><dd>IESG</dd>
          </dl>
      </section>
      
      <section anchor="bit2-keyword-registration"><name>$MailFlagBit2 keyword registration</name>
          <dl spacing="normal">
            <dt>IMAP/JMAP keyword name:</dt><dd><tt>$MailFlagBit2</tt></dd>
            <dt>Purpose:</dt><dd>0 bit part of a 3-bit bitmask that defines the color of the flag when the has the system flag <tt>\Flagged</tt> set</dd>
            <dt>Private or Shared on a server:</dt><dd>SHARED</dd>
            <dt>Is it an advisory keyword or may it cause an automatic action:</dt><dd>No</dd>
            <dt>When/by whom the keyword is set/cleared:</dt><dd>This keyword is set by an IMAP or JMAP client as the result of a user action to "flag" a message for urgent/special attention.</dd>
        <dt>Related keywords:</dt><dd><tt>$MailFlagBit0</tt>, <tt>$MailFlagBit1</tt></dd>
        <dt>Related IMAP capabilities:</dt><dd>None</dd>
        <dt>Security considerations:</dt><dd>None</dd>
        <dt>Published specification:</dt><dd>This document</dd>
        <dt>Intended usage:</dt><dd>COMMON</dd>
        <dt>Owner/Change controller:</dt><dd>IESG</dd>
          </dl>
      </section>
      
    </section>
    
    
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>This document should not affect the security of the Internet.</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.2119.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.9051.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5788.xml"/>
      </references>
      
    </references>
  </back>
</rfc>
