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
[ "$1" = configure ] || exit 0
. /usr/share/debconf/confmodule
db_version 2.0
umask 022
db_get shared/mailname
echo "$RET" > /etc/mailname.new
ucf /etc/mailname.new /etc/mailname < /dev/tty
rm -f /etc/mailname.new
db_get nullmailer/relayhost
echo "$RET" | tr ':' '\n' > /etc/nullmailer/remotes.new
ucf /etc/nullmailer/remotes.new /etc/nullmailer/remotes < /dev/tty
rm -f /etc/nullmailer/remotes.new
db_get nullmailer/adminaddr
if [ "$RET" ]; then
echo "$RET" > /etc/nullmailer/adminaddr.new
else
echo -n > /etc/nullmailer/adminaddr.new
fi
ucf /etc/nullmailer/adminaddr.new /etc/nullmailer/adminaddr < /dev/tty
rm -f /etc/nullmailer/adminaddr.new
db_stop
# for compatibility < 1.00RC5-11
[ -d /var/lib/nullmailer ] && cp -a /var/lib/nullmailer /var/spool && rm -rf /var/lib/nullmailer || true
# sanity checks
chmod 0755 /var/spool/nullmailer
chmod 0750 /var/spool/nullmailer/queue
chmod 0750 /var/spool/nullmailer/tmp
chown -R mail:root /var/spool/nullmailer
update-rc.d nullmailer defaults > /dev/null
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d nullmailer start
elif [ -x /etc/init.d/nullmailer ]; then
/etc/init.d/nullmailer start
fi
exit 0
|