freebsd-ports/mail/qmail-scanner/pkg-install
Sergei Kolobov 46a4563118 Add qmail-scanner 1.20.r4, Content/Anti-virus Scanner for qmail.
Qmail-Scanner is e-mail content scanner that enables a qmail server to
scan all messages it receives for certain characteristics (normally viruses),
and react accordingly.

If you have a commercial virus scanner (eg, Sophos sweep, McAfee
uvscan, etc) installed when you build qmail-scanner, qmail-scanner
will configure itself to use that.  Otherwise, it will only use its
internal content filter which only allows you to block mail based
on text in the subject/body, general types of attachments, etc.

WWW:	http://qmail-scanner.sourceforge.net/

PR:		55941
Submitted by:	moeti <freebsd@simplerezo.com>
2003-12-11 11:40:35 +00:00

43 lines
969 B
Bash

#!/bin/sh
CHMOD=/bin/chmod
CHOWN=/usr/sbin/chown
MKDIR=/bin/mkdir
PW=/usr/sbin/pw
GU_ID=98
GU_NAME=qscand
PREFIX=${PKG_PREFIX}
SPOOLDIR=${PREFIX}/qmailscan
case "$2" in
PRE-INSTALL)
# User and group
${PW} groupshow -n ${GU_NAME} >/dev/null 2>&1 \
|| ${PW} groupadd -n ${GU_NAME} -g ${GU_ID}
${PW} usershow -n ${GU_NAME} >/dev/null 2>&1 \
|| ${PW} useradd ${GU_NAME} -g ${GU_NAME} -u ${GU_ID} -s /sbin/nologin
${MKDIR} -p ${SPOOLDIR}
;;
POST-INSTALL)
# Directories
for i in quarantine working archives; do
for j in tmp cur new; do
${MKDIR} -p ${SPOOLDIR}/$i/$j
done
done
${MKDIR} -p ${SPOOLDIR}/tmp
# Mod and owner
${CHOWN} ${GU_NAME}:${GU_NAME} ${PREFIX}/bin/qmail-scanner-queue.pl
${CHMOD} 4755 ${PREFIX}/bin/qmail-scanner-queue.pl
# Initialize
${PREFIX}/bin/qmail-scanner-queue.pl -z
${PREFIX}/bin/qmail-scanner-queue.pl -g
# Mod and owner (final)
${CHOWN} -R ${GU_NAME}:${GU_NAME} ${SPOOLDIR}
;;
esac