You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

267 lines

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Message Delivery Receipts</title>
  10. <abstract>This specification defines an XMPP protocol extension for message delivery receipts, whereby the sender of a message can request notification that the message has been delivered to a client controlled by the intended recipient.</abstract>
  12. <number>0184</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes>
  21. <spec>XEP-0022 (in part)</spec>
  22. </supersedes>
  23. <supersededby/>
  24. <shortname>receipts</shortname>
  25. <schemaloc>
  26. <url></url>
  27. </schemaloc>
  28. &stpeter;
  29. &hildjj;
  30. <revision>
  31. <version>1.2</version>
  32. <date>2011-03-01</date>
  33. <initials>psa</initials>
  34. <remark><p>Clarified terminology and several points of implementation; explicitly stated that this protocol notifies the sender only that a message has been delivered to a client, not that it has been read or understood by a human user (if any); changed title from Message Receipts to Message Delivery Receipts to make this 100% clear.</p></remark>
  35. </revision>
  36. <revision>
  37. <version>1.1</version>
  38. <date>2010-03-31</date>
  39. <initials>psa</initials>
  40. <remark>
  41. <ul>
  42. <li>Clarified the level of reliability that this protocol provides and, most importantly, does not provide.</li>
  43. <li>Explicitly discouraged dependence on receipts unless some other protocol is used to negotiate the use of message delivery receipts.</li>
  44. <li>Provided explicit recommendations about when and when not to request receipts.</li>
  45. <li>Relaxed the business rules to allow inclusion of receipt requests even to the bare JID and even if the sender does not yet know whether the intended recipient supports this protocol.</li>
  46. <li>Added 'id' attribute to &lt;received/&gt; element for tracking purposes.</li>
  47. <li>Removed text about XEP-0155 negotiation.</li>
  48. </ul>
  49. </remark>
  50. </revision>
  51. <revision>
  52. <version>1.0</version>
  53. <date>2007-09-26</date>
  54. <initials>psa</initials>
  55. <remark><p>Per a vote of the XMPP Council, advanced to Draft.</p></remark>
  56. </revision>
  57. <revision>
  58. <version>0.4</version>
  59. <date>2007-05-30</date>
  60. <initials>psa</initials>
  61. <remark><p>Per Council feedback, modified to use dedicated namespace (not AMP).</p></remark>
  62. </revision>
  63. <revision>
  64. <version>0.3</version>
  65. <date>2006-11-06</date>
  66. <initials>psa</initials>
  67. <remark><p>Removed reliability features, which belong at a different level.</p></remark>
  68. </revision>
  69. <revision>
  70. <version>0.2</version>
  71. <date>2006-09-21</date>
  72. <initials>psa</initials>
  73. <remark><p>Added two more scenarios; defined business rule about not sending to bare JIDs; specified security consideration regarding presence leaks.</p></remark>
  74. </revision>
  75. <revision>
  76. <version>0.1</version>
  77. <date>2006-04-11</date>
  78. <initials>psa</initials>
  79. <remark><p>Initial version.</p></remark>
  80. </revision>
  81. <revision>
  82. <version>0.0.2</version>
  83. <date>2006-04-07</date>
  84. <initials>psa</initials>
  85. <remark><p>Added text and examples for service discovery; added text and examples for chat session negotiation; added recommendations regarding message processing, retries, etc.</p></remark>
  86. </revision>
  87. <revision>
  88. <version>0.0.1</version>
  89. <date>2006-03-27</date>
  90. <initials>psa</initials>
  91. <remark><p>First draft.</p></remark>
  92. </revision>
  93. </header>
  94. <section1 topic='Introduction' anchor='intro'>
  95. <p>While &xep0079; provides message acknowledgements at the server level, it does not extend that model all the way to the client. <note>Naturally, message delivery receipts can be combined with the rules specified in <cite>Advanced Message Processing</cite> for more complete reporting.</note> However, sometimes client-level acknowledgements are needed, for example to provide "receipts". This document defines a mechanism for XMPP message delivery receipts, which are functionally equivalent to the "delivered" or "displayed" event in &xep0022;, which this specification in part obsoletes.</p>
  96. <p>Note well that this specification does not distinguish between delivery and display, as was done in the message events protocol, in part because no implementations of XEP-0022 made that distinction. However, in the absence of such a distinction, readers need to understand that this protocol can provide only a notification that a message has been received at a client, i.e. delivered to a client, not that the message has been actively read or understood by a human user (if any). Therefore this extension is functionally equivalent to an <cite>Advanced Message Processing</cite> rule of "receipt", although it uses a dedicated namespace to simplify processing by clients and intermediate routers.</p>
  97. </section1>
  98. <section1 topic='Requirements' anchor='reqs'>
  99. <p>This document addresses the following requirements:</p>
  100. <ol>
  101. <li>Enable a sender to request notification that an XMPP message stanza has been received (i.e., delivered to a client, but not necessarily read or understood by a human user, if any).</li>
  102. <li>Enable a recipient to provide message delivery receipts if desired.</li>
  103. </ol>
  104. </section1>
  105. <section1 topic='Terminology' anchor='terms'>
  106. <p>The term "content message" refers to the stanza for which the original sender would like to receive a receipt.</p>
  107. <p>The term "ack message" refers to the stanza by which the recipient acknowledges receipt of the content message at a client (i.e., delivery to a client).</p>
  108. </section1>
  109. <section1 topic='What This Protocol Provides' anchor='what'>
  110. <p>This document defines a protocol that enables a sender to ask the recipient to acknowledge receipt of a content message by returning an ack message. Although the return of an ack message lets the sender know that the content message has been delivered to a client controlled by the intended recipient, there are many reasons why the sender might not receive an ack message immediately or at all, including but not limited to the following:</p>
  111. <ul>
  112. <li>The sender addressed the content message to the recipient's bare JID &LOCALBARE; and therefore does not know if the recipient even supports the Message Delivery Receipts protocol.</li>
  113. <li>The sender has not bothered to determine whether the recipient supports the Message Delivery Receipts protocol.</li>
  114. <li>The recipient (or the particular intended resource to which the sender addressed the content message) does not in fact support the Message Delivery Receipts protocol.</li>
  115. <li>The intended resource supports the Message Delivery Receipts protocol but the recipient's server delivers the content message to another resource that does not support the Message Delivery Receipts protocol.</li>
  116. <li>The recipient's client receives the content message but experiences a malfunction before generating an ack message.</li>
  117. <li>The recipient returns an ack message but the ack message is lost on the way back from the recipient to the sender (e.g., because of connectivity issues or software failures at any hop).</li>
  118. <li>The recipient simply does not wish to return a receipt for the content message.</li>
  119. </ul>
  120. <p>Because of these significant limitations, this protocol does not provide complete or even partial reliability or guaranteed delivery. Therefore, the sender SHOULD NOT impute any meaning to the fact that it has not received an ack message, unless it has established with the recipient that receipt requests will be honored; however, methods for doing so are out of scope for this specification and it is NOT RECOMMENDED to take any particular action (such as resending the content message) without such methods. <note>This protocol merely provides a building block that could be used in conjunction with other protocols to asymptotically approach the eventual goal of messaging reliability and guaranteed delivery.</note></p>
  121. <p>Because it is possible for a given content message to be delivered to multiple XMPP resources controlled by the recipient, the sender of the content message needs to be prepared to receive multiple ack messages.</p>
  122. <p>Finally, this protocol does not enable the sender to know that the intended recipient has read the message or understood the message (if the intended recipient is a human being), that the intended recipient has processed the message (if the intended recipient is a bot or other automated system), that an end user client has presented the message to a human user (if any), etc. This protocol provides delivery receipts only, not notifications about presentation, processing, reading, understanding, or any other action related to a message other than delivery to a client of some kind.</p>
  123. </section1>
  124. <section1 topic='When to Request Receipts' anchor='when'>
  125. <p>A sender <em>could</em> request receipts on any non-error content message (chat, groupchat, headline, or normal) no matter if the recipient's address is a bare JID &LOCALBARE; or a full JID &LOCALFULL;. Whether it is <em>appropriate</em> or <em>advisable</em> to do so it another question. This section provides recommendations about when and when not to request receipts, and what results to expect in each scenario.</p>
  126. <section2 topic='Bare JID' anchor='when-bare'>
  127. <p>If the sender knows only the recipient's bare JID, it cannot determine (via &xep0030; or &xep0115;) whether the intended recipient supports the Message Delivery Receipts protocol. In this case, the sender MAY request a receipt when sending a content message of type "chat", "headline", or "normal" to the recipient's bare JID. However, the sender MUST NOT depend on receiving an ack message in reply.</p>
  128. </section2>
  129. <section2 topic='Full JID' anchor='when-full'>
  130. <p>If the sender knows a full JID for the recipient (e.g., via presence), it SHOULD attempt to determine (via service disco or entity capabilities) whether the client at that full JID supports the Message Delivery Receipts protocol before attempting to request receipts.</p>
  131. <p>If the sender determines that the recipient's client does not support the Message Delivery Receipts protocol then it SHOULD NOT request a receipt when sending a content message to that full JID and MUST NOT depend on receiving an ack message.</p>
  132. <p>If the sender determines that the recipient's client supports the Message Delivery Receipts protocol then it MAY request a receipt when sending a content message of type "chat", "headline", or "normal" to that full JID. However, even in this case the sender SHOULD NOT depend on receiving an ack message.</p>
  133. </section2>
  134. <section2 topic='Groupchat' anchor='when-groupchat'>
  135. <p>It is NOT RECOMMENDED to request a receipt when sending a content message of type "groupchat" in a &xep0045; room because the logic for determining when a content message is truly "received" by all of the room occupants is complex, and because the sender would receive one ack message from each occupant of the room, thus significantly increasing the number of stanzas sent through the room.</p>
  136. </section2>
  137. <section2 topic='Ack Messages' anchor='when-ack'>
  138. <p>To prevent looping, an entity MUST NOT include a receipt request (i.e., the &lt;request/&gt; element) in an ack message (i.e., a message stanza that includes the &lt;received/&gt; element).</p>
  139. </section2>
  140. <section2 topic='Archived Messages' anchor='when-archive'>
  141. <p>An entity MUST NOT send an ack message when a user views messages that have been archived or stored on the client or the server (e.g., via &xep0136;), only when first receiving the message.</p>
  142. </section2>
  143. </section1>
  144. <section1 topic='Determining Support' anchor='disco'>
  145. <p>If an entity supports the Message Delivery Receipts protocol, it MUST report that by including a &xep0030; feature of "urn:xmpp:receipts" in response to disco#info requests:</p>
  146. <example caption="Initial Service Discovery information request"><![CDATA[
  147. <iq from='northumberland@shakespeare.lit/westminster'
  148. id='disco1'
  149. to='kingrichard@royalty.england.lit/throne'
  150. type='get'>
  151. <query xmlns=''/>
  152. </iq>
  153. ]]></example>
  154. <example caption="Service Discovery information response"><![CDATA[
  155. <iq from='kingrichard@royalty.england.lit/throne'
  156. id='disco1'
  157. to='northumberland@shakespeare.lit/westminster'
  158. type='result'>
  159. <query xmlns=''>
  160. <feature var='urn:xmpp:receipts'/>
  161. </query>
  162. </iq>
  163. ]]></example>
  164. <p>Support can also be determined via &xep0115;, a.k.a. "caps".</p>
  165. </section1>
  166. <section1 topic='Protocol Format' anchor='format'>
  167. <p>In order to make it possible for senders to request and for recipients to generate message delivery receipts, we define a dedicated protocol extension qualified by the 'urn:xmpp:receipts' namespace.</p>
  168. <p>There are two allowable elements in this namespace:</p>
  169. <ul>
  170. <li>&lt;request/&gt; -- included in a content message by a sending entity that wishes to know if the content message has been received, i.e., delivered to a client controlled by the intended recipient.</li>
  171. <li>&lt;received/&gt; -- included in an ack message by a receiving entity that wishes to inform the sending entity that the content message has been received, i.e., delivered to a client controlled by the intended recipient.</li>
  172. </ul>
  173. <p>Specifically, the receiving entity shall return an ack message containing the &lt;received/&gt; extension if the content message has been delivered to a client controlled by the intended recipient. In general, a client will return a receipt only if the client has processed the content message (e.g., if the client has presented the content message to a human user or has completed any automated processing of the content message, such as generation of an error response if the application determines that the content message cannot be handled). However, the Message Delivery Receipts protocol does not provide notification that a human user has read or understood the content message, that an automated system has completed processed or acted upon the message, etc.</p>
  174. <p>The following is an example of a content message that includes a request for return receipt.</p>
  175. <example caption='A content message with receipt requested'><![CDATA[
  176. <message
  177. from='northumberland@shakespeare.lit/westminster'
  178. id='richard2-4.1.247'
  179. to='kingrichard@royalty.england.lit/throne'>
  180. <body>My lord, dispatch; read o'er these articles.</body>
  181. <request xmlns='urn:xmpp:receipts'/>
  182. </message>
  183. ]]></example>
  184. <p class='box'>Note: A sender MUST include an 'id' attribute on every content message that requests a receipt, so that the sender can properly track ack messages.</p>
  185. <p>The recipient shall generate an ack message if and only if:</p>
  186. <ol>
  187. <li>it supports the Message Delivery Receipts protocol; and</li>
  188. <li>it is configured to return receipts, either globally or for this recipient.</li>
  189. </ol>
  190. <p>Otherwise it MUST NOT return a receipt and SHOULD NOT return an error.</p>
  191. <example caption='A message delivery receipt'><![CDATA[
  192. <message
  193. from='kingrichard@royalty.england.lit/throne'
  194. id='bi29sg183b4v'
  195. to='northumberland@shakespeare.lit/westminster'>
  196. <received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/>
  197. </message>
  198. ]]></example>
  199. <p>When the recipient sends an ack message, it SHOULD ensure that the message stanza contains only one child element, namely the &lt;received/&gt; element qualified by the 'urn:xmpp:receipts' namespace. In addition, it SHOULD include an 'id' attribute that echoes the 'id' attribute of the content message. Naturally, intermediate entities might add other extension elements to the message when routing or delivering the receipt message, e.g., a &lt;delay/&gt; element as specified in &xep0203;.</p>
  200. </section1>
  201. <section1 topic='Security Considerations' anchor='security'>
  202. <p>It is possible for a recipient to leak its presence when returning message delivery receipts; therefore, a recipient SHOULD NOT return message delivery receipts to senders who are not otherwise authorized to view its presence.</p>
  203. </section1>
  204. <section1 topic='IANA Considerations' anchor='iana'>
  205. <p>No interaction with &IANA; is necessary as a result of this document.</p>
  206. </section1>
  207. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  208. <section2 topic='Protocol Namespaces' anchor='ns'>
  209. <p>The &REGISTRAR; includes "urn:xmpp:receipts" in its registry of protocol namespaces (see &NAMESPACES;).</p>
  210. </section2>
  211. </section1>
  212. <section1 topic='XML Schema' anchor='schema'>
  213. <code><![CDATA[
  214. <?xml version='1.0' encoding='UTF-8'?>
  215. <xs:schema
  216. xmlns:xs=''
  217. targetNamespace='urn:xmpp:receipts'
  218. xmlns='urn:xmpp:receipts'
  219. elementFormDefault='qualified'>
  220. <xs:annotation>
  221. <xs:documentation>
  222. The protocol documented by this schema is defined in
  223. XEP-0184:
  224. </xs:documentation>
  225. </xs:annotation>
  226. <xs:element name='received'>
  227. <xs:complexType>
  228. <xs:simpleContent>
  229. <xs:extension base='empty'>
  230. <xs:attribute name='id' type='xs:string' use='optional'/>
  231. </xs:extension>
  232. </xs:simpleContent>
  233. </xs:complexType>
  234. </xs:element>
  235. <xs:element name='request' type='empty'/>
  236. <xs:simpleType name='empty'>
  237. <xs:restriction base='xs:string'>
  238. <xs:enumeration value=''/>
  239. </xs:restriction>
  240. </xs:simpleType>
  241. </xs:schema>
  242. ]]></code>
  243. </section1>
  244. <section1 topic='Acknowledgements' anchor='ack'>
  245. <p>Thanks to Steven te Brinke, Bruce Campbell, Joe Kemp, Kevin Smith, Remko Tronçon, Matthew Wild, and Kurt Zeilenga for their input.</p>
  246. </section1>
  247. </xep>