pkgsrc-wip/dcc/INSTALL
Petar Bogdanovic 4d584802fc Import dcc-1.3.99 as wip/dcc.
The Distributed Checksum Clearinghouses or DCC is an anti-spam content filter
that runs on a variety of operating systems. As of the middle of 2007, it
involves millions of users, more than six hundred thousand client computer
systems, and more than 250 servers collecting and counting checksums related to
more than 300 million mail messages on week days. The counts can be used by
SMTP servers and mail user agents to detect and reject or filter spam or
unsolicited bulk mail. DCC servers exchange or "flood" common checksums. The
checksums include values that are constant across common variations in bulk
messages, including "personalizations".
2008-12-22 17:26:14 +00:00

66 lines
1.5 KiB
Text

# $NetBSD: INSTALL,v 1.1.1.1 2008/12/22 17:26:14 pebog Exp $
#
# mostly taken from homedir/Makefile.in
#
#
case ${STAGE} in
POST-INSTALL)
DD=/bin/dd
TR=/usr/bin/tr
CKSUM=/usr/bin/cksum
CDCC=${PREFIX}/bin/cdcc
URND=/dev/urandom
DCC_USER=@DCC_USER@
DCC_GROUP=@DCC_GROUP@
DCC_HOME=@DCC_HOME@
DCC_EGDIR=@DCC_EGDIR@
DCC_MODE_PRIV=0600
IDS=ids
MAP=map
MAPTXT=${MAP}.txt
WLIST=whitelist
SECRET1=$(${DD} if=${URND} count=1 2>&1 | ${CKSUM} | ${TR} ' ' xy)
SECRET2=$(${DD} if=${URND} count=1 2>&1 | ${CKSUM} | ${TR} ' ' xy)
#
# assemble sed-commands
#
if [ -f ${DCC_HOME}/${WLIST} ]; then
CMD_S1="-e s/secret1/${SECRET1}/"
CMD_S2="-e s/secret2/${SECRET2}/"
else
CMD_LH="-e s/^127\.0\.0\.1/#&/"
fi
if [ -f ${DCC_HOME}/${WLIST} -a ! -f ${DCC_HOME}/${IDS} ]; then
#
# replace secrets in ids
#
${SED} ${CMD_S1} ${CMD_S2} ${DCC_EGDIR}/${IDS} \
>${DCC_HOME}/${IDS}
${CHMOD} ${DCC_MODE_PRIV} ${DCC_HOME}/${IDS}
${CHOWN} ${DCC_USER}:${DCC_GROUP} ${DCC_HOME}/${IDS}
fi
if [ ! -f ${DCC_HOME}/${MAPTXT} -a ! -f ${DCC_HOME}/${MAP} ]; then
#
# replace random secrets in MAPTXT and generate MAP
#
${SED} ${CMD_S1} ${CMD_LH} ${DCC_EGDIR}/${MAPTXT} |
${CDCC} -qh${DCC_HOME} "new map; load -"
${CHMOD} ${DCC_MODE_PRIV} ${DCC_HOME}/${MAP}
${CHOWN} ${DCC_USER}:${DCC_GROUP} ${DCC_HOME}/${MAP}
#
# regenerate MAPTXT from MAP
#
${CDCC} -qh${DCC_HOME} "file ${MAP}; info" >${DCC_HOME}/${MAPTXT}
${CHMOD} ${DCC_MODE_PRIV} ${DCC_HOME}/${MAPTXT}
${CHOWN} ${DCC_USER}:${DCC_GROUP} ${DCC_HOME}/${MAPTXT}
fi
;;
esac