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

Collapse All | Expand All

(-)Makefile (-21 / +29 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=	8
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-42 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
26
PLIST_SUB=	USER=${PGY_USERNAME} \
27
PG_DBDIR?=	/var/db/postgrey
27
		GROUP=${PGY_GROUPNAME}
28
PG_GROUP?=	postgrey
28
SUB_LIST=	USER=${PGY_USERNAME} \
29
PG_RUNDIR?=	/var/run/postgrey
29
		GROUP=${PGY_GROUPNAME} \
30
PG_USER?=	postgrey
30
		ETCFILES="${ETCFILES}" \
31
31
		POSTGREYDIR=${PGY_DIR}
32
SUB_LIST=	PG_DBDIR=${PG_DBDIR} \
33
		PG_RUNDIR=${PG_RUNDIR}
34
35
PLIST_SUB+=	PG_DBDIR=${PG_DBDIR} \
36
		PG_GROUP=${PG_GROUP} \
37
		PG_RUNDIR=${PG_RUNDIR} \
38
		PG_USER=${PG_USER}
39
40
USERS=		${PG_USER}
41
GROUPS=		${PG_GROUP}
42
43
MANPAGES=	postgrey.1 policy-test.1 postgreyreport.1
32
ETCFILES=	whitelist_clients whitelist_recipients
44
ETCFILES=	whitelist_clients whitelist_recipients
33
PGY_USERNAME?=	postgrey
34
PGY_GROUPNAME?=	postgrey
35
PGY_DIR?=	/var/db/postgrey
36
45
37
USERS=		${PGY_USERNAME}
46
USE_RC_SUBR=	postgrey
38
GROUPS=		${PGY_GROUPNAME}
39
MPAGES=		postgrey.1 policy-test.1 postgreyreport.1
40
47
41
USES=		shebangfix perl5
48
USES=		shebangfix perl5
42
SHEBANG_FILES=	postgrey policy-test contrib/postgreyreport
49
SHEBANG_FILES=	postgrey policy-test contrib/postgreyreport
Lines 46-60 Link Here
46
.include <bsd.port.options.mk>
53
.include <bsd.port.options.mk>
47
54
48
post-patch:
55
post-patch:
49
	@${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUPNAME}#' \
56
	@${REINPLACE_CMD} -e 's#nogroup#${PG_GROUP}#' \
50
		-e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
57
		-e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
51
	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \
58
	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \
52
		${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
59
		${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
53
	@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DIR}#' \
60
	@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PG_DBDIR}#' \
54
		${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
61
		${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
55
62
56
do-install:
63
do-install:
57
	${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1
64
	${POD2MAN} ${WRKSRC}/postgrey ${WRKSRC}/postgrey.1
58
	${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
65
	${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
59
	${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
66
	${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
60
	${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${STAGEDIR}${PREFIX}/sbin
67
	${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${STAGEDIR}${PREFIX}/sbin
Lines 61-70 Link Here
61
	${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${STAGEDIR}${PREFIX}/sbin
68
	${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${STAGEDIR}${PREFIX}/sbin
62
	${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport \
69
	${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport \
63
		${STAGEDIR}${PREFIX}/sbin
70
		${STAGEDIR}${PREFIX}/sbin
64
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PGY_DIR}
71
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PG_DBDIR} \
72
		${STAGEDIR}/${PG_RUNDIR}
65
.for i in ${ETCFILES}
73
.for i in ${ETCFILES}
66
	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} \
74
	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} \
67
		${STAGEDIR}${PREFIX}/etc/postfix/dist-postgrey_${i}
75
		${STAGEDIR}${PREFIX}/etc/postfix/postgrey_${i}.sample
68
.endfor
76
.endfor
69
77
70
.if ${PORT_OPTIONS:MDOCS}
78
.if ${PORT_OPTIONS:MDOCS}
Lines 72-77 Link Here
72
	@cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
80
	@cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
73
.endif
81
.endif
74
	@cd ${WRKSRC} && \
82
	@cd ${WRKSRC} && \
75
		${INSTALL_MAN} ${MPAGES} ${STAGEDIR}${MANPREFIX}/man/man1
83
		${INSTALL_MAN} ${MANPAGES} ${STAGEDIR}${MANPREFIX}/man/man1
76
84
77
.include <bsd.port.mk>
85
.include <bsd.port.mk>
(-)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 (-19 lines)
Lines 1-19 Link Here
1
--- postgrey.orig	2011-05-05 04:54:15.000000000 +0800
2
+++ postgrey	2013-10-20 01:07:50.744835568 +0800
3
@@ -557,6 +557,16 @@
4
     if($opt{dbdir}) {
5
         $opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1;
6
     }
7
+    # untaint what is given on --pidfile. It is not security sensitive since
8
+    # it is provided by the admin
9
+    if($opt{pidfile}) {
10
+        $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1;
11
+    }
12
+    # untaint what is given on --inet. It is not security sensitive since
13
+    # it is provided by the admin
14
+    if($opt{inet}) {
15
+        $opt{inet} =~ /^(.*)$/; $opt{inet} = $1;
16
+    }
17
 
18
     # determine proper "logsock" for Sys::Syslog
19
     my $syslog_logsock;
(-)files/pkg-install.in (-28 lines)
Lines 1-28 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
  for i in %%ETCFILES%%; do
18
    if [ ! -f "%%PREFIX%%/etc/postfix/postgrey_${i}" ]; then
19
	echo "---> Installing new config file %%PREFIX%%/etc/postfix/postgrey_${i}"
20
	cp -p	%%PREFIX%%/etc/postfix/dist-postgrey_${i} \
21
		%%PREFIX%%/etc/postfix/postgrey_${i}
22
    else
23
	echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}"
24
    fi
25
  done
26
  ;;
27
28
esac
(-)files/postgrey.in (-6 / +4 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: %%PG_DBDIR%%
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-44 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:=%%PG_DBDIR%%}
34
: ${postgrey_flags:=--inet=10023}
34
: ${postgrey_flags:=--inet=10023}
35
35
36
command=%%PREFIX%%/sbin/postgrey
36
command=%%PREFIX%%/sbin/postgrey
37
pidfile=/var/run/postgrey.pid
37
pidfile=%%PG_RUNDIR%%/postgrey.pid
38
required_dirs=${postgrey_dbdir}
38
required_dirs="${postgrey_dbdir} %%PG_RUNDIR%%"
39
39
40
command_args="-d --pidfile=${pidfile} --dbdir=${postgrey_dbdir}"
40
command_args="-d --pidfile=${pidfile} --dbdir=${postgrey_dbdir}"
41
41
42
stop_postcmd="rm -f ${pidfile}"
43
44
run_rc_command "$1"
42
run_rc_command "$1"
(-)pkg-message (-5 / +31 lines)
Lines 1-7 Link Here
1
1
2
ATTENTION
2
NETWORK LISTENER WARNING
3
------------------------
3
4
4
The startup script for postgrey will make it listen on TCP port
5
By default, the startup script specifies "--inet=10023" in postgrey_flags.
5
10023 by default. If you want to use a different setting, please
6
This makes postgrey listen on localhost TCP port 10023.  If you want to use a
6
read the comments in the RC script and set the appropriate settings
7
unix socket, a different port, or an external interface, please see the
7
via rc.conf before starting postgrey.
8
postgrey(1) man page about the use of the --inet and --unix flags and set
9
postgrey_flags as appropriate.
10
11
12
THIRD-PARTY DISCLOSURE WARNING
13
------------------------------
14
15
The default text used when postgrey returns a "greylisted" response includes a
16
URL of the form:
17
18
http://postgrey.schweikert.ch/help/example.com.html
19
20
where example.com is the FQDN of the RCPT TO address of the greylisted message.
21
This is a potential information disclosure in the following ways:
22
23
- Indicates you are using David Schweikert's postgrey;
24
- Someone who goes to that link may disclose to the website's operator that
25
  they sent email to your domain.
26
27
If you do not want this behaviour, you can override the default text by
28
setting --greylist-text in postgrey_flags.  An example of a generic setting
29
would be --greylist-text='4.7.1 Greylisted'.
30
31
Please see the "Greylist Text" section of the postgrey(1) man page for more
32
information.
33
(-)pkg-plist (-5 / +5 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_clients.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_recipients.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 8-11 Link Here
8
sbin/postgrey
6
sbin/postgrey
9
sbin/policy-test
7
sbin/policy-test
10
sbin/postgreyreport
8
sbin/postgreyreport
11
@dir(%%USER%%,%%GROUP%%,2775) /var/db/postgrey
9
@dir etc/postfix
10
@dir(%%PG_USER%%,%%PG_GROUP%%,750) %%PG_DBDIR%%
11
@dir(%%PG_USER%%,%%PG_GROUP%%,750) %%PG_RUNDIR%%

Return to bug 194019