No Description
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.

xep-0160.xml 8.5KB

  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>Best Practices for Handling Offline Messages</title>
  10. <abstract>This document specifies best practices to be followed by Jabber/XMPP servers in handling messages sent to recipients who are offline.</abstract>
  12. <number>0160</number>
  13. <status>Active</status>
  14. <type>Informational</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XMPP IM</spec>
  20. <spec>XEP-0030</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>msgoffline</shortname>
  25. &stpeter;
  26. <revision>
  27. <version>1.0.1</version>
  28. <date>2016-10-07</date>
  29. <initials>egp</initials>
  30. <remark><p>Use the correct namespace in the Service Discovery examples; fix some formatting.</p></remark>
  31. </revision>
  32. <revision>
  33. <version>1.0</version>
  34. <date>2006-01-24</date>
  35. <initials>psa</initials>
  36. <remark>Per a vote of the Jabber Council, advanced status to Active.</remark>
  37. </revision>
  38. <revision>
  39. <version>0.2</version>
  40. <date>2005-11-15</date>
  41. <initials>psa</initials>
  42. <remark>Added section on handling of each message type.</remark>
  43. </revision>
  44. <revision>
  45. <version>0.1</version>
  46. <date>2005-10-05</date>
  47. <initials>psa</initials>
  48. <remark>Initial version.</remark>
  49. </revision>
  50. <revision>
  51. <version>0.0.1</version>
  52. <date>2005-09-27</date>
  53. <initials>psa</initials>
  54. <remark>First draft.</remark>
  55. </revision>
  56. </header>
  57. <section1 topic='Introduction' anchor='intro'>
  58. <p>&xmppcore; and &xmppim; specify general rules for handling XML stanzas, but explicitly do not address how to handle message stanzas sent to recipients (e.g., IM users or other nodes) that are offline, except to say that a server MUST return a &unavailable; error if offline message storage or message forwarding is not enabled (see <cite>RFC 6121</cite>). This document fills the gap by specifying best practices for storage and delivery of so-called "offline messages".</p>
  59. </section1>
  60. <section1 topic='Process Flow' anchor='flow'>
  61. <p>The RECOMMENDED process flow is as follows:</p>
  62. <ol>
  63. <li>Sender generates XMPP message stanza <note>This document does not discuss IQ or presence stanzas, handling of which is described in <cite>RFC 6120</cite> and <cite>RFC 6121</cite>.</note> for delivery to a recipient such as an IM user or other node, where the 'to' address is of the form &lt;node@domain&gt; or &lt;node@domain/resource&gt; (see <cite>RFC 6121</cite> for rules regarding server handling of such XMPP message stanzas).</li>
  64. <li>Recipient's server determines that the intended recipient has no available resources that have specified non-negative presence priority. <note>As specified in <cite>RFC 6121</cite>, available resources that have specified a negative presence priority shall never receive message stanzas addressed to &lt;node@domain&gt;.</note></li>
  65. <li>Recipient's server determines that if the server can store offline messages on behalf of the intended recipient; if not (e.g., because the recipient's offline message queue is full), the server returns a &unavailable; error to the sender.</li>
  66. <li>Recipient's server does not return a &unavailable; error but instead stores the message stanza for later delivery.</li>
  67. <li>When the recipient next sends non-negative available presence to the server, the server delivers the message to the resource that has sent that presence. (Alternatively, the server may support &xep0013;, although that functionality is not described herein.)</li>
  68. </ol>
  69. <p>This flow is described more fully below.</p>
  70. <p>First, the sender (in this example, sends a message to an intended recipient (</p>
  71. <example caption='Sender Generates Message to Recipient'><![CDATA[
  72. <message from='' to=''>
  73. <body>
  74. O blessed, blessed night! I am afeard.
  75. Being in night, all this is but a dream,
  76. Too flattering-sweet to be substantial.
  77. </body>
  78. </message>
  79. ]]></example>
  80. <p>Next, the recipient's server determines if there are any available resources that have sent non-negative presence priority. If there are, the server immediately delivers the message stanza to the resource that it determines to be most available (based on its own algorithm).</p>
  81. <p>Next, the recipient's server determines if offline messages can be stored on behalf of the intended recipient. If not (e.g., because the recipient's offline message queue is full), the server returns a &unavailable; error to the sender. If so, the server stores the message for later delivery.</p>
  82. <p>Now the recipient authenticates with the server and sends initial presence (with a non-negative priority) to the server.</p>
  83. <example caption='Recipient Becomes Available'><![CDATA[
  84. <presence from=''>
  85. <priority>1</priority>
  86. </presence>
  87. ]]></example>
  88. <p>The recipient's server now delivers the offline message to that resource (it is RECOMMENDED for the server to add a &xep0203; extension to indicate that the message was stored offline).</p>
  89. <example caption='Recipient&apos;s Server Delivers Message'><![CDATA[
  90. <message from='' to=''>
  91. <body>
  92. O blessed, blessed night! I am afeard.
  93. Being in night, all this is but a dream,
  94. Too flattering-sweet to be substantial.
  95. </body>
  96. <delay xmlns='urn:xmpp:delay'
  97. from=''
  98. stamp='2002-09-10T23:08:25Z'>Offline Storage</delay>
  99. </message>
  100. ]]></example>
  101. </section1>
  102. <section1 topic='Handling of Message Types' anchor='types'>
  103. <p>Message stanzas SHOULD be handled by a server as follows (based on the values of the 'type' attribute specified in <cite>RFC 6121</cite>):</p>
  104. <ul>
  105. <li><p><strong>normal</strong> -- Messages with a 'type' attribute whose value is "normal" (or messages with no 'type' attribute) SHOULD be stored offline.</p></li>
  106. <li><p><strong>chat</strong> -- Messages with a 'type' attribute whose value is "chat" SHOULD be stored offline, with the exception of messages that contain only &xep0085; content (such messages SHOULD NOT be stored offline).</p></li>
  107. <li><p><strong>groupchat</strong> -- Messages with a 'type' attribute whose value is "groupchat" SHOULD NOT be stored offline, since by definition a user without online presence cannot be in a &xep0045; room.</p></li>
  108. <li><p><strong>headline</strong> -- Messages with a 'type' attribute whose value is "headline" SHOULD NOT be stored offline, since such messages are usually time-sensitive.</p></li>
  109. <li><p><strong>error</strong> -- Messages with a 'type' attribute whose value is "error" SHOULD NOT be stored offline, although a server MAY store &xep0079; error messages offline.</p></li>
  110. </ul>
  111. </section1>
  112. <section1 topic='Service Discovery' anchor='disco'>
  113. <p>If a server supports offline message handling as described herein, it SHOULD return a "msgoffline" feature in response to &xep0030; information requests:</p>
  114. <example caption='Recipient Queries Server About Support'><![CDATA[
  115. <iq from='' to=''>
  116. <query xmlns=''/>
  117. </iq>
  118. ]]></example>
  119. <example caption='Server Returns Information About Support'><![CDATA[
  120. <iq from='' to=''>
  121. <query xmlns=''>
  122. ...
  123. <feature var='msgoffline'/>
  124. ...
  125. </query>
  126. </iq>
  127. ]]></example>
  128. </section1>
  129. <section1 topic='Security Considerations' anchor='security'>
  130. <p>A message stored offline may not be readable by the recipient if the message was encrypted using a session-based encryption method such as &xep0116; or if the key used in object encryption is revoked after the message was sent but before it is read.</p>
  131. <p>In certain countries, offline storage of message stanzas may introduce legal requirements or privacy vulnerabilities that do not apply to messages that are delivered immediately and never stored on an intermediate server.</p>
  132. <p>See <cite>XEP-0203</cite> for security considerations regarding the inclusion and processing of delayed delivery notations.</p>
  133. </section1>
  134. <section1 topic='IANA Considerations' anchor='iana'>
  135. <p>This document requires no interaction with &IANA;.</p>
  136. </section1>
  137. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  138. <p>The &REGISTRAR; includes "msgoffline" in its registry of service discovery features (see &DISCOFEATURES;).</p>
  139. </section1>
  140. </xep>