XEP-0184: Message Receipts

Abstract:This specification defines an XMPP protocol extension for message receipts, whereby the sender of a message can request notification that it has been received by the intended recipient.
Authors:Peter Saint-Andre, Joe Hildebrand
Copyright:© 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Draft
Type:Standards Track
Version:1.1rc8
Last Updated:in progress, last updated 2010-03-30

NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.


Table of Contents


1. Introduction
2. Requirements
3. What This Protocol Provides
4. When to Request Receipts
    4.1. Bare JID
    4.2. Full JID
    4.3. Groupchat
5. Determining Support
6. Protocol Format
7. Security Considerations
8. IANA Considerations
9. XMPP Registrar Considerations
    9.1. Protocol Namespaces
10. XML Schema
11. 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

While Advanced Message Processing [1] provides message acknowledgements at the server level, it does not extend that model all the way to the client. [2] However, sometimes client-level acknowledgements are needed, for example to provide "receipts". This document defines a mechanism for XMPP message receipts, which are functionally equivalent to the "delivered" or "displayed" event in Message Events [3], which this specification in part obsoletes. [4]

Note: This extension is functionally equivalent to an Advanced Message Processing rule of "receipt" but uses a dedicated namespace to simplify processing by end user clients and intermediate routers.

2. Requirements

This document addresses the following requirements:

  1. Enable a sender to request notification that an XMPP message stanza has been received.
  2. Enable a recipient to provide message receipts if desired.

3. What This Protocol Provides

This document defines a protocol that enables a sender to ask the recipient to return a receipt for a message. Although the return of a message receipt lets the sender know that the message has been delivered, there are many reasons why the sender might not receive a receipt immediately or at all, including but not limited to the following:

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 lack of a receipt 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 a message) without such methods. [5]

4. When to Request Receipts

A sender could request receipts on any non-error message (chat, groupchat, headline, or normal) no matter if the recipient's address is a bare JID <localpart@domain.tld> or a full JID <localpart@domain.tld/resource>. Whether it is appropriate or advisable 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.

4.1 Bare JID

If the sender knows only the recipient's bare JID, it cannot cannot determine (via disco or caps) whether the intended recipient supports message receipts. In this case, the sender MAY request a receipt when sending a message of type "chat", "headline", or "normal" to the recipient's bare JID. However, the sender MUST NOT depend on receiving a receipt.

4.2 Full JID

If the sender knows a full JID for the recipient (e.g., via presence), it SHOULD attempt to determine (via disco or caps) whether the client at that full JID supports message receipts before attempting to request receipts.

If the sender determines that the recipient's client does not support message receipts then it SHOULD NOT request a receipt when sending a message to that full JID and MUST NOT depend on receiving a receipt.

If the sender determines that the recipient's client supports message receipts then it MAY request a receipt when sending a message of type "chat", "headline", or "normal" to that full JID. However, even in this case the sender SHOULD NOT depend on receiving a receipt.

4.3 Groupchat

It is NOT RECOMMENDED to request a receipt when sending a message of type "groupchat" in a Multi-User Chat [6] room because the logic for determining when a message is truly "received" by all of the room occupants is complex and because the sender would receive one receipt from each occupant of the room, thus significantly increasing the number of messages sent through the room.

5. Determining Support

If an entity supports message receipts, it MUST report that by including a Service Discovery [7] feature of "urn:xmpp:receipts" in response to disco#info requests:

Example 1. Initial Service Discovery information request

<iq from='northumberland@shakespeare.lit/westminster'
    id='disco1'
    to='kingrichard@royalty.england.lit/throne'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

Example 2. Service Discovery information response

<iq from='kingrichard@royalty.england.lit/throne'
    id='disco1'
    to='northumberland@shakespeare.lit/westminster'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:receipts'/>
  </query>
</iq>
  

Support can also be determined via Entity Capabilities [8] a.k.a. "caps".

6. Protocol Format

In order to make it possible for senders to request and for recipients to generate message receipts, we define a dedicated protocol extension qualified by the 'urn:xmpp:receipts' namespace.

There are two allowable elements in this namespace:

Specifically, the receiving entity shall return a <received/> notice if it has received and processed the message. The term "processed" is understood to include presentation to a human user if appropriate or any other application-specific client-side processing, including generation of an error response if the application determines that the message contents cannot be handled.

The following is an example of a message that includes a request for return receipt.

Example 3. A message with receipt requested

<message
    from='northumberland@shakespeare.lit/westminster'
    id='richard2-4.1.247'
    to='kingrichard@royalty.england.lit/throne'>
  <body>My lord, dispatch; read o'er these articles.</body>
  <request xmlns='urn:xmpp:receipts'/>
</message>
  

Note: A sender MUST include an 'id' attribute on every message that requests a receipt, so that the sender can properly track the receipt.

The recipient shall generate a receipt if and only if it supports the protocol defined herein and it is configured to return receipts, either globally or for this recipient (otherwise it MUST NOT return a receipt and SHOULD NOT return an error).

Example 4. A message receipt

<message
    from='kingrichard@royalty.england.lit/throne'
    id='bi29sg183b4v'
    to='northumberland@shakespeare.lit/westminster'>
  <received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/>
</message>
  

The <received/> element SHOULD be the only child of the <message/> stanza and SHOULD include an 'id' attribute that echoes the 'id' attribute of the sent message.

7. Security Considerations

It is possible for a recipient to leak its presence when returning message receipts; therefore, a recipient SHOULD NOT return message receipts to senders who are not otherwise authorized to view its presence.

8. IANA Considerations

No interaction with the Internet Assigned Numbers Authority (IANA) [9] is necessary as a result of this document.

9. XMPP Registrar Considerations

9.1 Protocol Namespaces

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

10. XML Schema

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

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

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

  <xs:element name='received'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:empty'>
          <xs:attribute name='id' type='xs:string' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name='request' type='empty'/>

  <xs:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
  

11. Acknowledgements

Thanks to Joe Kemp, Kevin Smith, Remko Tronçon, and Matthew Wild for their input.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0184
Publisher: XMPP Standards Foundation
Status: Draft
Type: Standards Track
Version: 1.1rc8
Last Updated: in progress, last updated 2010-03-30
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: XEP-0022 (in part)
Superseded By: None
Short Name: receipts
Schema: <http://www.xmpp.org/schemas/receipts.xsd>
Source Control: HTML  RSS


Appendix B: Author Information

Peter Saint-Andre

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

Joe Hildebrand

Email: jhildebr@cisco.com
JabberID: hildjj@jabber.org


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2010 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/extensions/ipr-policy.shtml> 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 3920) and XMPP IM (RFC 3921) 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-0079: Advanced Message Processing <http://xmpp.org/extensions/xep-0079.html>.

2. Naturally, message receipts can be combined with the rules specified in Advanced Message Processing for more complete reporting.

3. XEP-0022: Message Events <http://xmpp.org/extensions/xep-0022.html>.

4. This specification does not distinguish between delivery and presentation, as was done in the message events protocol, in part because no existing clients make the distinction.

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

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

7. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

8. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

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

10. 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 1.1rc8 (in progress, last updated 2010-03-30)

(psa)

Version 1.0 (2007-09-26)

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

(psa)

Version 0.4 (2007-05-30)

Per Council feedback, modified to use dedicated namespace (not AMP).

(psa)

Version 0.3 (2006-11-06)

Removed reliability features, which belong at a different level.

(psa)

Version 0.2 (2006-09-21)

Added two more scenarios; defined business rule about not sending to bare JIDs; specified security consideration regarding presence leaks.

(psa)

Version 0.1 (2006-04-11)

Initial version.

(psa)

Version 0.0.2 (2006-04-07)

Added text and examples for service discovery; added text and examples for chat session negotiation; added recommendations regarding message processing, retries, etc.

(psa)

Version 0.0.1 (2006-03-27)

First draft.

(psa)

END