This document specifies best practices to be followed by Jabber/XMPP servers in handling messages sent to recipients who are offline.
NOTICE: This JEP is currently within Last Call or under consideration by the Jabber Council for advancement to the next stage in the JSF standards process. For further details, visit <http://www.jabber.org/council/queue.shtml>.
Last Updated: 2005-11-15
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, XMPP IM, JEP-0030
Superseded By: None
Short Name: msgoffline
Wiki Page: <http://wiki.jabber.org/index.php/Best Practices for Handling Offline Messages (JEP-0160)>
This Jabber Enhancement Proposal is copyright 1999 - 2005 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this JEP has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
RFC 3920  and RFC 3921  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 <service-unavailable/> error if offline message storage or message forwarding is not enabled (see Section 11.1 of RFC 3921). This document fills the gap by specifying best practices for storage and delivery of so-called "offline messages".
The RECOMMENDED process flow is as follows:
This flow is described more fully below.
First, the sender (in this example, email@example.com) sends a message to an intended recipient (firstname.lastname@example.org).
<message email@example.com/orchard' firstname.lastname@example.org'> <body> O blessed, blessed night! I am afeard. Being in night, all this is but a dream, Too flattering-sweet to be substantial. </body> </message>
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). If there are not, the server stores the message for later delivery.
Now the recipient authenticates with the server and sends initial presence (with a non-negative priority) to the server.
<presence email@example.com/balcony'> <priority>1</priority> </presence>
The recipient's server now delivers the offline message to that resource (it is RECOMMENDED for the server to add a Delayed Delivery  extension to indicate that the message was stored offline).
<message firstname.lastname@example.org/orchard' email@example.com'> <body> O blessed, blessed night! I am afeard. Being in night, all this is but a dream, Too flattering-sweet to be substantial. </body> <x from='capulet.com' stamp='20020910T23:08:25' xmlns='jabber:x:delay'> Offline Storage </x> </message>
Message 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, with the exception of messages that contain only Chat State Notifications  content (such messages SHOULD NOT be stored offline).
groupchat -- 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 Multi-User Chat  room.
headline -- Messages with a 'type' attribute whose value is "headline" SHOULD NOT be stored offline, since such messages are usually time-sensitive.
error -- Messages with a 'type' attribute whose value is "error" SHOULD NOT be stored offline, although a server MAY store Advanced Message Processing  error messages offline.
If a server supports offline message handling as described herein, it SHOULD return a "msgoffline" feature in response to Service Discovery  information requests:
<iq firstname.lastname@example.org/chamber' to='capulet.com'> <query xmlns='http://jabber.org/disco#info'/> </iq>
<iq from='capulet.com' email@example.com/chamber'> <query xmlns='http://jabber.org/disco#info'> ... <feature var='msgoffline'/> </query> </iq>
A message stored offline may not be readable by the recipient if the message was encrypted using a session-based encryption method such as Encrypted Sessions  or if the key used in 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 or privacy vulnerabilities that do not apply to messages that are delivered immediately and never stored on an intermediate server.
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) .
This JEP requires no interaction with the Jabber Registrar , since the "msgoffline" service discovery feature is already registered.
3. This JEP 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 priority shall never receive message stanzas addressed to <node@domain>.
12. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
13. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.