summaryrefslogtreecommitdiff
path: root/testing/postfix/install
blob: f5d81a565212ead0eb98b6df431203aae345a6d0 (plain)
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
post_install() {
	getent group postdrop &>/dev/null || groupadd -g 75 postdrop >/dev/null
	getent group postfix  &>/dev/null || groupadd -g 73 postfix  >/dev/null
	getent passwd postfix &>/dev/null || useradd -u 73 -d /var/spool/postfix -g postfix -s /bin/false postfix >/dev/null

	cd var/spool/postfix
	chown postfix active bounce corrupt defer deferred flush hold incoming private public maildrop trace saved
	chgrp postdrop public maildrop
	cd ../../../usr/sbin
	chgrp postdrop postqueue postdrop
	chmod g+s postqueue postdrop
	cd ../..
	chown postfix var/lib/postfix

	newaliases
}

post_upgrade() {
	post_install

	if [ `vercmp $2 2.8` = -1 ]; then cat <<EOF

==> You must now execute "/etc/rc.d/postfix reload" (or restart).
==> This is needed because the queue manager to delivery agent
==> protocol has changed.

EOF
	fi
}

pre_remove() {
	getent passwd postfix &>/dev/null && userdel  postfix  >/dev/null
	getent group postfix  &>/dev/null && groupdel postfix  >/dev/null
	getent group postdrop &>/dev/null && groupdel postdrop >/dev/null
}