Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 67 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 67 Rev 79
1
#!/bin/sh
1
#!/bin/sh
2
set -e
2
set -e
3
3
4
. /usr/share/debconf/confmodule
4
. /usr/share/debconf/confmodule
5
5
6
LOCALSCANCONF=/etc/exim4/conf.d/main/15_sa-exim_plugin_path
6
LOCALSCANCONF=/etc/exim4/conf.d/main/15_sa-exim_plugin_path
7
DISABLELOCALSCANTEXT='# sa-exim plugin is disabled, because it was uninstalled'
7
DISABLELOCALSCANTEXT='# sa-exim plugin is disabled, because it was uninstalled'
8
DISABLELOCALSCANMD5=`echo "${DISABLELOCALSCANTEXT}" | md5sum | cut -d\  -f1`
8
DISABLELOCALSCANMD5=`echo "${DISABLELOCALSCANTEXT}" | md5sum | cut -d\  -f1`
9
9
10
OLDCRONJOB=/etc/cron.hourly/greylistclean
10
OLDCRONJOB=/etc/cron.hourly/greylistclean
11
OLDCRONJOBREN=/etc/cron.hourly/.greylistclean.insecure.deleteme
11
OLDCRONJOBREN=/etc/cron.hourly/.greylistclean.insecure.deleteme
12
if test -f $OLDCRONJOB; then
12
if test -f $OLDCRONJOB; then
13
    echo "disabling old insecure $OLDCRONJOB"
13
    echo "disabling old insecure $OLDCRONJOB"
14
    echo "(renamed to $OLDCRONJOBREN)"
14
    echo "(renamed to $OLDCRONJOBREN)"
15
    echo "See new cronjob in /etc/cron.d/greylistclean"
15
    echo "See new cronjob in /etc/cron.d/greylistclean"
16
    mv $OLDCRONJOB $OLDCRONJOBREN
16
    mv $OLDCRONJOB $OLDCRONJOBREN
17
fi
17
fi
18
18
19
case "$1" in
19
case "$1" in
20
    configure)
20
    configure)
21
	if [ ! -e /var/spool/sa-exim ] ; then
21
	if [ ! -e /var/spool/sa-exim ] ; then
22
		# Debian-exim should exist as we depend on exim4-base
22
		# Debian-exim should exist as we depend on exim4-base
23
		install -d -m770 -oDebian-exim -gDebian-exim \
23
		install -d -m770 -oDebian-exim -gDebian-exim \
24
		/var/spool/sa-exim
24
		/var/spool/sa-exim
25
	fi
25
	fi
26
	# Support for greylisting tuplets (written by default as Debian-exim by spamd)
26
	# Support for greylisting tuplets (written by default as Debian-exim by spamd)
27
	if [ ! -e /var/spool/sa-exim/tuplets ] ; then
27
	if [ ! -e /var/spool/sa-exim/tuplets ] ; then
28
		install -d -m770 -oDebian-exim -gDebian-exim \
28
		install -d -m770 -oDebian-exim -gDebian-exim \
29
		/var/spool/sa-exim/tuplets
29
		/var/spool/sa-exim/tuplets
30
	elif [ `stat -c "%U:%G" /var/spool/sa-exim/tuplets` = "nobody:Debian-exim" ] &&
30
	elif [ `stat -c "%U:%G" /var/spool/sa-exim/tuplets` = "nobody:Debian-exim" ] &&
31
		dpkg --compare-versions "$2" lt-nl "4.2.1-14"; then
31
		dpkg --compare-versions "$2" lt-nl "4.2.1-14"; then
32
	    	# If ownership is as before 4.2.1-14, give the Debian-exim
32
	    	# If ownership is as before 4.2.1-14, give the Debian-exim
33
	    	# group write permissions. Bug 563492.
33
	    	# group write permissions. Bug 563492.
34
		chmod g+w /var/spool/sa-exim/tuplets
34
		chmod g+w /var/spool/sa-exim/tuplets
35
	fi
35
	fi
36
	# clean up temporary file generated by postrm uninstall
36
	# clean up temporary file generated by postrm uninstall
37
	if [ -e "${LOCALSCANCONF}.rul" ] && \
37
	if [ -e "${LOCALSCANCONF}.rul" ] && \
38
	   [ "`md5sum ${LOCALSCANCONF}.rul | cut -d\  -f1`" = "${DISABLELOCALSCANMD5}" ]; then
38
	   [ "`md5sum ${LOCALSCANCONF}.rul | cut -d\  -f1`" = "${DISABLELOCALSCANMD5}" ]; then
39
	   rm ${LOCALSCANCONF}.rul
39
	   rm ${LOCALSCANCONF}.rul
40
	fi
40
	fi
41
	if [ -x /etc/init.d/exim4 ]; then
41
	if [ -x /etc/init.d/exim4 ]; then
42
		if [ -x /usr/sbin/invoke-rc.d ]; then
42
		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
43
			invoke-rc.d exim4 reload || true
43
			invoke-rc.d exim4 reload || true
44
		else
44
		else
45
			/etc/init.d/exim4 reload || true
45
			/etc/init.d/exim4 reload || true
46
		fi
46
		fi
47
	fi
47
	fi
48
	;;
48
	;;
49
49
50
esac
50
esac
51
51
52
#DEBHELPER#
52
#DEBHELPER#