--- guam-0.9.14.orig/debian/changelog
+++ guam-0.9.14/debian/changelog
@@ -0,0 +1,244 @@
+guam (0.9.14-1) unstable; urgency=medium
+
+  * Release of version 0.9.14
+
+ -- Christian Mollekopf <mollekopf@apheleia-it.ch>  Tue,  14 April 2026 09:31:31 +0200
+
+guam (0.9.13-1) unstable; urgency=medium
+
+  * Release of version 0.9.13
+
+ -- Christian Mollekopf <mollekopf@apheleia-it.ch>  Mon,  12 Sep 2022 09:31:31 +0200
+
+guam (0.9.12-2) unstable; urgency=medium
+
+  * Moved vendorized libraries to private location
+
+ -- Christian Mollekopf <mollekopf@apheleia-it.ch>  Tue,  14 Jun 2022 09:31:31 +0200
+
+guam (0.9.12-1) unstable; urgency=medium
+
+  * Release of version 0.9.12
+
+ -- Christian Mollekopf <mollekopf@apheleia-it.ch>  Tue,  19 Apr 2022 09:31:31 +0200
+
+guam (0.9.11-1) unstable; urgency=medium
+
+  * Release of version 0.9.11
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Mon,  07 Jun 2021 09:31:31 +0200
+
+guam (0.9.10-1) unstable; urgency=medium
+
+  * Release of version 0.9.10
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Mon,  31 May 2021 09:31:31 +0200
+
+guam (0.9.9-1) unstable; urgency=medium
+
+  * Release of version 0.9.9
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Mon,  14 Dec 2020 09:31:31 +0200
+
+guam (0.9.8-2) unstable; urgency=medium
+
+  * Fixed STARTTLS
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Mon,  9 Nov 2020 09:31:31 +0200
+
+guam (0.9.8-1) unstable; urgency=medium
+
+  * Release of version 0.9.8
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Mon,  26 Oct 2020 09:31:31 +0200
+
+guam (0.9.7-3) unstable; urgency=medium
+
+  * Updated debian/postinst script
+
+ -- Daniel Hoffend <dh@dotlan.net>  Wed,  22 Apr 2020 00:46:22 +0200
+
+guam (0.9.7-1) unstable; urgency=medium
+
+  * Release of version 0.9.7
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Wed,  15 Apr 2020 09:31:31 +0200
+
+guam (0.9.6-1) unstable; urgency=medium
+
+  * Release of version 0.9.6
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Tue,  31 Mar 2020 09:31:31 +0200
+
+guam (0.9.5-2) unstable; urgency=medium
+
+  * Release of version 0.9.5
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Thu,  5 Dec 2019 09:31:31 +0200
+
+guam (0.9.4-16) unstable; urgency=medium
+
+  * Fix LIST-EXTENDED, LIST-STATUS and other LIST return options for purely numeric folder names (T209164)
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Wed, 15 May 2019 09:31:31 +0200
+
+guam (0.9.4-14) unstable; urgency=medium
+
+  * Removed the unavailable syslog backend for plesk.
+
+ -- Christian Mollekopf (Kolab Systems) <mollekopf@kolabsys.com>  Tue,  23 Apr 2019 09:31:31 +0200
+
+guam (0.9.4-13) unstable; urgency=medium
+
+  * Fix LIST-EXTENDED, LIST-STATUS and other LIST return options response filtering (Bifrost T160184)
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Wed,  2 Jan 2019 09:31:31 +0200
+
+guam (0.9.4-12) unstable; urgency=medium
+
+  * Rebuild
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Thu, 13 Dec 2018 09:31:31 +0200
+
+guam (0.9.4-9) unstable; urgency=medium
+
+  * Add setting cacertfile for Plesk (Bifrost T143291)
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Thu,  4 Oct 2018 09:31:31 +0200
+
+guam (0.9.4-8) unstable; urgency=medium
+
+  * Fix lib symlink
+  * Add missing dependency on erlang-goldrush
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Wed, 04 Jul 2018 09:04:39 +0200
+
+guam (0.9.4-7) unstable; urgency=medium
+
+  * Fix generating DH parameters on openssl >= 1.1.0f with gendh->dhparam
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Sat, 19 May 2018 09:31:31 +0200
+
+guam (0.9.4-6) unstable; urgency=medium
+
+  * Apply patch that fixes stalling client buffers and handling of split commands
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Tue, 08 May 2018 09:31:31 +0200
+
+guam (0.9.4-5) unstable; urgency=medium
+
+  * Add erlang-eimap to guam-bundled-libs
+  * Make logs go to /var/log/guam
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Fri, 04 May 2018 09:59:56 +0200
+
+guam (0.9.4-4) unstable; urgency=medium
+
+  * Fix packaging, dependencies and more stuff
+  * Make package compatible with Erlang from backports
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Sat, 21 Apr 2017 10:39:28 +0200
+
+guam (0.9.4-3) unstable; urgency=medium
+
+  * Use script rather than symlink
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Thu, 19 Apr 2017 21:33:45 +0200
+
+guam (0.9.4-2) unstable; urgency=medium
+
+  * Ship correct variants of sys.config and vm.args
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Thu, 19 Apr 2017 19:36:20 +0200
+
+guam (0.9.4-1) unstable; urgency=medium
+
+  * Release of version 0.9.4
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Sun, 15 Apr 2017 23:14:48 +0200
+
+guam (0.9.2-4) unstable; urgency=medium
+
+  * Allow empty lines in commands
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Tue, 27 Feb 2018 06:06:06 +0600
+
+guam (0.9.2-3) unstable; urgency=medium
+
+  * Rebuild
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Tue, 29 Aug 2017 06:06:06 +0600
+
+guam (0.9.2-2) unstable; urgency=medium
+
+  * Fix potentially empty responses
+  * Fix T25795 / IDLE passthrough
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Mon, 26 Jun 2017 06:06:06 +0600
+
+guam (0.9.2-1) unstable; urgency=medium
+
+  * Release of version 0.9.2
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Mon, 19 Jun 2017 06:06:06 +0600
+
+guam (0.8.3-1.3) unstable; urgency=medium
+
+  * Ship a different default config for Plesk
+  * Unmask service if masked
+
+ -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>  Wed,  8 Feb 2017 12:12:12 +0100
+
+guam (0.8.3-1) unstable; urgency=medium
+
+  * Release of 0.8.3
+
+ -- Aaron Seigo <seigo@kolabsystems.com>  Tue,  12 Jul 2016 13:00:00 +0600
+
+guam (0.8.2-2) unstable; urgency=medium
+
+  * Fix T1345
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Fri,  8 Jul 2016 06:06:06 +0600
+
+guam (0.8.2-1) unstable; urgency=medium
+
+  * Release of 0.8.2
+
+ -- Aaron Seigo <seigo@kolabsystems.com>  Wed,  6 Jul 2016 13:00:00 +0600
+
+guam (0.8.1-1) unstable; urgency=medium
+
+  * Release of 0.8.1
+
+ -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>  Tue,  5 Jul 2016 06:06:06 +0600
+
+guam (0.8-2mic1) unstable; urgency=medium
+
+  * add patches from rpm builds
+
+ -- hede <kolab983@der-he.de>  Tue, 28 Jun 2016 06:54:23 +0100
+
+guam (0.8-2) unstable; urgency=medium
+
+  * Package version 0.8
+
+ -- Aaron Seigo <seigo@kolabsystems.com>  Fri, 10 Jun 2016 10:54:23 +0100
+
+guam (0.8-1+git20160219~kolab1) unstable; urgency=medium
+
+  * Bump to new git version.
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Sat, 27 Feb 2016 23:30:08 +0100
+
+guam (0.8-1+git20160111~kolab1) unstable; urgency=medium
+
+  * Bump to new git version.
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Thu, 11 Feb 2016 21:04:08 +0100
+
+guam (0.7.1-1~kolab1) unstable; urgency=medium
+
+  * Initial release.
+
+ -- Christoph Erhardt <kolab@sicherha.de>  Sun, 07 Feb 2016 08:48:37 +0100
--- guam-0.9.14.orig/debian/compat
+++ guam-0.9.14/debian/compat
@@ -0,0 +1 @@
+9
--- guam-0.9.14.orig/debian/control
+++ guam-0.9.14/debian/control
@@ -0,0 +1,20 @@
+Source: guam
+Section: mail
+Priority: extra
+Maintainer: Christoph Erhardt <kolab@sicherha.de>
+Standards-Version: 3.9.6
+Build-Depends: debhelper (>= 10) | dh-systemd (>= 1.5),
+	erlang (>= 17.4),
+	psa | bash
+Homepage: https://kolab.org/about/guam
+
+Package: guam
+Architecture: any
+Section: mail
+Depends: erlang-base | erlang-base-hipe,
+    erlang-asn1,
+    erlang-inets,
+    erlang-public-key
+Description: Smart Reverse IMAP Proxy
+ Guam is a smart, unjustly outcast Reverse IMAP Proxy that lives at
+ the perimeter of your IMAP environment.
--- guam-0.9.14.orig/debian/copyright
+++ guam-0.9.14/debian/copyright
@@ -0,0 +1,24 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: guam
+Source: https://kolab.org/about/guam
+
+Files: *
+Copyright: 2016 Kolab Systems AG <contact@kolabsys.com>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
--- guam-0.9.14.orig/debian/postinst
+++ guam-0.9.14/debian/postinst
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+case "$1" in
+    configure)
+        if [ ! -f "/etc/guam/dh_2048.pem" ]; then
+            openssl gendh -out /etc/guam/dh_2048.pem -2 2048 >/dev/null 2>&1 || \
+            openssl dhparam -out /etc/guam/dh_2048.pem -2 2048 >/dev/null 2>&1
+        fi
+
+        # This will only remove masks created by d-s-h on package removal.
+        deb-systemd-helper unmask 'guam.service' >/dev/null || true
+
+        # was-enabled defaults to true, so new installations run enable.
+        if deb-systemd-helper --quiet was-enabled 'guam.service'; then
+                # Enables the unit on first installation, creates new
+                # symlinks on upgrades if the unit file has changed.
+                deb-systemd-helper enable 'guam.service' >/dev/null || true
+        else
+                # Update the statefile to add new symlinks (if any), which need to be
+                # cleaned up on purge. Also remove old symlinks.
+                deb-systemd-helper update-state 'guam.service' >/dev/null || true
+        fi
+
+        # start or restart on install/updated
+        systemctl --system daemon-reload >/dev/null || true
+        if [ -n "$2" ]; then
+                _dh_action=restart
+        else
+                _dh_action=start
+        fi
+        deb-systemd-invoke $_dh_action 'guam.service' >/dev/null || true
+    ;;
+esac
--- guam-0.9.14.orig/debian/rules
+++ guam-0.9.14/debian/rules
@@ -0,0 +1,99 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/pkg-info.mk
+
+DESTDIR   = $(CURDIR)/debian/guam
+
+%:
+	dh $@ --with=systemd
+
+override_dh_auto_build:
+	export DEBUG=1
+	export HEX_OFFLINE=true
+	export REBAR_CACHE_DIR="cache/rebar3/"
+
+	# Rebuild all beam files (The otp version from the tarball may not match)
+	rm -rf _build
+	./rebar3 compile
+
+	./rebar3 release \
+		--dev-mode false \
+		--relname guam \
+		--relvsn $(DEB_VERSION_UPSTREAM)
+
+override_dh_auto_clean:
+    # do nothing, rebar3 clean would clear the artifacts that we need above
+    #./rebar3 clean || :
+
+override_dh_auto_test:
+	export DEBUG=1
+	export HEX_OFFLINE=true
+	export REBAR_CACHE_DIR="cache/rebar3/"
+	./rebar3 eunit -v || :
+	./rebar3 ct -v || :
+
+override_dh_auto_install:
+	mkdir -p $(DESTDIR)/usr/sbin \
+		$(DESTDIR)/etc/guam \
+		$(DESTDIR)/lib/systemd/system \
+		$(DESTDIR)/var/log/ \
+		$(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/ \
+		$(DESTDIR)/usr/lib/erlang/bin \
+		$(DESTDIR)/var/log/guam
+	chmod o= $(DESTDIR)/var/log/guam
+
+	# Service scripts
+	install -p -m 644 contrib/guam.service \
+			$(DESTDIR)/lib/systemd/system/guam.service
+
+	rm _build/default/rel/guam/releases/$(DEB_VERSION_UPSTREAM)/sys.config
+	rm _build/default/rel/guam/releases/$(DEB_VERSION_UPSTREAM)/vm.args
+
+	cp -a _build/default/rel/guam/releases \
+		$(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/
+
+	# Configuration
+	if [ -f "/etc/plesk-release" ]; then \
+		cp ../SOURCES/plesk.sys.config \
+			$(DESTDIR)/etc/guam/sys.config ; \
+	else \
+		sed -i -e 's/pki\/tls\/private\/localhost\.pem/ssl\/certs\/ssl-cert-snakeoil.pem/' \
+			-e 's/pki\/tls\/private\/localhost\.ca\.pem/ssl\/certs\/ssl-cert-snakeoil.pem/' \
+			-e 's/pki\/tls\/private\/localhost\.key/ssl\/private\/ssl-cert-snakeoil.key/' \
+			_build/default/rel/guam/etc/sys.config ; \
+		cp _build/default/rel/guam/etc/sys.config \
+			$(DESTDIR)/etc/guam/sys.config ; \
+	fi
+
+	ln -s ../../../../../../../etc/guam/sys.config \
+		$(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/releases/$(DEB_VERSION_UPSTREAM)/sys.config
+
+	cp _build/default/rel/guam/vm.args $(DESTDIR)/etc/guam/vm.args
+
+	ln -s ../../../../../../../etc/guam/vm.args \
+		$(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/releases/$(DEB_VERSION_UPSTREAM)/vm.args
+
+	ln -s ../../../../../var/log/guam $(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/log
+
+	cp -a _build/default/rel/guam/bin \
+		$(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/
+
+	# Remove the sources
+	find _build/default/rel/guam/lib/ -type d -name "src" -exec rm -Rf {} +
+
+	# Copy over all lib dirs
+	cp -av _build/default/rel/guam/lib $(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/lib
+
+	# Copy over the release directory as well
+	cp -av _build/default/rel/guam/releases/ $(DESTDIR)/usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/
+
+	echo '#!/bin/bash' > $(DESTDIR)/usr/sbin/guam
+	echo 'exec /usr/lib/erlang/lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/bin/guam $$*' \
+		 >> $(DESTDIR)/usr/sbin/guam
+	chmod +x $(DESTDIR)/usr/sbin/guam
+
+	ln -s ../lib/kolab_guam-$(DEB_VERSION_UPSTREAM)/bin/guam \
+		$(DESTDIR)/usr/lib/erlang/bin/kolab_guam
+
+override_dh_gencontrol:
+	dh_gencontrol
--- guam-0.9.14.orig/debian/source/format
+++ guam-0.9.14/debian/source/format
@@ -0,0 +1 @@
+1.0
