XEP-0203: Delayed Delivery

Abstract:This specification defines an XMPP protocol extension for communicating the fact that an XML stanza has been delivered with a delay, for example because a message has been stored on a server while the intended recipient was offline or because a message is contained in the history of a multi-user chat room.
Author:Peter Saint-Andre
Copyright:© 1999 - 2014 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Final
Type:Standards Track
Version:2.0
Last Updated:2009-09-15

NOTICE: The protocol defined herein is a Final Standard of the XMPP Standards Foundation and can be considered a stable technology for implementation and deployment.


Table of Contents


1. Introduction
2. Protocol Definition
3. Examples
4. Implementation Notes
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
    7.1. Protocol Namespace
8. XML Schema
9. Acknowledgements

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

Although the XMPP protocol extension defined in Legacy Delayed Delivery (XEP-0091) [1] provides a way to communicate that an XML stanza (typically a <message/> or <presence/> stanza) has been delivered with a delay, the timestamp format defined in that document does not adhere to the recommended date and time profiles for XMPP protocols defined in XMPP Date and Time Profiles (XEP-0082) [2]. Therefore, this document defines a replacement for XEP-0091 which enables communication of delayed delivery information while adhering to XEP-0082.

2. Protocol Definition

The XML namespace defined herein is used to provide timestamp information about data stored for later delivery. The most common uses of this namespace are to stamp:

Information about the delivery delay is communicated by adding to the <message/> or <presence/> stanza one and only one <delay/> child qualified by a namespace to be issued when this specification advances to a status of Draft. This information is added by the server or component that delivers the stanza. The following attributes are defined for the <delay/> element:

Table 1: Defined Attributes

Attribute Definition Inclusion
from The Jabber ID of the entity that originally sent the XML stanza or that delayed the delivery of the stanza (e.g., the address of a multi-user chat room). RECOMMENDED
stamp The time when the XML stanza was originally sent. The format MUST adhere to the dateTime format specified in XEP-0082 and MUST be expressed in UTC. REQUIRED

In addition, the <delay/> element MAY contain XML character data that provides a natural-language description of the reason for the delay.

3. Examples

Example 1. Receiving a Message Sent While Offline

<message
    from='romeo@montague.net/orchard'
    to='juliet@capulet.com'
    type='chat'>
  <body>
    O blessed, blessed night! I am afeard.
    Being in night, all this is but a dream,
    Too flattering-sweet to be substantial.
  </body>
  <delay xmlns='urn:xmpp:delay'
     from='capulet.com'
     stamp='2002-09-10T23:08:25Z'>
    Offline Storage
  </delay>
</message>
  

Example 2. Receiving the Last Presence Update of Another Entity

<presence from='juliet@capulet.com/balcony' to='romeo@montague.net'>
  <status>anon!</status>
  <show>xa</show>
  <priority>1</priority>
  <delay xmlns='urn:xmpp:delay'
     from='juliet@capulet.com/balcony'
     stamp='2002-09-10T23:41:07Z'/>
</presence>
  

Example 3. Receiving Cached Messages from a Conference Room

<message
    from='coven@macbeth.shakespeare.lit/secondwitch'
    to='macbeth@shakespeare.lit/laptop'
    type='groupchat'>
  <body>
    By the pricking of my thumbs,
    Something wicked this way comes.
    Open, locks,
    Whoever knocks!
  </body>
  <delay xmlns='urn:xmpp:delay'
     from='coven@macbeth.shakespeare.lit'
     stamp='2002-09-10T23:05:37Z'/>
</message>
  

4. Implementation Notes

This protocol was designed in a way that makes migration from XEP-0091 straightforward. All attributes present in the 'jabber:x:delay' namespace are present in the namespace defined herein. However, this document specifies a different format for the value of the <stamp> attribute (compliant with XEP-0082).

Implementations that support XEP-0091 should support the protocol defined herein as soon as possible, but should continue to support the protocol defined in XEP-0091 for backwards compatibility until the status of that specification is changed to Obsolete.

5. Security Considerations

Delayed delivery data can expose information about the sender's presence on the network at some time in the past. However, this introduces no new vulnerabilities, since the same information would have been available in real time.

Absent cryptographic signing of stanzas and parts of stanzas, it is possible for delayed delivery notations to be forged. For example, the originator of a message (or the originator's server) could include a notation that makes it appear as if delivery of the message was delayed by the recipient's server. The same is true of delayed delivery notations putatively added by a Multi-User Chat room, which could be forged by the message originator, the originator's server, the recipient's server, or the server that hosts the chatroom service. Although the recipient's server SHOULD discard a delayed delivery notation whose 'from' attribute matches the server's JabberID (or return a <not-acceptable/> error to the originator), this policy does not guard against forging of notations putatively from other entities (such as a chatroom hosted at a different trust domain). Therefore, a recipient SHOULD NOT rely on delayed delivery notations to provide a completely accurate representation of the delivery path or timing of a stanza it has received.

6. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].

7. XMPP Registrar Considerations

7.1 Protocol Namespace

The XMPP Registrar [6] includes 'urn:xmpp:delay' in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).

8. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:delay'
    xmlns='urn:xmpp:delay'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0203: http://www.xmpp.org/extensions/xep-0203.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='delay'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:string'>
          <xs:attribute name='from' type='xs:string' use='optional'/>
          <xs:attribute name='stamp' type='xs:dateTime' use='required'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

</xs:schema>
  

9. Acknowledgements

Thanks to Sergei Golovan for his feedback regarding forged timestamps.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0203
Publisher: XMPP Standards Foundation
Status: Final
Type: Standards Track
Version: 2.0
Last Updated: 2009-09-15
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0082
Supersedes: XEP-0091
Superseded By: None
Short Name: delay
Schema: <http://www.xmpp.org/schemas/delay.xsd>
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2014 by the XMPP 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 a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised 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 can be found at <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards 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 document 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.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements 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".


Appendix G: Notes

1. XEP-0091: Legacy Delayed Delivery <http://xmpp.org/extensions/xep-0091.html>.

2. XEP-0082: XMPP Date and Time Profiles <http://xmpp.org/extensions/xep-0082.html>.

3. XEP-0160: Best Practices for Handling Offline Messages <http://xmpp.org/extensions/xep-0160.html>.

4. XEP-0045: Multi-User Chat <http://xmpp.org/extensions/xep-0045.html>.

5. 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/>.

6. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 2.0 (2009-09-15)

Per a vote of the XMPP Council, advanced specification from Draft to Final; also addressed a security concern about forged timestamps that was provided during the Call for Experience.

(psa)

Version 1.0 (2007-03-29)

Per a vote of the XMPP Council, advanced from Experimental to Draft.

(psa)

Version 0.3 (2007-03-28)

Per a vote of the XMPP Council, advanced to Draft; also removed service discovery per Council discussion.

(psa)

Version 0.2 (2007-03-19)

Added service discovery section.

(psa)

Version 0.1 (2006-12-20)

Initial version.

(psa)

Version 0.0.1 (2006-12-19)

First draft. (psa)

END