--- /dev/null
+#!/bin/sh
+set -e
+
+if [ "$1" != configure ]; then
+ exit 0
+fi
+
+# Source debconf library.
+if [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+if [ -d /usr/doc -a ! -e /usr/doc/t-prot -a -d /usr/share/doc/t-prot ]; then
+ ln -sf ../share/doc/t-prot /usr/doc/t-prot
+fi
+
+# check for the /etc/Muttrc return value
+if [ -e /usr/share/debconf/confmodule ]; then
+ db_get t-prot/muttrc_option
+ muttrc="$RET"
+fi
+
+if [ "$muttrc" = "true" ] ; then
+ # check if it's already added
+ if ! grep /etc/Muttrc.t-prot /etc/Muttrc > /dev/null; then
+ echo 'source "/etc/Muttrc.t-prot" # for the t-prot script' \
+ >> /etc/Muttrc
+ fi
+elif [ "$muttrc" = "false" ] ; then
+ # delete the line.
+ if grep /etc/Muttrc.t-prot /etc/Muttrc > /dev/null; then
+ TMPFILE=`mktemp /tmp/Muttrc.XXXXXX`
+ sed -e '\,/etc/Muttrc.t-prot,d' < /etc/Muttrc > $TMPFILE
+ chmod --reference=/etc/Muttrc $TMPFILE
+ mv -f $TMPFILE /etc/Muttrc
+ fi
+fi