xep-0160

Embed Size (px)

Citation preview

  • 8/13/2019 xep-0160

    1/6

    XEP-0160: Best Practices for Handling Offline Messages

    This document specifies best practices to be followed by Jabber/XMPP servers in handlingmessages sent to recipients who are offline.

    NOTICE: This Informational specification defines a best practice or protocol profile that has beenapproved by the XMPP Council and/or the XSF Board of Directors. Implementations areencouraged and the best practice or protocol profile is appropriate for deployment in productionsystems.

    Document InformationSeries:XEP

    Number: 0160

    Publisher:XMPP Standards Foundation

    Status:Active

    Type:Informational

    Version: 1.0

    Last Updated: 2006-01-24

    Approving Body:XMPP Council

    Dependencies: XMPP Core, XMPP IM, XEP-0030

    Supersedes: None

    Superseded By: None

    Short Name: msgoffline

    Author Information

    Peter Saint-Andre

    JabberID:[email protected]

    URI:https://stpeter.im/

    Legal Notices

    Copyright

    This XMPP Extension Protocol is copyright (c) 1999 - 2009 by theXMPP Standards Foundation(XSF).

    Permissions

    Permission is hereby granted, free of charge, to any person obtaining a copy of this specification(the "Specification"), to make use of the Specification without restriction, including without limitation

    the rights to implement the Specification in a software program, deploy the Specification in anetwork service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copiesof the Specification, and to permit persons to whom the Specification is furnished to do so, subject

    http://www.xmpp.org/extensions/http://www.xmpp.org/xsf/http://www.xmpp.org/extensions/xep-0001.html#states-Activehttp://www.xmpp.org/extensions/xep-0001.html#typeshttp://www.xmpp.org/council/http://xmpp:[email protected]/https://stpeter.im/http://xmpp.org/http://xmpp.org/https://stpeter.im/http://xmpp:[email protected]/http://www.xmpp.org/council/http://www.xmpp.org/extensions/xep-0001.html#typeshttp://www.xmpp.org/extensions/xep-0001.html#states-Activehttp://www.xmpp.org/xsf/http://www.xmpp.org/extensions/
  • 8/13/2019 xep-0160

    2/6

    to the condition that the foregoing copyright notice and this permission notice shall be included inall copies or substantial portions of the Specification. Unless separate permission is granted,modified works that are redistributed shall not contain misleading information regarding theauthors, title, number, or publisher of the Specification, and shall not claim endorsement of themodified works by the authors, any organization or project to which the authors belong, or theXMPP Standards Foundation.

    Disclaimer of Warranty## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUTWARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, withoutlimitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall theXMPP Standards Foundation or the authors of this Specification be liable for any claim,damages, or other liability, whether in an action of contract, tort, or otherwise, arising from,out of, or in connection with the Specification or the implementation, deployment, or otheruse of the Specification. ##

    Limitation of Liability

    In no event and under no legal theory, whether in tort (including negligence), contract, orotherwise, unless required by applicable law (such as deliberate and grossly negligent acts) oragreed to in writing, shall the XMPP Standards Foundation or any author of this Specification beliable for damages, including any direct, indirect, special, incidental, or consequential damages ofany character arising out of the use or inability to use the Specification (including but not limited todamages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if the XMPP Standards Foundation or such author has beenadvised of the possibility of such damages.

    IPR Conformance

    This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual

    Property Rights Policy (a copy of which may be found at or obtained by writing to XSF, P.O. Box 1641,Denver, CO 80201 USA).

    Discussion VenueThe preferred venue for discussion of this document is the Standards discussion list:.

    Errata may be sent to .

    Relation to XMPPThe Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation tothe Internet Standards Process, which is managed by the Internet Engineering Task Force inaccordance with RFC 2026. Any protocol defined in this document has been developed outside theInternet Standards Process and is to be understood as an extension to XMPP rather than as anevolution, development, or modification of XMPP itself.

    Conformance Terms

    The following keywords as used in this document are to be interpreted as described in RFC 2119:"MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED";"SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

    http://xmpp.org/extensions/ipr-policy.shtmlhttp://mail.jabber.org/mailman/listinfo/standardsmailto:[email protected]://www.ietf.org/rfc/rfc2119.txthttp://www.ietf.org/rfc/rfc2119.txtmailto:[email protected]://mail.jabber.org/mailman/listinfo/standardshttp://xmpp.org/extensions/ipr-policy.shtml
  • 8/13/2019 xep-0160

    3/6

    Table of Contents1.Introduction2.Process Flow

    3.Handling of Message Types4.Service Discovery5.Security Considerations6.IANA Considerations7.XMPP Registrar Considerations

    Notes

    Revision History

    1. Introduction

    RFC 3920[1] andRFC 3921[2] specify general rules for handling XML stanzas, but explicitly donot address how to handle message stanzas sent to recipients (e.g., IM users or other nodes) thatare offline, except to say that a server MUST return a error if offlinemessage storage or message forwarding is not enabled (see Section 11.1 of RFC 3921). Thisdocument fills the gap by specifying best practices for storage and delivery of so-called "offlinemessages".

    2. Process FlowThe RECOMMENDED process flow is as follows:

    1. Sender generates XMPP message stanza [3] for delivery to a recipient such as an IM user

    or other node, where the 'to' address is of the form or (see RFC 3921 for rules regarding server handling of suchXMPP message stanzas).

    2. Recipient's server determines that the intended recipient has no available resources thathave specified non-negative presence priority. [4]

    3. Recipient's server determines that if the server can store offline messages on behalf of theintended recipient; if not (e.g., because the recipient's offline message queue is full), theserver returns a error to the sender.

    4. Recipient's server does not return a error but instead stores themessage stanza for later delivery.

    5. When the recipient next sends non-negative available presence to the server, the serverdelivers the message to the resource that has sent that presence. (Alternatively, the server

    may supportFlexible Offline Message Retrieval[5], although that functionality is notdescribed herein.)

    This flow is described more fully below.

    First, the sender (in this example, [email protected]) sends a message to an intendedrecipient ([email protected]).

    Example 1. Sender Generates Message to Recipient

    O blessed, blessed night! I am afeard.Being in night, all this is but a dream,Too flattering-sweet to be substantial.

    Next, the recipient's server determines if there are any available resources that have sentnon-negative presence priority. If there are, the server immediately delivers the message stanza to

    http://tools.ietf.org/html/rfc3920http://tools.ietf.org/html/rfc3921http://xmpp.org/extensions/xep-0013.htmlhttp://xmpp.org/extensions/xep-0013.htmlhttp://tools.ietf.org/html/rfc3921http://tools.ietf.org/html/rfc3920
  • 8/13/2019 xep-0160

    4/6

    the resource that it determines to be most available (based on its own algorithm).

    Next, the recipient's server determines if offline messages can be stored on behalf of the intendedrecipient. If not (e.g., because the recipient's offline message queue is full), the server returns a error to the sender. If so, the server stores the message for later delivery.

    Now the recipient authenticates with the server and sends initial presence (with a non-negativepriority) to the server.

    Example 2. Recipient Becomes Available

    1

    The recipient's server now delivers the offline message to that resource (it is RECOMMENDED forthe server to add aDelayed Delivery[6] extension to indicate that the message was stored offline).

    Example 3. Recipient's Server Delivers Message

    O blessed, blessed night! I am afeard.Being in night, all this is but a dream,Too flattering-sweet to be substantial.

    Offline Storage

    3. Handling of Message TypesMessage stanzas SHOULD be handled by a server as follows (based on the values of the 'type'attribute specified in RFC 3921):

    normal-- Messages with a 'type' attribute whose value is "normal" (or messages with no'type' attribute) SHOULD be stored offline.

    chat-- Messages with a 'type' attribute whose value is "chat" SHOULD be stored offline, withthe exception of messages that contain onlyChat State Notifications[7] content (suchmessages SHOULD NOT be stored offline).

    groupchat-- Messages with a 'type' attribute whose value is "groupchat" SHOULD NOT bestored offline, since by definition a user without online presence cannot be in a Multi-UserChat[8] room.

    headline-- Messages with a 'type' attribute whose value is "headline" SHOULD NOT bestored offline, since such messages are usually time-sensitive.

    error-- Messages with a 'type' attribute whose value is "error" SHOULD NOT be storedoffline, although a server MAY storeAdvanced Message Processing[9] error messagesoffline.

    4. Service DiscoveryIf a server supports offline message handling as described herein, it SHOULD return a "msgoffline"feature in response toService Discovery[10] information requests:

    Example 4. Recipient Queries Server About Support

    Example 5. Server Returns Information About Support

    ...

    http://xmpp.org/extensions/xep-0203.htmlhttp://xmpp.org/extensions/xep-0085.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0079.htmlhttp://xmpp.org/extensions/xep-0030.htmlhttp://xmpp.org/extensions/xep-0030.htmlhttp://xmpp.org/extensions/xep-0079.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0085.htmlhttp://xmpp.org/extensions/xep-0203.html
  • 8/13/2019 xep-0160

    5/6

    5. Security ConsiderationsA message stored offline may not be readable by the recipient if the message was encrypted usinga session-based encryption method such asEncrypted Session Negotiation[11] or if the key usedin object encryption is revoked after the message was sent but before it is read.

    In certain countries, offline storage of message stanzas may introduce legal requirements orprivacy vulnerabilities that do not apply to messages that are delivered immediately and neverstored on an intermediate server.

    6. IANA ConsiderationsThis document requires no interaction with theInternet Assigned Numbers Authority (IANA)[12].

    7. XMPP Registrar ConsiderationsTheXMPP Registrar[13] includes "msgoffline" in its registry of service discovery features (see).

    Notes1. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core.

    2. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging andPresence .

    3. This document does not discuss IQ or presence stanzas, handling of which is described in RFC

    3920 and RFC 3921.4. As specified in RFC 3920, available resources that have specified a negative presence priorityshall never receive message stanzas addressed to .

    5. XEP-0013: Flexible Offline Message Retrieval .

    6. XEP-0203: Delayed Delivery .

    7. XEP-0085: Chat State Notifications .

    8. XEP-0045: Multi-User Chat .

    9. XEP-0079: Advanced Message Processing .

    10. XEP-0030: Service Discovery .

    11. XEP-0116: Encrypted Session Negotiation .

    12. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignmentof unique parameter values for Internet protocols, such as port numbers and URI schemes. Forfurther information, see .

    13. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries ofparameters used in the context of XMPP extension protocols approved by the XMPP StandardsFoundation. For further information, see .

    Revision History

    Version 1.0 (2006-01-24)

    Per a vote of the Jabber Council, advanced status to Active. (psa)

    http://xmpp.org/extensions/xep-0116.htmlhttp://www.iana.org/http://xmpp.org/registrar/http://xmpp.org/registrar/disco-features.htmlhttp://tools.ietf.org/html/rfc3920http://tools.ietf.org/html/rfc3921http://xmpp.org/extensions/xep-0013.htmlhttp://xmpp.org/extensions/xep-0203.htmlhttp://xmpp.org/extensions/xep-0085.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0079.htmlhttp://xmpp.org/extensions/xep-0030.htmlhttp://xmpp.org/extensions/xep-0116.htmlhttp://www.iana.org/http://xmpp.org/registrar/http://xmpp.org/registrar/http://www.iana.org/http://xmpp.org/extensions/xep-0116.htmlhttp://xmpp.org/extensions/xep-0030.htmlhttp://xmpp.org/extensions/xep-0079.htmlhttp://xmpp.org/extensions/xep-0045.htmlhttp://xmpp.org/extensions/xep-0085.htmlhttp://xmpp.org/extensions/xep-0203.htmlhttp://xmpp.org/extensions/xep-0013.htmlhttp://tools.ietf.org/html/rfc3921http://tools.ietf.org/html/rfc3920http://xmpp.org/registrar/disco-features.htmlhttp://xmpp.org/registrar/http://www.iana.org/http://xmpp.org/extensions/xep-0116.html
  • 8/13/2019 xep-0160

    6/6

    Version 0.2 (2005-11-15)

    Added section on handling of each message type. (psa)

    Version 0.1 (2005-10-05)

    Initial version. (psa)

    Version 0.0.1 (2005-09-27)

    First draft. (psa)

    END