summaryrefslogtreecommitdiff
path: root/mail/mimedefang/pkg-install
blob: 3e3a74824db99bcbae2956b8ace47543dc9c4bc1 (plain) (blame)
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
#!/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 700 ${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