aboutsummaryrefslogtreecommitdiff
path: root/mail/cyrus-imapd23/files/pkg-install.in
blob: 8ca4da0a84acf8133c4b720324bcf6a01ce7c3b0 (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
37
38
39
40
41
42
43
#!/bin/sh
#
# $FreeBSD$

#set -vx

PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%}
CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}

#
# Modify the 'cyrus' user created from the cyrus-sasl port
#

modify_cyrus_user() {
	USER=${CYRUS_USER}
	PW=/usr/sbin/pw
	shell=/bin/csh
	uhome=${PKG_PREFIX}/cyrus

	if ! ${PW} mod user ${USER} -d "${uhome}" -s "${shell}"; then
		echo "*** Failed to update user \`${USER}'."
	else
		echo "*** Updated user \`${USER}'."
	fi
}

case $2 in
	PRE-INSTALL)
		;;

	POST-INSTALL)
		modify_cyrus_user
		if grep 'sieve' /etc/services; then
			echo
		else
			echo
			echo "** Please add an entry for the sieve protocol (4190/tcp)"
			echo "   to /etc/services"
			echo
		fi
		;;
esac