XEP-0184: Message Delivery Receipts

Abstract
This specification defines an XMPP protocol extension for message delivery receipts, whereby the sender of a message can request notification that the message has been delivered to a client controlled by the intended recipient.
Authors
  • Peter Saint-Andre
  • Joe Hildebrand
Copyright
© 1999 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Draft

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.
Type
Standards Track
Version
1.4.0 (2018-08-02)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Draft
  4. Final

1. Introduction

While Advanced Message Processing (XEP-0079) [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 delivery receipts, which are functionally equivalent to the "delivered" or "displayed" event in Message Events (XEP-0022) [3], which this specification in part obsoletes.

Note well that this specification does not distinguish between delivery and display, as was done in the message events protocol, in part because no implementations of XEP-0022 made that distinction. However, in the absence of such a distinction, readers need to understand that this protocol can provide only a notification that a message has been received at a client, i.e. delivered to a client, not that the message has been actively read or understood by a human user (if any). Therefore this extension is functionally equivalent to an Advanced Message Processing rule of "receipt", although it uses a dedicated namespace to simplify processing by 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 (i.e., delivered to a client, but not necessarily read or understood by a human user, if any).
  2. Enable a recipient to provide message delivery receipts if desired.

3. Terminology

The term "content message" refers to the stanza for which the original sender would like to receive a receipt.

The term "ack message" refers to the stanza by which the recipient acknowledges receipt of the content message at a client (i.e., delivery to a client).

4. What This Protocol Provides

This document defines a protocol that enables a sender to ask the recipient to acknowledge receipt of a content message by returning an ack message. Although the return of an ack message lets the sender know that the content message has been delivered to a client controlled by the intended recipient, there are many reasons why the sender might not receive an ack message 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 fact that it has not received an ack message, 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 the content message) without such methods. [4]

Because it is possible for a given content message to be delivered to multiple XMPP resources controlled by the recipient, the sender of the content message needs to be prepared to receive multiple ack messages.

Finally, this protocol does not enable the sender to know that the intended recipient has read the message or understood the message (if the intended recipient is a human being), that the intended recipient has processed the message (if the intended recipient is a bot or other automated system), that an end user client has presented the message to a human user (if any), etc. This protocol provides delivery receipts only, not notifications about presentation, processing, reading, understanding, or any other action related to a message other than delivery to a client of some kind.

5. When to Request Receipts

A sender could request receipts on any non-error content 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.

5.1 Bare JID

If the sender knows only the recipient's bare JID, it cannot determine (via Service Discovery (XEP-0030) [5] or Entity Capabilities (XEP-0115) [6]) whether the intended recipient supports the Message Delivery Receipts protocol. In this case, the sender MAY request a receipt when sending a content message of type "chat", "headline", or "normal" to the recipient's bare JID. However, the sender MUST NOT depend on receiving an ack message in reply.

5.2 Full JID

If the sender knows a full JID for the recipient (e.g., via presence), it SHOULD attempt to determine (via service disco or entity capabilities) whether the client at that full JID supports the Message Delivery Receipts protocol before attempting to request receipts.

If the sender determines that the recipient's client does not support the Message Delivery Receipts protocol then it SHOULD NOT request a receipt when sending a content message to that full JID and MUST NOT depend on receiving an ack message.

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

5.3 Groupchat

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

5.4 Ack Messages

To prevent looping, an entity MUST NOT include a receipt request (i.e., the <request/> element) in an ack message (i.e., a message stanza that includes the <received/> element).

5.5 Archived Messages

An entity MUST NOT send an ack message when a user views messages that have been archived or stored on the client or the server (e.g., via Message Archiving (XEP-0136) [8]), only when first receiving the message.

6. Determining Support

If an entity supports the Message Delivery Receipts protocol, it MUST report that by including a Service Discovery (XEP-0030) [5] 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 (XEP-0115) [6], a.k.a. "caps".

7. Protocol Format

In order to make it possible for senders to request and for recipients to generate message delivery 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 an ack message containing the <received/> extension if the content message has been delivered to a client controlled by the intended recipient. In general, a client will return a receipt only if the client has processed the content message (e.g., if the client has presented the content message to a human user or has completed any automated processing of the content message, such as generation of an error response if the application determines that the content message cannot be handled). However, the Message Delivery Receipts protocol does not provide notification that a human user has read or understood the content message, that an automated system has completed processed or acted upon the message, etc.

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

Example 3. A content 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 content message that requests a receipt, so that the sender can properly track ack messages.

The recipient shall generate an ack message if and only if:

  1. it supports the Message Delivery Receipts protocol; and
  2. 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 delivery 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>

When the recipient sends an ack message, it SHOULD ensure that the message stanza contains only one child element, namely the <received/> element qualified by the 'urn:xmpp:receipts' namespace, which MUST include an 'id' attribute that echoes the 'id' attribute of the content message. Naturally, intermediate entities might add other extension elements to the message when routing or delivering the receipt message, e.g., a <delay/> element as specified in Delayed Delivery (XEP-0203) [9].

Note: It is a good practice to use the same message type as the message that requested the receipt, however a client SHOULD also accept receipts with a different message type. When sending a Receipt for a type='groupchat' message (which is NOT RECOMMENDED), the Receipt must be sent to the bare JID of the room and not to the full JID of the sender.

8. Security Considerations

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

9. IANA Considerations

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

10. XMPP Registrar Considerations

10.1 Protocol Namespaces

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

11. 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://xmpp.org/extensions/xep-0184.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='received'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='empty'>
          <xs:attribute name='id' type='xs:string' use='required'/>
        </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>

12. Acknowledgements

Thanks to Steven te Brinke, Bruce Campbell, Joe Kemp, Kevin Smith, Remko Tronçon, Matthew Wild, and Kurt Zeilenga for their input.


Appendices

Appendix A: Document Information

Series
XEP
Number
0184
Publisher
XMPP Standards Foundation
Status
Draft
Type
Standards Track
Version
1.4.0
Last Updated
2018-08-02
Approving Body
XMPP Council
Dependencies
XMPP Core
Supersedes
XEP-0022 (in part)
Superseded By
None
Short Name
receipts
Schema
<http://xmpp.org/schemas/receipts.xsd>
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre
Email
xsf@stpeter.im
JabberID
peter@jabber.org
URI
http://stpeter.im/
Joe Hildebrand
Email
jhildebr@cisco.com
JabberID
hildjj@jabber.org

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2020 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 <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

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-0079: Advanced Message Processing <https://xmpp.org/extensions/xep-0079.html>.

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

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

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

5. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

6. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.

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

8. XEP-0136: Message Archiving <https://xmpp.org/extensions/xep-0136.html>.

9. XEP-0203: Delayed Delivery <https://xmpp.org/extensions/xep-0203.html>.

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

11. 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 <https://xmpp.org/registrar/>.

Appendix H: Revision History

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

  1. Version 1.4.0 (2018-08-02)

    Make the 'id' attribute required, this extension makes no sense otherwise.

    egp
  2. Version 1.3.0 (2019-05-15)

    Suggest a message type to use for replies.

    gl
  3. Version 1.2 (2011-03-01)

    Clarified terminology and several points of implementation; explicitly stated that this protocol notifies the sender only that a message has been delivered to a client, not that it has been read or understood by a human user (if any); changed title from Message Receipts to Message Delivery Receipts to make this 100% clear.

    psa
  4. Version 1.1 (2010-03-31)
    psa
  5. Version 1.0 (2007-09-26)

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

    psa
  6. Version 0.4 (2007-05-30)

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

    psa
  7. Version 0.3 (2006-11-06)

    Removed reliability features, which belong at a different level.

    psa
  8. 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
  9. Version 0.1 (2006-04-11)

    Initial version.

    psa
  10. 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
  11. Version 0.0.1 (2006-03-27)

    First draft.

    psa

END