#!/bin/sh set -e # Source debconf library . /usr/share/debconf/confmodule add_override() { if ! dpkg-statoverride --list $4 >/dev/null; then dpkg-statoverride --update --add $1 $2 $3 $4 fi } if [ "$1" = "configure" ]; then db_get sqwebmail/install-www if [ "$RET" = "symlink" ]; then db_get sqwebmail/install-www-backup if [ "$RET" = "copy" ]; then rm -rf /var/www/sqwebmail elif [ "$RET" = "symlink" ]; then rm -f /var/www/sqwebmail fi ln -sf /usr/share/sqwebmail /var/www/sqwebmail elif [ "$RET" = "copy" ]; then if [ "$RET" = "copy" ]; then rm -rf /var/www/sqwebmail elif [ "$RET" = "symlink" ]; then rm -f /var/www/sqwebmail fi mkdir -p /var/www/sqwebmail cp -a /usr/share/sqwebmail/* /var/www/sqwebmail fi # configure calendarmode db_get sqwebmail/calendarmode CALFILE=/etc/courier/calendarmode if [ "$RET" = "local" ]; then echo local > $CALFILE elif [ "$RET" = "net" ]; then echo net > $CALFILE else echo > $CALFILE fi # create ispelldict configuration db_get sqwebmail/dictionary echo -n "$RET" > /etc/courier/ispelldict add_override root courier 0755 /usr/lib/courier/courier/webmail add_override courier courier 2755 /usr/lib/courier/courier/sqwebpasswd add_override courier courier 0700 /var/cache/sqwebmail add_override courier courier 0750 /var/lib/courier/calendar fi # Automatically added by dh_apache2/UNDECLARED if true; then if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then . /usr/share/apache2/apache2-maintscript-helper for conf in sqwebmail.apache24 ; do apache2_invoke enconf $conf || exit 1 done fi fi # End automatically added section # Automatically added by dh_installtmpfiles/13.14.1 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.14.1 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.14.1 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.14.1 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 exit 0