#!/bin/sh # Exit immediately if a command produces an error. set -e # Source debconf library . /usr/share/debconf/confmodule # Create a dpkg-statoverride add function. add_override() { if ! dpkg-statoverride --list $4 >/dev/null 2>&1; then dpkg-statoverride --update --add $1 $2 $3 $4 fi } if [ "$1" = "configure" ]; then # Populate /etc/courier/calendarmode. db_get sqwebmail/calendarmode if [ "$RET" = "local" ]; then echo local > /etc/courier/calendarmode elif [ "$RET" = "net" ]; then echo net > /etc/courier/calendarmode else echo > /etc/courier/calendarmode fi # Populate /etc/courier/ispelldict. db_get sqwebmail/dictionary echo -n "$RET" > /etc/courier/ispelldict # Add the dpkg-statoverrides. TODO. The first one could probably be removed as the default is root:root 755, which ends up being the same permissions. add_override root courier 0755 /usr/lib/courier/courier/webmail add_override courier courier 2755 /usr/lib/courier/courier/sqwebpasswd add_override bin bin 700 /var/cache/sqwebmail add_override courier courier 0750 /var/lib/courier/calendar # Delete the obsolete /var/www/sqwebmail directory. This can be removed in forky+1. rm -rf /var/www/sqwebmail # Delete the obsolete Apache 2 config files. These can be removed in forky+1. rm -f /etc/apache2/conf-available/sqwebmail.apache24.conf rm -f /etc/apache2/conf-enabled/sqwebmail.apache24.conf fi # Automatically added by dh_installtmpfiles/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "$(command -v systemd-tmpfiles)" ]; then systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create sqwebmail.conf || true fi fi # End automatically added section # Automatically added by dh_installinit/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "$DPKG_ROOT" ] && [ -x "/etc/init.d/sqwebmail" ]; then update-rc.d sqwebmail defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native sqwebmail $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'sqwebmail.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'sqwebmail.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'sqwebmail.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 'sqwebmail.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'sqwebmail.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'sqwebmail-cleancache.timer' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'sqwebmail-cleancache.timer'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'sqwebmail-cleancache.timer' >/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 'sqwebmail-cleancache.timer' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.26 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'sqwebmail-cleancache.service' 'sqwebmail-cleancache.timer' >/dev/null || true fi fi # End automatically added section exit 0