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.
Last Updated: 2004-01-06
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core
Superseded By: JEP-0079
Short Name: x-expire
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/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
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.
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.
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  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 .
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.
SEND: <message firstname.lastname@example.org' 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>
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:
SEND: <message email@example.com' 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!
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.
There are no security features or concerns related to this proposal.
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) .
No action on the part of the Jabber Registrar  is necessary as a result of this JEP, since 'jabber:x:expire' is already a registered protocol namespace.
<?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>
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/>.