config is in qpsmtpd 0.84-11.
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | #!/bin/bash
#
# qpsmtpd package debconf configuration script
#
set -e
ENABLED=""
INTERFACES=""
QUEUE_PLUGIN=""
QUEUE_MAILDIR_DESTINATION=""
QUEUE_NONE_CONFIRM=""
QUEUE_PROXY_DESTINATION=""
RCPTHOSTS=""
. /usr/share/debconf/confmodule
db_version 2.0
db_beginblock
db_input medium qpsmtpd/startup_enabled || true
db_endblock
db_go
db_get qpsmtpd/startup_enabled
ENABLED="$RET"
if [ "$ENABLED" = "true" ] ; then
db_get qpsmtpd/listen_interfaces
INTERFACES="$RET"
if [ "$INTERFACES" = "unset" -o -z "$INTERFACES" ] ; then
INTERFACES=$(ifconfig -a |
grep 'inet addr' |
tr : ' ' |
awk '{print $3}' |
sort | uniq |
tr '\n' ' ' |
sed 's/ *$//')
fi
db_set qpsmtpd/listen_interfaces "$INTERFACES"
db_beginblock
db_input medium qpsmtpd/listen_interfaces || true
db_endblock
db_go
db_get qpsmtpd/listen_interfaces
INTERFACES="$RET"
# try to guess the local MTA, to select defaults
if ( readlink /usr/sbin/sendmail 2>/dev/null | grep -q exim ) ; then
LOCAL_MTA=exim
elif [ -e /var/spool/postfix/public/cleanup ] ; then
LOCAL_MTA=postfix
elif [ -x /usr/sbin/qmail-queue -o -x /var/qmail/bin/qmail-queue ] ; then
LOCAL_MTA=qmail
fi
# loop until we get to an acceptable state (e.g. confirmed queue-none)
db_get qpsmtpd/queue_plugin
QUEUE_PLUGIN="$RET"
# echo "initial queue_plugin=$QUEUE_PLUGIN"
# echo "none_confirm=$QUEUE_NONE_CONFIRM"
iter=0
while [[ ( "$iter" == "0" ) ||
( "x$QUEUE_PLUGIN" == "" ) ||
( "x$QUEUE_PLUGIN" == "xnone" &&
"x$QUEUE_NONE_CONFIRM" != "xtrue" ) ]] ; do
iter=1
# echo "loop queue_plugin=$QUEUE_PLUGIN"
if [ "x$QUEUE_PLUGIN" = "x" ] ; then
QUEUE_PLUGIN="$LOCAL_MTA"
[ ! -z "$QUEUE_PLUGIN" ] && db_set qpsmtpd/queue_plugin "$QUEUE_PLUGIN"
fi
db_beginblock
db_input medium qpsmtpd/queue_plugin || true
db_endblock
db_go
db_get qpsmtpd/queue_plugin
QUEUE_PLUGIN="$RET"
if [ "x$QUEUE_PLUGIN" = "xproxy" ] ; then
db_beginblock
db_input medium qpsmtpd/queue_smtp_proxy_destination || true
db_endblock
db_go
db_get qpsmtpd/queue_smtp_proxy_destination
QUEUE_PROXY_DESTINATION="$RET"
if [ "x$QUEUE_PROXY_DESTINATION" = "x" ] ; then
QUEUE_PROXY_DESTINATION="localhost"
fi
elif [ "x$QUEUE_PLUGIN" = "xmaildir" ] ; then
db_beginblock
db_input medium qpsmtpd/queue_maildir_destination || true
db_endblock
db_go
db_get qpsmtpd/queue_maildir_destination
QUEUE_MAILDIR_DESTINATION="$RET"
if [ "x$QUEUE_MAILDIR_DESTINATION" = "x" ] ; then
db_set qpsmtpd/queue_maildir_destination \
"/var/spool/qpsmtpd/Maildir"
fi
elif [ "x$QUEUE_PLUGIN" = "xnone" -o "x$QUEUE_PLUGIN" = "x" ] ; then
db_beginblock
db_input high qpsmtpd/queue_none_confirm || true
db_endblock
db_go
db_get qpsmtpd/queue_none_confirm
QUEUE_NONE_CONFIRM="$RET"
fi
db_get qpsmtpd/rcpthosts
RCPTHOSTS="$RET"
# if rcpthosts has never been set, try to guess a default
if [ "x$RCPTHOSTS" = "xunset" ] ; then
RCPTHOSTS=""
if [ "x$QUEUE_PLUGIN" = "xexim" ] ; then
db_get exim4/dc_relay_domains
EXIM_RELAYDOMAINS=`echo "$RET" | \
tr ',' ' '`
db_get exim4/dc_other_hostnames
EXIM_OTHERHOSTNAMES=`echo "$RET" | \
tr ',' ' '`
db_get exim4/dc_relay_domains
RCPTHOSTS=`echo "$EXIM_RELAYDOMAINS $EXIM_OTHERHOSTNAMES" | sed 's/ $//'`
elif [ "x$QUEUE_PLUGIN" = "xpostfix" ] ; then
RCPTHOSTS=`postconf -h mydestination 2>/dev/null |
perl -pe 's/[,\s]+/ /g' | uniq`
elif [ "x$QUEUE_PLUGIN" = "xqmail" ] ; then
for qetc in /etc/qmail /var/qmail/control ; do
if [ -e "$qetc/rcpthosts" ] ; then
RCPTHOSTS=`cat $qetc/rcpthosts |
grep '^[a-zA-Z0-9-.]' |
tr '\n' ' '`
fi
done
fi
db_set qpsmtpd/rcpthosts "$RCPTHOSTS"
fi
db_beginblock
db_input medium qpsmtpd/rcpthosts || true
db_endblock
db_go
db_get qpsmtpd/rcpthosts
RCPTHOSTS="$RET"
db_beginblock
db_input medium qpsmtpd/server_type || true
db_endblock
db_go
db_get qpsmtpd/server_type
SERVER="$RET"
done
fi
db_stop
exit 0
|