XEP-0191: Simple Communications Blocking

This document specifies an XMPP protocol extension for simple communications blocking.


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


XEP Information

Status: Proposed
Type: Standards Track
Number: 0191
Version: 0.2
Last Updated: 2006-08-30
Publishing Organization: Jabber Software Foundation
Approving Body: XMPP Council
Dependencies: XMPP Core, XMPP IM, XEP-0030
Supersedes: None
Superseded By: None
Short Name: blocking
Wiki Page: <http://wiki.jabber.org/index.php/Simple Communications Blocking (XEP-0191)>

Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JID: stpeter@jabber.org

Legal Notice

This XMPP Extension Protocol is copyright 1999 - 2006 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF'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-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 (RFC 3920) and XMPP IM (RFC 3921) 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 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. Use Cases
3.1. User Discovers Support
3.2. User Blocks Contact
3.3. User Retrieves Block List
3.4. User Unblocks Contact
3.5. User Unblocks All Contacts
4. Implementation Notes
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
8. XML Schema
8.1. blocking
8.2. blocking#errors
9. Acknowledgements
Notes
Revision History


1. Introduction

RFC 3921 [1] includes an XMPP protocol extension for communications blocking. Unfortunately, because that extension (privacy lists) is quite complex, it has not been widely implemented in servers and has been implemented virtually not at all in clients. This is problematic, since the ability to block communications from selected users is an important feature for an instant messaging system (and is required by RFC 2779 [2]). However, the full power of privacy lists is not needed in order to block communications, so this document proposes a much simpler blocking protocol that meets the requirement specified in RFC 2779 and can be implemented much more easily in Jabber/XMPP clients and servers.

2. Requirements

The requirements for simple communications blocking are straightforward:

  1. A user must be able to block communications from a specific contact.
  2. A user should be able to determine which contacts are blocked.
  3. A user should be able to unblock communications from a specific contact.

3. Use Cases

3.1 User Discovers Support

In order for a client to discover whether its server supports the protocol defined herein, it MUST send a Service Discovery [3] information request to the server:

Example 1. Service discovery request

<iq from='bilbo@tolkien.lit/shire' to='tolkien.lit' type='get' id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
    

If the server supports the protocol defined herein, it MUST return a feature of "http://jabber.org/protocol/blocking":

Example 2. Service discovery response

<iq from='bilbo@tolkien.lit/shire' to='tolkien.lit' type='result' id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='http://jabber.org/protocol/blocking'/>
    ...
  </query>
</iq>
    

3.2 User Blocks Contact

In order for a user to block communications from a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing a <block/> element qualified by the 'http://jabber.org/protocol/blocking' namespace, where the JID to be blocked is encapsulated as the 'jid' attribute of the <item/> child element:

Example 3. Block command

<iq type='set' id='block1'>
  <block xmlns='http://jabber.org/protocol/blocking'>
    <item jid='romeo@montague.net'/>
  </block>
</iq>
    

If the server can successfully process the block command, it MUST return an IQ-result:

Example 4. Block command is successful

<iq type='result' id='block1'/>
    

(Standard XMPP stanza errors apply; see XMPP Core [4] and Error Condition Mappings [5].)

Note: The <block/> element MAY contain more than one <item/> child.

Once the user has blocked communications from the contact, the user's server MUST NOT deliver any XML stanzas from the contact to the user.

If the contact attempts to send a stanza to the user (i.e., an inbound stanza from the user's perspective), the user's server shall return an error according to the following rules:

If the user attempts to send an outbound stanza to the contact, the user's server MUST NOT route the stanza to the contact but instead MUST return a <not-acceptable/> error containing an application-specific error condition of <blocked/> qualified by the 'http://jabber.org/protocol/blocking#errors' namespace:

Example 5. Error: contact is blocked

<message type='error' from='romeo@montague.net' to='juliet@capulet.com'>
  <body>Can you hear me now?</body>
  <error type='cancel'>
    <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <blocked xmlns='http://jabber.org/protocol/blocking#errors'/>
  </error>
</message>
    

3.3 User Retrieves Block List

In order for a client to request a user's list of blocked contacts (e.g., in order to determine whether to unblock a contact), it shall send an IQ-get with no 'to' address (thus handled by the user's server) containing a <blocklist/> element qualified by the 'http://jabber.org/protocol/blocking' namespace:

Example 6. Client requests blocklist

<iq type='get' id='blocklist1'>
  <blocklist xmlns='http://jabber.org/protocol/blocking'/>
</iq>
    

If the user has any contacts in its blocklist, the server MUST return an IQ-result containing a <blocklist/> element that in turn contains one child <item/> element for each blocked contact:

Example 7. Server returns blocklist with items

<iq type='result' id='blocklist1'>
  <blocklist xmlns='http://jabber.org/protocol/blocking'>
    <item jid='romeo@montague.net'/>
    <item jid='iago@shakespeare.lit'/>
  </blocklist>
</iq>
    

If the user has no contacts in its blocklist, the server MUST return an IQ-result containing an empty <blocklist/> element:

Example 8. Server returns empty blocklist

<iq type='result' id='blocklist1'>
  <blocklist xmlns='http://jabber.org/protocol/blocking'/>
</iq>
    

A client SHOULD retrieve the block list after authenticating with its server.

3.4 User Unblocks Contact

In order for a user to unblock communications from a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an <unblock/> element qualified by the 'http://jabber.org/protocol/blocking' namespace, where the JID to be unblocked is encapsulated as the 'jid' attribute of the <item/> child element:

Example 9. Unblock contact command

<iq type='set' id='unblock1'>
  <unblock xmlns='http://jabber.org/protocol/blocking'>
    <item jid='romeo@montague.net'/>
  </unblock>
</iq>
    

If the server can successfully process the unblock command, it MUST return an IQ-result:

Example 10. Unblock contact command is successful

<iq type='result' id='unblock1'/>
    

Once the user has unblocked communications from the contact, the user's server MUST deliver any XML stanzas from the contact to the user.

3.5 User Unblocks All Contacts

In order for a user to unblock communications from all contacts, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an empty <unblock/> element qualified by the 'http://jabber.org/protocol/blocking' namespace:

Example 11. Unblock all command

<iq type='set' id='unblock2'>
  <unblock xmlns='http://jabber.org/protocol/blocking'/>
</iq>
    

If the server can successfully process the unblock command, it MUST return an IQ-result:

Example 12. Unblock all command is successful

<iq type='result' id='unblock2'/>
    

Once the user has unblocked communications from all contacts, the user's server MUST deliver any XML stanzas from those contacts to the user.

4. Implementation Notes

When a server receives a block command from a user, it MAY cancel any existing presence subscriptions between the user and the blocked user and MAY send a message to the blocked user; however, it is RECOMMENDED to deploy so-called "polite blocking" instead (i.e., to not cancel the presence subscriptions or send a notification). Which approach to follow is a matter of local service policy.

A service MAY also filter blocking users out of searches performed on user directories (see, for example, Jabber Search [6]); however, that functionality is out of scope for this specification.

5. Security Considerations

If properly implemented, this protocol extension does not introduce any new security concerns above and beyond those defined in RFC 3920 and RFC 3921.

6. IANA Considerations

No interaction with the Internet Assigned Numbers Authority (IANA) [7] is required as a result of this specification.

7. XMPP Registrar Considerations

7.1 Protocol Namespaces

The XMPP Registrar [8] shall include 'http://jabber.org/protocol/blocking' and 'http://jabber.org/protocol/blocking#errors' in its registry of protocol namespaces (see <http://www.xmpp.org/registrar/namespaces.html>).

8. XML Schema

8.1 blocking

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

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

  <xs:element name='block'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <xs:element name='unblock'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <xs:element name='blocklist'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name='item'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='empty'>
          <xs:attribute name='jid' type='xs:string' use='required'/>
        </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.2 blocking#errors

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://jabber.org/protocol/blocking#errors'
    xmlns='http://jabber.org/protocol/blocking#errors'
    elementFormDefault='qualified'>

  <xs:element name='blocked' type='empty'/>

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

</xs:schema>
    

9. Acknowledgements

Thanks to Valerie Mercier, Maciek Niedzielski, and Remko Tronçon for their feedback.


Notes

1. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://www.ietf.org/rfc/rfc3921.txt>.

2. RFC 2779: A Model for Presence and Instant Messaging <http://www.ietf.org/rfc/rfc2779.txt>.

3. XEP-0030: Service Discovery <http://www.xmpp.org/extensions/xep-0030.html>.

4. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://www.ietf.org/rfc/rfc3920.txt>.

5. XEP-0086: Error Condition Mappings <http://www.xmpp.org/extensions/xep-0086.html>.

6. XEP-0055: Jabber Search <http://www.xmpp.org/extensions/xep-0055.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 Jabber Software Foundation. For further information, see <http://www.xmpp.org/registrar/>.


Revision History

Version 0.2 (2006-08-30)

Added implementation notes regarding polite blocking and filtering of search results; recommended retrieval of block list after authentication; defined protocol flow for unblocking all contacts.

(psa)

Version 0.1 (2006-08-16)

Initial version.

(psa)

Version 0.0.2 (2006-08-10)

Added block list retrieval use case; modified block and unblock syntax to use item child element.

(psa)

Version 0.0.1 (2006-08-09)

First draft.

(psa)


END