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.1 |
Last Updated: | 2010-03-31 |
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.
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
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.
This document addresses the following requirements:
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]
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.
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.
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.
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.
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:
<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>
<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".
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.
<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).
<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.
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.
No interaction with the Internet Assigned Numbers Authority (IANA) [9] is necessary as a result of this document.
The XMPP Registrar [10] includes "urn:xmpp:receipts" in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).
<?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='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>
Thanks to Joe Kemp, Kevin Smith, Remko Tronçon, and Matthew Wild for their input.
Series: XEP
Number: 0184
Publisher: XMPP Standards Foundation
Status:
Draft
Type:
Standards Track
Version: 1.1
Last Updated: 2010-03-31
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
RSS
This document in other formats:
XML
PDF
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
Email:
jhildebr@cisco.com
JabberID:
hildjj@jabber.org
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.
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>.
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".
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/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Per a vote of the XMPP Council, advanced to Draft.
(psa)Per Council feedback, modified to use dedicated namespace (not AMP).
(psa)Removed reliability features, which belong at a different level.
(psa)Added two more scenarios; defined business rule about not sending to bare JIDs; specified security consideration regarding presence leaks.
(psa)Initial version.
(psa)Added text and examples for service discovery; added text and examples for chat session negotiation; added recommendations regarding message processing, retries, etc.
(psa)First draft.
(psa)END