%ents; ]>
Extended Stanza Addressing This document specifies an XMPP protocol extension that enables entities to include RFC822-style address headers within XMPP stanzas in order to specify multiple recipients or sub-addresses. &LEGALNOTICE; 0033 Draft Standards Track Standards JIG XMPP Core JEP-0030 address http://jabber.org/protocol/address/address.xsd &hildjj; &stpeter; 1.1 2004-09-15 psa Per list discussion, removed prohibition on multiple replyto and replyroom addresses, since this is allowed by RFC 822. 1.0 2004-05-10 psa Per a vote of the Jabber Council, advanced status to Draft; also added Security Considerations in consultation with JEP author. 0.10 2004-03-18 psa Disallowed <addresses/> as direct child of &IQ;. 0.9 2004-02-27 jjh Added language note on desc attribute. Ensured that if uri attribute is used, node MUST NOT be. 0.8 2004-02-11 jjh Editorial cleanups, rearrangement. Allowed IQ's in certain cases. Clarified node rules. Changed delivered='yes' to delivered='true'. Noreply shouldn't imply no other addresses. Clarified when authorization checks take place. Remove own address on reply. Bad URI error added. 0.7 2004-02-04 jjh Clarified that a node attribute refers to a disco node. 0.6 2004-02-04 jjh Changed namespace to 'http://www.jabber.org/protocol/address', and removed one level of nesting, since addresses are the only block left. Made it clearer that the session manager can implement multicast directly. Removed infobits (needs to be a separate JEP). Reworked the examples to be more correct. Added reply handling rules. Added schema. 0.5 2003-12-17 jjh Replaced info with infobits, added noreply address type. 0.4 2003-12-15 jjh Removed trace; if you want that, use a different namespace. Required disco use, and removed agents/browse. Added URI addressing. 0.3 2002-07-29 jjh Made addresses extensible, added replyroom 0.2 2002-05-06 jjh Re-worked to simpler/more structured XML. 0.1 2002-04-19 jjh Initial version.

On the existing Jabber network, there are many opportunities to optimize stanza traffic. For example, clients that want to send the same stanza to multiple recipients currently must send multiple stanzas. Similarly, when a user comes online the server sends many nearly-identical presence stanzas to remote servers.

The 'http://jabber.org/protocol/address' specification provides a method for both clients and servers to send a single stanza and have it be delivered to multiple recipients, similar to that found in &rfc0822;. As a side-effect, it also provides all of the functionality specified by the old 'jabber:x:envelope' jabber:x:envelope - Message Envelope Information Extension proposal, which this JEP can supersede.

Support for Extended Stanza Addressing in a given server instance SHOULD be determined using &jep0030;. A conforming server MUST respond to disco#info requests.

To determine if a server or service supports Extended Stanza Addressing, the requesting entity SHOULD send a disco#info request to it.

]]>

If the server supports Extended Stanza Addressing, it MUST include a "http://jabber.org/protocol/address" feature in the response.

... ... ]]>

The IM service MAY implement multicast directly, or it MAY delegate that chore to a separate service. A client can use the following approach to find a multicast-capable service hosted by its domain:

  1. Send a disco#info request to the IM server; if its reply includes the 'http://jabber.org/protocol/address' feature, then it is a multicast-capable service.
  2. If the IM server is not a multicast-capable service, send a disco#items request to the IM server; the IM server will then return a list of associated services.
  3. Send a disco#info request to each of the services associated with the IM server; if one of the replies includes the 'http://jabber.org/protocol/address' feature, then that service is a multicast-capable service.

The multicast service MAY choose to limit which local users can use the service. The server MAY choose to limit whether non-local servers can send address headers that require the local server to send to third parties (relaying). In either case, if the server chooses to disallow the request, the server MUST return a Forbidden error (see the Error Conditions section below). In the relaying case, the server SHOULD NOT deliver to any of the addresses (even the local ones) if the sender is disallowed.

Implementations MAY choose to cache the disco response. Positive responses MAY be cached differently than negative responses. The result SHOULD NOT be cached for more than 24 hours, unless some sort of time-to-live information is added to the Service Discovery protocol in the future.

For multicast processing, the stanza containing an address header (the 'outer stanza') MUST be addressed to the multicast service, with no username or resource in the 'to' attribute.

When used for additional information in a one-to-one stanza (e.g. using the 'node' attribute), the outer stanza SHOULD be addressed directly to the recipient, not to the multicast service.

A multicast service MUST NOT change the 'from' address on the outer stanza. Note that this will limit third-party relaying across server-to-server connections as a side-effect.

Address headers MAY be included in message or presence stanzas. They MUST NOT be included as the direct child of an IQ stanza.

Address values are packaged together into an <addresses/> element.

Hello, world! ]]>
]]>

Each address to which the sender wants the stanza to be re-sent will show up as an <address/> in the <addresses/> element. There are several different types of address, shown below.

An <address/> element MUST possess a 'type' attribute, and MUST possess at least one of the 'jid', 'uri', 'node', and 'desc' attributes. An <address/> element MUST NOT possess both a 'jid' attribute and a 'uri' attribute. If sending through a multicast service, an address MUST include a 'jid' or a 'uri' attribute, unless it is of type 'noreply'.

The 'jid' attribute is used to specify a simple Jabber ID associated with this address. If the 'jid' attribute is specified, the 'uri' attribute MUST NOT be specified. Support for the 'jid' attribute is REQUIRED.

The 'uri' attribute is used to specify an external system address, such as a sip:, sips:, or im: URI. If the 'uri' attribute is specified, the 'jid' and 'node' attributes MUST NOT be specified. These URIs MUST be formatted as specified in their respective RFCs, however with the characters & < > ' " replaced by their equivalent XML escapes, &amp; &lt; &gt; &apos; &quot;. If a receiving entity does not understand the given URI scheme, or if the URI is not formatted correctly, a "JID Malformed" error SHOULD be returned. Support for the 'uri' attribute is OPTIONAL.

The 'node' attribute is used to specify a sub-addressable unit at a particular JID, corresponding to a Service Discovery node. A node attribute MAY be included if a 'jid' attribute is specified. If a 'uri' attribute is specified, a 'node' attribute MUST NOT be specified. Support for the 'node' attribute is RECOMMENDED.

The 'desc' attribute is used to specify human-readable information for this address. This data may be used by clients to provide richer address-book integration. This information is in the language of the sender, which MAY be identified using the standard xml:lang rules from &xmppcore;. Support for the 'desc' attribute is RECOMMENDED.

When a multicast service delivers the stanza to a non-bcc address, it MUST add a delivered='true' attribute to the address element. A multicast service MUST NOT deliver to an address that was marked with a delivered='true' attribute when the service received the stanza. A multicast service SHOULD attempt to deliver to all addresses that are not marked with a delivered='true' attribute. The delivered attribute is used to prevent loops. See the Multicast Usage section below for more details. Support for the 'delivered' attribute is REQUIRED.

The 'type' attribute is used to specify the semantics of a particular address. Support for the 'type' attribute is REQUIRED.

These addressees are the primary recipients of the stanza.

These addressees are the secondary recipients of the stanza.

These addressees should receive 'blind carbon copies' of the stanza. This means that the server MUST remove these addresses before the stanza is delivered to anyone other than the given bcc addressee or the multicast service of the bcc addressee.

This is the address to which all replies are requested to be sent. Clients SHOULD respect this request unless an explicit override occurs. There MAY be more than one replyto or replyroom on a stanza, in which case the reply stanza MUST be routed to all of the addresses.

This is the JID of a &jep0045; room to which responses should be sent. When a user wants to reply to this stanza, the client SHOULD join this room first. Clients SHOULD respect this request unless an explicit override occurs. There MAY be more than one replyto or replyroom on a stanza, in which case the reply stanza MUST be routed to all of the addresses.

This address type contains no actual address information. Instead, it means that the receiver SHOULD NOT reply to the message. This is useful when broadcasting messages to many receivers.

As specified herein, the <address/> element is empty. Implementations or future protocols MAY extend the <address/> element for additional functionality, but any extensions are out of scope for this JEP. Such extensions SHOULD be appropriately qualified with a new namespace, and any extensions that are not understood by an implementation MUST be ignored.

foo
]]>

The following usage scenario shows how messages flow through both address-enabled and non-address-enabled portions of the Jabber network.

Note: the logic associated with how to perform the following tasks is purely informational. A conforming service MUST generate output as if these rules had been followed, but need not (and probably will not) use this algorithm.

  1. User desires to send a stanza to more than one recipient.
  2. Client determines the JID of a multicast service, using Service Discovery.
  3. If no multicast service is found, the client MAY choose to deliver each stanza individually, or it MAY query each of the servers associated with desired recipients, and batch stanzas to those servers itself.
  4. If a multicast service is found, the client constructs a stanza with an address block, and sends it to the multicast service. (Note: For the following rules, any address that was marked on the incoming address header with delivered='true' is never re-delivered.)
  5. The server checks to see if it can deliver to all of the specified addresses. If not, the stanza is returned with a "Forbidden" error, and processing stops.
  6. The server adds a delivered='true' attribute to all addresses.
  7. The server removes all type='bcc' attributes.
  8. The server delivers the stanza to all of the 'to', 'cc', and 'bcc' addresses from the original address header that are being handled locally. The server replaces the 'to' attribute on the outer stanza with the JID of each addressee. Each 'bcc' recipient MUST receive only the <address type='bcc'/> associated with that addressee.
  9. For each non-local server (the 'target server') that has addresses specified in 'to', 'cc', or 'bcc' addresses in the original address header, the local server determines whether the target server supports multicast, using Service Discovery.
  10. If the target server does not support address headers, the local server sends a copy of the stanza to each address, with the 'to' attribute on the outer stanza set to the JID of the given addressee.
  11. If the target server does support address headers, the server removes the delivered='true' attributes on each of the addresses bound for that server, and replaces the 'to' attribute on the outer stanza with the adress of the multicast service for the target server. The 'bcc' addresses for the target server from the original address header are added back to the address header. A single stanza is sent to the target server.

Assume for these examples that header1.org and header2.org support address headers, and noheader.org does not.

]]> ]]>
Hello, World! ]]>
Hello, World!
Hello, World!
Hello, World! ]]> ]]> ... no address feature ... ]]> ]]> ]]> ]]> ]]>
Hello, World! ]]>
Hello, World!
Hello, World!
Hello, World! ]]> ]]> ... no address feature ... ]]>
Hello, World!
Hello, World!
Hello, World! ]]>

When replying to a message stanza that contains an extended address, the following rules apply:

  1. If more than one replyto or replyroom address is specified (bad protocol), or if a noreply address is specified, a reply SHOULD NOT be generated.
  2. If a replyroom address is specified, the client SHOULD join the specified chat room instead of replying directly to the specified user. No further extended address processing is required.
  3. If a replyto address is specified, the reply SHOULD go to the specified address. No further extended address processing is required. Any <thread/> element from the initial message MUST be copied into the reply.
  4. Otherwise, an extended-address aware client MUST copy the address header from the original message into the reply, removing any delivered attributes. If the original sender is not in the copied list, the original sender MUST be added as a 'to' address. The recipient's address SHOULD be removed from the list. The client then proceeds with the rules from the Multicast Usage section above for delivery of the message.

The following error conditions are to be used by implementations (for further information regarding error syntax, see &jep0086;):

XMPP Condition Purpose
<forbidden/> The sending user does not have permission to use this multicast service.
<jid-malformed/> A URI attribute was invalid or not understood (note that support for the 'uri' attribute is optional).
<not-acceptable/> Too many receiver fields were specified. Servers MAY have configurable limits for this, but the limit MUST be at least 50.

A recipient SHOULD trust a stanza's extended addressing headers only as much as it trusts the sender of the stanza.

Furthermore, there exists the potential for abuse related to the 'replyto' and 'replyroom' features (e.g., an entity could send messages with 'replyroom' set to the address of a room that hosts salacious content or with 'replyto' set to the address of a spambot that harvests Jabber addresses). Therefore if a human user's receiving application receives a message with extended stanza addressing that specifies a 'replyto' or 'replyroom' address other than that of the sender, it SHOULD inform the user of that fact. (Naturally, the receiving application MAY also limit the entities to which the recipient can reply using privacy lists as specified in &xmppim;.)

This JEP requires no interaction with &IANA;.

The ®ISTRAR; shall include 'http://jabber.org/protocol/address' in its registry of protocol namespaces.

The protocol documented by this schema is defined in JEP-0033: http://www.jabber.org/jeps/jep-0033.html ]]>

Sections of this document were inspired by RFC 822.