182 lines
8.7 KiB

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Message Expiration</title>
<abstract>This specification documents an historical protocol that was used to specify expiration dates for messages; this protocol has been deprecated in favor of XEP-0079: Advanced Message Processing.</abstract>
<spec>XMPP Core</spec>
<remark><p>Per a vote of the XMPP Council, changed status to Obsolete.</p></remark>
<remark><p>Per a vote of the Jabber Council, changed status to Deprecated since message expiration functionality should be implemented via XEP-0079: Advanced Message Processing.</p></remark>
<remark><p>Added XML schema; added security, IANA, and XMPP Registrar considerations.</p></remark>
<remark><p>Changed status to Active.</p></remark>
<remark><p>Added remarks about client-end expiry.</p></remark>
<remark><p>Initial draft.</p></remark>
<section1 topic='Introduction'>
<p><em>Note Well: The protocol described herein has been deprecated by the &XSF;. The recommended protocol for implementing message expiration functionality is now &xep0079;.</em></p>
<p>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.</p>
<p>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:</p>
<li>The sender of the message is responsible for attaching a jabber:x:expire extension to the XML stanza (usually a message).</li>
<li>Mechanisms involved in the store-and-forward of such a stanza
<note>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.</note>
en route to its intended recipient are responsible for checking the remaining time to live and expiring (discarding) the XML stanza if necessary.</li>
<section1 topic='Specifying a TTL'>
<p>An Endpoint can specify a TTL for an XML stanza that it wishes to send by attaching an &lt;x/&gt; 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.</p>
<example caption='Specifying a 30-minute TTL for a message'>
SEND: &lt;message to='sabine@gnu.mine.nu' id='msg811'&gt;
&lt;subject&gt;Eccles cakes!&lt;/subject&gt;
I've got some freshly made Eccles cakes here, come
round for one before they all disappear!
&lt;x xmlns='jabber:x:expire' seconds='1800'/&gt;
<section1 topic='Handling XML Stanzas with a TTL'>
<p>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 &lt;x/&gt; 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'.</p>
<p>Here we see what the original message looks like after the stanza has been committed to storage and the time of storage recorded:</p>
<example caption='Recording a storage-time in the extension'>
SEND: &lt;message to='sabine@gnu.mine.nu' id='msg811'&gt;
&lt;subject&gt;Eccles cakes!&lt;/subject&gt;
I've got some freshly made Eccles cakes here, come
round for one before they all disappear!
&lt;x xmlns='jabber:x:expire'
<p>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!</p>
<section2 topic='Usage in client space'>
<p>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.</p>
<section1 topic='Security Considerations'>
<p>There are no security features or concerns related to this proposal.</p>
<section1 topic='IANA Considerations'>
<p>This document requires no interaction with &IANA;.</p>
<section1 topic='XMPP Registrar Considerations'>
<p>No action on the part of the &REGISTRAR; is necessary as a result of this document, since 'jabber:x:expire' is already a registered protocol namespace.</p>
<section1 topic='XML Schema'>
<?xml version='1.0' encoding='UTF-8'?>
The protocol documented by this schema is defined in
XEP-0023: http://www.xmpp.org/extensions/xep-0023.html
<xs:element name='x'>
<xs:extension base='empty'>
<xs:attribute name='seconds' type='xs:unsignedLong' use='required'/>
<xs:attribute name='stored' type='xs:unsignedLong' use='optional'/>
<xs:simpleType name='empty'>
<xs:restriction base='xs:string'>
<xs:enumeration value=''/>
<section1 topic='Open Issues'>
<li>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.</li>
<li>A physical, time-based TTL is not implemented by this document, and would not be possible across systems without synchronized time.</li>