--- ejabberd-2.0.5.orig/debian/control.in
+++ ejabberd-2.0.5/debian/control.in
@@ -0,0 +1,30 @@
+Source: ejabberd
+Section: net
+Priority: optional
+Maintainer: Torsten Werner <twerner@debian.org>
+Build-Depends: @cdbs@, erlang-nox, erlang-dev (>= 1:11.b.2), libexpat1-dev, libssl-dev, zlib1g-dev, libpam0g-dev
+Standards-Version: 3.8.0
+Homepage: http://www.process-one.net/en/projects/ejabberd/
+Vcs-Svn: svn+ssh://svn.debian.org/svn/collab-maint/deb-maint/ejabberd/trunk
+Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/ejabberd/trunk/
+
+Package: ejabberd
+Architecture: any
+Depends: adduser, ${erlang-nox:Depends}, ${erlang-abi:Depends}, openssl, ucf, ${misc:Depends}, ${shlibs:Depends}
+Suggests: libunix-syslog-perl
+Description: Distributed, fault-tolerant Jabber/XMPP server written in Erlang
+ ejabberd is a distributed, fault-tolerant Jabber/XMPP server written in Erlang
+ Features:
+  - XMPP-compliant
+  - Web based administration
+  - Load balancing: can run in a cluster of machines
+  - Fault-tolerance: database can be replicated and stored on multiple
+    nodes (nodes can be added or replaced 'on the fly')
+  - Virtual hosting: several virtual domains can be served using single ejabberd
+    instance
+  - SSL/TLS support
+  - Multi-User Chat (MUC/conference)
+  - IRC transport
+  - Jabber Users Directory, based on users vCards
+  - Service Discovery
+  - Shared roster
--- ejabberd-2.0.5.orig/debian/control
+++ ejabberd-2.0.5/debian/control
@@ -0,0 +1,31 @@
+Source: ejabberd
+Section: net
+Priority: optional
+Maintainer: Torsten Werner <twerner@debian.org>
+Uploaders: Gerfried Fuchs <rhonda@debian.at>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27), erlang-nox, erlang-dev (>= 1:11.b.2), libexpat1-dev, libssl-dev, zlib1g-dev, libpam0g-dev
+Standards-Version: 3.8.0
+Homepage: http://www.process-one.net/en/projects/ejabberd/
+Vcs-Svn: svn+ssh://svn.debian.org/svn/collab-maint/deb-maint/ejabberd/trunk
+Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/ejabberd/trunk/
+
+Package: ejabberd
+Architecture: any
+Depends: adduser, ${erlang-nox:Depends}, ${erlang-abi:Depends}, openssl, ucf, ${misc:Depends}, ${shlibs:Depends}
+Suggests: libunix-syslog-perl
+Description: Distributed, fault-tolerant Jabber/XMPP server written in Erlang
+ ejabberd is a distributed, fault-tolerant Jabber/XMPP server written in Erlang
+ Features:
+  - XMPP-compliant
+  - Web based administration
+  - Load balancing: can run in a cluster of machines
+  - Fault-tolerance: database can be replicated and stored on multiple
+    nodes (nodes can be added or replaced 'on the fly')
+  - Virtual hosting: several virtual domains can be served using single ejabberd
+    instance
+  - SSL/TLS support
+  - Multi-User Chat (MUC/conference)
+  - IRC transport
+  - Jabber Users Directory, based on users vCards
+  - Service Discovery
+  - Shared roster
--- ejabberd-2.0.5.orig/debian/postinst
+++ ejabberd-2.0.5/debian/postinst
@@ -0,0 +1,157 @@
+#! /bin/sh
+# postinst script for ejabberd
+#
+# see: dh_installdeb(1)
+
+set -e
+
+CONFIG_SOURCE=/usr/share/ejabberd/ejabberd.cfg
+CONFIG_TARGET=/etc/ejabberd/ejabberd.cfg
+TEMPFILE=$(mktemp)
+
+. /usr/share/debconf/confmodule
+
+setup_ejabberd()
+{
+    # Ejabberd config dir may contain sensitive data, so making it unreadable by
+    # the world.
+    if ! dpkg-statoverride --list /etc/ejabberd >/dev/null; then
+	chown root:ejabberd /etc/ejabberd
+	chmod 750 /etc/ejabberd
+    fi
+
+    # The users database dir /var/lib/ejabberd must be writable by user ejabberd.
+    install -d /var/lib/ejabberd
+    if ! dpkg-statoverride --list /var/lib/ejabberd >/dev/null; then
+	chown -R ejabberd:ejabberd /var/lib/ejabberd
+	chmod 700 /var/lib/ejabberd
+    fi
+
+    # Ejabberd logs should be readable by users in adm group (see also logrotate script).
+    install -d /var/log/ejabberd
+    if ! dpkg-statoverride --list /var/log/ejabberd >/dev/null; then
+	chown ejabberd:adm /var/log/ejabberd
+	chmod 750 /var/log/ejabberd
+    fi
+
+    # Moving certificate from /etc/ssl/certs to /etc/ejabberd (see bug #368414).
+    cd /etc/ssl/certs
+    if [ -f ejabberd.pem ] && [ ! -z $2 ] && dpkg --compare-versions "$2" lt-nl "1.1.1-3"
+    then
+	echo "Moving ejabberd.pem from /etc/ssl/certs to /etc/ejabberd..."
+	rm -f $(openssl x509 -noout -hash < ejabberd.pem).0
+	mv ejabberd.pem /etc/ejabberd
+	echo "Replacing /etc/ejabberd/ejabberd.pem for /etc/ssl/certs/ejabberd.pem in the config file..."
+	sed -i -e 's:/etc/ssl/certs/ejabberd.pem:/etc/ejabberd/ejabberd.pem:g' /etc/ejabberd/ejabberd.cfg
+    fi
+
+    # Making /etc/ejabberd/ejabberd.pem if it does not exist.
+    ( cd /etc/ejabberd
+    if [ ! -f ejabberd.pem ]
+    then
+	echo "Generating SSL certificate /etc/ejabberd/ejabberd.pem..."
+	EHOSTNAME=$(hostname -s 2>/dev/null || echo localhost)
+	EDOMAINNAME=$(hostname -d 2>/dev/null || echo localdomain)
+	openssl req -new -x509 -days 365 -nodes -out ejabberd.pem \
+		    -keyout ejabberd.pem > /dev/null 2>&1 <<+++
+.
+.
+.
+$EDOMAINNAME
+$EHOSTNAME
+ejabberd
+root@$EHOSTNAME.$EDOMAINNAME
++++
+    fi
+    if ! dpkg-statoverride --list /etc/ejabberd/ejabberd.pem >/dev/null; then
+	chown root:ejabberd /etc/ejabberd/ejabberd.pem
+	chmod 640 /etc/ejabberd/ejabberd.pem
+    fi
+    )
+
+    db_get ejabberd/hostname
+    HOST="$RET"
+    db_get ejabberd/user
+    USER="$RET"
+    db_get ejabberd/password
+    PASSWD="$RET"
+    sed -e "s/__USER__/$USER/g ; s/__HOSTNAME__/$HOST/g" $CONFIG_SOURCE >$TEMPFILE
+    ucf --three-way --debconf-ok $TEMPFILE $CONFIG_TARGET
+    db_stop
+
+    # Making ejabberd config readable only by ejabberd user.
+    chown ejabberd:ejabberd $CONFIG_TARGET
+    chmod 600 $CONFIG_TARGET
+}
+
+register_admin()
+{
+    if [ -n "$USER" -a -n "$PASSWD" ]; then
+	echo -n "Waiting for ejabberd to register admin user"
+
+	if /usr/sbin/ejabberdctl status >/dev/null || test $? = 1 ; then
+	    # Ejabberd is starting ($? = 1) or running ($? = 0) already.
+	    cnt=0
+	    flag=1
+	    while ! /usr/sbin/ejabberdctl status >/dev/null ; do
+		echo -n "."
+		cnt=`expr $cnt + 1`
+		if [ $cnt -ge 60 ] ; then
+		    echo
+		    echo "Can't register admin user \"$USER@$HOST\"."
+		    echo -n "Ejabberd is starting too long."
+		    flag=0
+		    break
+		fi
+		sleep 1
+	    done
+
+	    echo
+	    if [ $flag -eq 1 ] ; then
+		if ! status=$(/usr/sbin/ejabberdctl register "$USER" "$HOST" "$PASSWD") ; then
+		    if echo $status | grep -q "already registered" ; then
+			echo "Admin user \"$USER@$HOST\" is already registered. Password IS NOT changed."
+		    else
+			echo "Can't register admin user \"$USER@$HOST\"."
+		    fi
+		else
+		    echo "Admin user \"$USER@$HOST\" is registered successfully."
+		fi
+	    fi
+	else
+	    echo
+	    echo "Can't register admin user \"$USER@$HOST\"."
+	    echo "Ejabberd server is not started."
+	fi
+    fi
+}
+
+case "$1" in
+    configure|reconfigure)
+	adduser --quiet --system --shell /bin/sh --group --home /var/lib/ejabberd ejabberd
+	setup_ejabberd
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+    configure|reconfigure)
+    register_admin
+    ;;
+esac
+
+exit 0
+
--- ejabberd-2.0.5.orig/debian/compat
+++ ejabberd-2.0.5/debian/compat
@@ -0,0 +1 @@
+5
--- ejabberd-2.0.5.orig/debian/inetrc
+++ ejabberd-2.0.5/debian/inetrc
@@ -0,0 +1,2 @@
+{file, resolv, "/etc/resolv.conf"}.
+
--- ejabberd-2.0.5.orig/debian/postrm
+++ ejabberd-2.0.5/debian/postrm
@@ -0,0 +1,42 @@
+#! /bin/sh
+# postrm script for ejabberd
+#
+# see: dh_installdeb(1)
+
+set -e
+
+CONFIG_TARGET=/etc/ejabberd/ejabberd.cfg
+
+if [ -f /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+fi
+
+case "$1" in
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    purge)
+	if which ucf >/dev/null ; then
+	    ucf --purge $CONFIG_TARGET
+	fi
+	rm -f $CONFIG_TARGET
+	rm -f /etc/ejabberd/ejabberd.pem
+	rm -Rf /var/log/ejabberd /var/lib/ejabberd
+	rm -f /etc/default/ejabberd
+	if which deluser >/dev/null ; then
+	    deluser ejabberd 2>/dev/null || true
+	    delgroup ejabberd 2>/dev/null || true
+	fi
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
--- ejabberd-2.0.5.orig/debian/default
+++ ejabberd-2.0.5/debian/default
@@ -0,0 +1,116 @@
+#
+# In this file you can configure options that are passed
+# to the erlang runtime system when starting ejabberd
+#
+
+# POLL: Kernel polling ([true|false])
+#
+# The kernel polling option requires support in the kernel.
+# Additionaly, you need to enable this feature while compiling Erlang.
+#
+# Default: false
+#
+#POLL=false
+
+# SMP: SMP support ([enable|auto|disable])
+#
+# Explanation in Erlang/OTP documentation:
+# enable: starts the Erlang runtime system with SMP support enabled. 
+#   This may fail if no runtime system with SMP support is available.
+# auto: starts the Erlang runtime system with SMP support enabled if it
+#   is available and more than one logical processor are detected.
+# disable: starts a runtime system without SMP support.
+#
+# Default: disable
+#
+#SMP=disable
+
+# ERL_MAX_PORTS: Maximum number of simultaneously open Erlang ports
+#
+# ejabberd consumes two or three ports for every connection, either 
+# from a client or from another Jabber server. So take this into
+# account when setting this limit.
+#
+# Default: 32000
+# Maximum: 268435456
+#
+#ERL_MAX_PORTS=32000
+
+# PROCESSES: Maximum number of Erlang processes
+#
+# Erlang consumes a lot of lightweight processes. If there is a lot of activity
+# on ejabberd so that the maximum number of proccesses is reached, people will
+# experiment greater latency times. As these processes are implemented in
+# Erlang, and therefore not related to the operating system processes, you do
+# not have to worry about allowing a huge number of them.
+#
+# Default: 250000
+# Maximum: 268435456
+#
+#PROCESSES=250000
+
+# ERL_MAX_ETS_TABLES: Maximum number of ETS and Mnesia tables
+#
+# The number of concurrent ETS and Mnesia tables is limited. When the limit is
+# reached, errors will appear in the logs:
+#   ** Too many db tables **
+# You can safely increase this limit when starting ejabberd. It impacts memory
+# consumption but the difference will be quite small.
+#
+# Default: 1400
+#
+#ERL_MAX_ETS_TABLES=1400
+
+# ERL_OPTIONS: Additional Erlang options
+# 
+# The next variable allows to specify additional options passed to erlang while
+# starting ejabberd. Some useful options are -noshell, -detached, -heart. When
+# ejabberd is started from an init.d script options -noshell and -detached are
+# added implicitly. See erl(1) for more info.
+#
+# It might be useful to add "-pa /usr/local/lib/ejabberd/ebin" if you
+# want to add local modules in this path.
+#
+# Default: empty
+#
+#ERL_OPTIONS=""
+
+
+# ERL_FULLSWEEP_AFTER: The maximum number of generational collections before
+# forcing a fullsweep
+# 
+# The Erlang runtime system uses a generational garbage collection scheme,
+# using an "old heap" for data that has survived at least one garbage
+# collection. When there is no more room on the old heap, a fullsweep garbage
+# collection will be done.
+#
+# The fullsweep_after option makes it possible to specify the maximum number
+# of generational collections before forcing a fullsweep even if there is
+# still room on the old heap. Setting the number to zero effectively disables
+# the general collection algorithm, meaning that all live data is copied at
+# every garbage collection.
+#
+# To reduce memory usage, you can set environment variable ERL_FULLSWEEP_AFTER
+# to zero. But in this case ejabberd may work slower.
+#
+# Default: 65535
+#
+#ERL_FULLSWEEP_AFTER=65535
+
+# ERLANG_NODE: Erlang node for ejabberd server
+# 
+# The next variable allows to explicitly specify erlang node for ejabberd
+# It can be given in different formats:
+# ERLANG_NODE=ejabberd
+#   Lets erlang add hostname to the node (ejabberd uses short name in this case)
+# ERLANG_NODE=ejabberd@hostname
+#   Erlang uses node name as is (so make sure that hostname is a real
+#   machine hostname or you'll not be able to control ejabberd)
+# ERLANG_NODE=ejabberd@hostname.domainname
+#   The same as previous, but erlang will use long hostname 
+#   (see erl (1) manual for details)
+#
+# Default: ejabberd
+#
+#ERLANG_NODE=ejabberd
+
--- ejabberd-2.0.5.orig/debian/prerm
+++ ejabberd-2.0.5/debian/prerm
@@ -0,0 +1,52 @@
+#! /bin/sh
+# prerm script for ejabberd
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/doc/packaging-manual/
+
+case "$1" in
+    remove|upgrade)
+	if ejabberdctl status >/dev/null ; then
+	    # Use timestamp to make database restoring easier
+	    TIME=$(date +%Y-%m-%dT%H:%M:%S)
+	    BACKUPDIR=$(mktemp -d -p /var/backups/ ejabberd-$TIME.XXXXXX)
+	    chown ejabberd:ejabberd $BACKUPDIR
+	    BACKUP=$BACKUPDIR/ejabberd-database
+	    ejabberdctl backup $BACKUP
+	    # Change ownership to root:root because ejabberd user might be
+	    # removed on package removal.
+	    chown -R root:root $BACKUPDIR
+	    chmod 700 $BACKUPDIR
+	    echo
+	    echo The ejabberd database has been backed up to $BACKUP.
+	    echo
+	fi
+    ;;
+
+    deconfigure)
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+	echo "prerm called with unknown argument \`$1'" >&2
+	exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
--- ejabberd-2.0.5.orig/debian/init.d
+++ ejabberd-2.0.5/debian/init.d
@@ -0,0 +1,113 @@
+#! /bin/sh
+#
+# ejabberd        Start/stop ejabberd server
+#
+
+### BEGIN INIT INFO
+# Provides:          ejabberd
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts ejabberd jabber server
+# Description:       Starts ejabberd jabber server, an XMPP
+#                    compliant server written in Erlang.
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+EJABBERD=/usr/sbin/ejabberd
+EJABBERDCTL=/usr/sbin/ejabberdctl
+EJABBERDUSER=ejabberd
+NAME=ejabberd
+
+test -f $EJABBERD || exit 0
+test -f $EJABBERDCTL || exit 0
+
+# Include ejabberd defaults if available
+if [ -f /etc/default/ejabberd ] ; then
+    . /etc/default/ejabberd
+fi
+
+ctl()
+{
+    action="$1"
+    su $EJABBERDUSER -c "$EJABBERDCTL $action" >/dev/null
+}
+
+start()
+{
+    cd /var/lib/ejabberd
+    su $EJABBERDUSER -c "$EJABBERD -noshell -detached"
+
+    cnt=0
+    while ! (ctl status || test $? = 1) ; do
+	echo -n .
+	cnt=`expr $cnt + 1`
+	if [ $cnt -ge 60 ] ; then
+	    echo -n " failed"
+	    break
+	fi
+	sleep 1
+    done
+}
+
+stop()
+{
+    if ctl stop ; then
+	cnt=0
+	sleep 1
+	while ctl status || test $? = 1 ; do
+	    echo -n .
+	    cnt=`expr $cnt + 1`
+	    if [ $cnt -ge 60 ] ; then
+		echo -n " failed"
+		break
+	    fi
+	    sleep 1
+	done
+    else
+	echo -n " failed"
+    fi
+}
+
+case "$1" in
+    start)
+	echo -n "Starting jabber server: $NAME"
+	if ctl status ; then
+	    echo -n " already running"
+	else
+	    start
+	fi
+    ;;
+    stop)
+	echo -n "Stopping jabber server: $NAME"
+	if ctl status ; then
+	    stop
+	else
+	    echo -n " already stopped"
+	fi
+    ;;
+    restart|force-reload)
+	echo -n "Restarting jabber server: $NAME"
+	if ctl status ; then
+	    stop
+	    start
+	else
+	    echo -n " is not running. Starting $NAME"
+	    start
+	fi
+    ;;
+    *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+    ;;
+esac
+
+if [ $? -eq 0 ]; then
+    echo .
+else
+    echo " failed."
+fi
+
+exit 0
+
--- ejabberd-2.0.5.orig/debian/changelog
+++ ejabberd-2.0.5/debian/changelog
@@ -0,0 +1,711 @@
+ejabberd (2.0.5-1~bpo50+1) lenny-backports; urgency=medium
+
+  * Security related rebuild for lenny-backports, fixing Cross-site scripting
+    (XSS) vulnerability in ejabberd (CVE-2009-0934, #520852)
+
+ -- Gerfried Fuchs <rhonda@debian.at>  Wed, 15 Apr 2009 10:43:54 +0200
+
+ejabberd (2.0.5-1) unstable; urgency=high
+
+  * new upstream release
+    - Fixes 'CVE-2009-0934: Cross-site scripting (XSS) vulnerability in
+    ejabberd' (Closes: #520852)
+    - Fixes 'starttls hangs' (Closes: #516528, #518079)
+  * Disable patch ldaps.patch because it does not apply any more.
+  * Refresh all other patches.
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 05 Apr 2009 22:53:46 +0200
+
+ejabberd (2.0.3-2) unstable; urgency=low
+
+  * Remove Sergei from Uploaders field as requested by himself.
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 15 Feb 2009 21:47:35 +0100
+
+ejabberd (2.0.3-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Thu, 15 Jan 2009 19:44:58 +0300
+
+ejabberd (2.0.2-3) experimental; urgency=low
+
+  * Merge changes from version 2.0.1-5 from unstable.
+  * Document ERL_OPTIONS in /etc/default/ejabberd and README.Debian.
+    (Closes: #503012)
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 11 Jan 2009 17:19:28 +0100
+
+ejabberd (2.0.2-2) experimental; urgency=low
+
+  * Added option {keepalive, true} to ssl socket in LDAPS support patch.
+    This helps not to loose long-term connections to LDAPS server (thanks
+    to Alex Mauer for a suggestion).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 12 Sep 2008 19:14:17 +0400
+
+ejabberd (2.0.2-1) experimental; urgency=low
+
+  * New upstream release.
+  * Protected hostname -s and hostname -d calls in postinst script to prevent
+    its failure in case when hostname is incorrectly configured. It's harmless
+    to replace hostname by "localhost" because it's used only for generating
+    a reference SSL certificate which is to be replaced by a proper one.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 29 Aug 2008 21:15:26 +0400
+
+ejabberd (2.0.1-6) unstable; urgency=high
+
+  * Add backported patch pubsub_upgrade_tables.patch that fixes the broken
+    upgrade of ejabberd from Etch. (Closes: #507615)
+
+ -- Torsten Werner <twerner@debian.org>  Sat, 07 Feb 2009 20:02:20 +0100
+
+ejabberd (2.0.1-5) unstable; urgency=low
+
+  * Added Brazilian Portuguese debconf templates translation
+    (closes: #501751).
+  * Protected hostname -s and hostname -d calls in postinst script to prevent
+    its failure in case when hostname is incorrectly configured. It's harmless
+    to replace hostname by "localhost" because it's used only for generating
+    a reference SSL certificate which is to be replaced by a proper one.
+  * Added option {keepalive, true} to ssl socket in LDAPS support patch.
+    This helps not to loose long-term connections to LDAPS server (thanks
+    to Alex Mauer for a suggestion).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 10 Oct 2008 09:48:34 +0400
+
+ejabberd (2.0.1-4) unstable; urgency=low
+
+  * Added Basque debconf templates translation (closes: #492129).
+  * Removed unneeded package grep-dctrl from build-dependencies (a call to
+    erlang-depends has replaced it long time ago).
+  * Updated Czech debconf templates translation (closes: #492495).
+  * Added a unique suffix to ejabberdctl nodes to allow several commands to
+    run in parallel.
+  * Fixed a bug in building mod_http_fileserver, which made it completely
+    unusable.
+  * Added missing description of reopen-weblog ejabberdctl command to
+    ejabberdctl.8 manpage.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 04 Aug 2008 14:10:00 +0400
+
+ejabberd (2.0.1-3) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Synced mod_ctlextra module with upstream (closes: #488991).
+  * Updated Portuguese debconf templates translation (closes: #487822).
+  * Switched off autoupdating debian/control by cdbs to make
+    build-dependencies consistent.
+  * Added Swedish debconf templates translation (closes: #490681).
+  * Updated Russian debconf templates translation (closes: #491424).
+  * Updated Spanish debconf templates translation.
+  * Added Galician debconf templates translation (closes: #490855).
+  * Added Vietnamese debconf templates translation (closes: #491056).
+  * Cleaned up LDAPS patch and fixed a bug with leaking SSL sockets
+    (closes: #490059).
+  * Don't return from init script until at least Erlang VM is started to make
+    subsequent checks for running ejabberd simpler.
+  * Added an additional check for starting Erlang VM and don't try to register
+    admin user if ejabberd isn't started. This allows to shorten waiting
+    interval during upgrade if it isn't desirable to start ejabberd
+    automatically (closes: #462357).
+  * Added Turkish debconf templates translation (closes: #491493).
+  * Added Finnish debconf templates translation (closes: #491652).
+  * Install SQL database schemas to examples directory.
+  * Fixed crash in checking relational DB modules (closes: #491664).
+
+  [ Torsten Werner ]
+  * Updated German debconf templates translation.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Wed, 23 Jul 2008 16:32:03 +0400
+
+ejabberd (2.0.1-2) unstable; urgency=low
+
+  * Improved a patch which removes message rejecting intervals for
+    server-to-server recipients.
+  * Bumped standards version to 3.8.0.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 20 Jun 2008 10:07:29 +0400
+
+ejabberd (2.0.1-1) unstable; urgency=low
+
+  * New upstream bugfix release.
+  * Refreshed patches, removed those which were included into upstream.
+  * Added _2 suffix to get-orig-source target in debian/rules (temporarily).
+  * Fixed debian/watch to cover current release version (with _2 suffix).
+  * Fixed mod_ctlextra to work with ejabberd 2.0.1 (changed session record
+    definition).
+  * Added new ejabberdctl commands (both new in 2.0.1 and in mod_ctlextra)
+    to ejabberdctl manual page.
+  * Changed restart branch in init.d script to perform full Erlang VM stop
+    and start again (this allows to apply changes in /etc/default/ejabberd
+    if any during ejabberd restart).
+  * Clarified -sname and -name Erlang option usage by ejabberd and ejabberdctl
+    in their manual pages (closes: #482904).
+  * Added BUGS section to ejabberd manual page with a short description of
+    the most common cases of ejabberd start failures (closes: #481819).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 08 Jun 2008 16:32:18 +0400
+
+ejabberd (2.0.0-7) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Installed eldap.hrl header. It is necessary to build some external modules
+    for ejabberd.
+  * Moved headers which are in subdirectories of src directory to
+    corresponding subdirectory of /usr/lib/ejabberd/include/ as they are
+    usually included with subdirectory prepended.
+  * Included a patch which adds LDAPS support and added {ldap_encrypt} and
+    {ldap_port} example options to ejabberd config file (closes: #477918).
+  * Added an additional info on how to use ejabberd headers to README.Debian.
+  * Changed section in doc-base registration file to Network/Communication.
+  * Don't use HOSTNAME variable in postinstall and debconf config scripts to
+    prevent confusion with the same bash standard environment variable.
+  * Removed empty preinstall maintainer script.
+  * Fixed minus signs in ejabberd and ejabberdctl manual pages.
+  * Updated Russian debconf templates translation.
+
+  [ Torsten Werner ]
+  * Updated German debconf templates translation.
+  * Update Vcs headers in debian/control.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 17 May 2008 23:30:17 +0400
+
+ejabberd (2.0.0-6) unstable; urgency=low
+
+  * Replaced a patch for proxy65 module with nicer one (thanks to Evgeniy
+    Khramtsov).
+  * Added a patch for S2S module to make STARTTLS working with Erlang R12B.
+  * Added a patch by upstream fixes crash when browsing the Update page in
+    Erlang R12B.
+  * Fixed ODBC patch to work with Erlang R11B also.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 11 Mar 2008 15:10:42 +0300
+
+ejabberd (2.0.0-5) experimental; urgency=low
+
+  * Turned unnecessary error messages in mod_caps module into debug messages.
+  * Added a few patches to shared roster module and also added mod_ctlextra
+    (a module which offers many more or less useful commands to ejabberdctl)
+    following the discussion in the following thread:
+    http://lists.debian.org/debian-edu/2008/03/msg00017.html
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 07 Mar 2008 20:30:07 +0300
+
+ejabberd (2.0.0-4) experimental; urgency=low
+
+  * Updated French debconf templates translation (closes: #468788).
+  * Disabled epoll by default in /etc/default/ejabberd.
+  * Increased default maximum number of conference room occupants to 500.
+    Given increasing popularity of XMPP old default value 200 is too low.
+  * Disabled SMP support in ejabberd by default. It isn't necessary in most
+    cases but can be less reliable.
+  * Enabled PAM authentication support (yet needs to be refined).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 03 Mar 2008 22:54:48 +0300
+
+ejabberd (2.0.0-3) experimental; urgency=low
+
+  * Increased S2S timeouts. Defaults seems to be too short.
+  * Removed a 5-minute delay between a remote server connect failure and the
+    next connection attempt. It causes more harm than good.
+  * Changed ownership of ejabberd config directory and SSL certificate to
+    root:ejabberd and mode to to make sure they aren't overwritten by running
+    ejabberd.
+  * Remove an SSL certificate on package purge. It is assumed that it's a
+    generated certificate, so the removal is unconditional.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 24 Feb 2008 10:40:03 +0300
+
+ejabberd (2.0.0-2) experimental; urgency=low
+
+  * Saved a little bit of resources by not starting ssl module which isn't
+    used by ejabberd anymore.
+  * Added several new variables to ejabberd script and default settings
+    following upstream.
+  * Added 'debug' option to ejabberdctl script which attaches Erlang shell to
+    already running ejabberd server.
+  * Removed useless README and /etc/ejabberd/ejabberdctl.cfg files from the
+    binary package (/etc/ejabberd/ejabberdctl.cfg content is moved to
+    /etc/default/ejabberd).
+  * Added a patch which makes proxy65 module working with Erlang R12B.
+  * Fixed position of override section in ejabberd.cfg and uncommented proxy65
+    module (with adding restrictive options).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 22 Feb 2008 13:51:14 +0300
+
+ejabberd (2.0.0-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Thu, 21 Feb 2008 18:36:46 +0300
+
+ejabberd (1.1.4-6) unstable; urgency=low
+
+  * Loosened build dependencies to make backporting to etch easier.
+  * Added a requirement for $remote_fs into init.d script because ejabberd
+    needs mounted /usr to run.
+  * Added a patch which allows ODBC to work with Erlang R12B.
+  * Clarified debconf messages (closes: #390206).
+  * Added a notice about hostname change to README.Debian and included erlang
+    node conversion utility to the binary package (closes: #457097).
+  * Added a patch which allows to use certificate chain files for encrypted
+    connections (closes: #466676).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Thu, 21 Feb 2008 18:21:32 +0300
+
+ejabberd (1.1.4-5) unstable; urgency=low
+
+  * Do not remove /etc/ejabberd on package purge to preserve user files if
+    any (closes: #460459).
+  * Bumped standards version to 3.7.3.
+  * Added homepage header to debian control file.
+  * Fixed unnecessary space in doc-base.
+  * Changed default setting for nicknames which can be registered to 'none'
+    (which effectively forbids registration) as this setting is more safe
+    (closes: #458627).
+  * Fixed name section of ejabberd and ejabberdctl manual pages.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 13 Jan 2008 01:37:19 +0300
+
+ejabberd (1.1.4-4) unstable; urgency=low
+
+  * Added a patch which fixes access rule check in mod_irc.
+  * Added a patch which fixes ejabberd build using erlang R12B-0.
+  * Increased number of erlang ports in /etc/ejabberd/default. The default
+    value of 1024 allows too few simultaneous connections (from 300 to 500
+    for both clients and servers depending of whether they use SSL or traffic
+    compression).
+  * Fixed shell backquotes in ejabberd and ejabberdctl manual pages. Also
+    bumped their versions to 1.1.4.
+  * Added a note about binding to privileged ports to README.Debian.
+  * Fixed a race condition between starting log handler and port listener.
+    Otherwise, error reports about port binding can't get into log file
+    (closes: #458518).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 01 Jan 2008 17:09:57 +0300
+
+ejabberd (1.1.4-3) unstable; urgency=low
+
+  * Applied a patch by upstream which fixes usage of relational databases in
+    ejabberd modules while using internal or LDAP-based authentication
+    (closes: #446848). The patch was adopted from ejabberd SVN by Andreas
+    Oberritter.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 16 Oct 2007 10:34:07 +0400
+
+ejabberd (1.1.4-2) unstable; urgency=low
+
+  * Moved ejabberd application directory from
+    /usr/lib/erlang/lib/ejabberd-1.1.4 to /usr/lib/ejabberd to avoid conflicts
+    of modules names (specifically, eldap module conflicts with shiiped in Yxa
+    SIP server).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 12 Oct 2007 10:07:19 +0400
+
+ejabberd (1.1.4-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fixed debian/watch file.
+  * Removed ejabberd_sm.diff patch. This makes ejabberd using recommended
+    error condition <service-unavailable/> instead of
+    <feature-not-implemented/>. There was sufficient time to fix broken
+    clients.
+  * Removed perl-path.diff, shaper.diff, ejabberd_http_poll.diff, eldap.diff,
+    sql_escape.diff patches since they are included into upstream release.
+  * Redefined HOME environment variable to fix Erlang compiler warnings in
+    case when HOME points to an existent inaccessible directory.
+  * Bumped debhelper compatibility level to 5.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 09 Sep 2007 14:25:16 +0400
+
+ejabberd (1.1.2-10) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Added Sergei Golovan <sgolovan@debian.org> to uploaders list.
+  * Included a fix for IE bug (it sends zero length queries which cause
+    error 404) from http://www.jabber.ru/bugzilla/attachment.cgi?id=205
+    (closes: #428864).
+  * Included experimental Personal Eventing via Pubsub (XEP-0163) support
+    using patch from https://svn.process-one.net/ejabberd-modules/pep/.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 27 Aug 2007 20:19:43 +0400
+
+ejabberd (1.1.2-9) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Added binary package dependency on erlang-abi-* virtual package to
+    prevent installation of ejabberd which uses incompatible erlang ABI.
+  * Included ejabberd headers to binary package to make building external
+    modules for ejabberd possible (closes: #428081).
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 10 Jun 2007 19:19:20 +0400
+
+ejabberd (1.1.2-8) unstable; urgency=high
+
+  [ Torsten Werner ]
+  * Remove redundant Build-Depends.
+  * Use erlang-depends for calculating Depends now.
+  * Change email address of Christophe Romain in man page as requested by
+    himself.
+  * Add XS-X-Vcs-Svn header to debian/control.
+
+  [ Sergei Golovan ]
+  * Security fix, mentioned in 1.1.2-5 was backported from SVN and not
+    from 1.1.3, where it is incomplete (the bug affects ejabberd only if
+    users' rosters are stored in relational database, and not in Mnesia,
+    which is default).
+  * Moved patches to debian directory. This fixes cleaning up
+    after build process. (Closes: #424193)
+  * Moved creating user ejabberd from preinst to postinst because preinst
+    cannot rely on existence of adduser package.
+  * Added a comment to ejabberd.cfg concerning UTF-8 encoding.
+  * Unfuzzied one string in russian debconf translation (closes: #408410).
+  * Removed annoying message about existing SSL certificate.
+  * Fixed references to ejabberd installation and operation guide in manual
+    pages (closes: #416050).
+  * Backup ejabberd database on package removal or upgrade to a subdirectory
+    of /var/backups instead of /var/tmp (closes: #409916).
+  * Do not change /etc/ejabberd, /var/lib/ejabberd and /var/log/ejabberd
+    ownership and permissions if they are overridden using dpkg-statoverride
+    (closes: #416178).
+  * Conditionally source /usr/share/debconf/confmodule in postrm script as
+    debconf isn't an essential package (closes: #416743).
+  * Included Portuguese translation of debconf messages (closes: #416779).
+
+ -- Torsten Werner <twerner@debian.org>  Fri, 18 May 2007 13:44:53 +0200
+
+ejabberd (1.1.2-7) unstable; urgency=low
+
+  * Rebuild the package with newer erlang.
+
+ -- Torsten Werner <twerner@debian.org>  Fri, 13 Apr 2007 20:14:12 +0200
+
+ejabberd (1.1.2-6) unstable; urgency=high
+
+  [ Sergei Golovan ]
+  * Fixed users database and logs directoriy permissions (closes: #412583).
+
+ -- Torsten Werner <twerner@debian.org>  Tue, 27 Feb 2007 08:28:31 +0300
+
+ejabberd (1.1.2-5) unstable; urgency=high
+
+  * apply security fix backported from version 1.1.3
+    (http://ejabberd.jabber.ru/ejabberd-1.1.3); thanks to Sergei
+
+ -- Torsten Werner <twerner@debian.org>  Sat,  3 Feb 2007 23:08:08 +0100
+
+ejabberd (1.1.2-4) unstable; urgency=medium
+
+  [ Sergei Golovan ]
+  * Fixed bug with LDAP support, thanks to Evgeniy Khramtsov. (Closes: #399659)
+  * Documented quilt patches in patches/ directory.
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 22 Nov 2006 13:44:13 +0300
+
+ejabberd (1.1.2-3) unstable; urgency=low
+
+  * Add patch http_bind.diff, thanks to Matthew Harrell. (Closes: #399560)
+  * Updated debian/control from debian/control.in.
+
+ -- Torsten Werner <twerner@debian.org>  Mon, 20 Nov 2006 20:11:08 +0100
+
+ejabberd (1.1.2-2) unstable; urgency=medium
+
+  [ Sergei Golovan ]
+  * backported bugfix for HTTP-polling from the ejabberd author
+
+  [ Torsten Werner ]
+  * Set urgency to medium.
+
+ -- Torsten Werner <twerner@debian.org>  Sun,  8 Oct 2006 11:32:25 +0200
+
+ejabberd (1.1.2-1) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * new upstream release
+  * added spanish translation
+  * removed no longer needed mod_muc_log patch 
+  * added variable ERLANG_NODE, which allows to override default
+    ejabberd node, to /etc/default/ejabberd file
+  * changed erlang node selection by ejabberdctl (in some cases
+    `hostname -s` and erlang's view of hostname are different, so
+    let ejabberd_ctl module find hostname), closes: #389635
+  * documented ERLANG_NODE variable in ejabberd and ejabberdctl manual
+    pages
+  * explicitly specify hostname in admin ACL
+  * improved admin user registering in debian/postinst. installation
+    is not interrupted if the user can't be registered, so, closes: #385020
+  * only call ucf and deluser on purge when they are available,
+    closes: #389756
+  * added check for running ejabberd before backup in debian/prerm,
+    closes: #389757
+  * added workaround for centericq users (replaced fetaure-not-implemented
+    error for service-unavailable in session management)
+  * backported bugfix for shapers from ejabberd SVN
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 04 Oct 2006 08:00:46 +0400
+
+ejabberd (1.1.1-9) unstable; urgency=low
+
+  [ Miroslav Kure ]
+  * updated czech translation
+
+  [ Sergei Golovan ]
+  * replaced 'note' type in debconf template ejabberd/nomatch by 'error'
+    since it is more approppriate, closes: #388890
+
+ -- Torsten Werner <twerner@debian.org>  Sat, 23 Sep 2006 10:42:03 +0400
+
+ejabberd (1.1.1-8) unstable; urgency=medium
+
+  [ Sergei Golovan ]
+  * security fix! fixed vulnerability in mod_muc_log where users were
+    able to insert an HTML code to MUC weblogs (fix is backported from
+    ejabberd SVN)
+  * added LSB keyword section to init.d script
+
+  [ Torsten Werner ]
+  * setting urgency to medium because of a securetty issue
+
+ -- Torsten Werner <twerner@debian.org>  Thu, 14 Sep 2006 07:20:39 +0200
+
+ejabberd (1.1.1-7) unstable; urgency=low
+
+  * updated french translation, closes: #385811
+  * bugfix in postrm
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 10 Sep 2006 02:27:19 +0200
+
+ejabberd (1.1.1-6) unstable; urgency=low
+
+  * add french translation, closes: #381900
+  * add czech translation, closes: #380525
+  * add dutch translation, closes: #381131
+  * updated debconf question ejabberd/user
+  * fix in debian/config
+  * make a backup of the database when removing or updating the package
+  * remove the actual database when purging
+
+ -- Torsten Werner <twerner@debian.org>  Wed,  2 Aug 2006 15:20:14 +0200
+
+ejabberd (1.1.1-5) unstable; urgency=low
+
+  [ Torsten Werner ]
+  * add target get-orig-source in debian/rules
+  * updated Standards-Version to 3.7.2, no changes needed
+  * use ucf for handling conffiles
+  * remove old cruft not needed any more
+  * use debconf to setup an admin account, partially fixes: #286110
+  * make bashism explicit
+  * minor cleanups in debian/rules
+  * renamed some files in debian/
+  * add german translation of the debconf template
+
+  [ Sergei Golovan ]
+  * use debconf to setup a served hostname
+  * added russian translation of the debconf template
+
+ -- Torsten Werner <twerner@debian.org>  Sun, 23 Jul 2006 12:12:12 +0400
+
+ejabberd (1.1.1-4) unstable; urgency=low
+
+  * updated Build-Depends for erlang 10.b.10
+  * switched to quilt for managing upstream patches
+
+ -- Torsten Werner <twerner@debian.org>  Sat, 24 Jun 2006 21:06:59 +0200
+
+ejabberd (1.1.1-3) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * moved ejabberd SSL certificate from /etc/ssl/certs to /etc/ejabberd,
+    closes: #368414
+
+  [ Torsten Werner ]
+  * upload to unstable
+
+ -- Torsten Werner <twerner@debian.org>  Sat, 10 Jun 2006 18:13:34 +0200
+
+ejabberd (1.1.1-2) experimental; urgency=low
+
+  [ Sergei Golovan ]
+  * changed Build-Depends from erlang-base-hipe to erlang-base
+  * fix for lintian complaint about incorrect usage of chown
+
+  [ Torsten Werner ]
+  * making Build-Depends and erlang:Depends more strict: they are working now
+    only with the latest versions of erlang
+
+ -- Torsten Werner <twerner@debian.org>  Tue,  2 May 2006 21:00:47 +0200
+
+ejabberd (1.1.1-1) experimental; urgency=low
+
+  * New upstream release
+  * applied changes from Sergei Golovan
+  * removed src/Makefile.in from Debians SVN because the changes have been
+    included upstream
+
+ -- Torsten Werner <twerner@debian.org>  Mon,  1 May 2006 19:36:19 +0200
+
+ejabberd (1.0.0-2) unstable; urgency=low
+
+  * downgraded erlang-Depends to erlang-runtime, closes: #361739
+
+ -- Torsten Werner <twerner@debian.org>  Mon, 10 Apr 2006 20:52:45 +0200
+
+ejabberd (1.0.0-1) unstable; urgency=low
+
+  * new upstream release, closes: #344330, #353989
+    - Server-to-server Encryption for Enhanced Security: STARTTLS +
+    SASL_EXTERNAL and STARTTLS + Dialback.
+    - Different certificates can be defined for each virtual host.
+    - Shared Roster groups support has been enhanced. New is the ability to
+    add all registered users to a Shared Roster group.
+    - Improved ODBC support.
+    - Support for vCard storage in ODBC has been added.
+    - New tool to convert an Mnesia-based installation to an ODBC compatible
+    relational database.
+    - Native PostgreSQL support.
+    - More XHTML 1.0 Transitional compliancy work is included.
+    - Documentation has been extended to cover more topics.
+
+ -- Torsten Werner <twerner@debian.org>  Sun,  5 Mar 2006 10:20:50 +0100
+
+ejabberd (0.9.8-1) unstable; urgency=low
+
+  * new upstream version
+  * added debian/watch
+  * merged some documentation and configuration fixes from Sergei Golovan
+    <sgolovan@nes.ru>
+
+ -- Torsten Werner <twerner@debian.org>  Sat,  6 Aug 2005 19:39:59 +0200
+
+ejabberd (0.9.1-2) unstable; urgency=low
+
+  * some fixes to the german translation, thanks to Patrick Dreker
+    <pdreker@debianforum.de> for pointing that out, closes: #317955
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 13 Jul 2005 21:53:16 +0200
+
+ejabberd (0.9.1-1) unstable; urgency=low
+
+  * New upstream release, closes: #309526
+  * added --enable-odbc to configure
+  * small fix to init script
+  * thanks to Sergei Golovan <sgolovan@nes.ru> for helping
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 25 May 2005 23:55:28 +0200
+
+ejabberd (0.9-2) unstable; urgency=low
+
+  * smoothed the upgrade procedure from 0.7.5
+  * added custom inetrc file (erlang R10 doesn't load /etc/resolv.conf when
+    running in -sname mode, making resolving of SRV record impossible),
+    thanks to Sergej Golovan, closes: #299533
+  * updated homepage
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 18 May 2005 00:16:22 +0200
+
+ejabberd (0.9-1) unstable; urgency=low
+
+  * new upstream version, closes: #307652
+
+ -- Torsten Werner <twerner@debian.org>  Tue, 10 May 2005 22:04:03 +0200
+
+ejabberd (0.7.5-7) unstable; urgency=low
+
+  * can build now with various erlang versions because of buggy erlang on arm
+
+ -- Torsten Werner <twerner@debian.org>  Sat,  8 Jan 2005 23:34:27 +0100
+
+ejabberd (0.7.5-6) unstable; urgency=low
+
+  * changed to versioned (Build-)Depends: erlang (>= 1:10), closes: #282836
+  * fixed error in init script, closes: #283205
+  * scripts ejabberd and ejabberdctl export $HOME environment variable now
+  * usage message for ejabberdctl updated to reflect the different call syntax
+    thanks to Sergei Golovan (both changes)
+  * updated the Description proposed by Andreas van Cranenburgh
+
+ -- Torsten Werner <twerner@debian.org>  Tue, 30 Nov 2004 22:05:28 +0100
+
+ejabberd (0.7.5-5) unstable; urgency=low
+
+  * renamed debian/control to debian/control.in and changed Build-Depends:
+    @cdbs@
+
+ -- Torsten Werner <twerner@debian.org>  Fri, 19 Nov 2004 23:58:01 +0100
+
+ejabberd (0.7.5-4) unstable; urgency=low
+
+  * switched to cdbs
+  * fixed perl script and added Suggests: libunix-syslog-perl
+
+ -- Torsten Werner <twerner@debian.org>  Thu, 18 Nov 2004 15:48:36 +0100
+
+ejabberd (0.7.5-3) unstable; urgency=low
+
+  * changed maintainer to myself
+
+ -- Torsten Werner <twerner@debian.org>  Wed, 17 Nov 2004 19:23:08 +0100
+
+ejabberd (0.7.5-2) unstable; urgency=low
+
+  * fixed doc-base file
+  * initial upload based on Sergei's work
+
+ -- Torsten Werner <twerner@debian.org>  Wed,  3 Nov 2004 21:43:58 +0100
+
+ejabberd (0.7.5-1) unstable; urgency=low
+
+  * new upstream release (highlights: new tls module, starttls,
+    improvements in admiin web interface, bugfixes)
+  * improved init.d script
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Sun, 10 Oct 2004 21:44:25 +0400
+
+ejabberd (0.7-2) unstable; urgency=low
+
+  * workaround for mnesia issue in mod_last
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Wed, 14 Jul 2004 01:43:13 +0400
+
+ejabberd (0.7-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Tue, 13 Jul 2004 20:35:29 +0400
+
+ejabberd (0.6-alpha-20040522-4) unstable; urgency=low
+
+  * fixed icq.localhost entry in config file
+  * added example options to config file
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Thu, 17 Jun 2004 00:23:32 +0400
+
+ejabberd (0.6-alpha-20040522-3) unstable; urgency=low
+
+  * fixed comments in config file
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Wed, 16 Jun 2004 21:10:13 +0400
+
+ejabberd (0.6-alpha-20040522-2) unstable; urgency=low
+
+  * added comments to config file
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Sun, 13 Jun 2004 13:24:58 +0400
+
+ejabberd (0.6-alpha-20040522-1) unstable; urgency=low
+
+  * new upstream CVS snapshot
+  * updated manual pade for ejabberdctl
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Sun, 30 May 2004 09:36:59 +0400
+
+ejabberd (0.6-alpha-20040417-1) unstable; urgency=low
+
+  * initial prerelease from upstream CVS snapshot
+
+ -- Sergei Golovan <sgolovan@nes.ru>  Sun, 25 Apr 2004 16:39:22 +0400
+
--- ejabberd-2.0.5.orig/debian/rules
+++ ejabberd-2.0.5/debian/rules
@@ -0,0 +1,46 @@
+#!/usr/bin/make -f
+
+#DEB_AUTO_UPDATE_DEBIAN_CONTROL := true
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+export HOME := $(CURDIR)/debian
+DEB_BUILDDIR := $(shell pwd)/src
+DEB_CONFIGURE_SCRIPT := $(DEB_BUILDDIR)/configure
+DEB_CONFIGURE_EXTRA_FLAGS := --enable-odbc --enable-pam
+# Not sure if we should enable workaround for gateway subscription
+# Adding it breaks XMPP compatibility
+# Not adding breaks roster import for some gateways (specifically JIT)
+#DEB_CONFIGURE_EXTRA_FLAGS := --enable-odbc --enable-roster-gateway-workaround
+
+DEB_INSTALL_DOCS_ALL :=
+
+EJABBERDIR := /usr/lib/ejabberd
+DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(DEB_DESTDIR) \
+	EJABBERDDIR=$(DEB_DESTDIR)$(EJABBERDIR)           \
+	ETCDIR=$(DEB_DESTDIR)/etc/ejabberd                \
+	LOGDIR=$(DEB_DESTDIR)/var/log/ejabberd
+
+CFLAGS := -I `ls -d /usr/lib/erlang/erts-*`/include/
+
+# declares a minimal versioned erlang Depends:
+install/ejabberd::
+	$(RM) $(DEB_DESTDIR)/etc/ejabberd/ejabberd.cfg
+	$(RM) $(DEB_DESTDIR)/etc/ejabberd/ejabberdctl.cfg
+	install -d $(DEB_DESTDIR)$(EJABBERDIR)/include
+	install -m 644 src/*.hrl $(DEB_DESTDIR)$(EJABBERDIR)/include
+	for f in src/*/*.hrl ; do \
+	    install -D -m 644 $$f $(DEB_DESTDIR)$(EJABBERDIR)/include/$$(basename $$(dirname $$f))/$$(basename $$f) ; \
+	done
+	rm -f $(DEB_DESTDIR)$(EJABBERDIR)/include/eldap/ELDAPv3.hrl
+	rm -f $(DEB_DESTDIR)$(EJABBERDIR)/include/XmppAddr.hrl
+	rmdir $(DEB_DESTDIR)$(EJABBERDIR)/db
+	erlang-depends
+
+get-orig-source:
+	dh_testdir
+	wget -O ../ejabberd_$(DEB_UPSTREAM_VERSION).orig.tar.gz \
+		http://www.process-one.net/en/projects/ejabberd/download/$(DEB_UPSTREAM_VERSION)/ejabberd-$(DEB_UPSTREAM_VERSION).tar.gz
+
--- ejabberd-2.0.5.orig/debian/docs
+++ ejabberd-2.0.5/debian/docs
@@ -0,0 +1,4 @@
+doc/*.html
+doc/*.png
+doc/*.txt
+
--- ejabberd-2.0.5.orig/debian/ejabberd.cfg
+++ ejabberd-2.0.5/debian/ejabberd.cfg
@@ -0,0 +1,515 @@
+%%%
+%%%     Debian ejabberd configuration file
+%%%     This config must be in UTF-8 encoding
+%%%
+%%% The parameters used in this configuration file are explained in more detail
+%%% in the ejabberd Installation and Operation Guide.
+%%% Please consult the Guide in case of doubts, it is available at
+%%% /usr/share/doc/ejabberd/guide.html
+
+%%%   ===================================
+%%%   OVERRIDE OPTIONS STORED IN DATABASE
+
+%%
+%% Override global options (shared by all ejabberd nodes in a cluster).
+%%
+%%override_global.
+
+%%
+%% Override local options (specific for this particular ejabberd node).
+%%
+%%override_local.
+
+%%
+%% Remove the Access Control Lists before new ones are added.
+%%
+%%override_acls.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Options which are set by Debconf and managed by ucf
+
+%% Admin user
+{acl, admin, {user, "__USER__", "__HOSTNAME__"}}.
+
+%% Hostname
+{hosts, ["__HOSTNAME__"]}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% This configuration file contains Erlang terms.
+%%% In case you want to understand the syntax, here are the concepts:
+%%%
+%%%  - The character to comment a line is %
+%%%
+%%%  - Each term ends in a dot, for example:
+%%%      override_global.
+%%%
+%%%  - A tuple has a fixed definition, its elements are
+%%%    enclosed in {}, and separated with commas:
+%%%      {loglevel, 4}.
+%%%
+%%%  - A list can have as many elements as you want,
+%%%    and is enclosed in [], for example:
+%%%      [http_poll, web_admin, tls]
+%%%
+%%%  - A keyword of ejabberd is a word in lowercase.
+%%%    The strings are enclosed in "" and can have spaces, dots...
+%%%      {language, "en"}.
+%%%      {ldap_rootdn, "dc=example,dc=com"}.
+%%%
+%%%  - This term includes a tuple, a keyword, a list and two strings:
+%%%      {hosts, ["jabber.example.net", "im.example.com"]}.
+%%%
+
+
+%%%   =========
+%%%   DEBUGGING
+
+%%
+%% loglevel: Verbosity of log files generated by ejabberd.
+%% 0: No ejabberd log at all (not recommended)
+%% 1: Critical
+%% 2: Error
+%% 3: Warning
+%% 4: Info
+%% 5: Debug
+%%
+{loglevel, 4}.
+
+%%
+%% watchdog_admins: If an ejabberd process consumes too much memory,
+%% send live notifications to those Jabber accounts.
+%%
+%%{watchdog_admins, ["bob@example.com"]}.
+
+
+%%%   ================
+%%%   SERVED HOSTNAMES
+
+%%
+%% hosts: Domains served by ejabberd.
+%% You can define one or several, for example:
+%% {hosts, ["example.net", "example.com", "example.org"]}.
+%%
+%% (This option is defined by debconf earlier)
+%% {hosts, ["localhost"]}.
+
+%%
+%% route_subdomains: Delegate subdomains to other Jabber server.
+%% For example, if this ejabberd serves example.org and you want
+%% to allow communication with a Jabber server called im.example.org.
+%%
+%%{route_subdomains, s2s}.
+
+
+%%%   ===============
+%%%   LISTENING PORTS
+
+%%
+%% listen: Which ports will ejabberd listen, which service handles it
+%% and what options to start it with.
+%%
+{listen,
+ [
+  {5222, ejabberd_c2s, [
+			{access, c2s},
+			{shaper, c2s_shaper},
+			{max_stanza_size, 65536},
+			starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
+		       ]},
+
+  %%
+  %% To enable the old SSL connection method (deprecated) in port 5223:
+  %%
+  %%{5223, ejabberd_c2s, [
+  %%			{access, c2s},
+  %%			{shaper, c2s_shaper},
+  %%			{max_stanza_size, 65536},
+  %%			tls, {certfile, "/etc/ejabberd/ejabberd.pem"}
+  %%		       ]},
+
+  {5269, ejabberd_s2s_in, [
+			   {shaper, s2s_shaper},
+			   {max_stanza_size, 131072}
+			  ]},
+
+  %% External MUC jabber-muc (but internal mod_muc is better :))
+  %%{5554, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {host, "muc.localhost", [{password, "secret"}]}
+  %%			    ]},
+
+  %% Jabber ICQ Transport
+  %%{5555, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {hosts, ["icq.localhost", "sms.localhost"],
+  %%				       [{password, "secret"}]}
+  %%			    ]},
+
+  %% AIM Transport
+  %%{5556, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {host, "aim.localhost", [{password, "secret"}]}
+  %%			    ]},
+
+  %% MSN Transport
+  %%{5557, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {host, "msn.localhost", [{password, "secret"}]}
+  %%			    ]},
+
+  %% Yahoo! Transport
+  %%{5558, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {host, "yahoo.localhost", [{password, "secret"}]}
+  %%			    ]},
+
+  %% External JUD (internal is more powerful,
+  %% but doesn't allow to register users from other servers)
+  %%{5559, ejabberd_service, [
+  %%			    {ip, {127, 0, 0, 1}},
+  %%			    {access, all},
+  %%			    {shaper_rule, fast},
+  %%			    {host, "jud.localhost", [{password, "secret"}]}
+  %%			    ]},
+
+  {5280, ejabberd_http, [
+			 http_poll,
+			 web_admin
+			]}
+
+ ]}.
+
+%%
+%% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
+%% Allowed values are: true or false.
+%% You must specify a certificate file.
+%%
+{s2s_use_starttls, true}.
+
+%%
+%% s2s_certfile: Specify a certificate file.
+%%
+{s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
+
+%%
+%% domain_certfile: Specify a different certificate for each served hostname.
+%%
+%%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
+%%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
+
+%%
+%% S2S whitelist or blacklist
+%%
+%% Default s2s policy for undefined hosts.
+%%
+%%{s2s_default_policy, allow}.
+
+%%
+%% Allow or deny communication with specific servers.
+%%
+%%{{s2s_host, "goodhost.org"}, allow}.
+%%{{s2s_host, "badhost.org"}, deny}.
+
+
+%%%   ==============
+%%%   AUTHENTICATION
+
+%%
+%% auth_method: Method used to authenticate the users.
+%% The default method is the internal.
+%% If you want to use a different method,
+%% comment this line and enable the correct ones.
+%%
+{auth_method, internal}.
+
+%%
+%% Authentication using external script
+%% Make sure the script is executable by ejabberd.
+%%
+%%{auth_method, external}.
+%%{extauth_program, "/path/to/authentication/script"}.
+
+%%
+%% Authentication using ODBC
+%% Remember to setup a database in the next section.
+%%
+%%{auth_method, odbc}.
+
+%%
+%% Authentication using PAM
+%%
+%%{auth_method, pam}.
+%%{pam_service, "pamservicename"}.
+
+%%
+%% Authentication using LDAP
+%%
+%%{auth_method, ldap}.
+%%
+%% List of LDAP servers:
+%%{ldap_servers, ["localhost"]}.
+%%
+%% Encryption of connection to LDAP servers (LDAPS):
+%%{ldap_encrypt, tls}.
+%%
+%% Port connect to LDAP server:
+%%{ldap_port, 636}.
+%%
+%% LDAP manager:
+%%{ldap_rootdn, "dc=example,dc=com"}.
+%%
+%% Password to LDAP manager:
+%%{ldap_password, "******"}.
+%%
+%% Search base of LDAP directory:
+%%{ldap_base, "dc=example,dc=com"}.
+%%
+%% LDAP attribute that holds user ID:
+%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
+%%
+%% LDAP filter:
+%%{ldap_filter, "(objectClass=shadowAccount)"}.
+
+%%
+%% Anonymous login support:
+%%   auth_method: anonymous
+%%   anonymous_protocol: sasl_anon | login_anon | both
+%%   allow_multiple_connections: true | false
+%%
+%%{host_config, "public.example.org", [{auth_method, anonymous},
+%%                                     {allow_multiple_connections, false},
+%%                                     {anonymous_protocol, sasl_anon}]}.
+%%
+%% To use both anonymous and internal authentication:
+%%
+%%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
+
+
+%%%   ==============
+%%%   DATABASE SETUP
+
+%% ejabberd uses by default the internal Mnesia database,
+%% so you can avoid this section.
+%% This section provides configuration examples in case
+%% you want to use other database backends.
+%% Please consult the ejabberd Guide for details about database creation.
+
+%%
+%% MySQL server:
+%%
+%%{odbc_server, {mysql, "server", "database", "username", "password"}}.
+%%
+%% If you want to specify the port:
+%%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
+
+%%
+%% PostgreSQL server:
+%%
+%%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
+%%
+%% If you want to specify the port:
+%%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
+%%
+%% If you use PostgreSQL, have a large database, and need a
+%% faster but inexact replacement for "select count(*) from users"
+%%
+%%{pgsql_users_number_estimate, true}.
+
+%%
+%% ODBC compatible or MSSQL server:
+%%
+%%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
+
+%%
+%% Number of connections to open to the database for each virtual host
+%%
+%%{odbc_pool_size, 10}.
+
+%%
+%% Interval to make a dummy SQL request to keep alive the connections
+%% to the database. Specify in seconds: for example 28800 means 8 hours
+%%
+%%{odbc_keepalive_interval, undefined}.
+
+
+%%%   ===============
+%%%   TRAFFIC SHAPERS
+
+%%
+%% The "normal" shaper limits traffic speed to 1.000 B/s
+%%
+{shaper, normal, {maxrate, 1000}}.
+
+%%
+%% The "fast" shaper limits traffic speed to 50.000 B/s
+%%
+{shaper, fast, {maxrate, 50000}}.
+
+
+%%%   ====================
+%%%   ACCESS CONTROL LISTS
+
+%%
+%% The 'admin' ACL grants administrative privileges to Jabber accounts.
+%% You can put as many accounts as you want.
+%%
+%%{acl, admin, {user, "aleksey", "localhost"}}.
+%%{acl, admin, {user, "ermine", "example.org"}}.
+
+%%
+%% Blocked users
+%%
+%%{acl, blocked, {user, "baduser", "example.org"}}.
+%%{acl, blocked, {user, "test"}}.
+
+%%
+%% Local users: don't modify this line.
+%%
+{acl, local, {user_regexp, ""}}.
+
+%%
+%% More examples of ACLs
+%%
+%%{acl, jabberorg, {server, "jabber.org"}}.
+%%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
+%%{acl, test, {user_regexp, "^test"}}.
+%%{acl, test, {user_glob, "test*"}}.
+
+
+%%%   ============
+%%%   ACCESS RULES
+
+%% Define the maximum number of time a single user is allowed to connect:
+{access, max_user_sessions, [{10, all}]}.
+
+%% This rule allows access only for local users:
+{access, local, [{allow, local}]}.
+
+%% Only non-blocked users can use c2s connections:
+{access, c2s, [{deny, blocked},
+	       {allow, all}]}.
+
+%% For all users except admins used "normal" shaper
+{access, c2s_shaper, [{none, admin},
+		      {normal, all}]}.
+
+%% For all S2S connections used "fast" shaper
+{access, s2s_shaper, [{fast, all}]}.
+
+%% Only admins can send announcement messages:
+{access, announce, [{allow, admin}]}.
+
+%% Only admins can use configuration interface:
+{access, configure, [{allow, admin}]}.
+
+%% Admins of this server are also admins of MUC service:
+{access, muc_admin, [{allow, admin}]}.
+
+%% All users are allowed to use MUC service:
+{access, muc, [{allow, all}]}.
+
+%% No username can be registered via in-band registration:
+%% To enable in-band registration, replace 'deny' with 'allow'
+% (note that if you remove mod_register from modules list then users will not
+% be able to change their password as well as register).
+% This setting is default because it's more safe.
+{access, register, [{deny, all}]}.
+
+%% Everybody can create pubsub nodes
+{access, pubsub_createnode, [{allow, all}]}.
+
+
+%%%   ================
+%%%   DEFAULT LANGUAGE
+
+%%
+%% language: Default language used for server messages.
+%%
+{language, "en"}.
+
+
+%%%   =======
+%%%   MODULES
+
+%%
+%% Modules enabled in all ejabberd virtual hosts.
+%%
+{modules,
+ [
+  {mod_adhoc,    []},
+  {mod_announce, [{access, announce}]}, % requires mod_adhoc
+  {mod_caps,     []},
+  {mod_configure,[]}, % requires mod_adhoc
+  {mod_ctlextra, []},
+  {mod_disco,    []},
+  %%{mod_echo,   [{host, "echo.localhost"}]},
+  {mod_irc,      []},
+  {mod_last,     []},
+  {mod_muc,      [
+		  %%{host, "conference.@HOST@"},
+		  {access, muc},
+		  {access_create, muc},
+		  {access_persistent, muc},
+		  {access_admin, muc_admin},
+		  {max_users, 500}
+		 ]},
+  %%{mod_muc_log,[]},
+  {mod_offline,  []},
+  {mod_privacy,  []},
+  {mod_private,  []},
+  {mod_proxy65,  [
+		  {access, local},
+		  {shaper, c2s_shaper}
+		 ]},
+  {mod_pubsub,   [ % requires mod_caps
+		  {access_createnode, pubsub_createnode},
+		  {plugins, ["default", "pep"]}
+		 ]},
+  {mod_register, [
+		  %%
+		  %% After successful registration, the user receives
+		  %% a message with this subject and body.
+		  %%
+		  {welcome_message, {"Welcome!",
+				     "Welcome to a Jabber service powered by Debian. "
+				     "For information about Jabber visit "
+				     "http://www.jabber.org"}},
+		  %% Replace it with 'none' if you don't want to send such message:
+		  %%{welcome_message, none},
+
+		  %%
+		  %% When a user registers, send a notification to
+		  %% these Jabber accounts.
+		  %%
+		  %%{registration_watchers, ["admin1@example.org"]},
+
+		  {access, register}
+		 ]},
+  {mod_roster,   []},
+  %%{mod_service_log,[]},
+  %%{mod_shared_roster,[]},
+  {mod_stats,    []},
+  {mod_time,     []},
+  {mod_vcard,    []},
+  {mod_version,  []}
+ ]}.
+
+
+%%% $Id: ejabberd.cfg.example 1178 2008-02-08 18:28:36Z badlop $
+
+%%% Local Variables:
+%%% mode: erlang
+%%% End:
+%%% vim: set filetype=erlang tabstop=8:
--- ejabberd-2.0.5.orig/debian/manpages
+++ ejabberd-2.0.5/debian/manpages
@@ -0,0 +1,3 @@
+debian/ejabberd.8
+debian/ejabberdctl.8
+
--- ejabberd-2.0.5.orig/debian/ejabberdctl.8
+++ ejabberd-2.0.5/debian/ejabberdctl.8
@@ -0,0 +1,365 @@
+.TH ejabberdctl 8 "08 June 2008" "Version 2.0.1" "ejabberdctl manual page"
+
+.SH NAME
+ejabberdctl \(em a control interface of ejabberd Jabber/XMPP server
+
+.SH SYNOPSIS
+.PP 
+\fBejabberdctl\fR \fI[\-\-node node] [vhost server] command [options]\fP
+
+.SH DESCRIPTION
+.PP 
+\fBejabberdctl\fR  is a front end to the ejabberd Jabber/XMPP server.
+It is designed to help the administrator control the functioning of the
+running \fBejabberd\fR daemon.
+
+.SH OPTIONS
+.TP
+.BI \-\-node " node"
+Specifies remote Erlang node to connect to. Default value is
+\fIejabberd\fP.
+If the node name does not contain symbol \fI@\fP
+then actual node name becomes \fInode@host\fP where \fIhost\fP is short
+hostname (usually it coincides with \fI\(gahostname \-s\(ga\fP). If the node name
+contain symbol \fI@\fR and its hostname part is a FQDN then \fBejabberd\fR
+will use so-called long names (see \fBerl\fR(1) manual page and look for
+options \fI\-name\fP and \fI\-sname\fP for details).
+
+Examples of \fI\-\-node\fP option:
+
+.BI ejabberd
+Connect to locally run ejabberd server at node \fIejabberd@\(gahostname \-s\(ga\fP.
+
+.BI ejabberd@otherhost
+Connect to remotely run ejabberd server at node \fIejabberd@otherhost\fP.
+
+.BI ejabberd@localhost
+Connect to locally run ejabberd server at node \fIejabberd@localhost\fP.
+
+ejabberdctl honors ERLANG_NODE environment variable from /etc/default/ejabberd,
+see below.
+
+.TP
+.BI vhost " server"
+Specifies that \fIcommand\fP should be executed for virtual host \fIserver\fP.
+There are only few commands that require \fIvhost\fP argument.
+
+.PP
+If there are no \fIvhost server\fP options then the \fIcommand\fP can be any
+of the following:
+.TP
+.BI debug
+Attaches an interactive Erlang shell to a running ejabberd server. To detach it
+press Ctrl+G, q, <Return>.
+.TP
+.BI status
+Requests status of the Erlang virtual machine where ejabberd server is running.
+.TP
+.BI stop
+Stops the ejabberd server and Erlang virtual machine.
+.TP
+.BI restart
+Restarts the ejabberd server inside Erlang virtual machine. Note that if you want
+to change VM options (enable/disable kernel poll or SMP, increase number of ports
+or database tables) you have to stop ejabberd completely and then start it again.
+.TP
+.BI reopen\-log
+Force the ejabberd server to reopen its log
+file (\fI/var/log/ejabberd/ejabberd.log\fP by default).
+.TP
+.BI reopen\-weblog
+If module mod_http_fileserver is loaded then force the ejabberd server to reopen
+its weblog file.
+.TP
+.BI register " user server password"
+Register user \fIuser\fP with password \fIpassword\fP at ejabberd virtual
+host \fIserver\fP.
+.TP
+.BI unregister " user server"
+Unregister user \fIuser\fP at ejabberd virtual host \fIserver\fP.
+.TP
+.BI backup " filepath"
+Backup user database of the ejabberd server to file \fIfilepath\fP.
+.TP
+.BI restore " filepath"
+Restore user database of the ejabberd server from backup file \fIfilepath\fP.
+.TP
+.BI install\-fallback " filepath"
+Install a backup to \fIfilepath\fP as fallback. The fallback will be
+used to restore the database at the next start-up.
+.TP
+.BI dump " filepath"
+Dump user database of the ejabberd server to text file \fIfilepath\fP.
+.TP
+.BI load " filepath"
+Restore user database of the ejabberd server from text file \fIfilepath\fP.
+.TP
+.BI import\-file " filepath"
+Import user data from jabberd 1.4 spool file \fIfilepath\fP. For example, if
+\fIfilepath\fP is \fI.../example.org/user.xml\fP then imported username will be
+\fIuser\fP and it will be imported to virtual server \fIexample.org\fP.
+.TP
+.BI import\-dir " directorypath"
+Import user data from jabberd 1.4 spool directory \fIdirectorypath\fP. Directory
+name should be the name of virtual server to import users.
+.TP
+.BI delete\-expired\-messages
+Delete expired offline messages from ejabberd database.
+.TP
+.BI delete\-old\-messages " n"
+Delete offline messages older than \fIn\fP days from ejabberd database.
+.TP
+.BI mnesia info
+Show some information about the Mnesia system (see \fBmnesia\fP(3), function
+\fIinfo\fP).
+.TP
+.BI mnesia
+Show all information about the Mnesia system, such as transaction statistics,
+db_nodes, and configuration parameters (see \fBmnesia\fP(3), function
+system_info).
+.TP
+.BI mnesia " key"
+Show information about the Mnesia system according to \fIkey\fP specified
+(see \fBmnesia\fP(3), function system_info for valid \fIkey\fP values).
+.TP
+.BI incoming\-s2s\-number
+Print number of incoming server-to-server connections to the node.
+.TP
+.BI outgoing\-s2s\-number
+Print number of outgoing server-to-server connections from the node.
+.TP
+.BI user\-resources " user server"
+List all connected resources of user \fIuser@server\fP.
+.TP
+.BI connected\-users\-number
+Report number of established users' sessions.
+.TP
+.BI connected\-users
+List all established users' sessions.
+
+.PP
+If there are \fIvhost server\fP options then the \fIcommand\fP can be
+the following:
+.TP
+.BI registered\-users
+List all registered at the ejabberd server users (at virtual host \fIserver\fP).
+
+.SH EXTRA OPTIONS
+.PP
+An optional module \fBmod_ctlextra\fP adds a number of other commands.
+.PP
+To enable the additional commands add it to \fB{modules}\fP
+section of ejabberd config file and make it looking as the following:
+.sp
+.nf
+{modules,
+ [
+  ...
+  {mod_ctlextra, []},
+  ...
+ ]}.
+.fi
+.PP
+The new options are:
+
+.TP
+.BI compile " file"
+Compile Erlang source file \fIfile\fP.
+.TP
+.BI load\-config " file"
+Load config from \fIfile\fP. Note that loading config to a database doesn't mean
+reloading server. For example it's impossible to add/remove virtual hosts
+without server restart.
+.TP
+.BI remove\-node " nodename"
+Remove an ejabberd node \fInodename\fP from the Mnesia database cluster.
+.TP
+.BI delete\-older\-users " days"
+Delete users that have not logged in the last \fIdays\fP.
+.TP
+.BI set\-password " user server password"
+Set password for user \fIuser@server\fP to \fIpassword\fP.
+.TP
+.BI export2odbc " server outputdir"
+Export Mnesia tables on \fIserver\fP to files in \fIoutputdir\fP directory
+for subsequent import to a relational database system.
+.TP
+.BI delete\-older\-messages " days"
+Delete offline messages older than \fIdays\fP.
+.TP
+.BI srg\-create " group host name description display"
+Create shared roster group \fIgroup\fP at server \fIhost\fP with displayed name
+\fIname\fP, description \fIdescription\fP and displayed groups \fIdisplay\fP.
+.TP
+.BI srg\-delete " group host"
+Delete shared roster group \fIgroup\fP from server \fIhost\fP.
+.TP
+.BI srg\-user\-add " user server group host"
+Add user \fIuser@server\fP to group \fIgroup\fP at server \fIhost\fP.
+.TP
+.BI srg\-user\-del " user server group host"
+Delete user \fIuser@server\fP from group \fIgroup\fP at server \fIhost\fP.
+.TP
+.BI srg\-list\-groups " host"
+List the shared roster groups at server \fIhost\fP.
+.TP
+.BI srg\-get\-info " group host"
+Get info on the group \fIgroup\fP at server \fIhost\fP.
+.TP
+.BI vcard\-get " user host data [data2]"
+Get data from the vCard of \fIuser@host\fP. \fIdata\fP (and optional \fIdata2\fP)
+is a vCard node. For example \fIdata\fP may be \fBFN\fP or \fBNICKNAME\fP.
+For retrieving email address use \fBEMAIL USERID\fP. Other options can be obtained
+from XEP-0054 (http://www.xmpp.org/extensions/xep\-0054.html).
+.TP
+.BI vcard\-set " user host data [data2] content"
+Set data to content for \fIuser@host\fP vCard. \fIdata\fP (and optional \fIdata2\fP)
+has the same meaning as for \fBvcard\-get\fP command.
+\" .TP
+\" .BI muc\-purge " days"
+\" Destroy MUC rooms with zero activity (no messages in history) in the last
+\" \fIdays\fP days.
+\" .TP
+\" .BI muc\-online\-rooms
+\" Print the list of existing MUC rooms.
+.TP
+.BI add\-rosteritem " user1 server1 user2 server2 nick group subs"
+Add \fIuser2@server2\fP to \fIuser1@server1\fP's roster.
+Option \fIsubs\fP must be one of the \fInone\fP, \fIfrom\fP, or \fIboth\fP.
+.TP
+.BI rem\-rosteritem " user1 server1 user2 server2"
+Remove \fIuser2@server2\fP from \fIuser1@server1\fP's roster. 
+.TP
+.BI rosteritem\-purge " [options]"
+Purge all roster items that match filtering options.
+.TP
+.BI pushroster " file user server"
+Push template roster in file \fIfile\fP to \fIuser@server\fP. The file contents
+must use the following format:
+.sp
+.nf
+[{"bob", "example.org", "Bob's group", "Bob's nickname"},
+ {"mart", "example.org", "workers", "Mart"},
+ {"Rich", "example.org", "bosses", "Rich"}].
+.fi
+.TP
+.BI pushroster\-all " file"
+Push template roster in file to all users listed in the file \fIfile\fP itself.
+The file contents must be in the same format as for \fBpushroster\fP command.
+.TP
+.BI push\-alltoall " server group"
+Adds all the users at server \fIserver\fP to each other's roster using group \fIgroup\fP.
+.TP
+.BI status\-list " status"
+Print the list of currently logged users with status \fIstatus\fP. Status can be either
+\fBall\fP or one of the following: \fBavailable\fP, \fBchat\fP, \fBaway\fP, \fBxa\fP,
+\fBdnd\fP.
+.TP
+.BI status\-num " status"
+Print the number of currently logged users with status \fIstatus\fP. Status can be either
+\fBall\fP or one of the following: \fBavailable\fP, \fBchat\fP, \fBaway\fP, \fBxa\fP,
+\fBdnd\fP.
+.TP
+.BI "stats registeredusers"
+Print the number of currently registered users.
+.TP
+.BI "stats onlineusers"
+Print the number of currently logged users.
+.TP
+.BI "stats onlineusersnode"
+Print the number of currently logged users in the ejabberd node.
+.TP
+.BI "stats uptime\-seconds"
+Print the uptime of ejabberd node in seconds.
+.TP
+.BI get\-cookie
+Get the Erlang cookie of this node.
+.TP
+.BI killsession " user server resource"
+Kill user \fIuser@server/resource\fP session.
+
+.PP
+If there are \fIvhost server\fP options then the \fIcommand\fP can be
+one of the following:
+.TP
+.BI num\-active\-users " days"
+Print number of users active in the last \fIdays\fP days (at virtual host \fIserver\fP).
+.TP
+.BI status\-list " status"
+Print the list of currently logged to virtual host \fIserver\fP users with
+status \fIstatus\fP. Status can be either
+\fBall\fP or one of the following: \fBavailable\fP, \fBchat\fP, \fBaway\fP, \fBxa\fP,
+\fBdnd\fP.
+.TP
+.BI status\-num " status"
+Print the number of currently logged to virtual host \fIserver\fP users with
+status \fIstatus\fP. Status can be either
+\fBall\fP or one of the following: \fBavailable\fP, \fBchat\fP, \fBaway\fP, \fBxa\fP,
+\fBdnd\fP.
+.TP
+.BI "stats registeredusers"
+Print number of registered users (at virtual host \fIserver\fP).
+.TP
+.BI "stats onlineusers"
+Print number of logged users (at virtual host \fIserver\fP).
+.TP
+.BI ban\-account " username [reason]"
+Ban account: kick sessions and change password (at virtual host \fIserver\fP).
+
+.SH
+.PP
+ejabberdctl starts distributed Erlang node \fIejabberddebug\fP (if run with
+\fBdebug\fP option) or \fIejabberdctl\fP (if run with any other options).
+If the ejabberd server's node name to connect to includes FDQN as a hostname
+Erlang option \fI\-name\fP is used. Otherwise ejabberdctl uses short names
+(\fI\-sname\fP option).
+
+.PP
+Note that ejabberdctl does not append hostname to its own node name leaving
+this to Erlang emulator. It usually follows \fI\(gahostname \-f\(ga\fP to
+find a hostname if long names are used or \fI\(gahostname \-s\(ga\fP in case
+of short names, but may fail in case of unusual networking settings. A known
+case of failure is using long names when \fI\(gahostname \-f\(ga\fP doesn't
+return FDQN. If ejabberdctl cannot create Erlang node then it cannot control
+ejabberd server.
+
+.SH OPTIONS FILE
+.PP 
+The file \fB/etc/default/ejabberd\fR contains specific options. One of them
+is used by \fBejabberdctl\fP.
+
+.PD 0
+.I ERLANG_NODE
+Use specified string as Erlang node of \fBejabberd\fP server to connect. It
+overrides default \fBejabberd\fP node name. The string may take one of the
+following forms: \fBnodename\fP, \fBnodename@hostname\fP or
+\fBnodename@hostname.domainname\fP.
+
+.SH FILES
+.PD 0
+.I /etc/default/ejabberd
+default variables
+
+.SH SEE ALSO 
+.PP 
+\fBerl\fR(1), \fBejabberd\fR(8), \fBmnesia\fR(3).
+
+.PP 
+The program documentation is available at
+\fIhttp://www.process\-one.net/en/projects/ejabberd/\fP. 
+A copy of the documentation can be found at
+/usr/share/doc/ejabberd/guide.html.
+ 
+.SH AUTHORS
+.PP 
+This manual page was adapted by Sergei Golovan <sgolovan@nes.ru> for 
+the \fBDebian\fP system (but may be used by others) from the
+\fBejabberd\fP documentation written by Alexey Shchepin <alexey@sevcom.net>.
+
+Permission is granted to copy, distribute and/or modify this document under 
+the terms of the GNU General Public License, Version 2 any  
+later version published by the Free Software Foundation. 
+.PP 
+On Debian systems, the complete text of the GNU General Public 
+License can be found in /usr/share/common\-licenses/GPL. 
+
--- ejabberd-2.0.5.orig/debian/templates
+++ ejabberd-2.0.5/debian/templates
@@ -0,0 +1,34 @@
+Template: ejabberd/hostname
+Type: string
+Default: localhost
+_Description: The name of the host ejabberd will serve:
+ Please enter the hostname of your Jabber server (in lowercase).
+
+Template: ejabberd/user
+Type: string
+_Description: The username of an admin account for ejabberd:
+ Please provide the name of an account to administrate the ejabberd server.
+ After the installation of ejabberd you can use this account to log in with any
+ Jabber client to do administrative tasks or go to
+ http://${hostname}:5280/admin/ and log in with this account to enter the admin
+ interface. Enter the username part here (e.g. ${user}), but use the full Jabber
+ ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; otherwise it
+ will fail.
+ .
+ Leave empty if you don't want to create an admin account automatically.
+
+Template: ejabberd/password
+Type: password
+_Description: The password for the admin account:
+ Please enter the password for the administrative user.
+
+Template: ejabberd/verify
+Type: password
+_Description: The password for the admin account again for verification:
+ Please reenter the password for the administrative user for verification.
+
+Template: ejabberd/nomatch
+Type: error
+_Description: The passwords do not match!
+ The passwords you have typed do not match. Please try again.
+
--- ejabberd-2.0.5.orig/debian/logrotate
+++ ejabberd-2.0.5/debian/logrotate
@@ -0,0 +1,13 @@
+/var/log/ejabberd/ejabberd.log {
+	weekly
+	missingok
+	rotate 12
+	size 1M
+	compress
+	delaycompress
+	ifempty
+	create 640 ejabberd adm
+	postrotate
+		/usr/sbin/ejabberdctl reopen-log > /dev/null
+	endscript
+}
--- ejabberd-2.0.5.orig/debian/dirs
+++ ejabberd-2.0.5/debian/dirs
@@ -0,0 +1,2 @@
+var/lib/ejabberd
+var/log/ejabberd
--- ejabberd-2.0.5.orig/debian/ejabberd.8
+++ ejabberd-2.0.5/debian/ejabberd.8
@@ -0,0 +1,243 @@
+.TH ejabberd 8 "08 June 2008" "Version 2.0.1" "ejabberd manual page"
+
+.SH NAME
+ejabberd \(em a distributed fault-tolerant Jabber/XMPP server 
+
+.SH SYNOPSIS
+.PP 
+\fBejabberd\fR \fI[options] [\-\-] [erlang_options]\fP
+
+.SH DESCRIPTION
+.PP 
+\fBejabberd\fR is a distributed fault-tolerant Jabber/XMPP server written in
+Erlang. 
+
+Its main features are:
+.PD 0
+.TP
+\(em XMPP-compliant 
+.TP
+\(em Distributed: \fBejabberd\fR can run on a cluster of machines
+.TP
+\(em Fault-tolerant: All the information can be stored on more than one node, nodes can be added or replaced `on the fly' 
+.TP
+\(em Built-in Multi-User Chat service 
+.TP
+\(em Built-in IRC transport 
+.TP
+\(em Built-in Publish-Subscribe service 
+.TP
+\(em Built-in Jabber User Directory service based on users vCards 
+.TP
+\(em SSL support 
+.TP
+\(em Support for internationalized user messages
+
+.SH OPTIONS
+.TP
+.BI \-\-node " node"
+Specifies Erlang \fInode\fP at which ejabberd server will be run. Default
+node is \fBejabberd\fP.
+If the node name does not contain symbol \fI@\fR then actual node name
+becomes \fBnode@hostname\fP where hostname is short host name (usually it
+coincides with \fI\(gahostname \-s\(ga\fP). If the node name contain symbol \fI@\fR
+and its hostname part is a FQDN then \fBejabberd\fR will use so-called
+long names (see \fBerl\fR(1) manual page and look for options \fI\-name\fP
+and \fI\-sname\fP for details).
+
+Examples of \fI\-\-node\fP option:
+
+.BI ejabberd
+Locally run ejabberd server at node \fIejabberd@\(gahostname \-s\(ga\fP.
+
+.BI ejabberd@otherhost
+Pretend that ejabberd server runs at otherhost at node \fIejabberd@otherhost\fP.
+(Note that noone can remotely connect to this node if otherhost is resoved
+to other computer IP.)
+
+.BI ejabberd@localhost
+Locally run ejabberd server at node \fIejabberd@localhost\fP. Only nodes
+running at the same host can connect to this node.
+
+.BI ejabberd@hostname.domainname
+Using \fI\-name\fP Erlang option, run ejabberd server at long-name node
+\fIejabberd@hostname.domainname\fP. To be able to control this server instance
+\fIhostname.domainname\fP must resolve (either by DNS or via /etc/hosts) to
+the server's IP.
+
+.PP
+The default node can be overridden by defining ERLANG_NODE environment variable
+in /etc/default/ejabberd, see below.
+
+.TP
+.BI \-\-config " config\-file"
+Specifies an alternate \fIconfig\-file\fP to be parsed at startup, rather
+than the default (\fB/etc/ejabberd/ejabberd.cfg\fP).
+
+.TP
+.BI \-\-spool " spool\-dir"
+Specifies an alternate \fIspool\-dir\fP to store user database instead of
+the default (\fB/var/lib/ejabberd\fP).
+
+.TP
+.BI \-\-log " log\-file"
+Log Jabber events to specified \fIlog\-file\fP rather than to the default
+(\fB/var/log/ejabberd/ejabberd.log\fP).
+
+.TP
+.BI \-\-sasl\-log " sasl\-log\-file"
+Log SASL (System Application Support Libraries) events to specified
+\fIsasl\-log\-file\fP rather than to the default (\fB/var/log/ejabberd/sasl.log\fP).
+
+.TP
+.I erlang_options
+Other options (and all options following \fB\-\-\fR) are passed directly to
+\fBErlang\fR interpreter. See \fBErlang\fR documentation for more details on
+interpreter options.
+Some useful options are:
+.br
+.sp
+.BI \-detached
+    Starts the Erlang system detached from the system console.
+.br
+.BI \-heart
+    Starts heart beat monitoring of the Erlang system.
+.br
+.BI \-noinput
+    Ensures that the Erlang system never tries to read any input.
+
+.SH CONFIGURATION FILE
+.PP 
+The file \fB/etc/ejabberd/ejabberd.cfg\fR contains the main configuration.
+It is initially loaded the first time \fBejabberd\fR is
+executed, then it is parsed and stored in a database. Subsiquently the
+configuration is loaded from the database and any commands in the configuration
+file are appended to the entries in the database. The configuration file
+consists of a sequence of Erlang terms. Parts of lines after `%' sign
+are ignored. Each term is a tuple, where the first element is the name of an
+option, and the others are option values. E. g. if this file does not contain a
+"host" definition, then the value stored in the database will be used.
+
+To override old values stored in the database the following lines can be added
+in config:
+.br
+  override_global.
+.br
+  override_local.
+.br
+  override_acls.
+
+A complete explanation of each configuration value can be found in the
+official \fBejabberd\fR documentation. See "\fBSEE ALSO\fR" part of this
+manual page for more information about the documentation.
+
+.SH OPTIONS FILE
+.PP 
+The file \fB/etc/default/ejabberd\fR contains specific options.
+
+.PD 0
+.TP
+.I POLL
+If set to true this variable enables kernel polling which can reduce CPU
+load on a system with a high number of users.
+This option requires support in the kernel and in Erlang emulator.
+
+.TP
+.I SMP
+Enables or disables SMP support in Erlang emulator. Valid values are disable
+(default), auto, and enable.
+.br
+.sp
+Explanation in Erlang/OTP documentation:
+
+.BI enable:
+Starts the Erlang runtime system with SMP support enabled. This
+may fail if no runtime system with SMP support is available.
+.br
+.BI auto:
+Starts the Erlang runtime system with SMP support enabled if it
+is available and more than one logical processor are detected.
+.br
+.BI disable:
+Starts a runtime system without SMP support.
+
+.TP
+.I ERL_MAX_PORTS
+To use more than 1024 connections (default value), \fIERL_MAX_PORTS\fP should be set
+to the number of connections needed.
+
+.TP
+.I PROCESSES
+Specifies the maximum number of Erlang processes to use. Default value is 250000.
+Maximum value is 268435456. Ejabberd uses up to three processes per user or
+server connection.
+
+.TP
+.I ERL_MAX_ETS_TABLES
+Sets the maximum number of ETS and Mnesia tables. Default value is 1400 which
+should be sufficient for a sever without many custom modules. If a message
+** Too many db tables ** appears in ejabberd log files then increase this number.
+
+.TP
+.I ERL_OPTIONS
+With this option, parameters can be passed to \fBErlang\fR interpretor. See
+\fBErlang\fR documentation for more details on interpreter options.
+
+.TP
+.I ERL_FULLSWEEP_AFTER
+To reduce memory usage when allowing a large number of connections, \fIERL_FULLSWEEP_AFTER\fP
+may be set to 0 in the options file,
+but in this case \fBejabberd\fR may start to work slower.
+
+.TP
+.I ERLANG_NODE
+Use specified string as erlang node. It overrides default \fBejabberd\fP
+node name. The string may take one of the following forms:
+\fBnodename\fP, \fBnodename@hostname\fP or \fBnodename@hostname.domainname\fP
+
+.SH FILES
+.PD 0
+.TP
+.I /etc/ejabberd/ejabberd.cfg
+default configuration file
+
+.TP
+.I /etc/default/ejabberd
+default variables
+
+.SH BUGS
+.PP
+Ejabberd uses distributed Erlang mode to work properly. This means that on start it
+connects to \fBepmd\fP (Erlang port mapping daemon) which is listening at port 4369
+and tries to register ejabberd node name. If the connection fails (known failure
+reasons are unavailability of a loopback interface or firewall issues) Erlang emulator
+fails to start with not very clear error message. If there's already started Erlang
+node with the same name (\fIejabberd\fP by default) then ejabberd will also fail with
+a cryptic error message (in which one can find words \fI{error,duplicate_name}\fP).
+Another possible case when ejabberd cannot start is incorrect permissions of
+\fI/var/lib/ejabberd\fP directory (it must be writable by user ejabberd).
+
+.SH SEE ALSO 
+.PP 
+\fBerl\fR(1), \fBsasl\fR(6), \fBejabberdctl\fR(8), \fBepmd\fR. 
+
+.PP 
+The program documentation is available at
+\fIhttp://www.process\-one.net/en/projects/ejabberd/\fP. 
+A copy of the documentation can be found at
+/usr/share/doc/ejabberd/guide.html.
+ 
+.SH AUTHORS
+.PP 
+This manual page was adapted by Christophe Romain
+<christophe.romain@process\-one.net> and Sergei Golovan <sgolovan@nes.ru> for
+the \fBDebian\fP system (but may be used by others) from the \fBejabberd\fP
+documentation written by Alexey Shchepin <alexey@sevcom.net>.
+
+Permission is granted to copy, distribute and/or modify this document under 
+the terms of the GNU General Public License, Version 2 any  
+later version published by the Free Software Foundation. 
+.PP 
+On Debian systems, the complete text of the GNU General Public 
+License can be found in /usr/share/common\-licenses/GPL. 
+
--- ejabberd-2.0.5.orig/debian/config
+++ ejabberd-2.0.5/debian/config
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+
+get_passwd()
+{
+  db_input medium ejabberd/password || true
+  db_input medium ejabberd/verify || true
+  db_go || true
+  db_get ejabberd/password
+  PASSWORD="$RET"
+  db_get ejabberd/verify
+  VERIFY="$RET"
+  if [ "$PASSWORD" != "$VERIFY" ]; then
+    db_input medium ejabberd/nomatch || true
+    db_go || true
+    get_passwd
+  fi
+}
+
+get_credentials()
+{
+  db_get ejabberd/user
+  USER=${RET:-admin}
+  db_subst ejabberd/user user "$USER"
+  db_get ejabberd/hostname
+  HOST=${RET:-hostname}
+  db_subst ejabberd/user hostname "$HOST"
+  db_input medium ejabberd/user || true
+  db_go || true
+  db_get ejabberd/user
+  if [ -n "$RET" ]; then
+    get_passwd
+  fi
+}
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+db_input medium ejabberd/hostname || true
+db_go || true
+
+FLAG="/var/lib/ejabberd/.admin_registered"
+if [ ! -f $FLAG ]; then
+  get_credentials
+fi
+
+exit 0
+
--- ejabberd-2.0.5.orig/debian/watch
+++ ejabberd-2.0.5/debian/watch
@@ -0,0 +1,5 @@
+version=3
+
+http://www.process-one.net/en/ejabberd/archive/ \
+   /downloads/ejabberd/[\d.]+/ejabberd-([\d.]+)[_\d]*.tar.gz
+
--- ejabberd-2.0.5.orig/debian/install
+++ ejabberd-2.0.5/debian/install
@@ -0,0 +1,5 @@
+debian/scripts/ejabberd usr/sbin/
+debian/scripts/ejabberdctl usr/sbin/
+debian/ejabberd.cfg usr/share/ejabberd/
+debian/inetrc etc/ejabberd/
+
--- ejabberd-2.0.5.orig/debian/copyright
+++ ejabberd-2.0.5/debian/copyright
@@ -0,0 +1,21 @@
+This package was debianized by Sergei Golovan <sgolovan@nes.ru> on
+Sun, 25 Apr 2004 16:39:22 +0400.
+
+Original source has been downloaded from
+  http://www.process-one.net/en/projects/ejabberd/download.html
+
+Upstream Author: Alexey Shchepin <alexey@sevcom.net>
+
+This software is Copyright (c) 2002-2005 Alexey Shchepin
+
+You are free to distribute this software under the terms of
+the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in the file `/usr/share/common-licenses/GPL'.
+
+As a special exception, the author gives permission to link this program
+with the OpenSSL library and distribute the resulting binary.
+
--- ejabberd-2.0.5.orig/debian/doc-base
+++ ejabberd-2.0.5/debian/doc-base
@@ -0,0 +1,9 @@
+Document: ejabberd
+Title: Debian ejabberd Manual
+Author: Alexey Shchepin <alexey@sevcom.net>
+Abstract: User manual for ejabberd - Erlang Jabber server.
+Section: Network/Communication
+
+Format: HTML
+Index: /usr/share/doc/ejabberd/guide.html
+Files: /usr/share/doc/ejabberd/*.html
--- ejabberd-2.0.5.orig/debian/README.Debian
+++ ejabberd-2.0.5/debian/README.Debian
@@ -0,0 +1,85 @@
+The package always makes a backup of the ejabberd database if it's running
+when it is upgraded or removed. The backup files are stored in
+/var/backups/ejabberd-<timestamp>.* directory.
+
+
+The package installs ejabberd Erlang headers into /usr/lib/ejabberd/include
+directory. To build a module using these headers, as usual include them using
+    -include_lib("ejabberd/include/headername.hrl").
+and compile the module using -pa option to add ejabberd path to a search list
+    erlc -pa /usr/lib/ejabberd/ebin module.erl
+
+Alternatively, include headers as
+    -include("headername.hrl").
+and add option -I /usr/lib/ejabberd/include to erlc command line.
+
+
+The ejabberd daemon which is run in init.d script is owned by user ejabberd,
+so it cannot bind to privileged ports (below 1024). The error message in
+/var/log/ejabberd/ejabberd.log looks similar to the following:
+
+E(<0.242.0>:ejabberd_listener:80):
+                 Failed to open socket for {443,
+                                            ejabberd_c2s,
+                                            [{access,c2s},
+                                             {max_stanza_size,
+                                                 65536},
+                                             starttls,
+                                             {certfile,
+                                                 "/etc/ejabberd/ejabberd.pem"},
+                                             {shaper,
+                                                 c2s_shaper}]}: eacces
+
+If you want ejabberd to listen for example port 443 you could redirect it to
+port 5222 (the default XMPP port) by a firewall rule. For example:
+
+iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 5222
+
+
+The ejabberd daemon uses Erlang database Mnesia. Even if it's configured for
+using ODBC it uses Mnesia for some data (privacy lists et.) and runtime tasks
+(keeping routing table etc.). Mnesia is a multi-master database, and it tightly
+bounds to a hostname where it's working. Therefore, if you change computer
+hostname then ejabberd will stop working.
+
+If you don't have a current database backup then run ejabberd (attached to the
+terminal, otherwise you'll not be able to backup database and quit) by
+
+/usr/sbin/ejabberd --node ejabberd@oldhostname
+
+and in the Erlang shell prompt call
+
+(ejabberd@oldhostname)1> mnesia:backup("/tmp/ejabberd_at_oldhostname.backup").
+
+(note the trailing fullstop). Then stop ejabberd by typing
+
+(ejabberd@oldhostname)1> q().
+
+Now you have the latest Mnesia database backup.
+
+After that run a new Erlang shell by
+
+erl -pa /usr/lib/ejabberd/ebin
+
+and convert the backup file to a new hostname:
+
+1> mnesia_convert:change_node_name('ejabberd@oldhostname',
+				   'ejabberd@newhostname',
+				   "/tmp/ejabberd_at_oldhostname.backup",
+				   "/tmp/ejabberd_at_newhostname.backup").
+
+2> q().
+
+Then use file /tmp/ejabberd_at_newhostname.backup to restore ejabberd database
+as it is described in ejabberdctl manual page.
+
+
+You can add extra options to the erl command line like
+
+  -pa /usr/local/lib/ejabberd/ebin
+
+by adding them to ERL_OPTIONS in /etc/default/ejabberd.
+
+
+Torsten Werner <twerner@debian.org>,
+Sergei Golovan <sgolovan@debian.org>      Fri, 15 Feb 2008 10:23:59 +0300
--- ejabberd-2.0.5.orig/debian/examples
+++ ejabberd-2.0.5/debian/examples
@@ -0,0 +1,3 @@
+src/ejabberd.cfg.example
+examples/*
+src/odbc/*.sql
--- ejabberd-2.0.5.orig/debian/po/POTFILES.in
+++ ejabberd-2.0.5/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
--- ejabberd-2.0.5.orig/debian/po/gl.po
+++ ejabberd-2.0.5/debian/po/gl.po
@@ -0,0 +1,100 @@
+# Galician translation of ejabberd's debconf templates
+# This file is distributed under the same license as the ejabberd package.
+# Jacobo Tarrio <jtarrio@debian.org>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-14 20:27+0100\n"
+"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
+"Language-Team: Galician <proxecto@trasno.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "O nome do servidor de ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Introduza o nome do servidor Jabber (en minúsculas)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "O usuario dunha conta administrativa para ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Introduza o nome dunha conta para administrar o servidor ejabberd. Trala "
+"instalación de ejabberd pode empregar esta conta para se conectar con "
+"calquera cliente Jabber para realizar tarefas administrativas ou pode "
+"conectarse a http://${hostname}:5280/admin/ e identifíquese con esta conta "
+"para entrar na interface de administración. Introduza aquí a parte do nome "
+"de usuario (por exemplo, ${user}), pero empregue o ID de Jabber completo "
+"(por exemplo, ${user}@${hostname}) para se identificar na interface web de "
+"ejabberd; se non o fai así, a identificación ha fallar."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Déixeo en branco se non quere crear unha conta de administrador "
+"automaticamente."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "O contrasinal para a conta do administrador:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Introduza o contrasinal do usuario administrativo."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "O contrasinal do administrador outra vez para verificalo:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Volva introducir o contrasinal do usuario administrativo para verificalo."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Os contrasinais non coinciden"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Os contrasinais que introduciu non son iguais. Volva tentalo."
--- ejabberd-2.0.5.orig/debian/po/cs.po
+++ ejabberd-2.0.5/debian/po/cs.po
@@ -0,0 +1,101 @@
+# Czech translation of ejabberd debconf messages
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the ejabberd package.
+# Miroslav Kure <kurem@debian.cz>, 2006, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-26 18:50+0200\n"
+"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
+"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Jméno počítače, na kterém bude ejabberd sloužit:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr ""
+"Zadejte prosím jméno počítače vašeho jabberového serveru (malými písmeny)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Jméno administrátorského účtu pro ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Zadejte prosím jméno účtu, který bude spravovat ejabberd server. Po "
+"instalaci serveru ejabberd se můžete pomocí tohoto účtu přihlásit z "
+"libovolného jabberového klienta a vzdáleně tak provádět správcovské úkony. "
+"Jinou možností je webové rozhraní na http://${hostname}:5280/admin/, kde se "
+"s tímto účtem (např. „${user}@${hostname}“) taktéž můžete přihlásit do "
+"správcovského rozhraní. (Zde zadejte pouze uživatelskou část (např. ${user}), "
+"ale pro přihlášení do webového rozhraní používejte kompletní ID včetně jména "
+"serveru.)"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Jestliže nechcete automaticky vytvořit správcovský účet, ponechte prázdné."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Heslo správcovského účtu:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Zadejte prosím heslo uživatele se správcovskými oprávněními."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Ověření hesla správcovského účtu:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Pro ověření prosím zopakujte heslo uživatele se správcovskými oprávněními."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Hesla nesouhlasí!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Zadaná hesla nesouhlasí. Zkuste to prosím znovu."
--- ejabberd-2.0.5.orig/debian/po/pt_BR.po
+++ ejabberd-2.0.5/debian/po/pt_BR.po
@@ -0,0 +1,104 @@
+# ejabberd Brazilian Portuguese translation
+# Copyright (C) 2007 ejabberd's PACKAGE COPYRIGHT HOLDER
+# This file is distributed under the same license as the ejabberd package.
+# Alex de Oliveira Silva <enerv@host.sk>, 2007.
+# Felipe Augusto van de Wiel (faw) <faw@debian.org, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd_1.1.2-9\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-10-10 00:10-0300\n"
+"Last-Translator: Felipe Augusto van de Wiel (faw) <faw@debian.org>\n"
+"Language-Team: Brazilian Portuguese <debian-l10n-portuguese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"pt_BR utf-8\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "O nome da máquina na qual o ejabberd será servidor:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr ""
+"Por favor, informe o nome da máquina do seu servidor Jabber (em letras "
+"minúsculas)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "O nome de usuário de uma conta administrativa para o ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Por favor, forneça o nome de uma conta para administrar o servidor ejabberd. "
+"Depois da instalação do ejabberd você pode usar esta conta para logar em "
+"qualquer cliente Jabber para realizar tarefas administrativas ou acesse "
+"http://${hostname}:5280/admin/ e efetue o login com esta conta para entrar "
+"na interface administrativa. Informe aqui a parte do nome de usuário (e.g. "
+"${user}), mas use um ID Jabber completo (e.g. ${user}@${hostname}) para "
+"efetuar login na interface web do ejabberd; caso contrário não funcionará."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Deixe vazio se você não quer criar automaticamente uma conta administrativa."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "A senha para a conta administrativa:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Por favor, informe a senha para o usuário administrativo."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "A senha para a conta administrativa, novamente, para verificação:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Por favor, informe novamente a senha do usuário administrativo para "
+"verificação."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "As senhas não conferem!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "As senhas que você digitou não conferem. Por favor, tente novamente."
--- ejabberd-2.0.5.orig/debian/po/fr.po
+++ ejabberd-2.0.5/debian/po/fr.po
@@ -0,0 +1,104 @@
+# Translation of ejabberd debconf templates to French
+# Copyright (C) 2008 Florentin Duneau <fduneau@gmail.com>
+# This file is distributed under the same license as the ejabberd package.
+#
+#
+# Florentin Duneau <f.baced@wanadoo.fr>, 2006.
+# Florentin Duneau <fduneau@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-03-01 13:47+0100\n"
+"Last-Translator: Florentin Duneau <fduneau@gmail.com>\n"
+"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Nom d'hôte du serveur ejabberd :"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Veuillez indiquer le nom d'hôte (en minuscule) du serveur Jabber."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Identifiant du compte administrateur d'ejabberd :"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Veuillez indiquer un identifiant afin d'administrer le serveur ejabberd. "
+"Après l'installation, vous pourrez utilisez cette identité pour vous "
+"connecter avec tout client Jabber ou l'interface d'administration sur http://"
+"${hostname}:5280/admin/ pour réaliser des tâches administratives. Veuillez "
+"seulement entrer ici l'identifiant (par exemple, « ${user} »), cependant vous "
+"devrez utiliser une identité Jabber complète (par exemple, « ${user}@"
+"${hostname} ») pour vous connecter à l'interface web."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Veuillez laisser cette entrée vide si vous ne souhaitez pas créer de compte "
+"administrateur automatiquement."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Mot de passe du compte administrateur :"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Veuillez entrer le mot de passe de l'utilisateur administrateur."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Mot de passe du compte administrateur :"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Veuillez indiquer de nouveau le mot de passe de l'utilisateur administrateur "
+"pour vérification."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Mots de passe différents"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Les mots de passe saisis ne correspondent pas. Veuillez recommencer."
--- ejabberd-2.0.5.orig/debian/po/es.po
+++ ejabberd-2.0.5/debian/po/es.po
@@ -0,0 +1,113 @@
+# translation of ejabberd-debian-es.po to Spanish
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+#    Developers do not need to manually edit POT or PO files.
+#
+# Badlop <badlop@ono.com>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 2.0.1-2\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-14 13:57+0200\n"
+"Last-Translator: Badlop <badlop@ono.com>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Nombre del servidor Jabber que ejabberd servirá:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Por favor indica el nombre de tu servidor Jabber."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Cuenta de administrador en ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Por favor indica el nombre deseado para una cuenta de administrador en el "
+"servidor ejabberd. Después de la instalación de ejabberd podrás usar esta "
+"cuenta con un cliente Jabber y hacer tareas de administración, o entrar en "
+"la web de administración http://${hostname}:5280/admin/ Al poner los datos "
+"de administrador en esa web, recuerda introducir tu Jabber ID completo, por "
+"ejemplo '${user}@${hostname}'"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Dejar vacío si no deseas que se cree automáticamente una cuenta de "
+"administrador."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "La contraseña de la cuenta del administrador:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Por favor introduce la contraseña para la cuenta de administrador."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr ""
+"Introduce de nuevo la contraseña para la cuenta de administrador para "
+"verificación:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Por favor introduce de nuevo la contraseña de la cuenta de administrador "
+"para verificación."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "¡Las contraseñas no coinciden!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr ""
+"Las contraseñas que has tecleado no coinciden. Por favor inténtalo de nuevo."
--- ejabberd-2.0.5.orig/debian/po/nl.po
+++ ejabberd-2.0.5/debian/po/nl.po
@@ -0,0 +1,101 @@
+# translation of nl.po to
+# Czech translation of ejabberd debconf messages
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the ejabberd package.
+#
+# Sander Devrieze <s.devrieze@pandora.be>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: nl\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2006-08-02 17:34+0200\n"
+"Last-Translator: Sander Devrieze <s.devrieze@pandora.be>\n"
+"Language-Team:  <nl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.2\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Hostnaam die ejabberd moet aanbieden:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+#, fuzzy
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Voer de hostnaam van uw Jabber-server in."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+#, fuzzy
+msgid "The username of an admin account for ejabberd:"
+msgstr "Naam van een beheerdersaccount voor ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+#, fuzzy
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Geef de naam op voor een account om ejabberd te beheren. Na de installatie "
+"van ejabberd kunt u met deze account in elke Jabber-client beheerderstaken "
+"uitvoeren of kunt u naar http://${hostname}:5280/admin/ surfen om "
+"beheerderstaken uit te voeren. Let erop dat u de volledige Jabber ID (bv. "
+"'${user}@${hostname}') gebruikt om aan te melden; anders zal het niet lukken."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Voer niets in als u niet automatisch een beheerdersaccount wilt aanmaken."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Wachtwoord voor de beheerdersaccount:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Voer het wachtwoord in voor de beheerder."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Nogmaals het wachtwoord voor de beheerdersaccount ter controle:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr "Voer het wachtwoord voor de beheerder nogmaals in ter controle."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "De wachtwoorden komen niet overeen!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "De ingevoerde wachtwoorden komen niet overeen. Probeer opnieuw."
--- ejabberd-2.0.5.orig/debian/po/eu.po
+++ ejabberd-2.0.5/debian/po/eu.po
@@ -0,0 +1,98 @@
+# translation of eu.po to Euskara
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Aitor Ibañez  <aitiba@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-22 01:19+0200\n"
+"Last-Translator: Aitor Ibañez  <aitiba@gmail.com>\n"
+"Language-Team: Euskara <itzulpena@euskalgnu.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Ejabberd-ek zerbitzatuko duen ostalariaren izena:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Jabber zerbitzariaren ostalari izena sartu (letra xehez)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Ejabberd-en administrazio konturako erabiltzaile-izena:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Kontu-izen bat eman, haren bidez ejabberd zerbitzaria administratzeko. "
+"Ejabberd instalatu ostean, kontu hau erabil dezakezu edozein Jabber bezerotan "
+"edo http://${ostalari-izena}:5280/admin/ helbideko administrazio-interfazean "
+"saioa hasi eta administrazio lanak egiteko. Hemen erabiltzaile-izena soilik "
+"sartu (adib. ${erabiltzailea}), baina Jabber ID osoa erabili (e.g. "
+"${erabiltzailea}@${ostalari-izena}) ejabberd-en web interfazean sartzeko, "
+"bestela huts egingo du."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Bete gabe utzi administrazio kontua automatikoki sortzea nahi ez baduzu."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Pasahitza administrazio konturako:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Administratzaile erabiltzailearen pasahitza sartu."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Berriz sartu administrazio kontuko pasahitza, egiaztatzeko:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "Please reenter the password for the administrative user for verification."
+msgstr "Berriz sartu administratzaile erabiltzailearen pasahitza, egiaztatzeko."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Pasahitzak ez datoz bat!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Sartutako pasahitzak ez datoz bat. Mesedez, berriro saiatu."
+
--- ejabberd-2.0.5.orig/debian/po/vi.po
+++ ejabberd-2.0.5/debian/po/vi.po
@@ -0,0 +1,92 @@
+# Vietnamese translation for eJabberD.
+# Copyright © 2008 Free Software Foundation, Inc.
+# Clytie Siddall <clytie@riverland.net.au>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-16 17:20+0930\n"
+"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
+"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: LocFactoryEditor 1.7b3\n"
+
+#: ../templates:1001
+#. Type: string
+#. Description
+msgid "The name of the host ejabberd will serve:"
+msgstr "Tên máy của máy phục vụ Jabber:"
+
+#: ../templates:1001
+#. Type: string
+#. Description
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Hãy nhập (bằng chữ thường) tên của máy sẽ được ejabberd phục vụ. "
+
+#: ../templates:2001
+#. Type: string
+#. Description
+msgid "The username of an admin account for ejabberd:"
+msgstr "Tên đăng nhập của tài khoản quản trị cho ejabberd:"
+
+#: ../templates:2001
+#. Type: string
+#. Description
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr "Hãy cung cấp tên của một tài khoản sẽ quản trị máy phục vụ ejabberd. Sau khi cài đặt trình nền ejabberd, bạn có thể sử dụng tài khoản này để đăng nhập với bất cứ ứng dụng khách Jabber nào, để làm các công việc quản trị, hoặc thăm địa chỉ « http://"
+"${hostname}:5280/admin/ » và đăng nhập với tài khoản này để vào giao diện quản trị. Ở đây thì nhập chỉ phần tên người dùng (v.d. « ${user} »), nhưng hãy sử dụng Jabber ID hoàn toàn (v.d. « ${user}@${hostname} ») để đăng nhập vào giao diện Web của ejabberd; không thì không đăng nhập được."
+
+#: ../templates:2001
+#. Type: string
+#. Description
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Bỏ trống trường này nếu bạn không muốn tự động tạo một tài khoản quản trị."
+
+#: ../templates:3001
+#. Type: password
+#. Description
+msgid "The password for the admin account:"
+msgstr "Mật khẩu cho tài khoản quản trị:"
+
+#: ../templates:3001
+#. Type: password
+#. Description
+msgid "Please enter the password for the administrative user."
+msgstr "Hãy nhập mật khẩu của người dùng quản trị."
+
+#: ../templates:4001
+#. Type: password
+#. Description
+msgid "The password for the admin account again for verification:"
+msgstr "Nhập lại mật khẩu quản trị, để xác nhận:"
+
+#: ../templates:4001
+#. Type: password
+#. Description
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr "Hãy nhập lần nữa mật khẩu của người dùng quản trị, để xác nhận đây là mật khẩu đúng."
+
+#: ../templates:5001
+#. Type: error
+#. Description
+msgid "The passwords do not match!"
+msgstr "Hai mật khẩu không trùng nhau."
+
+#: ../templates:5001
+#. Type: error
+#. Description
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Bạn đã gõ hai mật khẩu khác nhau. Hãy thử lại."
--- ejabberd-2.0.5.orig/debian/po/pt.po
+++ ejabberd-2.0.5/debian/po/pt.po
@@ -0,0 +1,98 @@
+# Portuguese translation of ejabberd's debconf messages.
+# Copyright (C) 2007
+# This file is distributed under the same license as the ejabberd package.
+# Luísa Lourenço <kikentai@gmail.com>, 2007.
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd 1.1.2-6\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-06-24 11:21+0000\n"
+"PO-Revision-Date: 2007-03-28 13:03+0100\n"
+"Last-Translator: Luísa Lourenço <kikentai@gmail.com>\n"
+"Language-Team: Portuguese <traduz@debianpt.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "O nome da máquina que o ejabberd irá servir:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Por favor insira o nome da máquina do seu servidor de Jabber (em minúsculas)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "O nome de uma conta de admin para o ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Por favor forneça o nome de uma conta para administrar o servidor ejabberd. "
+"Depois da instalação do ejabberd pode usar esta conta para se ligar a "
+"qualquer cliente Jabber para efectuar tarefas administrativas ou ir a http://"
+"${hostname}:5280/admin/ e ligar com esta conta para entrar na interface de "
+"admin. Certifique-se que insere o Jabber ID completo (p.e. '${user}@"
+"${hostname}') para se ligar; caso contrário irá falhar."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Deixe em branco caso não queira criar uma conta admin automaticamente."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "A palavra chave para a conta de admin:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Por favor insira a palavra chave para o utilizador administrativo."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "De novo a palavra chave para a conta de admin para verificação:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+"Por favor re-insira a palavra chave para o utilizador administrativo para "
+"verificaçao."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "As palavras chave não coincidem!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "As palavras chave que inseriu não coincidem. Por favor tente de novo."
--- ejabberd-2.0.5.orig/debian/po/templates.pot
+++ ejabberd-2.0.5/debian/po/templates.pot
@@ -0,0 +1,91 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr ""
--- ejabberd-2.0.5.orig/debian/po/tr.po
+++ ejabberd-2.0.5/debian/po/tr.po
@@ -0,0 +1,85 @@
+# Turkish translation of ejabberd debconf template.
+# Copyright (C) 2008
+# This file is distributed under the same license as the ejabberd package.
+# Mert Dirik <mertdirik@gmail.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-20 00:41+0200\n"
+"Last-Translator: Mert Dirik <mertdirik@gmail.com>\n"
+"Language-Team: Debian L10n Turkish <debian-l10n-turkish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Poedit-Language: Turkish\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "ejabberd hizmeti verecek olan makinenin adı:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Lütfen Jabber sunucunuzun makine adını girin (küçük harflerle)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "ejabberd yönetici hesabının kullanıcı adı:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Please provide the name of an account to administrate the ejabberd server. After the installation of ejabberd you can use this account to log in with any Jabber client to do administrative tasks or go to http://${hostname}:5280/admin/ and log in with this account to enter the admin interface. Enter the username part here (e.g. ${user}), but use the full Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; otherwise it will fail."
+msgstr "Lütfen ejabberd sunucusunu yönetecek olan hesabın adını girin. Kurulum bittikten sonra yönetimsel görevleri yerine getirmek için herhangi bir Jabber istemcisini kullanarak bu hesapla oturum açabilir ya da http://${hostname}:5280/admin/ adresine gidip bu hesapla oturum açarak yönetim arayüzüne girebilirsiniz. Buraya kullanıcı adı kısmını girin (ör. ${user}), ama ejabberd web arayüzüne erişmek için tam Jabber kimliğini (ör. ${user}@${hostname}) kullanın, aksi takdirde oturum açamazsınız."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Yönetici hesabını otomatik olarak oluşturmak istemiyorsanız bu alanı boş bırakın."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Yönetici hesabının parolası:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Lütfen yönetimsel kullanıcı için bir parola girin."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Yönetici hesabının parolası, doğrulama için tekrardan:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "Please reenter the password for the administrative user for verification."
+msgstr "Lütfen yönetimsel kullanıcının parolasını doğrulama için tekrar girin."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Parolalar eşleşmedi!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Girdiğiniz parolalar eşleşmedi. Lütfen tekrar deneyin."
+
--- ejabberd-2.0.5.orig/debian/po/ru.po
+++ ejabberd-2.0.5/debian/po/ru.po
@@ -0,0 +1,113 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+
+# Sergei Golovan <sgolovan@nes.ru>, 2007.
+# Sergey Alyoshin <alyoshin.s@gmail.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 2.0.1-2\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-19 14:36+0400\n"
+"Last-Translator: Sergey Alyoshin <alyoshin.s@gmail.com>\n"
+"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
+"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Имя хоста, которое будет обслуживать ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Введите имя вашего Jabber-сервера (строчными буквами)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Имя учётной записи администратора ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Пожалуйста, введите имя учётной записи администратора сервера ejabberd. "
+"После установки ejabberd вы сможете подключаться к нему с помощью "
+"Jabber-клиента, используя эту учетную запись, и администрировать сервер. "
+"Также вы сможете использовать интерфейс администратора по адресу http://"
+"${hostname}:5280/admin/. Сейчас введите только имя (например, ${user}), "
+"а для последующего подключения используйте полный Jabber ID (например, "
+"'${user}@${hostname}'), иначе подключиться к интерфейсу администратора "
+"не удастся."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr ""
+"Оставьте поле пустым, если не хотите создавать учётную запись администратора "
+"автоматически."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Пароль учётной записи администратора:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Введите пароль администратора."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Повторный ввод пароля администратора для проверки:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr "Введите пароль администратора ещё раз для проверки."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Пароли не совпадают!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Введённые пароли не совпадают. Попробуйте ещё раз."
--- ejabberd-2.0.5.orig/debian/po/de.po
+++ ejabberd-2.0.5/debian/po/de.po
@@ -0,0 +1,99 @@
+# translation of po-debconf template to German
+# Copyright (C) 2006, Matthias Julius <twerner@debian.org>
+# Copyright (C) 2008 Helge Kreutzmann <debian@helgefjell.de>
+# This file is distributed under the same license as the ejabberd package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd 2.0.0-6\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-04-28 21:21+0200\n"
+"Last-Translator: Torsten Werner <twerner@debian.org>\n"
+"Language-Team: de <debian-l10n-german@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Der Name Ihres Ejabberd-Servers:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Geben Sie bitte (in Kleinbuchstaben) den Namen Ihres Jabberservers an."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Der Benutzername eines administrativen Kontos für Ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid ""
+"Please provide the name of an account to administrate the ejabberd server. "
+"After the installation of ejabberd you can use this account to log in with "
+"any Jabber client to do administrative tasks or go to http://"
+"${hostname}:5280/admin/ and log in with this account to enter the admin "
+"interface. Enter the username part here (e.g. ${user}), but use the full "
+"Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; "
+"otherwise it will fail."
+msgstr ""
+"Geben Sie bitte den Namen für ein Konto an, dass den Ejabberd-Server "
+"verwalten kann. Nach der Installation können Sie mit Hilfe dieses Kontos und "
+"eines beliebigen Jabber-Clients Verwaltungsaufgaben durchführen oder sich "
+"unter http://{hostname}:5280/admin/ an der Administratorschnittstelle "
+"anmelden. Geben Sie hier den Benutzernamen-Anteil ein (z.B. ${user}), "
+"verwenden Sie aber die komplette Jabber-ID (z.B. ${user}@${hostname}) um sich "
+"an der Ejabberd-Webschnittstelle anzumelden, da ansonsten die Anmeldung nicht "
+"funktionieren wird."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Lassen Sie das Feld leer, um kein privilegiertes Konto anzulegen."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Das Kennwort für das Administratorkonto:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Geben Sie das Kennwort für den Administrator an."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Wiederholen Sie das Passwort zur Vermeidung von Fehleingaben:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid ""
+"Please reenter the password for the administrative user for verification."
+msgstr "Bitte geben Sie noch einmal das Passwort ein."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Die Kennwörter waren nicht identisch!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr ""
+"Die Kennwörter waren nicht identisch, bitte versuchen Sie es noch einmal."
--- ejabberd-2.0.5.orig/debian/po/sv.po
+++ ejabberd-2.0.5/debian/po/sv.po
@@ -0,0 +1,83 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: twerner@debian.org\n"
+"POT-Creation-Date: 2008-02-15 10:37+0300\n"
+"PO-Revision-Date: 2008-07-13 18:03+0100\n"
+"Last-Translator: Martin Bagge <brother@bsnet.se>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Värdnamnet som ejabberd ska arbeta för:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Ange värdnamnet på din jabber-server (endast gemener)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "Användarnamnet för administratörskontot för ejabberd:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Please provide the name of an account to administrate the ejabberd server. After the installation of ejabberd you can use this account to log in with any Jabber client to do administrative tasks or go to http://${hostname}:5280/admin/ and log in with this account to enter the admin interface. Enter the username part here (e.g. ${user}), but use the full Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; otherwise it will fail."
+msgstr "Ange användarnamnet för ett administratörskonto för ejabberd-servern. Efter att installationen är klar kan du använda detta kontot för att logga in med en Jabber-klient för att utföra administrativa uppgifter, alternativt så kan du besöka http://${hostname}:5280/admin/ och logga in med kontot där för att komma åt administrationsgränssnittet. Ange användanamnet här (t.ex. ${user}), men kom ihåg att använda det fullständiga Jabber ID:t (t.ex. ${user}@${hostname}) för att logga in i ejabberd:s webbgränssnitt."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Lämna fältet tomt om du inte vill skapa ett administrationskonto automatiskt."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Lösenord för administrationskontot:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Ange lösenordet för administratörskontot."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Upprepa lösenordet för administratörskontot:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "Please reenter the password for the administrative user for verification."
+msgstr "För att kontrollera att du angivit rätt lösenord ska du upprepa det här."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Lösenorden var inte likadana!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Lösenorden du angav är inte likadana. Vänligen försök igen."
+
--- ejabberd-2.0.5.orig/debian/po/fi.po
+++ ejabberd-2.0.5/debian/po/fi.po
@@ -0,0 +1,79 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: ejabberd\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: 2008-07-21 08:41+0200\n"
+"Last-Translator: Esko Arajärvi <edu@iki.fi>\n"
+"Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Finnish\n"
+"X-Poedit-Country: FINLAND\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "The name of the host ejabberd will serve:"
+msgstr "Palvelin, jolla ejabberdia ajetaan:"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Please enter the hostname of your Jabber server (in lowercase)."
+msgstr "Anna Jabber-palvelimen verkkonimi (pienellä kirjoitettuna)."
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "The username of an admin account for ejabberd:"
+msgstr "ejabberdin ylläpitotunnus:"
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Please provide the name of an account to administrate the ejabberd server. After the installation of ejabberd you can use this account to log in with any Jabber client to do administrative tasks or go to http://${hostname}:5280/admin/ and log in with this account to enter the admin interface. Enter the username part here (e.g. ${user}), but use the full Jabber ID (e.g. ${user}@${hostname}) to log into ejabberd web interface; otherwise it will fail."
+msgstr "Anna tunnus, jota käytetään ejabberd-palvelimen ylläpitoon. Asennuksen jälkeen tällä tunnuksella voidaan tehdä ylläpitoon liittyviä tehtäviä käyttäen mitä tahansa Jabber-asiakasta. Sen avulla voidaan myös kirjautua osoitteessa http://${hostname}:5280/admin/ olevaan ylläpitokäyttöliittymään. Anna tässä vain käyttäjätunnus (esim. ${user}), mutta käytä ejabberdin verkkokäyttöliittymässä Jabber ID:tä kokonaisuudessaan (esim. ${user}@${hostname}). "
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Leave empty if you don't want to create an admin account automatically."
+msgstr "Jätä kenttä tyhjäksi, jos ylläpitotunnusta ei haluta luoda automaattisesti."
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "The password for the admin account:"
+msgstr "Ylläpitotunnuksen salasana:"
+
+#. Type: password
+#. Description
+#: ../templates:3001
+msgid "Please enter the password for the administrative user."
+msgstr "Anna salasana ylläpitotunnukselle."
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "The password for the admin account again for verification:"
+msgstr "Ylläpitotunnuksen salasana uudelleen:"
+
+#. Type: password
+#. Description
+#: ../templates:4001
+msgid "Please reenter the password for the administrative user for verification."
+msgstr "Anna ylläpitotunnuksen salasana uudelleen varmennuksena."
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords do not match!"
+msgstr "Salasanat eivät täsmää!"
+
+#. Type: error
+#. Description
+#: ../templates:5001
+msgid "The passwords you have typed do not match. Please try again."
+msgstr "Annetut salasanat eivät täsmää. Yritä uudelleen."
+
--- ejabberd-2.0.5.orig/debian/scripts/ejabberdctl
+++ ejabberd-2.0.5/debian/scripts/ejabberdctl
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+ERLANG_NODE=ejabberd
+
+if [ -f /etc/default/ejabberd ] ; then
+    . /etc/default/ejabberd
+fi
+
+if [ -r /var/lib/ejabberd/.erlang.cookie ] ; then
+    HOME=/var/lib/ejabberd
+    export HOME
+fi
+
+ERL=/usr/bin/erl
+EBIN_DIR=/usr/lib/ejabberd/ebin
+
+if [ $# -ne 0 ] ; then
+    case $1 in
+	--) shift; break ;;
+	--node) shift ; ERLANG_NODE=$1 ; shift ;;
+    esac
+fi
+
+if [ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] ; then
+    SNAME=-sname
+else
+    SNAME=-name
+fi
+
+SUFFIX=$(date +%s%N)
+
+case $1 in
+    debug)
+	shift
+
+	if [ "$ERLANG_NODE" = "${ERLANG_NODE%@*}" ] ; then
+	    ERLANG_NODE=$ERLANG_NODE@$(hostname -s)
+	fi
+
+	echo "Attaching Erlang shell to node $ERLANG_NODE."
+	echo "To detach it, press: Ctrl+G, q, Return"
+	echo ""
+	exec $ERL $SNAME ejabberddebug$SUFFIX \
+	    -remsh $ERLANG_NODE \
+	    "$@"
+    ;;
+    *)
+	exec $ERL $SNAME ejabberdctl$SUFFIX \
+	    -pa $EBIN_DIR \
+	    -s ejabberd_ctl \
+	    -noinput \
+	    -extra $ERLANG_NODE "$@"
+    ;;
+esac
--- ejabberd-2.0.5.orig/debian/scripts/ejabberd
+++ ejabberd-2.0.5/debian/scripts/ejabberd
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# define default configuration
+POLL=false
+SMP=disable
+PROCESSES=250000
+ERL_MAX_PORTS=32000
+ERL_MAX_ETS_TABLES=1400
+ERLANG_NODE=ejabberd
+
+if [ -f /etc/default/ejabberd ] ; then
+    . /etc/default/ejabberd
+fi
+
+ERLANG_OPTS="+K $POLL -smp $SMP +P $PROCESSES"
+
+if [ -r /var/lib/ejabberd/.erlang.cookie ] ; then
+    HOME=/var/lib/ejabberd
+    export HOME
+fi
+
+ERL=/usr/bin/erl
+EBIN_DIR=/usr/lib/ejabberd/ebin
+CONFIG=/etc/ejabberd/ejabberd.cfg
+INETRC=/etc/ejabberd/inetrc
+LOG=/var/log/ejabberd/ejabberd.log
+SASL_LOG=/var/log/ejabberd/sasl.log
+SPOOL=/var/lib/ejabberd
+ERL_CRASH_DUMP=/var/log/ejabberd/erl_crash.dump
+
+export ERL_CRASH_DUMP
+export ERL_MAX_PORTS
+export ERL_MAX_ETS_TABLES
+export ERL_FULLSWEEP_AFTER
+
+
+ARGS=
+while [ $# -ne 0 ] ; do
+    PARAM=$1
+    shift
+    case $PARAM in
+	--) break ;;
+	--node) ERLANG_NODE=$1; shift ;;
+	--config) CONFIG=$1 ; shift ;;
+	--log) LOG=$1 ; shift ;;
+	--sasl-log) SASL_LOG=$1 ; shift ;;
+	--spool) SPOOL=$1 ; shift ;;
+	*) ARGS="$ARGS $PARAM" ;;
+    esac
+done
+
+if [ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] ; then
+    SNAME=-sname
+else
+    SNAME=-name
+fi
+
+exec $ERL $SNAME $ERLANG_NODE \
+    -pa $EBIN_DIR \
+    -s ejabberd \
+    -kernel inetrc \"$INETRC\" \
+    -ejabberd config \"$CONFIG\" log_path \"$LOG\" \
+    -sasl sasl_error_logger \{file,\"$SASL_LOG\"\} \
+    -mnesia dir \"$SPOOL\" \
+    $ERLANG_OPTS $ERL_OPTIONS $ARGS "$@"
+
--- ejabberd-2.0.5.orig/debian/patches/convert.patch
+++ ejabberd-2.0.5/debian/patches/convert.patch
@@ -0,0 +1,51 @@
+Index: ejabberd-2.0.5/src/mnesia_convert.erl
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ ejabberd-2.0.5/src/mnesia_convert.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -0,0 +1,46 @@
++-module(mnesia_convert).
++-export([change_node_name/4]).
++
++change_node_name(From, To, Source, Target) ->
++	Switch =
++		fun
++			(Node) when Node == From ->
++				io:format("     - Replacing nodename: '~p' with: '~p'~n", [From, To]),
++				To;
++			(Node) when Node == To -> throw({error, already_exists});
++			(Node) ->
++				io:format("     - Node: '~p' will not be modified (it is not '~p')~n", [Node, From]),
++				Node
++		end,
++	Convert =
++		fun
++			({schema, db_nodes, Nodes}, Acc) ->
++				io:format(" +++ db_nodes ~p~n", [Nodes]),
++				{[{schema, db_nodes, lists:map(Switch,Nodes)}], Acc};
++			({schema, version, Version}, Acc) ->
++				io:format(" +++ version: ~p~n", [Version]),
++				{[{schema, version, Version}], Acc};
++			({schema, cookie, Cookie}, Acc) ->
++				io:format(" +++ cookie: ~p~n", [Cookie]),
++				{[{schema, cookie, Cookie}], Acc};
++			({schema, Tab, CreateList}, Acc) ->
++				io:format("~n * Checking table: '~p'~n", [Tab]),
++				%io:format("  . Initial content: ~p~n", [CreateList]),
++				Keys = [ram_copies, disc_copies, disc_only_copies],
++				OptSwitch =
++					fun({Key, Val}) ->
++						case lists:member(Key, Keys) of
++							true ->
++								io:format("   + Checking key: '~p'~n", [Key]),
++								{Key, lists:map(Switch, Val)};
++							false-> {Key, Val}
++						end
++					end,
++				Res = {[{schema, Tab, lists:map(OptSwitch, CreateList)}], Acc},
++				%io:format("  . Resulting content: ~p~n", [Res]),
++				Res;
++			(Other, Acc) ->
++				%io:format(" --- ~p~n", [Other]),
++				{[Other], Acc}
++		end,
++	mnesia:traverse_backup(Source, Target, Convert, switched).
--- ejabberd-2.0.5.orig/debian/patches/proxy.patch
+++ ejabberd-2.0.5/debian/patches/proxy.patch
@@ -0,0 +1,18 @@
+Patch by Evgeniy Khramtsov decreases proxy65 buffer sizes (size 65535 is known
+to confuse users with tight shapers).
+
+Index: ejabberd-2.0.5/src/mod_proxy65/mod_proxy65_stream.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/mod_proxy65/mod_proxy65_stream.erl	2009-04-01 17:23:51.000000000 +0200
++++ ejabberd-2.0.5/src/mod_proxy65/mod_proxy65_stream.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -89,8 +89,8 @@
+     process_flag(trap_exit, true),
+     AuthType = gen_mod:get_opt(auth_type, Opts, anonymous),
+     Shaper = gen_mod:get_opt(shaper, Opts, none),
+-    RecvBuf = gen_mod:get_opt(recbuf, Opts, 65535),
+-    SendBuf = gen_mod:get_opt(sndbuf, Opts, 65535),
++    RecvBuf = gen_mod:get_opt(recbuf, Opts, 8192),
++    SendBuf = gen_mod:get_opt(sndbuf, Opts, 8192),
+     TRef = erlang:send_after(?WAIT_TIMEOUT, self(), stop),
+     inet:setopts(Socket, [{active, true}, {recbuf, RecvBuf}, {sndbuf, SendBuf}]),
+     {ok, wait_for_init, #state{host      = Host,
--- ejabberd-2.0.5.orig/debian/patches/ssl.patch
+++ ejabberd-2.0.5/debian/patches/ssl.patch
@@ -0,0 +1,16 @@
+Patch by Sergei Golovan removes unnecessary call to ssl:start() because
+ssl module isn't used in ejabberd anymore (LDAP module will start ssl itself).
+
+Index: ejabberd-2.0.5/src/ejabberd_app.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/ejabberd_app.erl	2009-04-01 17:23:52.000000000 +0200
++++ ejabberd-2.0.5/src/ejabberd_app.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -44,7 +44,7 @@
+     randoms:start(),
+     db_init(),
+     sha:start(),
+-    catch ssl:start(),
++%%  catch ssl:start(),
+     stringprep_sup:start_link(),
+     start(),
+     translate:start(),
--- ejabberd-2.0.5.orig/debian/patches/update.patch
+++ ejabberd-2.0.5/debian/patches/update.patch
@@ -0,0 +1,19 @@
+Patch by upstream fixes crash when browsing the Update page in Erlang R12.
+
+--- ejabberd-2.0.0.orig/src/ejabberd_update.erl
++++ ejabberd-2.0.0/src/ejabberd_update.erl
+@@ -55,12 +55,12 @@
+ 	    UpdatedBeams =
+ 		lists:filter(
+ 		  fun(Module) ->
+-			  {ok, {Module, [NewVsn]}} =
++			  {ok, {Module, NewVsn}} =
+ 			      beam_lib:version(code:which(Module)),
+ 			  case code:is_loaded(Module) of
+ 			      {file, _} ->
+ 				  Attrs = Module:module_info(attributes),
+-				  {value, {vsn, [CurVsn]}} =
++				  {value, {vsn, CurVsn}} =
+ 				      lists:keysearch(vsn, 1, Attrs),
+ 				  NewVsn /= CurVsn;
+ 			      false ->
--- ejabberd-2.0.5.orig/debian/patches/ldaps.patch
+++ ejabberd-2.0.5/debian/patches/ldaps.patch
@@ -0,0 +1,391 @@
+--- ejabberd-2.0.3.orig/doc/guide.tex
++++ ejabberd-2.0.3/doc/guide.tex
+@@ -1818,12 +1818,15 @@
+ \begin{description}
+ \titem{ldap\_servers} \ind{options!ldap\_server}List of IP addresses or DNS names of your
+ LDAP servers. This option is required.
++\titem{ldap\_encrypt} \ind{options!ldap\_encrypt}Type of connection encryption to the LDAP server.
++Allowed values are: \term{none}, \term{tls}.
++Note that STARTTLS is not supported.
++The default value is: \term{none}.
+ \titem{ldap\_port} \ind{options!ldap\_port}Port to connect to your LDAP server.
+-  The initial default value is~389, so it is used when nothing is set into the
+-configuration file.
++The default port is~389 if encryption is disabled; and 636 if encryption is enabled.
+ If you configure a value, it is stored in \ejabberd{}'s database.
+ Then, if you remove that value from the configuration file,
+-the value previously stored in the database will be used instead of the default 389.
++the value previously stored in the database will be used instead of the default port.
+ \titem{ldap\_rootdn} \ind{options!ldap\_rootdn}Bind DN. The default value
+   is~\term{""} which means `anonymous connection'.
+ \titem{ldap\_password} \ind{options!ldap\_password}Bind password. The default
+@@ -1898,14 +1901,18 @@
+ Let's say \term{ldap.example.org} is the name of our LDAP server. We have
+ users with their passwords in \term{"ou=Users,dc=example,dc=org"} directory.
+ Also we have addressbook, which contains users emails and their additional
+-infos in \term{"ou=AddressBook,dc=example,dc=org"} directory.  Corresponding
+-authentication section should looks like this:
++infos in \term{"ou=AddressBook,dc=example,dc=org"} directory.
++The connection to the LDAP server is encrypted using TLS,
++and using the custom port 6336.
++Corresponding authentication section should looks like this:
+ 
+ \begin{verbatim}
+ %% Authentication method
+ {auth_method, ldap}.
+ %% DNS name of our LDAP server
+ {ldap_servers, ["ldap.example.org"]}.
++{ldap_encrypt, tls}.
++{ldap_port, 6336}.
+ %% Bind to LDAP server as "cn=Manager,dc=example,dc=org" with password "secret"
+ {ldap_rootdn, "cn=Manager,dc=example,dc=org"}.
+ {ldap_password, "secret"}.
+--- ejabberd-2.0.3.orig/src/ejabberd.cfg.example
++++ ejabberd-2.0.3/src/ejabberd.cfg.example
+@@ -225,17 +225,26 @@
+ %% List of LDAP servers:
+ %%{ldap_servers, ["localhost"]}.    
+ %%
+-%% LDAP attribute that holds user ID:
+-%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}. 
++%% Encryption of connection to LDAP servers:
++%%{ldap_encrypt, tls}.
+ %%
+-%% Search base of LDAP directory:
+-%%{ldap_base, "dc=example,dc=com"}. 
++%% Port connect to LDAP server:
++%%{ldap_port, 636}.
+ %%
+ %% LDAP manager:
+-%%{ldap_rootdn, "dc=example,dc=com"}. 
++%%{ldap_rootdn, "dc=example,dc=com"}.
+ %%
+ %% Password to LDAP manager:
+-%%{ldap_password, "******"}. 
++%%{ldap_password, "******"}.
++%%
++%% Search base of LDAP directory:
++%%{ldap_base, "dc=example,dc=com"}.
++%%
++%% LDAP attribute that holds user ID:
++%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
++%%
++%% LDAP filter:
++%%{ldap_filter, "(objectClass=shadowAccount)"}.
+ 
+ %%
+ %% Anonymous login support:
+--- ejabberd-2.0.3.orig/src/ejabberd_auth_ldap.erl
++++ ejabberd-2.0.3/src/ejabberd_auth_ldap.erl
+@@ -24,6 +24,10 @@
+ %%%
+ %%%----------------------------------------------------------------------
+ 
++%%% Modified by Thomas Baden <roo@ham9.net> 2008 April 6th
++%%% Added {ldap_encrypt, none|tls|starttls} configuration option.
++%%% NOTICE: STARTTLS is not yet supported.
++
+ -module(ejabberd_auth_ldap).
+ -author('alexey@process-one.net').
+ 
+@@ -360,9 +364,18 @@
+ 		   undefined -> [];
+ 		   Backups -> Backups
+ 		   end,
++    Encryption = ejabberd_config:get_local_option({ldap_encrypt, Host}),
+     LDAPPort = case ejabberd_config:get_local_option({ldap_port, Host}) of
+-		   undefined -> 389;
+-		   P -> P
++		   undefined -> case Encryption of
++				    tls -> {Encryption, ?LDAPS_PORT};
++				    starttls -> {Encryption, ?LDAP_PORT};
++				    _ -> ?LDAP_PORT
++				end;
++		   P -> case Encryption of
++			    tls -> {Encryption, P};
++			    starttls -> {Encryption, P};
++			    _ -> P
++			end
+ 	       end,
+     RootDN = case ejabberd_config:get_local_option({ldap_rootdn, Host}) of
+ 		 undefined -> "";
+--- ejabberd-2.0.3.orig/src/eldap/eldap.erl
++++ ejabberd-2.0.3/src/eldap/eldap.erl
+@@ -42,6 +42,12 @@
+ %%% Modified by Mickael Remond <mremond@process-one.net>
+ %%% Now use ejabberd log mechanism
+ 
++%%% Modified by Thomas Baden <roo@ham9.net> 2008 April 6th
++%%% Added LDAPS support, modeled off jungerl eldap.erl version.
++%%% NOTICE: STARTTLS is not yet supported.
++%%%
++%%% Modified by Andy Harb <Ahmad.N.Abou-Harb@jpl.nasa.gov> 2008 April 28th
++%%% Modified LDAPS support to work with ejabberd-2.0.0
+ 
+ %%% --------------------------------------------------------------------
+ -vc('$Id: eldap.erl 1237 2008-03-20 16:38:29Z mremond $ ').
+@@ -87,18 +93,23 @@
+ -define(CMD_TIMEOUT, 100000).
+ -define(MAX_TRANSACTION_ID, 65535).
+ -define(MIN_TRANSACTION_ID, 0).
++-define(SUPPORTEDEXTENSION, "1.3.6.1.4.1.1466.101.120.7").
++-define(SUPPORTEDEXTENSIONSYNTAX, "1.3.6.1.4.1.1466.115.121.1.38").
++-define(STARTTLS, "1.3.6.1.4.1.1466.20037").
+ 
+ -record(eldap, {version = ?LDAP_VERSION,
+ 		hosts,         % Possible hosts running LDAP servers
+ 		host = null,   % Connected Host LDAP server
+-		port = 389,    % The LDAP server port
++		port,          % The LDAP server port
+ 		fd = null,     % Socket filedescriptor.
+ 		rootdn = "",   % Name of the entry to bind as
+ 		passwd,        % Password for (above) entry
+ 		id = 0,        % LDAP Request ID 
+ 		bind_timer,    % Ref to bind timeout
+ 		dict,          % dict holding operation params and results
+-		bind_q         % Queue for bind() requests
++		bind_q,        % Queue for bind() requests
++		use_tls = false,      % LDAP/LDAPS
++		use_starttls = false
+ 	}).
+ 
+ %%%----------------------------------------------------------------------
+@@ -375,6 +386,32 @@
+ 	{error, Reason} ->
+ 	    {stop, Reason}
+     end;
++init({Hosts, Port, Rootdn, Passwd}) when is_tuple(Port) ->
++    %% The connection must be encrypted
++    %% Start the SSL server if it wasn't already started
++    catch ssl:start(),
++    {X1,X2,X3} = erlang:now(),
++    ssl:seed(integer_to_list(X1) ++ integer_to_list(X2) ++ integer_to_list(X3)),
++    case Port of
++	{tls, TLSPort} ->
++	    {ok, connecting, #eldap{hosts = Hosts,
++				    port = TLSPort,
++				    rootdn = Rootdn,
++				    passwd = Passwd,
++				    id = 0,
++				    dict = dict:new(),
++				    bind_q = queue:new(),
++				    use_tls = true}, 0};
++	{starttls, TCPPort} ->
++	    {ok, connecting, #eldap{hosts = Hosts,
++				    port = TCPPort,
++				    rootdn = Rootdn,
++				    passwd = Passwd,
++				    id = 0,
++				    dict = dict:new(),
++				    bind_q = queue:new(),
++				    use_starttls = true}, 0}
++    end;
+ init({Hosts, Port, Rootdn, Passwd}) ->
+     {ok, connecting, #eldap{hosts = Hosts,
+ 			    port = Port,
+@@ -446,7 +483,7 @@
+ %%          {stop, Reason, NewStateData}                         
+ %%----------------------------------------------------------------------
+ handle_event(close, _StateName, S) ->
+-    gen_tcp:close(S#eldap.fd),
++    do_close(S#eldap.fd, S),
+     {stop, closed, S};
+ 
+ handle_event(process_bind_q, active_bind, #eldap{bind_q=Q} = S) ->
+@@ -488,11 +525,15 @@
+ %%
+ %% Packets arriving in various states
+ %%
+-handle_info({tcp, _Socket, Data}, connecting, S) ->
++handle_info({Tag, _Socket, Data}, connecting, S)
++  when Tag == tcp;
++       Tag == ssl ->
+     ?DEBUG("eldap. tcp packet received when disconnected!~n~p", [Data]),
+     {next_state, connecting, S};
+ 
+-handle_info({tcp, _Socket, Data}, wait_bind_response, S) ->
++handle_info({Tag, _Socket, Data}, wait_bind_response, S)
++  when Tag == tcp;
++       Tag == ssl ->
+     cancel_timer(S#eldap.bind_timer),
+     case catch recvd_wait_bind_response(Data, S) of
+ 	bound                -> {next_state, active, S};
+@@ -504,8 +545,11 @@
+ 				{next_state, connecting, S#eldap{fd = null}}
+     end;
+ 
+-handle_info({tcp, _Socket, Data}, StateName, S)
+-  when StateName==active; StateName==active_bind ->
++handle_info({Tag, _Socket, Data}, StateName, S)
++  when StateName==active, Tag == tcp;
++       StateName==active, Tag == ssl;
++       StateName==active_bind, Tag == tcp;
++       StateName==active_bind, Tag == ssl ->
+     case catch recvd_packet(Data, S) of
+ 	{reply, Reply, To, NewS} -> gen_fsm:reply(To, Reply),
+ 				    {next_state, StateName, NewS};
+@@ -514,11 +558,14 @@
+ 	{error, _Reason}          -> {next_state, StateName, S}
+     end;
+ 
+-handle_info({tcp_closed, _Socket}, Fsm_state, S) ->
++handle_info({Tag, _Socket}, Fsm_state, S)
++  when Tag == tcp_closed;
++       Tag == ssl_closed ->
+     ?WARNING_MSG("LDAP server closed the connection: ~s:~p~nIn State: ~p",
+ 	  [S#eldap.host, S#eldap.port ,Fsm_state]),
++    catch do_close(S#eldap.fd, S),
+     F = fun(_Id, [{Timer, From, _Name}|_]) ->
+-		gen_fsm:reply(From, {error, tcp_closed}),
++		gen_fsm:reply(From, {error, Tag}),
+ 		cancel_timer(Timer)
+ 	end,
+     dict:map(F, S#eldap.dict),
+@@ -527,10 +574,12 @@
+ 						 bind_q=queue:new()}),
+     {next_state, NextState, NewS};
+ 
+-handle_info({tcp_error, _Socket, Reason}, Fsm_state, S) ->
+-    ?DEBUG("eldap received tcp_error: ~p~nIn State: ~p", [Reason, Fsm_state]),
++handle_info({Tag, _Socket, Reason}, Fsm_state, S)
++  when Tag == tcp_error;
++       Tag == ssl_error ->
++    ?DEBUG("eldap received ~p: ~p~nIn State: ~p", [Tag, Reason, Fsm_state]),
+     %% XXX wouldn't it be safer to try reconnect ?
+-    %% if we were waiting a result, we may mait forever
++    %% if we were waiting a result, we may wait forever
+     %% cause request is probably lost....
+     {next_state, Fsm_state, S};
+ 
+@@ -586,7 +635,7 @@
+ 			     protocolOp = {Name, Request}},
+     ?DEBUG("~p~n",[{Name, Request}]),
+     {ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message),
+-    case gen_tcp:send(S#eldap.fd, Bytes) of
++    case do_send(S#eldap.fd, S, Bytes) of
+     ok ->
+ 	Timer = erlang:start_timer(?CMD_TIMEOUT, self(), {cmd_timeout, Id}),
+ 	New_dict = dict:store(Id, [{Timer, From, Name}], S#eldap.dict),
+@@ -784,7 +833,7 @@
+     end.
+ 
+ close_and_retry(S) ->
+-    gen_tcp:close(S#eldap.fd),
++    do_close(S#eldap.fd, S),
+     retry_connect().
+ 
+ retry_connect() ->
+@@ -841,9 +890,12 @@
+ %%-----------------------------------------------------------------------
+ connect_bind(S) ->
+     Host = next_host(S#eldap.host, S#eldap.hosts),
+-    TcpOpts = [{packet, asn1}, {active, true}, {keepalive, true}, binary],
++    TcpOpts = case S#eldap.use_tls of
++		  true -> [{packet, asn1}, {active, true}, {keepalive, true}, binary];
++		  _ -> [{packet, asn1}, {active, true}, {keepalive, true}, binary]
++	      end,
+     ?INFO_MSG("LDAP connection on ~s:~p", [Host, S#eldap.port]),
+-    case gen_tcp:connect(Host, S#eldap.port, TcpOpts) of
++    case do_connect(Host, S, TcpOpts) of
+ 	{ok, Socket} ->
+ 	    case bind_request(Socket, S) of
+ 		{ok, NewS} ->
+@@ -854,7 +906,7 @@
+ 							bind_timer = Timer}};
+ 		{error, Reason} ->
+ 		    ?ERROR_MSG("LDAP bind failed on ~s:~p~nReason: ~p", [Host, S#eldap.port, Reason]),
+-		    gen_tcp:close(Socket),
++		    do_close(Socket, S),
+ 		    retry_connect(),
+ 		    {ok, connecting, S#eldap{host = Host}}
+ 	    end;
+@@ -864,6 +916,21 @@
+ 	    {ok, connecting, S#eldap{host = Host}}
+     end.
+ 
++do_connect(Host, State, Opts) when State#eldap.use_tls == false ->
++    gen_tcp:connect(Host, State#eldap.port, Opts);
++do_connect(Host, State, Opts) when State#eldap.use_tls == true ->
++    ssl:connect(Host, State#eldap.port, [{verify,0}|Opts]).
++
++do_close(Socket, State) when State#eldap.use_tls == false ->
++    gen_tcp:close(Socket);
++do_close(Socket, State) when State#eldap.use_tls == true ->
++    ssl:close(Socket).
++
++do_send(Socket, State, Bytes) when State#eldap.use_tls == false ->
++    gen_tcp:send(Socket, Bytes);
++do_send(Socket, State, Bytes) when State#eldap.use_tls == true ->
++    ssl:send(Socket, Bytes).
++
+ bind_request(Socket, S) ->
+     Id = bump_id(S),
+     Req = #'BindRequest'{version        = S#eldap.version,
+@@ -873,7 +940,7 @@
+ 			     protocolOp = {bindRequest, Req}},
+     ?DEBUG("Bind Request Message:~p~n",[Message]),
+     {ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message),
+-    case gen_tcp:send(Socket, Bytes) of
++    case do_send(Socket, S, Bytes) of
+ 	ok -> {ok, S#eldap{id = Id}};
+ 	Error -> Error
+     end.
+--- ejabberd-2.0.3.orig/src/eldap/eldap.hrl
++++ ejabberd-2.0.3/src/eldap/eldap.hrl
+@@ -19,6 +19,9 @@
+ %%%
+ %%%----------------------------------------------------------------------
+ 
++-define(LDAP_PORT, 389).
++-define(LDAPS_PORT, 636).
++
+ -record(eldap_search, {scope = wholeSubtree,
+ 		       base = [],
+ 		       filter,
+--- ejabberd-2.0.3.orig/src/mod_vcard_ldap.erl
++++ ejabberd-2.0.3/src/mod_vcard_ldap.erl
+@@ -24,6 +24,10 @@
+ %%%
+ %%%----------------------------------------------------------------------
+ 
++%%% Modified by Thomas Baden <roo@ham9.net> 2008 April 6th
++%%% Added {ldap_encrypt, none|tls|starttls} configuration option.
++%%% NOTICE: STARTTLS is not yet supported.
++
+ -module(mod_vcard_ldap).
+ -author('alexey@process-one.net').
+ 
+@@ -673,13 +677,26 @@
+ 			  ejabberd_config:get_local_option({ldap_servers, Host});
+ 		      Backups -> Backups
+ 		  end,
+-    LDAPPort = case gen_mod:get_opt(ldap_port, Opts, undefined) of
+-		   undefined ->
+-		       case ejabberd_config:get_local_option({ldap_port, Host}) of
+-			   undefined -> 389;
+-			   P -> P
+-		       end;
+-		   P -> P
++    Encryption = case gen_mod:get_opt(ldap_encrypt, Opts, undefined) of
++		     undefined ->
++			 ejabberd_config:get_local_option({ldap_encrypt, Host});
++		     LDE -> LDE
++		 end,
++    LDAPPortOpt = case gen_mod:get_opt(ldap_port, Opts, undefined) of
++		      undefined -> ejabberd_config:get_local_option({ldap_port, Host});
++		      POpt -> POpt
++		  end,
++    LDAPPort = case LDAPPortOpt of
++		   undefined -> case Encryption of
++				    tls -> {Encryption, ?LDAPS_PORT};
++				    starttls -> {Encryption, ?LDAP_PORT};
++				    _ -> ?LDAP_PORT
++				end;
++		   P -> case Encryption of
++			    tls -> {Encryption, P};
++			    starttls -> {Encryption, P};
++			    _ -> P
++			end
+ 	       end,
+     LDAPBase = case gen_mod:get_opt(ldap_base, Opts, undefined) of
+ 		   undefined ->
--- ejabberd-2.0.5.orig/debian/patches/caps.patch
+++ ejabberd-2.0.5/debian/patches/caps.patch
@@ -0,0 +1,24 @@
+Patch by Sergei Golovan turns unnecessary error messages into debug messages.
+
+Index: ejabberd-2.0.5/src/mod_caps.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/mod_caps.erl	2009-04-01 17:23:51.000000000 +0200
++++ ejabberd-2.0.5/src/mod_caps.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -301,7 +301,7 @@
+ 		      end),
+ 		    gen_server:cast(self(), visit_feature_queries);
+ 		error ->
+-		    ?ERROR_MSG("ID '~s' matches no query", [ID])
++		    ?DEBUG("ID '~s' matches no query", [ID])
+ 	    end;
+ 	{error, _} ->
+ 	    %% XXX: if we get error, we cache empty feature not to probe the client continuously
+@@ -315,7 +315,7 @@
+ 		      end),
+ 		    gen_server:cast(self(), visit_feature_queries);
+ 		error ->
+-		    ?ERROR_MSG("ID '~s' matches no query", [ID])
++		    ?DEBUG("ID '~s' matches no query", [ID])
+ 	    end;
+ 	    %gen_server:cast(self(), visit_feature_queries),
+ 	    %?DEBUG("Error IQ reponse from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
--- ejabberd-2.0.5.orig/debian/patches/s2s.patch
+++ ejabberd-2.0.5/debian/patches/s2s.patch
@@ -0,0 +1,42 @@
+Patch by Sergei Golovan increases timeouts in S2S and removes horrible 5-minute
+delay between remote server connection attempts after a falure (in case of
+server is down it would be reasonable, but what happens much more often is a
+network split when the delay is inadmissible).
+
+Index: ejabberd-2.0.5/src/ejabberd_s2s_in.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/ejabberd_s2s_in.erl	2009-04-01 17:23:52.000000000 +0200
++++ ejabberd-2.0.5/src/ejabberd_s2s_in.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -352,7 +352,7 @@
+             case {ejabberd_s2s:allow_host(To, From),
+                   lists:member(LTo, ejabberd_router:dirty_get_all_domains())} of
+                 {true, true} ->
+-		    ejabberd_s2s_out:terminate_if_waiting_delay(To, From),
++		    %%ejabberd_s2s_out:terminate_if_waiting_delay(To, From),
+ 		    ejabberd_s2s_out:start(To, From,
+ 					   {verify, self(),
+ 					    Key, StateData#state.streamid}),
+Index: ejabberd-2.0.5/src/ejabberd_s2s_out.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/ejabberd_s2s_out.erl	2009-04-01 17:23:51.000000000 +0200
++++ ejabberd-2.0.5/src/ejabberd_s2s_out.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -93,7 +93,7 @@
+ %% Only change this value if you now what your are doing:
+ -define(FSMLIMITS,[]).
+ %% -define(FSMLIMITS, [{max_queue, 2000}]).
+--define(FSMTIMEOUT, 30000).
++-define(FSMTIMEOUT, 60000).
+ 
+ %% We do not block on send anymore.
+ -define(TCP_SEND_TIMEOUT, 15000).
+@@ -227,8 +227,8 @@
+ 	{error, _Reason} ->
+ 	    ?INFO_MSG("s2s connection: ~s -> ~s (remote server not found)",
+ 		      [StateData#state.myname, StateData#state.server]),
+-	    wait_before_reconnect(StateData)
+-	    %%{stop, normal, StateData}
++	    %%wait_before_reconnect(StateData)
++	    {stop, normal, StateData}
+     end;
+ open_socket(stop, StateData) ->
+     ?INFO_MSG("s2s connection: ~s -> ~s (stopped in open socket)",
--- ejabberd-2.0.5.orig/debian/patches/shared_roster_recent.patch
+++ ejabberd-2.0.5/debian/patches/shared_roster_recent.patch
@@ -0,0 +1,147 @@
+Index: ejabberd-2.0.5/src/mod_shared_roster.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/mod_shared_roster.erl	2009-04-01 17:23:51.000000000 +0200
++++ ejabberd-2.0.5/src/mod_shared_roster.erl	2009-04-05 22:52:54.000000000 +0200
+@@ -439,13 +439,63 @@
+ 	    false
+     end.
+ 
++-record(last_activity, {us, timestamp, status}).
++
++%% stolen from mod_ctlextra, thanks Badlop! :)
++get_recent_users(Host, Days) ->
++    %% Convert older time
++    SecOlder = Days*24*60*60,
++
++    %% Get current time
++    {MegaSecs, Secs, _MicroSecs} = now(),
++    TimeStamp_now = MegaSecs * 1000000 + Secs,
++
++    %% Get the list of registered users
++    Users = ejabberd_auth:get_vh_registered_users(Host),
++
++    %% For a user, answer true if they are online, or were online within
++    %% the given number of Days
++    F = fun({LUser, LServer}) ->
++		%% Check if the user is logged
++		case ejabberd_sm:get_user_resources(LUser, LServer) of
++		    %% If it isnt
++		    [] ->
++			%% Look for his last_activity
++			case mnesia:dirty_read(last_activity, {LUser, LServer}) of
++			    %% If it is existent:
++			    [#last_activity{timestamp = TimeStamp}] ->
++				%% get his age
++				Sec = TimeStamp_now - TimeStamp,
++				%% true if he's recently active
++				Sec < SecOlder;
++			    %% nonexistent:
++			    [] ->
++				%% never signed in, skip
++				false
++			end;
++		    %% Else
++		    _ ->
++			%% currently online, include
++			true
++		end
++	end,
++    %% Apply the function to every user in the list
++    lists:filter(F, Users).
++
+ get_group_users(Host, Group) ->
+     case get_group_opt(Host, Group, all_users, false) of
+ 	true ->
+ 	    ejabberd_auth:get_vh_registered_users(Host);
+ 	false ->
+ 	    []
+-    end ++ get_group_explicit_users(Host, Group).
++    end ++
++    case get_group_opt(Host, Group, recent_users_days, 0) of
++	0 ->
++	    [];
++	Days when is_integer(Days) ->
++            get_recent_users(Host, Days)
++    end ++
++    get_group_explicit_users(Host, Group).
+ 
+ get_group_users(_User, Host, Group, GroupOpts) ->
+     case proplists:get_value(all_users, GroupOpts, false) of
+@@ -453,7 +503,14 @@
+ 	    ejabberd_auth:get_vh_registered_users(Host);
+ 	false ->
+ 	    []
+-    end ++ get_group_explicit_users(Host, Group).
++    end ++
++    case proplists:get_value(recent_users_days, GroupOpts, 0) of
++	0 ->
++	    [];
++	Days when is_integer(Days) ->
++            get_recent_users(Host, Days)
++    end ++
++    get_group_explicit_users(Host, Group).
+ 
+ %% @spec (Host::string(), Group::string()) -> [{User::string(), Server::string()}]
+ get_group_explicit_users(Host, Group) ->
+@@ -475,7 +532,8 @@
+ get_special_users_groups(Host) ->
+     lists:filter(
+       fun(Group) ->
+-	      get_group_opt(Host, Group, all_users, false)
++	      get_group_opt(Host, Group, all_users, false) orelse
++	      get_group_opt(Host, Group, recent_users_days, 0) > 0
+       end,
+       list_groups(Host)).
+ 
+@@ -803,6 +861,7 @@
+     Name = get_opt(GroupOpts, name, ""),
+     Description = get_opt(GroupOpts, description, ""),
+     AllUsers = get_opt(GroupOpts, all_users, false),
++    RecentUsersDays = get_opt(GroupOpts, recent_users_days, 0),
+     %%Disabled = false,
+     DisplayedGroups = get_opt(GroupOpts, displayed_groups, []),
+     Members = mod_shared_roster:get_group_explicit_users(Host, Group),
+@@ -812,7 +871,14 @@
+ 		"@all@\n";
+ 	    true ->
+ 		[]
+-	end ++ [[us_to_list(Member), $\n] || Member <- Members],
++	end ++
++	if
++	    RecentUsersDays > 0 ->
++		"@recent@\n";
++	    true ->
++		[]
++	end ++
++	[[us_to_list(Member), $\n] || Member <- Members],
+     FDisplayedGroups = [[DG, $\n] || DG <- DisplayedGroups],
+     FGroup =
+ 	?XAE("table", [],
+@@ -895,6 +961,8 @@
+ 			  case SJID of
+ 			      "@all@" ->
+ 				  USs;
++			      "@recent@" ->
++				  USs;
+ 			      _ ->
+ 				  case jlib:string_to_jid(SJID) of
+ 				      JID when is_record(JID, jid) ->
+@@ -909,10 +977,17 @@
+ 		    true -> [{all_users, true}];
+ 		    false -> []
+ 		end,
++	    %% FIXME: this should be specified by the user
++	    RecentUsersOpt =
++		case lists:member("@recent@", SJIDs) of
++		    true -> [{recent_users_days, 7}];
++		    false -> []
++		end,
+ 
+ 	    mod_shared_roster:set_group_opts(
+ 	      Host, Group,
+-	      NameOpt ++ DispGroupsOpt ++ DescriptionOpt ++ AllUsersOpt),
++	      NameOpt ++ DispGroupsOpt ++ DescriptionOpt ++ AllUsersOpt
++		++ RecentUsersOpt),
+ 
+ 	    if
+ 		NewMembers == error -> error;
--- ejabberd-2.0.5.orig/debian/patches/mod_ctlextra.patch
+++ ejabberd-2.0.5/debian/patches/mod_ctlextra.patch
@@ -0,0 +1,903 @@
+Index: ejabberd-2.0.5/src/ejabberd.app
+===================================================================
+--- ejabberd-2.0.5.orig/src/ejabberd.app	2009-04-01 17:23:51.000000000 +0200
++++ ejabberd-2.0.5/src/ejabberd.app	2009-04-05 22:51:20.000000000 +0200
+@@ -70,6 +70,7 @@
+ 	     mod_caps,
+ 	     mod_configure2,
+ 	     mod_configure,
++	     mod_ctlextra,
+ 	     mod_disco,
+ 	     mod_echo,
+ 	     mod_http_bind,
+Index: ejabberd-2.0.5/src/mod_ctlextra.erl
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ ejabberd-2.0.5/src/mod_ctlextra.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -0,0 +1,886 @@
++%%%----------------------------------------------------------------------
++%%% File    : mod_ctlextra.erl
++%%% Author  : Badlop <badlop@ono.com>
++%%% Purpose : Adds more commands to ejabberd_ctl
++%%% Created : 30 Nov 2006 by Badlop <badlop@ono.com>
++%%% Id      : $Id: mod_ctlextra.erl 557 2008-04-25 22:01:13Z badlop $
++%%%----------------------------------------------------------------------
++
++-module(mod_ctlextra).
++-author('badlop@ono.com').
++
++-behaviour(gen_mod).
++
++-export([start/2,
++	 stop/1,
++	 ctl_process/2,
++	 ctl_process/3
++	]).
++
++-include("ejabberd.hrl").
++-include("ejabberd_ctl.hrl").
++-include("jlib.hrl").
++-include("mod_roster.hrl").
++
++%% Copied from ejabberd_sm.erl
++-record(session, {sid, usr, us, priority, info}).
++
++-compile(export_all).
++
++%%-------------
++%% gen_mod
++%%-------------
++
++start(Host, _Opts) ->
++    ejabberd_ctl:register_commands(commands_global(), ?MODULE, ctl_process),
++    ejabberd_ctl:register_commands(Host, commands_host(), ?MODULE, ctl_process).
++
++stop(Host) ->
++    ejabberd_ctl:unregister_commands(commands_global(), ?MODULE, ctl_process),
++    ejabberd_ctl:unregister_commands(Host, commands_host(), ?MODULE, ctl_process).
++
++commands_global() ->
++    [
++     {"compile file", "recompile and reload file"},
++     {"load-config file", "load config from file"},
++     {"remove-node nodename", "remove an ejabberd node from the database"},
++
++     %% ejabberd_auth
++     {"delete-older-users days", "delete users that have not logged in the last 'days'"},
++     {"set-password user server password", "set password to user@server"},
++
++     %% ejd2odbc
++     {"export2odbc server output", "export Mnesia tables on server to files on output directory"},
++
++     %% mod_offline
++     {"delete-older-messages days", "delete offline messages older than 'days'"},
++
++     %% mod_shared_roster
++     {"srg-create group host name description display", "create the group with options"},
++     {"srg-delete group host", "delete the group"},
++     {"srg-user-add user server group host", "add user@server to group on host"},
++     {"srg-user-del user server group host", "delete user@server from group on host"},
++     {"srg-list-groups host", "list the shared roster groups from host"},
++     {"srg-get-info group host", "get info of a specific group on host"},
++
++     %% mod_vcard
++     {"vcard-get user host data [data2]", "get data from the vCard of the user"},
++     {"vcard-set user host data [data2] content", "set data to content on the vCard"},
++
++     %% mod_announce
++     %% announce_send_online host message
++     %% announce_send_all host, message
++
++     %% mod_roster
++     {"add-rosteritem user1 server1 user2 server2 nick group subs", "Add user2@server2 to user1@server1's roster"},
++     %%{"", "subs= none, from, to or both"},
++     %%{"", "example: add-roster peter localhost mike server.com MiKe Employees both"},
++     %%{"", "will add mike@server.com to peter@localhost roster"},
++     {"rem-rosteritem user1 server1 user2 server2", "Remove user2@server2 from user1@server1's roster"},
++     {"rosteritem-purge [options]", "Purge all rosteritems that match filtering options"},
++     {"pushroster file user server", "push template roster in file to user@server"},
++     {"pushroster-all file", "push template roster in file to all those users"},
++     {"push-alltoall server group", "adds all the users to all the users in Group"},
++
++     {"status-list status", "list the logged users with status"},
++     {"status-num status", "number of logged users with status"},
++
++     {"stats registeredusers", "number of registered users"},
++     {"stats onlineusers", "number of logged users"},
++     {"stats onlineusersnode", "number of logged users in the ejabberd node"},
++     {"stats uptime-seconds", "uptime of ejabberd node in seconds"},
++
++     %% misc
++     {"get-cookie", "get the Erlang cookie of this node"},
++     {"killsession user server resource", "kill a user session"}
++    ].
++
++commands_host() ->
++    [
++     %% mod_last
++     {"num-active-users days", "number of users active in the last 'days'"},
++     {"status-list status", "list the logged users with status"},
++     {"status-num status", "number of logged users with status"},
++     {"stats registeredusers", "number of registered users"},
++     {"stats onlineusers", "number of logged users"},
++
++     %% misc
++     {"ban-account username [reason]", "ban account: kick sessions and change password"}
++    ].
++
++
++%%-------------
++%% Commands global
++%%-------------
++
++ctl_process(_Val, ["delete-older-messages", Days]) ->
++    mod_offline:remove_old_messages(list_to_integer(Days)),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["delete-older-users", Days]) ->
++    {removed, N, UR} = delete_older_users(list_to_integer(Days)),
++    io:format("Deleted ~p users: ~p~n", [N, UR]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["export2odbc", Server, Output]) ->
++    Tables = [
++	      {export_last, last},
++	      {export_offline, offline},
++	      {export_passwd, passwd},
++	      {export_private_storage, private_storage},
++	      {export_roster, roster},
++	      {export_vcard, vcard},
++	      {export_vcard_search, vcard_search}],
++    Export = fun({TableFun, Table}) ->
++		     Filename = filename:join([Output, atom_to_list(Table)++".txt"]),
++		     io:format("Trying to export Mnesia table '~p' on server '~s' to file '~s'~n", [Table, Server, Filename]),
++		     Res = (catch ejd2odbc:TableFun(Server, Filename)),
++		     io:format("  Result: ~p~n", [Res])
++	     end,
++    lists:foreach(Export, Tables),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["set-password", User, Server, Password]) ->
++    ejabberd_auth:set_password(User, Server, Password),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["vcard-get", User, Server, Data]) ->
++    {ok, Res} = vcard_get(User, Server, [Data]),
++    io:format("~s~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["vcard-get", User, Server, Data1, Data2]) ->
++    {ok, Res} = vcard_get(User, Server, [Data1, Data2]),
++    io:format("~s~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["vcard-set", User, Server, Data1, Content]) ->
++    {ok, Res} = vcard_set(User, Server, [Data1], Content),
++    io:format("~s~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["vcard-set", User, Server, Data1, Data2, Content]) ->
++    {ok, Res} = vcard_set(User, Server, [Data1, Data2], Content),
++    io:format("~s~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["compile", Module]) ->
++    compile:file(Module),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["remove-node", Node]) ->
++    mnesia:del_table_copy(schema, list_to_atom(Node)),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-create" | Parameters]) ->
++	[Group, Host, Name, Description, Display] = group_parameters(Parameters, "'"),
++    Opts = [{name, Name}, {displayed_groups, [Display]}, {description, Description}],
++    {atomic, ok} = mod_shared_roster:create_group(Host, Group, Opts),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-delete", Group, Host]) ->
++    {atomic, ok} = mod_shared_roster:delete_group(Host, Group),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-user-add", User, Server, Group, Host]) ->
++    {atomic, ok} = mod_shared_roster:add_user_to_group(Host, {User, Server}, Group),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-user-del", User, Server, Group, Host]) ->
++    {atomic, ok} = mod_shared_roster:remove_user_from_group(Host, {User, Server}, Group),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-list-groups", Host]) ->
++    lists:foreach(
++      fun(SrgGroup) ->
++	      io:format("~s~n",[SrgGroup])
++      end,
++      lists:sort(mod_shared_roster:list_groups(Host))),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["srg-get-info", Group, Host]) ->
++    Opts = mod_shared_roster:get_group_opts(Host,Group),
++    [io:format("~s: ~p~n", [Title, Value]) || {Title , Value} <- Opts],
++
++    Members = mod_shared_roster:get_group_explicit_users(Host,Group),
++    Members_string = [ " " ++ jlib:jid_to_string(jlib:make_jid(MUser, MServer, ""))
++		       || {MUser, MServer} <- Members],
++    io:format("members:~s~n", [Members_string]),
++
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["add-rosteritem", LocalUser, LocalServer, RemoteUser, RemoteServer, Nick, Group, Subs]) ->
++    case add_rosteritem(LocalUser, LocalServer, RemoteUser, RemoteServer, Nick, Group, list_to_atom(Subs), []) of
++	{atomic, ok} ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Can't add ~p@~p to ~p@~p: ~p~n",
++		      [RemoteUser, RemoteServer, LocalUser, LocalServer, Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("Can't add roster item to user ~p: ~p~n",
++		      [LocalUser, Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["rem-rosteritem", LocalUser, LocalServer, RemoteUser, RemoteServer]) ->
++    case rem_rosteritem(LocalUser, LocalServer, RemoteUser, RemoteServer) of
++	{atomic, ok} ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Can't remove ~p@~p to ~p@~p: ~p~n",
++		      [RemoteUser, RemoteServer, LocalUser, LocalServer, Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("Can't remove roster item to user ~p: ~p~n",
++		      [LocalUser, Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["rosteritem-purge"]) ->
++    io:format("Rosteritems that match all the filtering will be removed.~n"),
++    io:format("Options for filtering:~n"),
++    io:format("~n"),
++    io:format("  -subs none|from|to|both~n"),
++    io:format("       Subscription type. By default all values~n"),
++    io:format("~n"),
++    io:format("  -ask none|out|in~n"),
++    io:format("       Pending subscription. By default all values~n"),
++    io:format("~n"),
++    io:format("  -user JID~n"),
++    io:format("       The JID of the local user.~n"),
++    io:format("       Can use these globs: *, ? and [...].~n"),
++    io:format("       By default it is: * *@*~n"),
++    io:format("~n"),
++    io:format("  -contact JID~n"),
++    io:format("       Similar to 'user', but for the contact JID.~n"),
++    io:format("~n"),
++    io:format("Example:~n"),
++    io:format("  ejabberdctl rosteritem-purge -subs none from to -ask out in -contact *@*icq*~n"),
++    io:format("~n"),
++    ?STATUS_SUCCESS;
++ctl_process(_Val, ["rosteritem-purge" | Options_list]) ->
++    Options_prop_list = lists:foldl(
++			  fun(O, R) ->
++				  case O of
++				      [$- | K] ->
++					  [{K, []} | R];
++				      V ->
++					  [{K, Vs} | RT] = R,
++					  [{K, [V|Vs]} | RT]
++				  end
++			  end,
++			  [],
++			  Options_list),
++
++    Subs = [list_to_atom(S)
++	    || S <- proplists:get_value("subs",
++					Options_prop_list,
++					["none", "from", "to", "both"])],
++    Asks = [list_to_atom(S)
++	    || S <-
++		   proplists:get_value("ask",
++				       Options_prop_list,
++				       ["none", "out", "in"])],
++    User = proplists:get_value("user", Options_prop_list, ["*", "*@*"]),
++    Contact = proplists:get_value("contact", Options_prop_list, ["*", "*@*"]),
++
++    case rosteritem_purge({Subs, Asks, User, Contact}) of
++	{atomic, ok} ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Error purging rosteritems: ~p~n",
++		      [Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("BadRPC purging rosteritems: ~p~n",
++		      [Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["pushroster", File, User, Server]) ->
++    case pushroster(File, User, Server) of
++	ok ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Can't push roster ~p to ~p@~p: ~p~n",
++		      [File, User, Server, Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("Can't push roster ~p: ~p~n",
++		      [File, Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["pushroster-all", File]) ->
++    case pushroster_all([File]) of
++	ok ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Can't push roster ~p: ~p~n",
++		      [File, Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("Can't push roster ~p: ~p~n",
++		      [File, Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["push-alltoall", Server, Group]) ->
++    case push_alltoall(Server, Group) of
++	ok ->
++	    ?STATUS_SUCCESS;
++	{error, Reason} ->
++	    io:format("Can't push all to all: ~p~n",
++		      [Reason]),
++	    ?STATUS_ERROR;
++	{badrpc, Reason} ->
++	    io:format("Can't push all to all: ~p~n",
++		      [Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["load-config", Path]) ->
++    case ejabberd_config:load_file(Path) of
++        {atomic, ok} ->
++            ?STATUS_SUCCESS;
++        {error, Reason} ->
++            io:format("Can't load config file ~p: ~p~n",
++                      [filename:absname(Path), Reason]),
++	    ?STATUS_ERROR;
++        {badrpc, Reason} ->
++            io:format("Can't load config file ~p: ~p~n",
++                      [filename:absname(Path), Reason]),
++	    ?STATUS_BADRPC
++    end;
++
++ctl_process(_Val, ["stats", Stat]) ->
++    Res = case Stat of
++	      "uptime-seconds" -> uptime_seconds();
++	      "registeredusers" -> mnesia:table_info(passwd, size);
++	      "onlineusersnode" -> length(ejabberd_sm:dirty_get_my_sessions_list());
++	      "onlineusers" -> length(ejabberd_sm:dirty_get_sessions_list())
++	  end,
++    io:format("~p~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["status-num", Status_required]) ->
++    ctl_process(_Val, "all", ["status-num", Status_required]);
++
++ctl_process(_Val, ["status-list", Status_required]) ->
++    ctl_process(_Val, "all", ["status-list", Status_required]);
++
++ctl_process(_Val, ["get-cookie"]) ->
++    io:format("~s~n", [atom_to_list(erlang:get_cookie())]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, ["killsession", User, Server, Resource | Tail]) ->
++    kick_session(User, Server, Resource, prepare_reason(Tail)),
++    ?STATUS_SUCCESS;
++
++ctl_process(Val, _Args) ->
++    Val.
++
++
++%%-------------
++%% Commands vhost
++%%-------------
++
++ctl_process(_Val, Host, ["num-active-users", Days]) ->
++    Number = num_active_users(Host, list_to_integer(Days)),
++    io:format("~p~n", [Number]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, Host, ["stats", Stat]) ->
++    Res = case Stat of
++	      "registeredusers" -> length(ejabberd_auth:get_vh_registered_users(Host));
++	      "onlineusers" -> length(ejabberd_sm:get_vh_session_list(Host))
++	  end,
++    io:format("~p~n", [Res]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, Host, ["status-num", Status_required]) ->
++    Num = length(get_status_list(Host, Status_required)),
++    io:format("~p~n", [Num]),
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, Host, ["status-list", Status_required]) ->
++    Res = get_status_list(Host, Status_required),
++    [ io:format("~s@~s ~s ~p \"~s\"~n", [U, S, R, P, St]) || {U, S, R, P, St} <- Res],
++    ?STATUS_SUCCESS;
++
++ctl_process(_Val, Host, ["ban-account", User | Tail]) ->
++    ban_account(User, Host, prepare_reason(Tail)),
++    ?STATUS_SUCCESS;
++
++ctl_process(Val, _Host, _Args) ->
++    Val.
++
++
++%%-------------
++%% Utils
++%%-------------
++
++uptime_seconds() ->
++    trunc(element(1, erlang:statistics(wall_clock))/1000).
++
++get_status_list(Host, Status_required) ->
++    %% Get list of all logged users
++    Sessions = ejabberd_sm:dirty_get_my_sessions_list(),
++    %% Reformat the list
++    Sessions2 = [ {Session#session.usr, Session#session.sid, Session#session.priority} || Session <- Sessions],
++    Fhost = case Host of
++		"all" ->
++		    %% All hosts are requested, so dont filter at all
++		    fun(_, _) -> true end;
++		_ ->
++		    %% Filter the list, only Host is interesting
++		    fun(A, B) -> A == B end
++	    end,
++    Sessions3 = [ {Pid, Server, Priority} || {{_User, Server, _Resource}, {_, Pid}, Priority} <- Sessions2, apply(Fhost, [Server, Host])],
++    %% For each Pid, get its presence
++    Sessions4 = [ {ejabberd_c2s:get_presence(Pid), Server, Priority} || {Pid, Server, Priority} <- Sessions3],
++    %% Filter by status
++    Fstatus = case Status_required of
++		  "all" ->
++		      fun(_, _) -> true end;
++		  _ ->
++		      fun(A, B) -> A == B end
++	      end,
++    [{User, Server, Resource, Priority, stringize(Status_text)}
++     || {{User, Resource, Status, Status_text}, Server, Priority} <- Sessions4,
++	apply(Fstatus, [Status, Status_required])].
++
++%% Make string more print-friendly
++stringize(String) ->
++    %% Replace newline characters with other code
++    element(2, regexp:gsub(String, "\n", "\\n")).
++
++add_rosteritem(LU, LS, RU, RS, Nick, Group, Subscription, Xattrs) ->
++    subscribe(LU, LS, RU, RS, Nick, Group, Subscription, Xattrs),
++    route_rosteritem(LU, LS, RU, RS, Nick, Group, Subscription),
++    {atomic, ok}.
++
++subscribe(LocalUser, LocalServer, RemoteUser, RemoteServer, Nick, Group, Subscription, Xattrs) ->
++    R = #roster{usj = {LocalUser,LocalServer,{RemoteUser,RemoteServer,[]}},
++		us = {LocalUser,LocalServer},
++		jid = {RemoteUser,RemoteServer,[]},
++		name = Nick,
++		subscription = Subscription, % none, to=you see him, from=he sees you, both
++		ask = none, % out=send request, in=somebody requests you, none
++		groups = [Group],
++		askmessage = Xattrs, % example: [{"category","conference"}]
++		xs = []},
++    mnesia:transaction(fun() -> mnesia:write(R) end).
++
++rem_rosteritem(LU, LS, RU, RS) ->
++    unsubscribe(LU, LS, RU, RS),
++    route_rosteritem(LU, LS, RU, RS, "", "", "remove"),
++    {atomic, ok}.
++
++unsubscribe(LocalUser, LocalServer, RemoteUser, RemoteServer) ->
++    Key = {{LocalUser,LocalServer,{RemoteUser,RemoteServer,[]}},
++	   {LocalUser,LocalServer}},
++    mnesia:transaction(fun() -> mnesia:delete(roster, Key, write) end).
++
++route_rosteritem(LocalUser, LocalServer, RemoteUser, RemoteServer, Nick, Group, Subscription) ->
++    LJID = jlib:make_jid(LocalUser, LocalServer, ""),
++    RJID = jlib:make_jid(RemoteUser, RemoteServer, ""),
++    ToS = jlib:jid_to_string(LJID),
++    ItemJIDS = jlib:jid_to_string(RJID),
++    GroupXML = {xmlelement, "group", [], [{xmlcdata, Group}]},
++    Item = {xmlelement, "item",
++	    [{"jid", ItemJIDS},
++	     {"name", Nick},
++	     {"subscription", Subscription}],
++	    [GroupXML]},
++    Query = {xmlelement, "query", [{"xmlns", ?NS_ROSTER}], [Item]},
++    Packet = {xmlelement, "iq", [{"type", "set"}, {"to", ToS}], [Query]},
++    ejabberd_router:route(LJID, LJID, Packet).
++
++
++%%-----------------------------
++%% Ban user
++%%-----------------------------
++
++ban_account(User, Server, Reason) ->
++    kick_sessions(User, Server, Reason),
++    set_random_password(User, Server, Reason).
++
++kick_sessions(User, Server, Reason) ->
++    lists:map(
++      fun(Resource) ->
++	      kick_session(User, Server, Resource, Reason)
++      end,
++      get_resources(User, Server)).
++
++kick_session(User, Server, Resource, Reason) ->
++    ejabberd_router:route(
++      jlib:make_jid("", "", ""),
++      jlib:make_jid(User, Server, Resource),
++      {xmlelement, "broadcast", [], [{exit, Reason}]}).
++
++get_resources(User, Server) ->
++    lists:map(
++      fun(Session) ->
++	      element(3, Session#session.usr)
++      end,
++      get_sessions(User, Server)).
++
++get_sessions(User, Server) ->
++    LUser = jlib:nodeprep(User),
++    LServer = jlib:nameprep(Server),
++    Sessions =  mnesia:dirty_index_read(session, {LUser, LServer}, #session.us),
++    true = is_list(Sessions),
++    Sessions.
++
++set_random_password(User, Server, Reason) ->
++    NewPass = build_random_password(Reason),
++    set_password(User, Server, NewPass).
++
++build_random_password(Reason) ->
++    Date = jlib:timestamp_to_iso(calendar:universal_time()),
++    RandomString = randoms:get_string(),
++    "BANNED_ACCOUNT--" ++ Date ++ "--" ++ RandomString ++ "--" ++ Reason.
++
++set_password(User, Server, Password) ->
++    {atomic, ok} = ejabberd_auth:set_password(User, Server, Password).
++
++prepare_reason([]) ->
++    "Kicked by administrator";
++prepare_reason([Reason]) ->
++    Reason;
++prepare_reason(StringList) ->
++    string:join(StringList, "_").
++
++
++%%-----------------------------
++%% Purge roster items
++%%-----------------------------
++
++rosteritem_purge(Options) ->
++    Num_rosteritems = mnesia:table_info(roster, size),
++    io:format("There are ~p roster items in total.~n", [Num_rosteritems]),
++    Key = mnesia:dirty_first(roster),
++    ok = rip(Key, Options, {0, Num_rosteritems, 0, 0}),
++    {atomic, ok}.
++
++rip('$end_of_table', _Options, Counters) ->
++    print_progress_line(Counters),
++    ok;
++rip(Key, Options, {Pr, NT, NV, ND}) ->
++    Key_next = mnesia:dirty_next(roster, Key),
++    ND2 = case decide_rip(Key, Options) of
++	      true ->
++		  mnesia:dirty_delete(roster, Key),
++		  ND+1;
++	      false ->
++		  ND
++	  end,
++    NV2 = NV+1,
++    Pr2 = print_progress_line({Pr, NT, NV2, ND2}),
++    rip(Key_next, Options, {Pr2, NT, NV2, ND2}).
++
++print_progress_line({Pr, NT, NV, ND}) ->
++    Pr2 = trunc((NV/NT)*100),
++    case Pr == Pr2 of
++	true ->
++	    ok;
++	false ->
++	    io:format("Progress ~p% - visited ~p - deleted ~p~n", [Pr2, NV, ND])
++    end,
++    Pr2.
++
++decide_rip(Key, {Subs, Asks, User, Contact}) ->
++    case catch mnesia:dirty_read(roster, Key) of
++	[RI] ->
++	    lists:member(RI#roster.subscription, Subs)
++		andalso lists:member(RI#roster.ask, Asks)
++		andalso decide_rip_jid(RI#roster.us, User)
++		andalso decide_rip_jid(RI#roster.jid, Contact);
++	_ ->
++	    false
++    end.
++
++%% Returns true if the server of the JID is included in the servers
++decide_rip_jid({UName, UServer, _UResource}, Match_list) ->
++    decide_rip_jid({UName, UServer}, Match_list);
++decide_rip_jid({UName, UServer}, Match_list) ->
++    lists:any(
++      fun(Match_string) ->
++	      MJID = jlib:string_to_jid(Match_string),
++	      MName = MJID#jid.luser,
++	      MServer = MJID#jid.lserver,
++	      Is_server = is_glob_match(UServer, MServer),
++	      case MName of
++		  [] when UName == [] ->
++		      Is_server;
++		  [] ->
++		      false;
++		  _ ->
++		      Is_server
++			  andalso is_glob_match(UName, MName)
++	      end
++      end,
++      Match_list).
++
++%% Copied from ejabberd-2.0.0/src/acl.erl
++is_regexp_match(String, RegExp) ->
++    case regexp:first_match(String, RegExp) of
++	nomatch ->
++	    false;
++	{match, _, _} ->
++	    true;
++	{error, ErrDesc} ->
++	    io:format(
++	      "Wrong regexp ~p in ACL: ~p",
++	      [RegExp, lists:flatten(regexp:format_error(ErrDesc))]),
++	    false
++    end.
++is_glob_match(String, Glob) ->
++    is_regexp_match(String, regexp:sh_to_awk(Glob)).
++
++
++%%-----------------------------
++%% Push Roster from file
++%%-----------------------------
++
++pushroster(File, User, Server) ->
++    {ok, [Roster]} = file:consult(File),
++    subscribe_roster({User, Server, "", User}, Roster).
++
++pushroster_all(File) ->
++    {ok, [Roster]} = file:consult(File),
++    subscribe_all(Roster).
++
++subscribe_all(Roster) ->
++    subscribe_all(Roster, Roster).
++subscribe_all([], _) ->
++    ok;
++subscribe_all([User1 | Users], Roster) ->
++    subscribe_roster(User1, Roster),
++    subscribe_all(Users, Roster).
++
++subscribe_roster(_, []) ->
++    ok;
++%% Do not subscribe a user to itself
++subscribe_roster({Name, Server, Group, Nick}, [{Name, Server, _, _} | Roster]) ->
++    subscribe_roster({Name, Server, Group, Nick}, Roster);
++%% Subscribe Name2 to Name1
++subscribe_roster({Name1, Server1, Group1, Nick1}, [{Name2, Server2, Group2, Nick2} | Roster]) ->
++    subscribe(Name1, Server1, Name2, Server2, Nick2, Group2, both, []),
++    subscribe_roster({Name1, Server1, Group1, Nick1}, Roster).
++
++push_alltoall(S, G) ->
++    Users = ejabberd_auth:get_vh_registered_users(S),
++    Users2 = build_list_users(G, Users, []),
++    subscribe_all(Users2).
++
++build_list_users(_Group, [], Res) ->
++    Res;
++build_list_users(Group, [{User, Server}|Users], Res) ->
++    build_list_users(Group, Users, [{User, Server, Group, User}|Res]).
++
++vcard_get(User, Server, Data) ->
++    [{_, Module, Function, _Opts}] = ets:lookup(sm_iqtable, {?NS_VCARD, Server}),
++    JID = jlib:make_jid(User, Server, ""),
++    IQ = #iq{type = get, xmlns = ?NS_VCARD},
++    IQr = Module:Function(JID, JID, IQ),
++    Res = case IQr#iq.sub_el of
++	      [A1] ->
++		  case vcard_get(Data, A1) of
++		      false -> no_value;
++		      Elem -> xml:get_tag_cdata(Elem)
++		  end;
++	      [] ->
++		  no_vcard
++	  end,
++    {ok, Res}.
++
++vcard_get([Data1, Data2], A1) ->
++    case xml:get_subtag(A1, Data1) of
++    	false -> false;
++	A2 -> vcard_get([Data2], A2)
++    end;
++
++vcard_get([Data], A1) ->
++    xml:get_subtag(A1, Data).
++
++vcard_set(User, Server, Data, Content) ->
++    [{_, Module, Function, _Opts}] = ets:lookup(sm_iqtable, {?NS_VCARD, Server}),
++    JID = jlib:make_jid(User, Server, ""),
++    IQ = #iq{type = get, xmlns = ?NS_VCARD},
++    IQr = Module:Function(JID, JID, IQ),
++
++    %% Get old vcard
++    A4 = case IQr#iq.sub_el of
++	     [A1] ->
++		 {_, _, _, A2} = A1,
++		 update_vcard_els(Data, Content, A2);
++	     [] ->
++		 update_vcard_els(Data, Content, [])
++	 end,
++
++    %% Build new vcard
++    SubEl = {xmlelement, "vCard", [{"xmlns","vcard-temp"}], A4},
++    IQ2 = #iq{type=set, sub_el = SubEl},
++
++    Module:Function(JID, JID, IQ2),
++    {ok, "done"}.
++
++update_vcard_els(Data, Content, Els1) ->
++    Els2 = lists:keysort(2, Els1),
++    [Data1 | Data2] = Data,
++    NewEl = case Data2 of
++		[] ->
++		    {xmlelement, Data1, [], [{xmlcdata,Content}]};
++		[D2] ->
++		    OldEl = case lists:keysearch(Data1, 2, Els2) of
++				{value, A} -> A;
++				false -> {xmlelement, Data1, [], []}
++			    end,
++		    {xmlelement, _, _, ContentOld1} = OldEl,
++		    Content2 = [{xmlelement, D2, [], [{xmlcdata,Content}]}],
++		    ContentOld2 = lists:keysort(2, ContentOld1),
++		    ContentOld3 = lists:keydelete(D2, 2, ContentOld2),
++		    ContentNew = lists:keymerge(2, Content2, ContentOld3),
++		    {xmlelement, Data1, [], ContentNew}
++	    end,
++    Els3 = lists:keydelete(Data1, 2, Els2),
++    lists:keymerge(2, [NewEl], Els3).
++
++-record(last_activity, {us, timestamp, status}).
++
++delete_older_users(Days) ->
++    %% Convert older time
++    SecOlder = Days*24*60*60,
++
++    %% Get current time
++    {MegaSecs, Secs, _MicroSecs} = now(),
++    TimeStamp_now = MegaSecs * 1000000 + Secs,
++
++    %% Get the list of registered users
++    Users = ejabberd_auth:dirty_get_registered_users(),
++
++    %% For a user, remove if required and answer true
++    F = fun({LUser, LServer}) ->
++		%% Check if the user is logged
++		case ejabberd_sm:get_user_resources(LUser, LServer) of
++		    %% If it isnt
++		    [] ->
++			%% Look for his last_activity
++			case mnesia:dirty_read(last_activity, {LUser, LServer}) of
++			    %% If it is
++			    %% existent:
++			    [#last_activity{timestamp = TimeStamp}] ->
++				%% get his age
++				Sec = TimeStamp_now - TimeStamp,
++				%% If he is
++				if
++				    %% younger than SecOlder:
++				    Sec < SecOlder ->
++					%% do nothing
++					false;
++				    %% older:
++				    true ->
++					%% remove the user
++					ejabberd_auth:remove_user(LUser, LServer),
++					true
++				end;
++			    %% nonexistent:
++			    [] ->
++				%% remove the user
++				ejabberd_auth:remove_user(LUser, LServer),
++				true
++			end;
++		    %% Else
++		    _ ->
++			%% do nothing
++			false
++		end
++	end,
++    %% Apply the function to every user in the list
++    Users_removed = lists:filter(F, Users),
++    {removed, length(Users_removed), Users_removed}.
++
++num_active_users(Host, Days) ->
++    list_last_activity(Host, true, Days).
++
++%% Code based on ejabberd/src/web/ejabberd_web_admin.erl
++list_last_activity(Host, Integral, Days) ->
++    {MegaSecs, Secs, _MicroSecs} = now(),
++    TimeStamp = MegaSecs * 1000000 + Secs,
++    TS = TimeStamp - Days * 86400,
++    case catch mnesia:dirty_select(
++		 last_activity, [{{last_activity, {'_', Host}, '$1', '_'},
++				  [{'>', '$1', TS}],
++				  [{'trunc', {'/',
++					      {'-', TimeStamp, '$1'},
++					      86400}}]}]) of
++							      {'EXIT', _Reason} ->
++		 [];
++	       Vals ->
++		 Hist = histogram(Vals, Integral),
++		 if
++		     Hist == [] ->
++			 0;
++		     true ->
++			 Left = if
++				    Days == infinity ->
++					0;
++				    true ->
++					Days - length(Hist)
++				end,
++			 Tail = if
++				    Integral ->
++					lists:duplicate(Left, lists:last(Hist));
++				    true ->
++					lists:duplicate(Left, 0)
++				end,
++			 lists:nth(Days, Hist ++ Tail)
++		 end
++	 end.
++histogram(Values, Integral) ->
++    histogram(lists:sort(Values), Integral, 0, 0, []).
++histogram([H | T], Integral, Current, Count, Hist) when Current == H ->
++    histogram(T, Integral, Current, Count + 1, Hist);
++histogram([H | _] = Values, Integral, Current, Count, Hist) when Current < H ->
++    if
++	Integral ->
++	    histogram(Values, Integral, Current + 1, Count, [Count | Hist]);
++	true ->
++	    histogram(Values, Integral, Current + 1, 0, [Count | Hist])
++    end;
++histogram([], _Integral, _Current, Count, Hist) ->
++    if
++	Count > 0 ->
++	    lists:reverse([Count | Hist]);
++	true ->
++	    lists:reverse(Hist)
++    end.
++
++group_parameters(Ps, [Char]) ->
++	{none, Grouped_Ps} = lists:foldl(
++		fun(P, {State, Res}) ->
++			case State of
++				none ->
++					case P of
++						[Char | PTail]->
++							{building, [PTail | Res]};
++						_ ->
++							{none, [P | Res]}
++					end;
++				building ->
++					[ResHead | ResTail] = Res,
++					case lists:last(P) of
++						Char ->
++							P2 = lists:sublist(P, length(P)-1),
++							{none, [ResHead ++ " " ++ P2 | ResTail]};
++						_ ->
++							{building, [ResHead ++ " " ++ P | ResTail]}
++					end
++			end
++		end,
++		{none, []},
++		Ps),
++	lists:reverse(Grouped_Ps).
--- ejabberd-2.0.5.orig/debian/patches/series
+++ ejabberd-2.0.5/debian/patches/series
@@ -0,0 +1,9 @@
+ssl.patch
+proxy.patch
+convert.patch
+s2s.patch
+caps.patch
+mod_ctlextra.patch
+shared_roster_recent.patch
+shared_roster_online.patch
+#ldaps.patch
--- ejabberd-2.0.5.orig/debian/patches/shared_roster_online.patch
+++ ejabberd-2.0.5/debian/patches/shared_roster_online.patch
@@ -0,0 +1,237 @@
+Index: ejabberd-2.0.5/src/mod_shared_roster.erl
+===================================================================
+--- ejabberd-2.0.5.orig/src/mod_shared_roster.erl	2009-04-05 22:51:20.000000000 +0200
++++ ejabberd-2.0.5/src/mod_shared_roster.erl	2009-04-05 22:51:20.000000000 +0200
+@@ -39,6 +39,8 @@
+ 	 out_subscription/4,
+ 	 register_user/2,
+ 	 remove_user/2,
++	 user_available/1,
++	 unset_presence/4,
+ 	 list_groups/1,
+ 	 create_group/2,
+ 	 create_group/3,
+@@ -88,7 +90,11 @@
+     ejabberd_hooks:add(register_user, Host,
+ 		       ?MODULE, register_user, 50),
+     ejabberd_hooks:add(remove_user, Host,
+-		       ?MODULE, remove_user, 50).
++		       ?MODULE, remove_user, 50),
++    ejabberd_hooks:add(user_available_hook, Host,
++         	       ?MODULE, user_available, 50),
++    ejabberd_hooks:add(unset_presence_hook, Host,
++         	       ?MODULE, unset_presence, 50).
+ %%ejabberd_hooks:add(remove_user, Host,
+ %%    	       ?MODULE, remove_user, 50),
+ 
+@@ -112,7 +118,11 @@
+     ejabberd_hooks:delete(register_user, Host,
+ 			  ?MODULE, register_user, 50),
+     ejabberd_hooks:delete(remove_user, Host,
+-			  ?MODULE, remove_user, 50).
++			  ?MODULE, remove_user, 50),
++    ejabberd_hooks:delete(user_available_hook, Host,
++			  ?MODULE, user_available, 50),
++    ejabberd_hooks:delete(unset_presence_hook, Host,
++			  ?MODULE, unset_presence, 50).
+ %%ejabberd_hooks:delete(remove_user, Host,
+ %%    		  ?MODULE, remove_user, 50),
+ 
+@@ -482,6 +492,9 @@
+     %% Apply the function to every user in the list
+     lists:filter(F, Users).
+ 
++get_online_users(Host) ->
++    lists:usort([{U, S} || {U, S, _} <- ejabberd_sm:get_vh_session_list(Host)]).
++
+ get_group_users(Host, Group) ->
+     case get_group_opt(Host, Group, all_users, false) of
+ 	true ->
+@@ -495,6 +508,12 @@
+ 	Days when is_integer(Days) ->
+             get_recent_users(Host, Days)
+     end ++
++    case get_group_opt(Host, Group, online_users, false) of
++	true ->
++	    get_online_users(Host);
++	false ->
++	    []
++    end ++
+     get_group_explicit_users(Host, Group).
+ 
+ get_group_users(_User, Host, Group, GroupOpts) ->
+@@ -510,6 +529,12 @@
+ 	Days when is_integer(Days) ->
+             get_recent_users(Host, Days)
+     end ++
++    case proplists:get_value(online_users, GroupOpts,false) of
++	true ->
++	    get_online_users(Host);
++	false ->
++	    []
++    end ++
+     get_group_explicit_users(Host, Group).
+ 
+ %% @spec (Host::string(), Group::string()) -> [{User::string(), Server::string()}]
+@@ -533,7 +558,8 @@
+     lists:filter(
+       fun(Group) ->
+ 	      get_group_opt(Host, Group, all_users, false) orelse
+-	      get_group_opt(Host, Group, recent_users_days, 0) > 0
++	      get_group_opt(Host, Group, recent_users_days, 0) > 0 orelse
++	      get_group_opt(Host, Group, online_users, false)
+       end,
+       list_groups(Host)).
+ 
+@@ -664,6 +690,103 @@
+ 			push_roster_item(U, S, LUser, LServer, GroupName, Subscription)
+ 		end, get_group_users(LUser, LServer, Group, GroupOpts))
+       end, lists:usort(SpecialGroups++UserGroups)).
++ 
++%% get a roster item for a contact from a particular user's
++%% perspective, considering both normal and shared roster items
++%% FIXME: is there a more efficient way to do this?
++get_user_roster_item(FromUS, ToUS) ->
++    {FUser, FServer} = FromUS,
++    case catch ejabberd_hooks:run_fold(roster_get, FServer, [], [ToUS]) of
++      Items when is_list(Items) ->
++	case [I || I <- Items, I#roster.jid == {FUser, FServer, []}] of
++	  [Item | _ ] ->
++	    Item;
++	  [] ->
++	    false
++	end;
++      _ ->
++	error
++    end.
++
++user_available(New) ->
++    LUser = New#jid.luser,
++    LServer = New#jid.lserver,
++    ?INFO_MSG("user_available for ~p @ ~p (~p resources)",
++        [LUser, LServer,
++         length(ejabberd_sm:get_user_resources(LUser, LServer))]),
++    case length(ejabberd_sm:get_user_resources(LUser, LServer)) of
++      %% first session for this user
++      1 ->
++	%% find all online users on the new user's server, but not the new user himself
++	OnlineUsers = [US || US <- get_online_users(LServer),
++			     US /= {LUser, LServer}],
++	%% for each of these people
++	lists:foreach(
++	  fun({U, S} = OnlineUS) ->
++	    %% see if they are displaying any @online@ groups
++	    DisplayedGroups = get_user_displayed_groups(OnlineUS),
++	    OnlineGroups = lists:filter(
++		fun(Group) ->
++		  get_group_opt(LServer, Group, online_users, false)
++		end, DisplayedGroups),
++	    case OnlineGroups of
++	      [] ->
++		ok;
++	      _ ->
++		%% if so, push them an item for the new user
++		case get_user_roster_item({LUser, LServer}, OnlineUS) of
++		  Item when is_record(Item, roster) ->
++		    push_item(U, S, jlib:make_jid("", S, ""), Item), ok;
++		  _ ->
++		    ok
++		end
++	    end
++	  end, OnlineUsers);
++      _ ->
++	ok
++    end.
++
++unset_presence(LUser, LServer, Resource, Status) ->
++    ?INFO_MSG("unset_presence for ~p @ ~p / ~p -> ~p (~p resources)",
++        [LUser, LServer, Resource, Status,
++         length(ejabberd_sm:get_user_resources(LUser, LServer))]),
++    %% if user has no resources left...
++    case length(ejabberd_sm:get_user_resources(LUser, LServer)) of
++      0 ->
++	%% find all users on their server
++	OnlineUsers = get_online_users(LServer),
++	lists:foreach(
++	  fun({U, S} = OnlineUS) ->
++	    %% see if they are displaying any @online@ groups
++	    DisplayedGroups = get_user_displayed_groups(OnlineUS),
++	    OnlineGroups = lists:filter(
++	      fun(Group) ->
++		get_group_opt(LServer, Group, online_users, false)
++	      end, DisplayedGroups),
++	    case OnlineGroups of
++	      [] ->
++	        ok;
++	      _ ->
++		%% push them their item for the departed user, or remove it
++		case get_user_roster_item({LUser, LServer}, OnlineUS) of
++		  Item when is_record(Item, roster) ->
++		    PushItem = Item;
++		  _ ->
++		    PushItem = #roster{usj = {U, S, {LUser, LServer, ""}},
++				       us = OnlineUS,
++				       jid = {LUser, LServer, ""},
++				       name = "",
++				       subscription = remove,
++				       ask = none,
++				       groups = []}
++		end,
++		push_item(U, S, jlib:make_jid("", S, ""), PushItem),
++		ok
++	    end
++	  end, OnlineUsers);
++      _ ->
++	ok
++    end.
+ 
+ push_user_to_displayed(LUser, LServer, Group, Subscription) ->
+     GroupsOpts = groups_with_opts(LServer),
+@@ -862,6 +985,7 @@
+     Description = get_opt(GroupOpts, description, ""),
+     AllUsers = get_opt(GroupOpts, all_users, false),
+     RecentUsersDays = get_opt(GroupOpts, recent_users_days, 0),
++    OnlineUsers = get_opt(GroupOpts, online_users, false),
+     %%Disabled = false,
+     DisplayedGroups = get_opt(GroupOpts, displayed_groups, []),
+     Members = mod_shared_roster:get_group_explicit_users(Host, Group),
+@@ -878,6 +1002,12 @@
+ 	    true ->
+ 		[]
+ 	end ++
++	if
++	    OnlineUsers ->
++		"@online@\n";
++	    true ->
++		[]
++	end ++
+ 	[[us_to_list(Member), $\n] || Member <- Members],
+     FDisplayedGroups = [[DG, $\n] || DG <- DisplayedGroups],
+     FGroup =
+@@ -963,6 +1093,8 @@
+ 				  USs;
+ 			      "@recent@" ->
+ 				  USs;
++			      "@online@" ->
++				  USs;
+ 			      _ ->
+ 				  case jlib:string_to_jid(SJID) of
+ 				      JID when is_record(JID, jid) ->
+@@ -983,11 +1115,16 @@
+ 		    true -> [{recent_users_days, 7}];
+ 		    false -> []
+ 		end,
++	    OnlineUsersOpt =
++		case lists:member("@online@", SJIDs) of
++		    true -> [{online_users, true}];
++		    false -> []
++		end,
+ 
+ 	    mod_shared_roster:set_group_opts(
+ 	      Host, Group,
+ 	      NameOpt ++ DispGroupsOpt ++ DescriptionOpt ++ AllUsersOpt
+-		++ RecentUsersOpt),
++		++ RecentUsersOpt ++ OnlineUsersOpt),
+ 
+ 	    if
+ 		NewMembers == error -> error;
