<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-brotman-bimi-mua-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true" consensus="true">

<front>
<title abbrev="BIMI-MUA">BIMI on an Independent MUA</title><seriesInfo value="draft-brotman-bimi-mua-00" stream="IETF" status="standard" name="RFC"></seriesInfo>
<author initials="A." surname="Brotman" fullname="Alex Brotman"><organization>Comcast, Inc</organization><address><postal><street></street>
</postal><email>alex_brotman@comcast.com</email>
</address></author><date year="2025" month="June" day="20"></date>
<area>Applications</area>
<workgroup></workgroup>

<abstract>
<t>This document describes a method by which a receiving MTA may insert Brand
Indicators for Message Identification (BIMI) headers into a message in such
a way that a third party MUA can not only use the information in those
headers but also validate that the headers were inserted by the MTA.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Brand Indicators for Message Identification (BIMI) describes a method to
enable Domain Owners to coordinate with Mailbox Providers (MBPs), Mail
Transfer Agents (MTAs), and Mail User Agents (MUAs) in the display of
brand-specific Indicators (e.g., logos) next to properly authenticated
messages.</t>
<t>BIMI relies on DMARC, which in turn relies on one of SPF or DKIM validation
for the message in question, and it is generally accepted that an MTA is best
positioned to do the SPF and DKIM validation that underpin DMARC since it
has the access to the data necessary for such validation. An MUA
almost certainly cannot perform SPF validation on a message, as it will not
know the sending IP of the message (short of attempting to interpret Received
headers), and an MUA could only perform DKIM
validation on a message if the MTA has not altered the DKIM-protected parts of
the message. This makes the simplest path to the display of a BIMI
Indicator one where the MTA performs the required checks for DMARC and BIMI
and records the results of those checks in a way that can be accessed by the
MUA.</t>
<t>BIMI makes no requirement that the MTA handling a message and the MUA reading
and displaying it are operated by the same entity. In cases where a mailbox
holder uses their MBP's MUA to read the contents of their mailbox, it is a
relatively simple matter for the MTA and MUA to interoperate in a way in
which the display of the BIMI Indicator can be controlled by the MBP.</t>
<t>What is less simple is the interoperability between an MBP's MTAs and message
stores and an independent, or third-party, MUA. In this scenario, there must
exist a standard way for an MTA to communicate BIMI and DMARC validation
results to the MUA in a way that can be verified by the MUA. In addition,
the MBP through its message store may desire to be able to indicate that a
BIMI Indicator and/or its Evidence Document has been revoked if circumstances
require.</t>
<t>This document describes a method for achieving interoperability between a
MBP's MTAs and message stores, and a third-party MUA. Without this link,
an attacker could potentially insert messages with existing headers
through some other means, SMTP and IMAP are examples here. Using this
verifiable method allows for the MUA to understand the validation at the
MTA layer.</t>
</section>

<section anchor="validation-information"><name>Validation Information</name>
<t>The receiving entity may add two headers, BIMI-Location and BIMI-Indicator.
These two headers are meant to aid the MUA with the location of the
BIMI-related information, as well as base64-encoded SVG image data. They
could also insert an Authentication-Results header at this stage.</t>
<t>Additionally, a receiver employing this method MUST add another header
to the message, BIMI-Receiver-Information. This will contain a
<tt>date-time</tt> (from <xref target="RFC5322"></xref>), and sha256-encoded hash from the
local part of the recipient, and then the <tt>domain</tt> (From the RFC5321
RCPT TO command):</t>
<t>BIMI-Receiver-Information: date: date-time ; rcpt: sha256-local @ domain</t>
<t>date-time: RFC5322</t>
<t>domain: RFC5321</t>
<t>sha256-local: 64( HEXDIG )</t>
<t>An example might be:</t>
<t>BIMI-Receiver-Information: date: Tue, 25 Feb 2023 01:05:55 +0000 ; <br />
  rcpt: 6d9010b2b7a1483b256ae7477738dba7c530bd9ba53db1d6691441e74b83608a@isp.net</t>
<t>A MBP may choose to add this data without the signature specified below.
However, as the data cannot be verified via the signature, the MUA may find
the data within the header unsatisfactory to be used.</t>
<t>NOTE: Changed to 5321, instead of 5322</t>
</section>

<section anchor="bimi-receiver-signature"><name>BIMI-Receiver-Signature</name>
<t>The MTA or other entity that performed the BIMI validation of the message
MUST, if the message passed all BIMI validation checks, insert a
BIMI-Receiver-Signature header constructed in a manner consistent with the
creation of a DKIM-Signature header as defined in [RFC6376]. This header
MUST include all the BIMI-Location, BIMI-Selector, and
BIMI-Receiver-Information headers as headers that were signed by this
signature.  Additionally, the signer should oversign the headers included as
part of this signature as defined in <xref target="RFC6376"></xref>.</t>
<t>CLARIFICATION: Is this Receiver-Signature header useful without the other
headers? Today, not all MBPs insert these headers.  Can this still be useful?</t>
<t>This signature will be validated by the MUA in the same manner that a
DKIM-Signature header is validated, and successful validation of this header
will indicate that the receiving domain inserted the signed headers.</t>
<t>The public key to support this signing activity will be published in the DNS
at a location one or more levels below the name &quot;_bimi.signingDomain&quot;, where
&quot;signingDomain&quot; is the domain associated with the address in the RCPT TO
command. By utilizing a different &quot;namespace&quot;, this prevents this particular
key from being used in DKIM Replay attacks. For example, an MBP named &quot;isp.net&quot;
might publish its public key at &quot;sel_sign._local._bimi.isp.net&quot;. For the
purposes of this document, we will refer to &quot;sel_sign&quot; as the &quot;True Selector&quot;.</t>
<t>The selector specified in the s= tag of this signature will be a
pseudo-selector constructed by prepending the FQDN domain from the
the BIMI discovery to the &quot;True Selector&quot;. In the INFORMATIVE EXAMPLE of a
BIMI-Receiver-Signature header shown below, the s= tag is assigned the value
&quot;marketing.example.org.sel_sign&quot;, which means that the BIMI information
for the message was found at the domain &quot;marketing.example.org&quot;.</t>
<t>DISCUSS: Terminology around which domain is used above, and how we reference
it.</t>
<t>DISCUSS: Other headers?  Other information?</t>
<t>BIMI-Receiver-Signature: v=BIMI1; d=isp.net; s=marketing.example.org.sel_sign;
c=canonicalization; h=BIMI-Location:BIMI-Selector:BIMI-Receiver-Information;
b=&lt;SIGNATURE_BLOB&gt;; t=timestamp</t>
<t>The public key used for validation by the MUA would be:</t>
<t><tt>marketing.example.org.sel_sign._local._bimi.isp.net</tt></t>
<t>The mechanics of the public key publishing are covered in sections below.</t>

<section anchor="public-key-publishing"><name>Public Key Publishing</name>
<t>While the above method describing &quot;pseudo-selectors&quot; might seem to require
that isp.net publish an infinite number of DKIM public keys in order to
support validation of its BIMI-Receiver-Signature headers, that is not the
case. Instead, validation of these signature headers will rely on publishing
a DNS wildcard record, while revocation of BIMI logos will rely on the
publishing of empty records to match the domains for which the MBP no longer
wishes to support validation of BIMI logos.</t>
<t>As mentioned in the previous section, the MBP will publish its public key
for supporting validation of BIMI-Receiver-Signatures at the name
matching this pattern:</t>
<t>&lt;True Selector&gt;._local._bimi.&lt;signing Domain&gt;</t>
<t>In the example above that would mean publishing a DKIM public key as follows:</t>
<t>sel_sign._local._bimi.isp.net TXT &quot;v=BIMI1; p=&lt;public_key_data&gt;&quot;</t>
<t>To support validation of its signatures where the selector is the
&quot;pseudo-selector&quot; described in the previous section, the MBP will also
publish the following DNS wildcard record:</t>
<t>*.sel_sign._local._bimi.isp.net CNAME sel_sign._local._bimi.isp.net.</t>
<t>When the MUA performs a lookup, the wildcard MUST match and provide
the MUA with the proper public key to validate the signature.</t>
</section>
</section>

<section anchor="mua-validation"><name>MUA Validation</name>
<t>NOTE: Stub, needs elaboration</t>
<t>As with DKIM, the MUA will use the cryptographic signature to validate
the protected contents.  Additionally, the MUA may use a sha-256 hash
to validate the message and signature are meant for the recipient using
the MUA. By validating the recipient, this could aid with replay protection.</t>
</section>

<section anchor="revocation"><name>Revocation</name>
<t>There could exist any number of reasons for a receiving entity to no
longer desire to display iconography related to a given sending domain. This
could include certificate revocation from the CA, diminished local
reputation, extensive abuse reports, certificate expiration, or anything
else.</t>
<t>In the case where this happens, the MBP (again, isp.net) can publish a NULL
record at the location where the domain would normally match a wildcard. The
MBP may optionally choose to include a string as to the reason for revocation
by utilizing the <tt>r</tt> tag in the record. If we also use
<tt>marketing.example.org</tt> with a selector of &quot;foo&quot;, this MUST appear as:</t>
<t>foo._s.marketing.example.org.sel_sign._local._bimi.isp.net TXT 'v=BIMI1;'
foo._s.marketing.example.org.sel_sign._local._bimi.isp.net TXT 'v=BIMI1;&quot;r=Reason String;&quot;'</t>
<t>The DNS response MUST not include a functional public key that could be used
to validate the signature. If compared to the wildcard DNS entry defined
earlier, there will no longer be a public key that can be used for validation.
The DNS record MUST contain only a <tt>v</tt> tag, MAY contain an optional <tt>r</tt> tag,
and MUST NOT contain a <tt>p</tt> (public key) tag.</t>
<t>This should ensure the MUA is no longer able to retrieve the public keys
necessary to validate the signature.  In this case, the MUA MUST NOT
utilize the headers, even though they do still exist in the stored message.</t>
<t>See the Appendix for how revocation would look in practice.</t>

<section anchor="wildcard-revocation"><name>Wildcard Revocation</name>
<t>Three situations could exist here.  A MBP would like to revoke multiple
third-level domains for a single apex domain.  Another could be that the
MBP would like to rotate older keys.</t>

<section anchor="multi-domain-revocation"><name>Multi-domain Revocation</name>
<t>In a case where the domain <tt>example.org</tt> sends messages as:</t>
<t><tt>marketing.example.org</tt><br />
<tt>billing.example.org</tt></t>
<t>And the MBP would like to revoke for the entirety of <tt>example.org</tt>, a
wildcard record could be published to match multiple:</t>
<t>example.org.sel_sign._local._bimi.isp.net TXT 'v=BIMI1;'
*.example.org.sel_sign._local._bimi.isp.net TXT 'v=BIMI1;'</t>
</section>

<section anchor="multi-selector-revocation"><name>Multi-selector Revocation</name>
<t>If the MBP would prefer to revoke all selectors for a given domain, it could be
published with a wildcard:</t>
<t>*._s.marketing.example.org.sel_sign._local._bimi.isp.net TXT 'v=BIMI1;'</t>
</section>

<section anchor="public-key-revocation-rotation"><name>Public Key Revocation/Rotation</name>
<t>The MBP could determine that an older key needs to be retired.  In this case
the MBP could either remove the DNS record, or continue publishing without
a valid public key attached:</t>
<t>sel_sign._local._bimi.isp.net TXT 'v=BIMI1;'<br />
*.sel_sign._local._bimi.isp.net CNAME sel_sign._bimi.isp.net</t>
<t>For any MUA attempting to validate a signature, this action SHOULD fail.  The
MBP should rotate keys far ahead of removal of older keys so that recent
messages are not disassociated with the imagery the MBP believes should be
displayed.</t>
<t>An MUA SHOULD check for revocation daily or upon receipt of the first message
for a domain.  If the MUA does not intend to display the logo for a given
message, it MAY NOT check for revocation.  This may happen if the MUA only
displays the logo when the message is opened (vs in the &quot;list view&quot;).</t>
</section>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>

<section anchor="threat-concerns"><name>Threat Concerns</name>
<t>There are a number of concerns relating to how an independent MUA may use
some of this information, or more important, how an attacker may attempt
to cause an MUA to improperly display iconography for a user.  This
document is attempting to address these potential attacks.</t>

<section anchor="injection-of-headers-to-an-unaware-mailbox-provider"><name>Injection of Headers to An Unaware Mailbox Provider</name>
<t>An attacker could attempt to inject a message via normal SMTP methods,
however, the message would contain headers that the MUA may believe
were added by the receiving Mailbox Provider.</t>
</section>

<section anchor="imap-append"><name>IMAP Append</name>
<t>An attacker could insert messages into a mail store via IMAP commands,
and given a reasonable set of information points could induce an MUA
to display a logo.</t>
</section>

<section anchor="signature-replay"><name>Signature Replay</name>
</section>

<section anchor="revocation-1"><name>Revocation</name>
</section>
</section>

<section anchor="key-separation"><name>Key Separation</name>
<t>The key used to sign these BIMI headers MUST NOT be shared with another
portion of the receiving platform.</t>
</section>

<section anchor="header-removal"><name>Header Removal</name>
<t>Any MBP receiving these headers intact SHOULD remove these and perform their
own evaluations.</t>
<t>NOTE: Ensure that core document specifies the same for BIMI-related headers</t>
</section>

<section anchor="dns-key-caching"><name>DNS/Key caching</name>
<t>Care should be taken not to cache public keys retrieved for an excessive
amount of time.  It's presumed that the MBP has a good reason to revoke the
display of related imagery.</t>
<t>NOTE: Require MUA only retain data for TTL duration?</t>
</section>

<section anchor="dns-query-data"><name>DNS Query Data</name>
<t>If the MUA queries DNS each time a message is loaded, it's conceivable that the
DNS server owner could correlate some information about a user.  It's not
entirely clear if that data could be tied to a specific user, or what value
this data may have.</t>
</section>
</section>

<section anchor="other-considerations"><name>Other Considerations</name>

<section anchor="multi-domain-mbp"><name>Multi-Domain MBP</name>
<t>There exist a large number of MBPs that accept mail for multiple domains. It
could be that there is a primary domain with some side aliases, or a large
hosting company. These types of entities may wish to explore using a DNAME
to link the data between these various domains.  One possible solution could
be to do something such as:</t>
<t>_local._bimi.companyA.com DNAME _local._bimi.isp.net</t>
<t>This would allow for the same sharing of keys, as well as revocation
information across the domains, while only managing one set of data.</t>
</section>
</section>

<section anchor="appendix-a"><name>Appendix A</name>
<t>For purposes below, sending is <tt>marketing.example.org</tt>, MBP is <tt>isp.net</tt>, and
selector is <tt>sel_sign</tt>.</t>

<section anchor="normal-operational-steps"><name>Normal Operational Steps</name>

<ul spacing="compact">
<li>ESP sends message to MBP containing appropriate headers for BIMI usage</li>
<li>MBP performs DKIM/SPF/DMARC steps</li>
<li>Presuming prior step works properly, MBP evaluates BIMI</li>
<li><t>Based on localized requirements, MBP adds headers to email</t>

<ul spacing="compact">
<li>BIMI-Location</li>
<li>BIMI-Indicator</li>
</ul></li>
<li><t>MBP additionally adds header specified in this document</t>

<ul spacing="compact">
<li>BIMI-Receiver-Information</li>
<li>Includes time of receipt, sha256 of local rcpt, and the &quot;@isp.net&quot; portion</li>
</ul></li>
<li><t>MBP signs all three headers using DKIM-style cryptography</t>

<ul spacing="compact">
<li>Adds new header containing hash, as well as s/d attributes</li>
</ul></li>
<li>...</li>
<li>MBP stores message in platform</li>
<li>MUA retrieves message from message store</li>
<li>User opens message or MUA uses data during list view</li>
<li>MUA inspects looking for BIMI data</li>
<li><t>MUA sees signature</t>

<ul spacing="compact">
<li>MUA verifies that the destination email address matches the signing domain</li>
<li>Looks for public keys at <tt>marketing.example.org.sel_sign._local._bimi.isp.net</tt></li>
<li>Matches wildcard at <tt>*.sel_sign._local._bimi.isp.net</tt></li>
</ul></li>
<li>MUA validates signature</li>
<li>MUA displays BIMI logo as needed (list or message view)</li>
</ul>
</section>

<section anchor="revoked-operational-steps"><name>Revoked Operational Steps</name>

<ul spacing="compact">
<li>ESP sends message to MBP containing appropriate headers for BIMI usage</li>
<li>MBP performs DKIM/SPF/DMARC steps</li>
<li>Presuming prior step works properly, MBP evaluates BIMI</li>
<li><t>Based on localized requirements, MBP adds headers to email</t>

<ul spacing="compact">
<li>BIMI-Location</li>
<li>BIMI-Indicator</li>
</ul></li>
<li><t>MBP additionally adds header specified in this document</t>

<ul spacing="compact">
<li>BIMI-Receiver-Information</li>
<li>Includes time of receipt, sha256 of local rcpt, and the &quot;@isp.net&quot; portion</li>
</ul></li>
<li><t>MBP signs all three headers using DKIM-style cryptography</t>

<ul spacing="compact">
<li>Adds new header containing hash, as well as s/d attributes</li>
</ul></li>
<li>...</li>
<li>MBP stores message in platform</li>
<li>MUA retrieves message from message store</li>
<li>User opens message or MUA uses data during list view</li>
<li>MUA inspects looking for BIMI data</li>
<li><t>MUA sees signature</t>

<ul spacing="compact">
<li>MUA verifies that the destination email address matches the signing domain</li>
<li>Looks for public keys at <tt>selector.marketing.example.org.sel_sign._local._bimi.isp.net</tt></li>
<li>MUA sees a value of &quot;v=BIMI1;&quot;</li>
</ul></li>
<li>MUA does NOT display logos for this message (and the domain as a whole)</li>
</ul>
</section>

<section anchor="sample-headers"><name>Sample headers</name>
<t>BIMI-Receiver-Signature: s=our_selector.marketing.example.org.sel_sign;d=isp.net;p=&lt;signature_data&gt;
BIMI-Receiver-Information: date: Tue, 25 Oct 2022 15:14:12 +00:00 ;
  rcpt=d1bc8d3ba4afc7e109612cb73acbdddac052c93025aa1f82942edabb7deb82a1@isp.net
BIMI-Location: v=BIMI1;a=<eref target="https://bimi.marketing.example.org/bimi/evidence.pem">https://bimi.marketing.example.org/bimi/evidence.pem</eref>;
  l=<eref target="https://bimi.marketing.example.org/bimi/logo.svg">https://bimi.marketing.example.org/bimi/logo.svg</eref>
BIMI-Indicator: &lt;base64_SVG_Data&gt;
Authentication-Results: spf=pass marketing.marketing.example.org;
  dkim=pass (signature was verified) header.d=marketing.example.org; dmarc=pass
  header.from=marketing.example.org; bimi=pass header.d=marketing.example.org
  header.selector=our_selector
DKIM-Signature: d=marketing.example.org;s=d_s;h=BIMI-Selector:From:To:Date:Message-Id;
  bh=&lt;hash_data&gt;;b=&lt;signature_data&gt;
BIMI-Selector: v=BIMI1;s=our_selector</t>
</section>
</section>

<section anchor="contributors"><name>Contributors</name>
</section>

<section anchor="notes"><name>Notes</name>
</section>

<section anchor="todo"><name>TODO</name>

<ul spacing="compact">
<li>Cleanup notes</li>
<li>Missing a number of references</li>
<li>Enhance MUA Validation stub</li>
</ul>
</section>

<section anchor="references"><name>References</name>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5322.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6376.xml"/>
</references>

</back>

</rfc>
