XEP-0184: Message Receipts

This document specifies an XMPP protocol extension for message receipts.


NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the XSF standards process.


Document Information

Series: XEP
Number: 0184
Publisher: XMPP Standards Foundation
Status: Proposed
Type: Standards Track
Version: 0.4
Last Updated: 2007-05-30
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: XEP-0022 (in part)
Superseded By: None
Short Name: TO BE ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Message Receipts (XEP-0184)>

Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org

Joe Hildebrand

Email: jhildebrand@jabber.com
JabberID: hildjj@jabber.org

Legal Notice

This XMPP Extension Protocol is copyright 1999 - 2007 by the XMPP Standards Foundation (XSF) and is in full conformance with the XSF's Intellectual Property Rights Policy <http://www.xmpp.org/extensions/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

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.

Conformance Terms

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


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. Acknowledgements
Notes
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 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 'http://www.xmpp.org/extensions/xep-0184.html#ns' namespace (see Protocol Namespaces regarding issuance of one or more permanent namespaces).

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='http://www.xmpp.org/extensions/xep-0184.html#ns'/>
</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='http://www.xmpp.org/extensions/xep-0184.html#ns'/>
</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 (<node@domain.tld>) of the recipient, only when sending to a full JID (<node@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 "http://www.xmpp.org/extensions/xep-0184.html#ns" in response to disco#info requests (see Protocol Namespaces regarding issuance of one or more permanent namespaces):

Example 3. Initial Service Discovery information request

<iq from='northumberland@shakespeare.lit/westminster'
    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'
    to='northumberland@shakespeare.lit/westminster'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='http://www.xmpp.org/extensions/xep-0184.html#ns'/>
    ...
  </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 "http://www.xmpp.org/extensions/xep-0184.html#ns" (see Protocol Namespaces regarding issuance of one or more permanent namespaces). 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='http://www.xmpp.org/extensions/xep-0184.html#ns'>
        <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='http://www.xmpp.org/extensions/xep-0184.html#ns'>
        <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

Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0184.html#ns"; upon advancement of this specification, the XMPP Registrar [8] shall issue a permanent namespace in accordance with the process defined in Section 4 of XMPP Registrar Function [9].

10.2 Field Standardization

Field Standardization for Data Forms [10] 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://www.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='http://www.xmpp.org/extensions/xep-0184.html#ns'
      type='boolean'
      label='Whether to enable Message Receipts per XEP-0184'/>
</form_type>
      

11. Acknowledgements

Thanks to Joe Kemp and Kevin Smith for their input.


Notes

1. XEP-0079: Advanced Message Processing <http://www.xmpp.org/extensions/xep-0079.html>.

2. XEP-0022: Message Events <http://www.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://www.xmpp.org/extensions/xep-0030.html>.

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

6. XEP-0155: Stanza Session Negotiation <http://www.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://www.xmpp.org/registrar/>.

9. XEP-0053: XMPP Registrar Function <http://www.xmpp.org/extensions/xep-0053.html>.

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


Revision History

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