View | Details | Raw Unified | Return to bug 162188 | Differences between
and this patch

Collapse All | Expand All

(-)ports/mail/postgrey/Makefile (-19 / +22 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	postgrey
8
PORTNAME=	postgrey
9
PORTVERSION=	1.34
9
PORTVERSION=	1.34
10
PORTREVISION=	1
10
CATEGORIES=	mail
11
CATEGORIES=	mail
11
MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
12
MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
12
		http://postgrey.schweikert.ch/pub/old/
13
		http://postgrey.schweikert.ch/pub/old/
Lines 14-19 Link Here
14
MAINTAINER=	ports.maintainer@evilphi.com
15
MAINTAINER=	ports.maintainer@evilphi.com
15
COMMENT=	Greylisting policy server for Postfix
16
COMMENT=	Greylisting policy server for Postfix
16
17
18
LICENSE=	GPLv2
19
LICENSE_FILE=	${WRKSRC}/COPYING
20
17
RUN_DEPENDS=	${SITE_PERL}/Net/Server.pm:${PORTSDIR}/net/p5-Net-Server \
21
RUN_DEPENDS=	${SITE_PERL}/Net/Server.pm:${PORTSDIR}/net/p5-Net-Server \
18
		${SITE_PERL}/IO/Multiplex.pm:${PORTSDIR}/devel/p5-IO-Multiplex \
22
		${SITE_PERL}/IO/Multiplex.pm:${PORTSDIR}/devel/p5-IO-Multiplex \
19
		${SITE_PERL}/Parse/Syslog.pm:${PORTSDIR}/textproc/p5-Parse-Syslog \
23
		${SITE_PERL}/Parse/Syslog.pm:${PORTSDIR}/textproc/p5-Parse-Syslog \
Lines 25-61 Link Here
25
NO_BUILD=	yes
29
NO_BUILD=	yes
26
POD2MAN?=	pod2man
30
POD2MAN?=	pod2man
27
PORTDOCS=	README Changes README.exim
31
PORTDOCS=	README Changes README.exim
28
SUB_FILES=	pkg-install
29
SUB_LIST=	USER=${PGY_USERNAME} UID=${PGY_USERID} GROUP=${PGY_GROUPNAME} \
30
		GID=${PGY_GROUPID} ETCFILES="${ETCFILES}" \
31
		POSTGREYDIR=${PGY_DIR}
32
ETCFILES=	whitelist_clients whitelist_recipients
33
PGY_USERNAME?=	postgrey
34
PGY_USERID?=	225
35
PGY_GROUPNAME?=	${PGY_USERNAME}
36
PGY_GROUPID?=	${PGY_USERID}
37
PGY_DIR?=	/var/db/postgrey
38
39
USERS=		${PGY_USERNAME}
40
GROUPS=		${PGY_GROUPNAME}
41
MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1
32
MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1
42
33
34
PGY_DBDIR=	/var/db/postgrey
35
36
USERS?=		postgrey
37
GROUPS?=	postgrey
38
39
PLIST_SUB=	DBDIR=${PGY_DBDIR} 
40
41
SUB_FILES=	${PORTNAME} pkg-install pkg-message
42
SUB_LIST=	USER=${USERS} GROUP=${GROUPS} DBDIR=${PGY_DBDIR}
43
43
post-patch:
44
post-patch:
44
	@${REINPLACE_CMD} -e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
45
	@${REINPLACE_CMD} -e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
45
	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
46
	@${REINPLACE_CMD} -e 's#/etc/postfix#${ETCDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
46
	@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
47
	@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DBDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
48
	@${REINPLACE_CMD} -e 's#nogroup#${GROUPS}#' ${WRKSRC}/postgrey
47
49
48
do-install:
50
do-install:
49
	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
50
	@${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1
51
	@${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1
51
	@${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
52
	@${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
52
	@${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
53
	@${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
53
	@${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${PREFIX}/sbin
54
	@${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${PREFIX}/sbin
54
	@${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${PREFIX}/sbin
55
	@${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${PREFIX}/sbin
55
	@${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport ${PREFIX}/sbin
56
	@${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport ${PREFIX}/sbin
56
	@${INSTALL} -d ${PREFIX}/etc/postfix
57
	@${INSTALL} -d ${ETCDIR}
57
.for i in ${ETCFILES}
58
.for file in postgrey_whitelist_clients postgrey_whitelist_recipients
58
	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} ${PREFIX}/etc/postfix/dist-postgrey_${i}
59
	${INSTALL_DATA} ${WRKSRC}/${file} ${ETCDIR}/dist-${file}
60
	@${CP} -n ${ETCDIR}/dist-${file} ${ETCDIR}/${file}
59
.endfor
61
.endfor
60
62
61
.if !defined(NOPORTDOCS)
63
.if !defined(NOPORTDOCS)
Lines 66-70 Link Here
66
68
67
post-install:
69
post-install:
68
	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
70
	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
71
	@${CAT} ${PKGMESSAGE}
69
72
70
.include <bsd.port.mk>
73
.include <bsd.port.mk>
(-)ports/mail/postgrey/pkg-plist (-6 / +8 lines)
Lines 1-9 Link Here
1
@unexec if cmp -s %D/etc/postfix/dist-postgrey_whitelist_recipients %D/etc/postfix/postgrey_whitelist_recipients; then rm -f %D/etc/postfix/postgrey_whitelist_recipients; fi
1
@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_recipients %D/%%ETCDIR%%/postgrey_whitelist_recipients; then rm %D/%%ETCDIR%%/postgrey_whitelist_recipients; fi
2
@unexec if cmp -s %D/etc/postfix/dist-postgrey_whitelist_clients %D/etc/postfix/postgrey_whitelist_clients; then rm -f %D/etc/postfix/postgrey_whitelist_clients; fi
2
@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_clients %D/%%ETCDIR%%/postgrey_whitelist_clients; then rm %D/%%ETCDIR%%/postgrey_whitelist_clients; fi
3
sbin/postgrey
3
sbin/postgrey
4
sbin/policy-test
4
sbin/policy-test
5
sbin/postgreyreport
5
sbin/postgreyreport
6
etc/postfix/dist-postgrey_whitelist_recipients
6
%%ETCDIR%%/dist-postgrey_whitelist_recipients
7
etc/postfix/dist-postgrey_whitelist_clients
7
@exec [ ! -f %B/postgrey_whitelist_recipients ] && cp %B/%f %B/postgrey_whitelist_recipients
8
@dirrmtry etc/postfix
8
%%ETCDIR%%/dist-postgrey_whitelist_clients
9
@unexec rmdir /var/db/postgrey 2>/dev/null || true
9
@exec [ ! -f %B/postgrey_whitelist_clients ] && cp %B/%f %B/postgrey_whitelist_clients
10
@dirrmtry %%ETCDIR%%
11
@unexec rmdir %%DBDIR%% 2>/dev/null || true
(-)ports/mail/postgrey/files/pkg-install.in (-30 / +16 lines)
Lines 3-46 Link Here
3
# $FreeBSD: ports/mail/postgrey/files/pkg-install.in,v 1.3 2011/10/20 21:12:06 crees Exp $
3
# $FreeBSD: ports/mail/postgrey/files/pkg-install.in,v 1.3 2011/10/20 21:12:06 crees Exp $
4
4
5
PATH=/bin:/usr/bin:/usr/sbin
5
PATH=/bin:/usr/bin:/usr/sbin
6
DBDIR="%%DBDIR%%"
7
USER="%%USER%%"
8
GROUP="%%GROUP%%"
6
9
7
case $2 in
10
case $2 in
8
11
9
PRE-INSTALL)
12
POST-INSTALL)
10
  echo "---> Starting install script:"
13
  echo "---> Starting post-install script:"
11
12
  if [ -z "%%POSTGREYDIR%%" -o \
13
       -z "%%USER%%" -o -z "%%GROUP%%" -o \
14
       -z "%%UID%%" -o -z "%%GID%%" ]; then
15
    echo "ERROR: A required pragma was empty"
16
    exit 1
17
  fi
18
14
19
  # Create home directory if required
15
  # Create home directory if required
20
  if [ -d "%%POSTGREYDIR%%" ]; then
16
  if [ -z ${DBDIR} ]; then
21
    echo "---> Using existing Postgrey database directory (%%POSTGREYDIR%%)"
17
    echo "---> Default database directory not specified"
18
  elif [ -d ${DBDIR} ]; then
19
    echo "---> Using existing Postgrey database directory (${DBDIR})"
22
    echo "     (There may be existing active postgrey databases - this installation"
20
    echo "     (There may be existing active postgrey databases - this installation"
23
    echo "     will attempt to preserve them.)"
21
    echo "     will attempt to preserve them.)"
22
  elif [ -e ${DBDIR} ]; then
23
    echo "---> The default Postgrey database directory (${DBDIR})"
24
    echo "     exists but is not a directory - you have to create it yourself"
24
  else
25
  else
25
    echo "---> Creating Postgrey database directory (%%POSTGREYDIR%%)"
26
    echo "---> Creating Postgrey database directory (${DBDIR})"
26
    (umask 002 && /bin/mkdir -p "%%POSTGREYDIR%%") || exit 1
27
    (umask 002 && mkdir -p ${DBDIR}) || exit 1
27
    /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%POSTGREYDIR%%" || exit 1
28
    chown -R ${USER}:${GROUP} ${DBDIR} || exit 1
28
    /bin/chmod g+s "%%POSTGREYDIR%%" || exit 1
29
    chmod g+s ${DBDIR} || exit 1
29
  fi
30
  fi
30
  ;;
31
32
POST-INSTALL)
33
  echo "---> Starting post-install script:"
34
35
  for i in %%ETCFILES%%; do
36
    if [ ! -f "%%PREFIX%%/etc/postfix/postgrey_${i}" ]; then
37
	echo "---> Installing new config file %%PREFIX%%/etc/postfix/postgrey_${i}"
38
	cp -p	%%PREFIX%%/etc/postfix/dist-postgrey_${i} \
39
		%%PREFIX%%/etc/postfix/postgrey_${i}
40
    else
41
	echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}"
42
    fi
43
  done
44
  ;;
45
31
46
esac
32
esac
(-)ports/mail/postgrey/files/pkg-message.in (+11 lines)
Added Link Here
1
2
3
ATTENTION:
4
5
The default location of the whitelist files has changed from
6
%%PREFIX%%/etc/postfix to %%ETCDIR%%.  If you modified the
7
whitelists, you will need to either move them to the new location or
8
specify their location by adding --whitelist-clients and
9
--whitelist-recipients parameters to postgrey_options in /etc/rc.conf.
10
11
(-)ports/mail/postgrey/files/postgrey.in (-6 / +8 lines)
Lines 12-18 Link Here
12
#
12
#
13
# postgrey_enable="YES"
13
# postgrey_enable="YES"
14
#
14
#
15
# See perldoc postgrey for flags
15
# See perldoc postgrey or run `postgrey --help` to see options. You can change
16
# the --dbdir path by setting postgrey_dbdir.  Specify additional options with
17
# the postgrey_options variable.
16
#
18
#
17
19
18
. /etc/rc.subr
20
. /etc/rc.subr
Lines 21-27 Link Here
21
rcvar=`set_rcvar`
23
rcvar=`set_rcvar`
22
24
23
command=%%PREFIX%%/sbin/postgrey
25
command=%%PREFIX%%/sbin/postgrey
24
required_dirs=/var/db/postgrey
25
extra_commands=reload
26
extra_commands=reload
26
27
27
stop_postcmd=stop_postcmd
28
stop_postcmd=stop_postcmd
Lines 35-47 Link Here
35
36
36
load_rc_config $name
37
load_rc_config $name
37
38
39
postgrey_dbdir=${postgrey_dbdir:-"%%DBDIR%%"}
38
postgrey_enable=${postgrey_enable:-"NO"}
40
postgrey_enable=${postgrey_enable:-"NO"}
39
postgrey_greylist_header=${postgrey_greylist_header:-"X-Greylist: delayed %t seconds by postgrey-%v at %h\; %d"}
41
postgrey_options=${postgrey_options:-"--inet=10023"}
40
postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"}
42
postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"}
41
postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \
43
postgrey_flags=${postgrey_flags:-"-d --pidfile=${postgrey_pidfile} \
42
	--inet=10023 -d --user=%%USER%% --group=%%GROUP%% --dbdir=/var/db/postgrey \
44
	--dbdir=${postgrey_dbdir} ${postgrey_options}"}
43
	--x-greylist-header=${postgrey_greylist_header}"}
44
45
45
pidfile="${postgrey_pidfile}"
46
pidfile="${postgrey_pidfile}"
47
required_dirs=${postgrey_dbdir}
46
48
47
run_rc_command "$1"
49
run_rc_command "$1"

Return to bug 162188