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

Collapse All | Expand All

(-)Makefile (-15 / +16 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	postgrey
4
PORTNAME=	postgrey
5
PORTVERSION=	1.34
5
PORTVERSION=	1.35
6
PORTREVISION=	7
7
CATEGORIES=	mail
6
CATEGORIES=	mail
8
MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
7
MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
9
		http://postgrey.schweikert.ch/pub/old/
8
		http://postgrey.schweikert.ch/pub/old/
Lines 11-16 Link Here
11
MAINTAINER=	ports.maintainer@evilphi.com
10
MAINTAINER=	ports.maintainer@evilphi.com
12
COMMENT=	Greylisting policy server for Postfix
11
COMMENT=	Greylisting policy server for Postfix
13
12
13
LICENSE=	GPLv2
14
14
RUN_DEPENDS=	p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \
15
RUN_DEPENDS=	p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \
15
		p5-IO-Multiplex>=0:${PORTSDIR}/devel/p5-IO-Multiplex \
16
		p5-IO-Multiplex>=0:${PORTSDIR}/devel/p5-IO-Multiplex \
16
		p5-Parse-Syslog>=0:${PORTSDIR}/textproc/p5-Parse-Syslog \
17
		p5-Parse-Syslog>=0:${PORTSDIR}/textproc/p5-Parse-Syslog \
Lines 22-39 Link Here
22
NO_BUILD=	yes
23
NO_BUILD=	yes
23
POD2MAN?=	pod2man
24
POD2MAN?=	pod2man
24
PORTDOCS=	README Changes README.exim
25
PORTDOCS=	README Changes README.exim
25
SUB_FILES=	pkg-install
26
SUB_LIST=	USER=${PGY_USERNAME} \
27
		GROUP=${PGY_GROUPNAME} \
28
		ETCFILES="${ETCFILES}" \
29
		POSTGREYDIR=${PGY_DIR}
30
ETCFILES=	whitelist_clients whitelist_recipients
26
ETCFILES=	whitelist_clients whitelist_recipients
31
PGY_USERNAME?=	postgrey
27
PGY_USER=	postgrey
32
PGY_GROUPNAME?=	postgrey
28
PGY_GROUP=	postgrey
33
PGY_DIR?=	/var/db/postgrey
29
PGY_DIR=	/var/db/postgrey
30
SUB_LIST+=	PGY_DIR=${PGY_DIR}
34
31
35
USERS=		${PGY_USERNAME}
32
USERS=		${PGY_USER}
36
GROUPS=		${PGY_GROUPNAME}
33
GROUPS=		${PGY_GROUP}
37
MPAGES=		postgrey.1 policy-test.1 postgreyreport.1
34
MPAGES=		postgrey.1 policy-test.1 postgreyreport.1
38
35
39
USES=		shebangfix perl5
36
USES=		shebangfix perl5
Lines 41-50 Link Here
41
38
42
OPTIONS_DEFINE=	DOCS
39
OPTIONS_DEFINE=	DOCS
43
40
41
PLIST_SUB+=	PGY_USER=${PGY_USER} \
42
		PGY_GROUP=${PGY_GROUP} \
43
		PGY_DIR=${PGY_DIR}
44
44
.include <bsd.port.options.mk>
45
.include <bsd.port.options.mk>
45
46
46
post-patch:
47
post-patch:
47
	@${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUPNAME}#' \
48
	@${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUP}#' \
48
		-e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
49
		-e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
49
	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \
50
	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \
50
		${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
51
		${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
Lines 52-58 Link Here
52
		${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
53
		${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
53
54
54
do-install:
55
do-install:
55
	${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1
56
	${POD2MAN} ${WRKSRC}/postgrey ${WRKSRC}/postgrey.1
56
	${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
57
	${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
57
	${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
58
	${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
58
	${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${STAGEDIR}${PREFIX}/sbin
59
	${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${STAGEDIR}${PREFIX}/sbin
Lines 62-68 Link Here
62
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PGY_DIR}
63
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PGY_DIR}
63
.for i in ${ETCFILES}
64
.for i in ${ETCFILES}
64
	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} \
65
	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} \
65
		${STAGEDIR}${PREFIX}/etc/postfix/dist-postgrey_${i}
66
		${STAGEDIR}${PREFIX}/etc/postfix/postgrey_${i}.sample
66
.endfor
67
.endfor
67
68
68
.if ${PORT_OPTIONS:MDOCS}
69
.if ${PORT_OPTIONS:MDOCS}
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (postgrey-1.34.tar.gz) = 9a9ee2f4e3cbbf15642e47802407c810ac5c54f0ad1572ebec3f0f645eb35707
1
SHA256 (postgrey-1.35.tar.gz) = f6a6956630803e6f79ebff6ad0cc0d46ba32046ed6cc260e38e6f591de7bbdcf
2
SIZE (postgrey-1.34.tar.gz) = 36399
2
SIZE (postgrey-1.35.tar.gz) = 36610
(-)files/patch-postgrey (-18 / +19 lines)
Lines 1-19 Link Here
1
--- postgrey.orig	2011-05-05 04:54:15.000000000 +0800
1
--- postgrey.orig	2014-09-29 18:33:26 UTC
2
+++ postgrey	2013-10-20 01:07:50.744835568 +0800
2
+++ postgrey
3
@@ -557,6 +557,16 @@
3
@@ -618,7 +618,7 @@
4
     if($opt{dbdir}) {
4
                     $opt{'auto-whitelist-clients'} : 5) : 5,
5
         $opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1;
5
             retry_window     => $retry_window,
6
     }
6
             greylist_action  => $opt{'greylist-action'} || 'DEFER_IF_PERMIT',
7
+    # untaint what is given on --pidfile. It is not security sensitive since
7
-            greylist_text    => $opt{'greylist-text'} || 'Greylisted, see http://postgrey.schweikert.ch/help/%r.html',
8
+    # it is provided by the admin
8
+            greylist_text    => $opt{'greylist-text'} || 'Greylisted, see http://postgrey.schweikert.ch/help',
9
+    if($opt{pidfile}) {
9
             whitelist_clients_files    => $opt{'whitelist-clients'} ||
10
+        $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1;
10
                 [ "$CONFIG_DIR/postgrey_whitelist_clients" ,
11
+    }
11
                   "$CONFIG_DIR/postgrey_whitelist_clients.local" ],
12
+    # untaint what is given on --inet. It is not security sensitive since
12
@@ -987,7 +987,7 @@
13
+    # it is provided by the admin
13
 When a message is greylisted, an error message like this will be sent at the
14
+    if($opt{inet}) {
14
 SMTP-level:
15
+        $opt{inet} =~ /^(.*)$/; $opt{inet} = $1;
16
+    }
17
 
15
 
18
     # determine proper "logsock" for Sys::Syslog
16
- Greylisted, see http://postgrey.schweikert.ch/help/example.com.html
19
     my $syslog_logsock;
17
+ Greylisted, see http://postgrey.schweikert.ch/help
18
 
19
 Usually no user should see that error message and the idea of that URL is to
20
 provide some help to system administrators seeing that message or users of
(-)files/pkg-install.in (-42 lines)
Lines 1-42 Link Here
1
#! /bin/sh
2
#
3
# $FreeBSD$
4
5
PATH=/bin:/usr/bin:/usr/sbin
6
7
case $2 in
8
9
PRE-INSTALL)
10
  if [ -z "%%POSTGREYDIR%%" -o -z "%%USER%%" -o -z "%%GROUP%%" ]; then
11
    echo "ERROR: A required pragma was empty"
12
    exit 1
13
  fi
14
  ;;
15
16
POST-INSTALL)
17
  echo "---> Starting post-install script:"
18
19
  # Create home directory if required
20
  if [ -d "%%POSTGREYDIR%%" ]; then
21
    echo "---> Using existing Postgrey database directory (%%POSTGREYDIR%%)"
22
    echo "     (There may be existing active postgrey databases - this installation"
23
    echo "     will attempt to preserve them.)"
24
  else
25
    echo "---> Creating Postgrey database directory (%%POSTGREYDIR%%)"
26
    (umask 002 && /bin/mkdir -p "%%POSTGREYDIR%%") || exit 1
27
    /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%POSTGREYDIR%%" || exit 1
28
    /bin/chmod g+s "%%POSTGREYDIR%%" || exit 1
29
  fi
30
31
  for i in %%ETCFILES%%; do
32
    if [ ! -f "%%PREFIX%%/etc/postfix/postgrey_${i}" ]; then
33
	echo "---> Installing new config file %%PREFIX%%/etc/postfix/postgrey_${i}"
34
	cp -p	%%PREFIX%%/etc/postfix/dist-postgrey_${i} \
35
		%%PREFIX%%/etc/postfix/postgrey_${i}
36
    else
37
	echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}"
38
    fi
39
  done
40
  ;;
41
42
esac
(-)files/postgrey.in (-2 / +2 lines)
Lines 12-18 Link Here
12
# postgrey_enable (bool)        Set to 'YES' to enable
12
# postgrey_enable (bool)        Set to 'YES' to enable
13
#                               Default: NO
13
#                               Default: NO
14
# postgrey_dbdir (path)         Location of postgrey database files.
14
# postgrey_dbdir (path)         Location of postgrey database files.
15
#                               Default: /var/db/postgrey
15
#                               Default: %%PGY_DIR%%
16
# postgrey_flags (extra args)   Additional command-line parameters.
16
# postgrey_flags (extra args)   Additional command-line parameters.
17
#                               Default: --inet=10023
17
#                               Default: --inet=10023
18
#
18
#
Lines 30-36 Link Here
30
load_rc_config $name
30
load_rc_config $name
31
31
32
: ${postgrey_enable:=NO}
32
: ${postgrey_enable:=NO}
33
: ${postgrey_dbdir:=/var/db/postgrey}
33
: ${postgrey_dbdir:=%%PGY_DIR%%}
34
: ${postgrey_flags:=--inet=10023}
34
: ${postgrey_flags:=--inet=10023}
35
35
36
command=%%PREFIX%%/sbin/postgrey
36
command=%%PREFIX%%/sbin/postgrey
(-)pkg-plist (-5 / +3 lines)
Lines 1-7 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
@sample etc/postfix/postgrey_whitelist_recipients.sample
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
@sample etc/postfix/postgrey_whitelist_clients.sample
3
etc/postfix/dist-postgrey_whitelist_recipients
4
etc/postfix/dist-postgrey_whitelist_clients
5
man/man1/policy-test.1.gz
3
man/man1/policy-test.1.gz
6
man/man1/postgrey.1.gz
4
man/man1/postgrey.1.gz
7
man/man1/postgreyreport.1.gz
5
man/man1/postgreyreport.1.gz
Lines 9-12 Link Here
9
sbin/policy-test
7
sbin/policy-test
10
sbin/postgreyreport
8
sbin/postgreyreport
11
@dirrmtry etc/postfix
9
@dirrmtry etc/postfix
12
@unexec rmdir /var/db/postgrey 2>/dev/null || true
10
@dirrmtry(%%PGY_USER%%,%%PGY_GROUP%%,750) %%PGY_DIR%%

Return to bug 194019