JEP-0023: Message Expiration

This JEP documents a protocol that can be used to specify expiration dates for messages.


NOTICE: This Historical JEP provides canonical documentation of a protocol that is in wide use within the Jabber community. This JEP is not a standards-track specification within the Jabber Software Foundation's standards process; therefore it may be converted to standards-track in the future or may be obsoleted by a more modern protocol.


JEP Information

Status: Active
Type: Historical
Number: 0023
Version: 1.1
Last Updated: 2004-01-06
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: JEP-0079
Short Name: x-expire
Schema: <http://jabber.org/protocol/x-expire/x-expire.xsd>

Author Information

Jeremie Miller

Email: jer@jabber.org
JID: jer@jabber.org

DJ Adams

Email: dj.adams@pobox.com
JID: dj@gnu.mine.nu

Harold Gottschalk

Email: heg@imissary.com
JID: heg@imissary.com

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).

Discussion Venue

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

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Table of Contents

1. Introduction
2. Specifying a TTL
3. Handling XML Stanzas with a TTL
3.1. Usage in client space
4. Security Considerations
5. IANA Considerations
6. Jabber Registrar Considerations
7. XML Schema
8. Open Issues
Notes
Revision History


1. Introduction

It is sometimes helpful to indicate that a piece of information has a finite useful life or time-to-live (TTL). In the context of instant messaging, the main use of a TTL is to indicate that a message must or should be used by or read by a certain time, usually because the message has meaning or purpose only within a finite amount of time. In normal usage, such a message should be discarded after the specified time has passed if it has not been used or read by that time.

In Jabber, TTL functionality has been implemented informally using the jabber:x:expire namespace. Support for this namespace was added to the jabberd [1] server as well as some clients and components in early 2001. Specifically, that support has involved the following two areas of responsibility:

Note: the recommended protocol for implementing the kind of functionality described herein is now Advanced Message Processing [3].

2. Specifying a TTL

An Endpoint can specify a TTL for an XML stanza that it wishes to send by attaching an <x/> extension qualified by the jabber:x:expire namespace. The extension contains no children, only a 'seconds' attribute that contains a value representing the stanza's TTL, in seconds.

Example 1. Specifying a 30-minute TTL for a message

SEND: <message to='sabine@gnu.mine.nu' id='msg811'>
        <subject>Eccles cakes!</subject>
        <body>
          I've got some freshly made Eccles cakes here, come
          round for one before they all disappear!
        </body>
        <x xmlns='jabber:x:expire' seconds='1800'/>
      </message>
  

3. Handling XML Stanzas with a TTL

Any mechanism that is involved in the storage, forwarding, and general handling of XML stanzas must check for the presence of such an extension and act accordingly, expiring (discarding) any stanzas that have exceeded their TTL lifetime. The jabber:x:expire namespace allows for a further attribute inside the <x/> extension: 'stored'. Here, the mechanism can record a value representing when the stanza was committed to storage, so that when the stanza is eventually retrieved for forwarding to the intended recipient, the elapsed time of storage can be calculated. This is to prevent the stanza from being held in 'suspended animation'.

Here we see what the original message looks like after the stanza has been committed to storage and the time of storage recorded:

Example 2. Recording a storage-time in the extension

SEND: <message to='sabine@gnu.mine.nu' id='msg811'>
        <subject>Eccles cakes!</subject>
        <body>
          I've got some freshly made Eccles cakes here, come
          round for one before they all disappear!
        </body>
        <x xmlns='jabber:x:expire'
           seconds='1800'
           stored='912830221'/>
      </message>
  

When Sabine attempts to retrieve her offline messages, the store-and-forward mechanism (e.g., mod_offline) compares the current time against the stored attribute. If the 1800 seconds have passed, the mechanism should simply drop the message, without notifying either the sender or the intended recipient. No Eccles cakes for Sabine!

3.1 Usage in client space

Although current usage of jabber:x:expire is most commonly seen in server implementations to address any TTL requirements of stored messages, Jabber clients can also be seen as handlers of messages that may contain expiration extension information. If a message is received by a Jabber client, and not immediately displayed to the user, the client must check for TTL information and expire the message (rather than display it to the user) if appropriate.

4. Security Considerations

There are no security features or concerns related to this proposal.

5. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [4].

6. Jabber Registrar Considerations

No action on the part of the Jabber Registrar [5] is necessary as a result of this JEP, since 'jabber:x:expire' is already a registered protocol namespace.

7. XML Schema

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='jabber:x:expire'
    xmlns='jabber:x:expire'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      JEP-0023: http://www.jabber.org/jeps/jep-0023.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='x'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='empty'>
          <xs:attribute name='seconds' type='xs:unsignedLong' use='required'/>
          <xs:attribute name='stored' type='xs:unsignedLong' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

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

</xs:schema>
    

8. Open Issues

  1. The jabber:x:expire namespace is processed only for delayed messages and only by servers and subsystems which support this informational draft. Therefore it is possible or even likely that a TTL will not be properly handled from the user perspective.
  2. A physical, time-based TTL is not implemented by this JEP, and would not be possible across systems without synchronized time.


Notes

1. The jabberd server is the original server implementation of the Jabber protocols, first developed by Jeremie Miller, inventor of Jabber. For further information, see <http://jabberd.jabberstudio.org/>.

2. The best-known example of a mechanism that handles storing and forwarding of XML stanzas is the Jabber Session Manager (JSM) within current Jabber server implementations, specifically the mod_offline module. However, expiration of an XML stanza could also be handled by a Jabber client.

3. JEP-0079: Advanced Message Processing <http://www.jabber.org/jeps/jep-0079.html>.

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

5. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.


Revision History

Version 1.1 (2004-01-06)

Added XML schema; added security, IANA, and Jabber Registrar considerations. (psa)

Version 1.0 (2002-07-15)

Changed status to Active. (psa)

Version 0.9 (2002-03-19)

Added remarks about client-end expiry. (dja)

Version 0.1 (2002-03-07)

Initial draft. (dja)


END