> ## Content Index
> Fetch the complete content index at: https://www.process-one.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# ejabberd 16.09
- URL: https://www.process-one.net/blog/ejabberd-16-09/
- Published: 2016-09-21T22:00:00.000Z
- Updated: 2024-09-19T12:27:59.000Z
- Author: Jérôme Sautret

We are happy to introduce our new ejabberd release, ejabberd 16.09\. As usual it includes many bug fixes and improvements. But most of all, it includes excellent student work done for Google Summer of Code program.

More specifically, this release adds the following major features:

- Support for Elixir configuration file. It means it is possible to configure ejabberd using an Elixir script file instead of ejabberd YAML format.
- Support [XEP-0355 – Namespace Delegation](https://xmpp.org/extensions/xep-0355.html?ref=process-one.net)  
This allows to use an external entity to manage some of the server features. This XEP is working with Privileged Entity (XEP-0356).
- Support [XEP-0356 – Privileged Entity](https://xmpp.org/extensions/xep-0356.html?ref=process-one.net)  
This allows a component or any entity to have a “privileged” status. As a result, it can manage an entity roster on its behalf, send or receive stanzas in the name of the server. The main goal of XEP-0356 is to create an external, server agnostic, PEP service.

Thanks to Anna Mukharram and Gabriel Gatu for their contributions.

## Namespace Delegation and Privileged Entity

Thanks to Anna Mukharram, it’s now possible to delegate features to a component with a privileged status, allowing components to get access to some ejabberd’s internal data and to perform some actions. This allows developing advanced components that were previously not possible to create with [XEP-0114 – Jabber Component Protocol](https://xmpp.org/extensions/xep-0114.html?ref=process-one.net).

On a typical setup, you’ll use both XEP-0355 and XEP-0356\. To do so, you need to add `mod_delegation` to your modules section in ejabberd’s configuration, and delegate namespace to a component by adding a component in your listener section. You may also grant some access to this component. Here is an example of such configuration:

```
listen:
  ...
  -
    port: 8888
    module: ejabberd_service
    hosts:
      "sat-pubsub.example.org":
        password: "secret"
    delegations:
      "urn:xmpp:mam:1":
        filtering: ["node"]
      "https://jabber.org/protocol/pubsub":
        filtering: []
  ...

```

In the example above, a component serving `sat-pubsub.example.org` will receive all pubsub requests and all MAM requests with the node filtering attribute presented in a query packet. The component is also allowed to get the roster of every user of the server and send messages on behalf of the server.

Compliance with [Salut à Toi](https://salut-a-toi.org/?ref=process-one.net) project components have been tested: We can now run SàT components directly on top of ejabberd.

Please, let us know if you write components for XMPP using this new feature :)

## Ejabberd configuration in Elixir

Thanks Gabriel Gatu, you now have choice when it comes to configure ejabberd. While YAML configuration file is the default way to configure ejabberd, it’s now possible to write configuration as an Elixir script which will be evaluated. The most notable benefit is the ability to add some logic and get unlimited number of possibilities for a dynamic configuration.

Here is an example of such configuration: [ejabberd.exs](https://github.com/processone/ejabberd/blob/master/config/ejabberd.exs?ref=process-one.net)

It also gives opportunity to apply a custom function for a given hook to customize ejabberd behavior without need to write your own ejabberd module. The following example adds an entry in the log when a user is registered:

```
hook :register_user, [host: "localhost"], fn(user, server) ->
   info("User registered: #{user} on #{server}")
end

```

Elixir configuration files are expected to have `.exs` extensions.

Check `config/ejabberd.exs` for a complete default configuration, and give it a try !

This is a work in progress, and you can expect more features soon. For example, you cannot yet define different module or listener configurations for different domains, but this is something we are aware of and that is on our roadmap.

## Changes

This is a selection of the most important changes:

### New XMPP Extension support

- Support for [XEP-0355 – Namespace Delegation](https://xmpp.org/extensions/xep-0355.html?ref=process-one.net)
- Support for [XEP-0356 – Privileged Entity](https://xmpp.org/extensions/xep-0356.html?ref=process-one.net)

### Elixir support

- Support for Elixir-based configuration files

### [MUC/Sub](https://docs.ejabberd.im/developer/proposed-extensions/muc-sub/?ref=process-one.net)

- Add a new request to list MUC room subscribers
- Link MUC subscription to bare JID
- New commands `unsubscribe_room` and `unsubscribe_room` for MUC subscriptions management through API
- Fix nick-to-jid mapping for MUC subscribers
- Fix subscribed rooms list retrieval
- Fix message routing from subscribers
- Do not update `muc_online_users` table on MUC/Sub operations

### MUC

- Support multiple JIDs in room invitations
- Create room on configuration request as per XEP-0045, 10.1.3

### PubSub

- Add SQL support for microblogging node plugin
- Fix publish with subscriber publish model and SQL backend
- node\_mb: Call node\_pep instead of node\_hometree

### Stream Management

- New Stream Management option: ack\_timeout
- Fix Stream Management feature for the websocket connections
- Cancel timer when waiting for resumption

### MAM and Offline

- Don’t store messages of type “headline”
- Simplify “assume\_mam\_usage” option
- Honor hint for any non-“error” message
- Store announcements for offline users

### Database

- Session backend: fix clean Redis table
- `mod_shared_roster`: Support SQL backend

### ejabberdctcl admin tool

- ejabberdctl: do not force access rules check on register command
- ejabberdctl: do not force command line to pass a credential
- New commands `unsubscribe_room` and `unsubscribe_room` for MUC subscriptions management
- New command `create_room_with_opts` to create room with custom config

### ejabberd API

- New commands `unsubscribe_room` and `unsubscribe_room` for MUC subscriptions management
- New command `create_room_with_opts` to create room with custom config
- Add X-Admin and basic auth header to CORS allowed headers in http\_api
- Properly process OPTIONS header in http\_api for all paths
- Expand parsing of JSON input to be able to handle `update_roster` command
- Provide proper `args_desc` in `oauth_issue_token` command

### Developer features: ejabberd Hooks

- Add hooks `c2s_session_pending`, `c2s_session_resumed`, `store_offline_message`, `store_mam_message`
- Add CSI user’s JID argument to `csi_filter_stanza` and `csi_flush_queue` hooks
- Add functions to get/set some c2s #state elements from external modules
- `mod_client_state`: Let other modules filter stanzas
- rework c2s API to simplify push modules integration

### Installers

- Fix several issues on Windows installer

## Feedback

As usual, the release is tagged in the Git source code repository on [Github](https://github.com/processone/ejabberd.git?ref=process-one.net).

The source package and binary installers are available at [ProcessOne](https://www.process-one.net/en/ejabberd/downloads/).

If you suspect that you’ve found a bug, please search or fill a bug report on [Github](https://github.com/processone/ejabberd/issues?ref=process-one.net).