aboutsummaryrefslogtreecommitdiffstats
path: root/mail/cyrus-imapd30/files/pkg-install.in
blob: c806a61ad6cc91334a36b8daedc6cd8015fbc8f5 (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
#!/bin/sh

#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