freebsd-ports/mail/mimedefang/pkg-install
Wes Peters c43edd97e5 Make the MIMEDefang spool directory group-searchable so associated
virus scanners can be run as different users.

Submitted by:	"Rob MacGregor" <freebsd.macgregor@blueyonder.co.uk>
2004-12-23 19:26:28 +00:00

36 lines
678 B
Bash

#!/bin/sh
[ $# != 2 ] && exit 1
[ -z "${PKG_PREFIX}" ] && exit 1
[ -n "${BATCH}" ] && exit 0
PKG_NAME=$1
PKG_ACTION=$2
MAILUSER=mailnull
SPOOLDIR=/var/spool/MIMEDefang
QUARANTINEDIR=/var/spool/MD-Quarantine
case "$PKG_ACTION" in
POST-INSTALL)
if [ ! -d ${SPOOLDIR} ]; then
mkdir -p ${SPOOLDIR}
chown ${MAILUSER}:${MAILUSER} ${SPOOLDIR}
chmod 710 ${SPOOLDIR}
fi
if [ ! -d ${QUARANTINEDIR} ]; then
mkdir -p ${QUARANTINEDIR}
chown ${MAILUSER}:${MAILUSER} ${QUARANTINEDIR}
chmod 700 ${QUARANTINEDIR}
fi
;;
PRE-INSTALL|POST-DEINSTALL|DEINSTALL)
;;
*)
echo "usage: $0 <PKG_NAME> {PRE-INSTALL|POST-INSTALL|DEINSTALL|POST-DEINSTALL}" >&2
exit 1
;;
esac
exit 0