<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.14 (Ruby 3.1.2) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="trust200902" docName="draft-robinson-dkim2-bounce-processing-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title abbrev="DKIM2 Bounce processing">DKIM2 Procedures for bounce processing</title>

    <author initials="A." surname="Robinson" fullname="Allen Robinson">
      <organization>Google Inc.</organization>
      <address>
        <email>arobins@google.com</email>
      </address>
    </author>

    <date year="2025" month="March" day="18"/>

    
    
    <keyword>Internet-Draft</keyword>

    <abstract>


<?line 26?>

<t>This memo provides a description of the procedures for bounce processing that should be performed by any mail system that implements DKIM2, as part of the overall DKIM2 protcol definition.</t>



    </abstract>



  </front>

  <middle>


<?line 30?>

<section anchor="introduction"><name>Introduction</name>

<t>As part of the DKIM2 protocol, handling for Delivery Status Notifications (DSNs, defined in <xref target="RFC3461"/>) is necessary to ensure that systems receiving these notifications have a mechanism to both authenticate the contents of the DSN, and to determine if the system generating the DSN is authorized to do so for the message being returned.</t>

</section>
<section anchor="bounce-processing"><name>Bounce processing</name>

<section anchor="forward-path"><name>Forward path</name>

<t>At a high level, the forward path in DKIM2 involves the addition of a new DKIM2-Signature header by each system that handles a message. This header declares that the message was originated by a system that has the right to do so, either because that system is the origin of the message, or because the system received the message from somewhere else and has decided to forward it to another system. In order to support injection-resistant bounce handling, each system must record in the DKIM2-Signature's <spanx style="verb">mf=</spanx> tag the return path identity of the message, along with all other values as required by the DKIM2 protocol.</t>

<t>The return path identity for an incoming message should be the address included in the SMTP transaction's <spanx style="verb">MAIL FROM</spanx> command. This identity will be related to the last (highest <spanx style="verb">i=</spanx> value) DKIM2 signature in the message, so this address represents an authenticated destination for future bounce notifications related to the message.</t>

</section>
<section anchor="return-path"><name>Return path</name>

<section anchor="bounce-origination"><name>Bounce origination</name>

<t>Once a system decides that a bounce notification needs to be generated in response to a message that it previously accepted for delivery, a new message must be formed to notify the sender that the message was not delivered successfully. Per <xref target="RFC3461"/>, the bounce notification message has a top-level MIME part of type <spanx style="verb">multipart/report</spanx>. Among other things, that MIME part must contain a MIME part of type <spanx style="verb">message/rfc822</spanx> that holds either the original message exactly as it was submitted by the sending system or just the headers for that message, so that the receiver of the bounce notification can authenticate the signatures associated with the original message before processing the bounce notification.</t>

</section>
<section anchor="bounce-propagation"><name>Bounce propagation</name>

<t>A system that acts as an intermediary step for the handling of a message in the forward path may decide to propagate bounce notifications through the return path of the message in response to receiving a bounce notification.</t>

<t>Same as the initial DSN, the intermediary system's generated bounce notification message must contain a MIME part of type <spanx style="verb">message/report</spanx> with a sub-part of type <spanx style="verb">message/rfc822</spanx> that holds the original message or its headers.</t>

<t>The bounce notification must be sent to the return path identity listed in this system's DKIM2-Signature header.</t>

<t>An intermediary system must be able to recover at least the originally-submitted headers for a forwarded message, for the purposes of generating bounce notifications. These systems may choose to use the DKIM2 modifications they declared as part of the forward path to reconstruct the original message based on the inbound bounce notification, if it is desirable to return the full message and the inbound bounce notification also includes the full message. Forwarding systems that want to return the full message in all cases should retain the content required to do that as it is not guaranteed to be present in a received DSN.</t>

</section>
<section anchor="authentication-of-inbound-bounce-notifications"><name>Authentication of inbound bounce notifications</name>

<t>When a system receives a DKIM2-signed bounce notification, and the included original message is also DKIM2-signed, the bounce receiver should verify that the original message was not altered. This means:</t>

<t>1) The DSN's DKIM2 signature must have a signing domain that is aligned with the recipient of the message that is being returned. The recipient's address is located in the rt= tag of the last (highest i= tag) DKIM2-Signature in the returned message.
1) The last (highest <spanx style="verb">i=</spanx> tag) DKIM2-Signature of the returned message must be one that was generated by the system receiving the bounce notification, determined by examining the d= and mf= tags of that signature header.
1) The signature in that DKIM2-Signature header must match the contents of the returned message. Verifiers must handle truncated or missing original message bodies gracefully, by using the body hash value included in the signature header without comparing it to the body contents.</t>

<t>The exact details of how to perform DKIM2 signature validation are out of scope for this draft.</t>

<t>In the event that the bounce notification contains unauthenticated content, the bounce receiver may decide to deem the bounce message itself as malicious and not propagate it through the return path declared in that message.</t>

</section>
<section anchor="dkim2-signing-of-bounce-notifications"><name>DKIM2 signing of bounce notifications</name>

<t>Bounce notifications should be DKIM2-signed in exactly the same way as a newly-originated message. This signature must use <spanx style="verb">i=1</spanx> since the system generating the notification is the originator of that message, and include an empty mf= tag to align with the SMTP transaction delivering the DSN.</t>

</section>
</section>
<section anchor="example"><name>Example</name>

<t>The following is a very simplified description of the SMTP transactions involved in the forward and return paths for a message. Only the SMTP commands and headers related to DKIM2 bounce processing are mentioned.</t>

<t>Message origination from example.com to foo.com:</t>

<t>```
MAIL FROM: <eref target="mailto:original@example.com">original@example.com</eref>
RCPT TO: <eref target="mailto:dest@foo.com">dest@foo.com</eref>
DKIM2-Signature i=1 domain=example.com rcpt=dest@foo.com
From: Sender <eref target="mailto:original@example.com">original@example.com</eref>
To: dest@foo.com</t>

<t>I hope this email reaches its destination
```</t>

<t>Forwarding of the message from foo.com to bar.com:</t>

<t>```
MAIL FROM: <eref target="mailto:something@foo.com">something@foo.com</eref>
RCPT TO: <eref target="mailto:dest@bar.com">dest@bar.com</eref>
DKIM2-Signature i=2 domain=foo.com rcpt=newdest@bar.com mf=original@example.com
DKIM2-Signature i=1 domain=example.com rcpt=dest@foo.com
From: Sender <eref target="mailto:original@example.com">original@example.com</eref>
To: dest@foo.com</t>

<t>I hope this email reaches its destination
```</t>

<t>Bounce notification from bar.com to foo.com:</t>

<t>```
MAIL FROM: &lt;&gt;
RCPT TO: <eref target="mailto:something@foo.com">something@foo.com</eref>
DKIM2-Signature: i=1 domain=bar.com rcpt=something@foo.com
From: <eref target="mailto:postmaster@bar.com">postmaster@bar.com</eref>
To: <eref target="mailto:something@foo.com">something@foo.com</eref>
Subject: DSN for ...
Content-Type: multipart/report; boundary="divider43541325151"</t>

<t>--divider43541325151
Content-Type: text/plain</t>

<t>This message is being returned.</t>

<t>--divider43541325151
Content-Type: message/delivery-status</t>

<t>--divider43541325151
Content-Type: message/rfc822
DKIM2-Signature i=2 domain=foo.com rcpt=newdest@bar.com mf=original@example.com
DKIM2-Signature i=1 domain=example.com rcpt=dest@foo.com
From: Sender <eref target="mailto:original@example.com">original@example.com</eref>
To: dest@foo.com</t>

<t>I hope this email reaches its destination
--divider43541325151--
```</t>

<t>Propagated bounce notification from foo.com to example.com:</t>

<t>```
MAIL FROM: &lt;&gt;
RCPT TO: <eref target="mailto:original@example.com">original@example.com</eref>
DKIM2-Signature: i=1 domain=foo.com rcpt=original@example.com
From: <eref target="mailto:postmaster@foo.com">postmaster@foo.com</eref>
To: <eref target="mailto:original@example.com">original@example.com</eref>
Subject: DSN for ...
DKIM2-Sig: i=1 domain=example.com rcpt=dest@foo.com
From: Sender <eref target="mailto:original@example.com">original@example.com</eref>
To: dest@foo.com
Content-Type: multipart/report; boundary="divider89869878"</t>

<t>--divider89869878
Content-Type: text/plain</t>

<t>This message is being returned.</t>

<t>--divider89869878
Content-Type: message/delivery-status</t>

<t>--divider43541325151
Content-Type: message/rfc822
DKIM2-Signature i=1 domain=example.com rcpt=dest@foo.com
From: Sender <eref target="mailto:original@example.com">original@example.com</eref>
To: dest@foo.com</t>

<t>I hope this email reaches its destination
--divider89869878--
```</t>

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

<t>To be covered in primary DKIM2 document.</t>

</section>
<section anchor="iana-considerations"><name>IANA considerations</name>

<t>To be covered in primary DKIM2 document.</t>

</section>
</section>


  </middle>

  <back>


    <references title='Normative References' anchor="sec-normative-references">



<reference anchor="RFC3461">
  <front>
    <title>Simple Mail Transfer Protocol (SMTP) Service Extension for Delivery Status Notifications (DSNs)</title>
    <author fullname="K. Moore" initials="K." surname="Moore"/>
    <date month="January" year="2003"/>
    <abstract>
      <t>This memo defines an extension to the Simple Mail Transfer Protocol (SMTP) service, which allows an SMTP client to specify (a) that Delivery Status Notifications (DSNs) should be generated under certain conditions, (b) whether such notifications should return the contents of the message, and (c) additional information, to be returned with a DSN, that allows the sender to identify both the recipient(s) for which the DSN was issued, and the transaction in which the original message was sent. [STANDARDS-TRACK]</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="3461"/>
  <seriesInfo name="DOI" value="10.17487/RFC3461"/>
</reference>




    </references>



<?line 175?>

<section anchor="changes-from-earlier-versions"><name>Changes from Earlier Versions</name>

<t>[[This section to be removed by RFC Editor]]</t>

</section>


  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA+VZXY/bxhV9568YxA+JAVH2ru3UVrOBN7a3WLRrG7uL9sE2
uiNyJE1McpiZoRQ1yH/vufPBL1HbGG2AAN0HWyLn495zz733zChN08RKW4gF
e/3Xy6tT9l6rTOSNFoatlGZL1VSZYDU9NUZW64Qvl1ps4/AfDt7nKqt4ifVy
zVc21WopK6OqNP8sy9PUr5d249PHjxPTLEuJb6q63deYefnm9iLJuBVrpfcL
ZmyeNHWO72aRqKVRhXAfZa0XzOrG2NPHj188Pk0+i/1O6RwLVFboStj0NdmQ
GMur/J+8UBUW3wuT1HLBPliVzZhR2mqxMvi0L+nDpyThjd0ovUhYmjD8wfwF
O5+z6+CJe+hdPC8KUQ1fKL1esL8otS4EzMjm7qEouSwWjHswXq7d63mmyiSp
lC65lVuxoJHXF6+ePP32BL5Vq+5FkqRpyvjSWM0zmyS3G2lYKUpFuG9ljlhx
hn8zLWsLFJlaMbsJUbknlhjELTMb1RQ5W+KN0LSrwJc949WekdkAxlhR+rGy
rAtRisoaH/8Z44bVXNu4pdoKzYsisANb2UwVsG0lK0mmzb0vpczzQiTJAwqV
VnmT0cskOR+u1q2isMyMbRDHggwnd16LAujoPbux3DaGvVVWriRog5UM++b1
zVtE1e0Mh2TFfvkloPvrrw8ZAKwEwcCxgFVMVAY4BUCcw4ZpDJBbj5MwglWD
DTZ8KwB7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