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.0
Last Updated:2007-09-26

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. Protocol Format
4. Business Rules
5. Determining Support
6. Negotiation
7. Implementation Notes
8. Security Considerations
9. IANA Considerations
10. XMPP Registrar Considerations
    10.1. Protocol Namespaces
    10.2. Field Standardization
11. XML Schema
12. 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. 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 [2], which this specification in part obsoletes. [3]

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.

Note: This document explicitly does not define a protocol for "guaranteed delivery", since that term (like "security") means different things to different people. Instead, we define a more focused protocol that addresses the need for message receipts, thus solving one problem that falls under the heading of "guaranteed delivery".

3. 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 1. 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>
  

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 2. A message receipt

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

The <received/> element SHOULD be the only child of the <message/> stanza and MUST mirror the 'id' of the sent message.

4. Business Rules

The following business rules apply:

  1. A sender SHOULD NOT include a request for message receipts when sending a message to the bare JID <localpart@domain.tld> of the recipient, only when sending to a full JID <localpart@domain.tld/resource>.

  2. A sender SHOULD NOT include a request for message receipts unless it knows (via Service Discovery [4] or Entity Capabilities [5]) that the intended recipient supports the protocol described herein or unless the use of message receipts is negotiated via Stanza Session Negotiation [6].

  3. A sender SHOULD include an 'id' attribute on the message so that the sender can properly track the receipt.

Naturally, message receipts can be combined with the rules specified in Advanced Message Processing (e.g., the deliver rule) for more complete reporting.

5. Determining Support

If a sender wishes to request message receipts, it SHOULD first determine whether the intended recipient supports message receipts. This can be done directly via Service Discovery or indirectly via Entity Capabilities.

If an entity supports message receipts, it MUST report that by including a service discovery feature of "urn:xmpp:receipts" in response to disco#info requests:

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

6. Negotiation

Two entities MAY negotiate the use of message receipts for a given session using Stanza Session Negotiation. The parameter to be negotiated is named "urn:xmpp:receipts". Its use is illustrated in the following examples.

Example 5. User requests chat session

<message type='normal'
         from='northumberland@shakespeare.lit/westminster'
         to='kingrichard@royalty.england.lit/throne'
         id='init1'>
  <thread>ffd7076498744578d10edabfe7f4a866</thread>
  <feature xmlns='http://jabber.org/protocol/feature-neg'>
    <x xmlns='jabber:x:data' type='form'>
      <field var='FORM_TYPE' type='hidden'>
        <value>urn:xmpp:ssn</value>
      </field>
      <field label='Accept this chat?'
             type='boolean' 
             var='accept'>
        <value>true</value>
        <required/>
      </field>
      <field label='Enable Message Receipts?'
             type='boolean' 
             var='urn:xmpp:receipts'>
        <value>0</value>
      </field>
    </x>
  </feature>
</message>
    

Example 6. Contact accepts offer and specifies parameters

<message type='normal'
         from='kingrichard@royalty.england.lit/throne'
         to='northumberland@shakespeare.lit/westminster'
         id='init1'>
  <thread>ffd7076498744578d10edabfe7f4a866</thread>
  <feature xmlns='http://jabber.org/protocol/feature-neg'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='FORM_TYPE' type='hidden'>
        <value>urn:xmpp:ssn</value>
      </field>
      <field var='accept'>
        <value>true</value>
      </field>
      <field var='urn:xmpp:receipts'>
        <value>1</value>
      </field>
    </x>
  </feature>
</message>
    

7. Implementation Notes

Although a sender MAY attempt to resend a message if it knows that the recipient supports message receipts and it does not receive a reply within some configurable timeout period, resend logic is out of scope for this specification.

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

9. IANA Considerations

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

10. XMPP Registrar Considerations

10.1 Protocol Namespaces

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

10.2 Field Standardization

Field Standardization for Data Forms [9] defines a process for standardizing the fields used within Data Forms qualified by a particular namespace, and the XMPP Registrar maintains a registry of such fields (see <http://xmpp.org/registrar/formtypes.html>). The Registrar shall add the following field for use in Stanza Session Negotiation forms:

Registry Submission

<form_type>
  <name>urn:xmpp:ssn</name>
  <field
      var='urn:xmpp:receipts'
      type='boolean'
      label='Whether to enable Message Receipts per XEP-0184'/>
</form_type>
      

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

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

  <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 Joe Kemp and Kevin Smith for their input.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0184
Publisher: XMPP Standards Foundation
Status: Draft
Type: Standards Track
Version: 1.0
Last Updated: 2007-09-26
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. XEP-0022: Message Events <http://xmpp.org/extensions/xep-0022.html>.

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

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

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

6. XEP-0155: Stanza Session Negotiation <http://xmpp.org/extensions/xep-0155.html>.

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

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

9. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.


Appendix H: Revision History

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

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