postinst is in courier-filter-perl 0.200+ds-4.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #!/bin/sh
set -e
mode=$1
# Move a conffile without triggering a dpkg question
mv_conffile() {
OLDCONFFILE="$1"
NEWCONFFILE="$2"
if [ -e "$OLDCONFFILE" ]; then
echo "Preserving user changes in $OLDCONFFILE to $NEWCONFFILE ..."
mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
mv -f "$OLDCONFFILE" "$NEWCONFFILE"
fi
}
# Move a conffile to a non-conffile
mv_conffile_to_noncf() {
OLDCONFFILE="$1"
NEWCONFFILE="$2"
if [ -e "$OLDCONFFILE" ]; then
echo "Preserving user changes in $OLDCONFFILE to $NEWCONFFILE ..."
mv -f "$OLDCONFFILE" "$NEWCONFFILE"
fi
}
case "$mode" in
configure )
old_version=$2
config_file=/etc/courier/filters/courier-filter-perl.conf
if dpkg --compare-versions "$old_version" lt "0.200"; then
# Preserve customized old config file, if any:
mv_conffile_to_noncf /etc/courier/filters/pureperlfilter.conf $config_file
fi
if [ ! -e $config_file ]; then
# No config file exists, create one:
cp /usr/share/courier-filter-perl/courier-filter-perl.conf.bare $config_file
fi
echo "Starting courier-filter-perl mail filter ..."
filterctl start courier-filter-perl
;;
esac
|