Index: Makefile =================================================================== --- Makefile (revision 369650) +++ Makefile (working copy) @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= postgrey -PORTVERSION= 1.34 -PORTREVISION= 7 +PORTVERSION= 1.35 CATEGORIES= mail MASTER_SITES= http://postgrey.schweikert.ch/pub/ \ http://postgrey.schweikert.ch/pub/old/ @@ -11,6 +10,8 @@ MAINTAINER= ports.maintainer@evilphi.com COMMENT= Greylisting policy server for Postfix +LICENSE= GPLv2 + RUN_DEPENDS= p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \ p5-IO-Multiplex>=0:${PORTSDIR}/devel/p5-IO-Multiplex \ p5-Parse-Syslog>=0:${PORTSDIR}/textproc/p5-Parse-Syslog \ @@ -22,18 +23,14 @@ NO_BUILD= yes POD2MAN?= pod2man PORTDOCS= README Changes README.exim -SUB_FILES= pkg-install -SUB_LIST= USER=${PGY_USERNAME} \ - GROUP=${PGY_GROUPNAME} \ - ETCFILES="${ETCFILES}" \ - POSTGREYDIR=${PGY_DIR} ETCFILES= whitelist_clients whitelist_recipients -PGY_USERNAME?= postgrey -PGY_GROUPNAME?= postgrey -PGY_DIR?= /var/db/postgrey +PGY_USER= postgrey +PGY_GROUP= postgrey +PGY_DIR= /var/db/postgrey +SUB_LIST+= PGY_DIR=${PGY_DIR} -USERS= ${PGY_USERNAME} -GROUPS= ${PGY_GROUPNAME} +USERS= ${PGY_USER} +GROUPS= ${PGY_GROUP} MPAGES= postgrey.1 policy-test.1 postgreyreport.1 USES= shebangfix perl5 @@ -41,10 +38,14 @@ OPTIONS_DEFINE= DOCS +PLIST_SUB+= PGY_USER=${PGY_USER} \ + PGY_GROUP=${PGY_GROUP} \ + PGY_DIR=${PGY_DIR} + .include post-patch: - @${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUPNAME}#' \ + @${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUP}#' \ -e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey @${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \ ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_* @@ -52,7 +53,7 @@ ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport do-install: - ${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1 + ${POD2MAN} ${WRKSRC}/postgrey ${WRKSRC}/postgrey.1 ${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1 ${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1 ${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${STAGEDIR}${PREFIX}/sbin @@ -62,7 +63,7 @@ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PGY_DIR} .for i in ${ETCFILES} ${INSTALL_DATA} ${WRKSRC}/postgrey_${i} \ - ${STAGEDIR}${PREFIX}/etc/postfix/dist-postgrey_${i} + ${STAGEDIR}${PREFIX}/etc/postfix/postgrey_${i}.sample .endfor .if ${PORT_OPTIONS:MDOCS} Index: distinfo =================================================================== --- distinfo (revision 369650) +++ distinfo (working copy) @@ -1,2 +1,2 @@ -SHA256 (postgrey-1.34.tar.gz) = 9a9ee2f4e3cbbf15642e47802407c810ac5c54f0ad1572ebec3f0f645eb35707 -SIZE (postgrey-1.34.tar.gz) = 36399 +SHA256 (postgrey-1.35.tar.gz) = f6a6956630803e6f79ebff6ad0cc0d46ba32046ed6cc260e38e6f591de7bbdcf +SIZE (postgrey-1.35.tar.gz) = 36610 Index: files/patch-postgrey =================================================================== --- files/patch-postgrey (revision 369650) +++ files/patch-postgrey (working copy) @@ -1,19 +0,0 @@ ---- postgrey.orig 2011-05-05 04:54:15.000000000 +0800 -+++ postgrey 2013-10-20 01:07:50.744835568 +0800 -@@ -557,6 +557,16 @@ - if($opt{dbdir}) { - $opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1; - } -+ # untaint what is given on --pidfile. It is not security sensitive since -+ # it is provided by the admin -+ if($opt{pidfile}) { -+ $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1; -+ } -+ # untaint what is given on --inet. It is not security sensitive since -+ # it is provided by the admin -+ if($opt{inet}) { -+ $opt{inet} =~ /^(.*)$/; $opt{inet} = $1; -+ } - - # determine proper "logsock" for Sys::Syslog - my $syslog_logsock; Index: files/pkg-install.in =================================================================== --- files/pkg-install.in (revision 369650) +++ files/pkg-install.in (working copy) @@ -1,42 +0,0 @@ -#! /bin/sh -# -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -case $2 in - -PRE-INSTALL) - if [ -z "%%POSTGREYDIR%%" -o -z "%%USER%%" -o -z "%%GROUP%%" ]; then - echo "ERROR: A required pragma was empty" - exit 1 - fi - ;; - -POST-INSTALL) - echo "---> Starting post-install script:" - - # Create home directory if required - if [ -d "%%POSTGREYDIR%%" ]; then - echo "---> Using existing Postgrey database directory (%%POSTGREYDIR%%)" - echo " (There may be existing active postgrey databases - this installation" - echo " will attempt to preserve them.)" - else - echo "---> Creating Postgrey database directory (%%POSTGREYDIR%%)" - (umask 002 && /bin/mkdir -p "%%POSTGREYDIR%%") || exit 1 - /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%POSTGREYDIR%%" || exit 1 - /bin/chmod g+s "%%POSTGREYDIR%%" || exit 1 - fi - - for i in %%ETCFILES%%; do - if [ ! -f "%%PREFIX%%/etc/postfix/postgrey_${i}" ]; then - echo "---> Installing new config file %%PREFIX%%/etc/postfix/postgrey_${i}" - cp -p %%PREFIX%%/etc/postfix/dist-postgrey_${i} \ - %%PREFIX%%/etc/postfix/postgrey_${i} - else - echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}" - fi - done - ;; - -esac Index: files/postgrey.in =================================================================== --- files/postgrey.in (revision 369650) +++ files/postgrey.in (working copy) @@ -12,7 +12,7 @@ # postgrey_enable (bool) Set to 'YES' to enable # Default: NO # postgrey_dbdir (path) Location of postgrey database files. -# Default: /var/db/postgrey +# Default: %%PGY_DIR%% # postgrey_flags (extra args) Additional command-line parameters. # Default: --inet=10023 # @@ -30,7 +30,7 @@ load_rc_config $name : ${postgrey_enable:=NO} -: ${postgrey_dbdir:=/var/db/postgrey} +: ${postgrey_dbdir:=%%PGY_DIR%%} : ${postgrey_flags:=--inet=10023} command=%%PREFIX%%/sbin/postgrey Index: pkg-plist =================================================================== --- pkg-plist (revision 369650) +++ pkg-plist (working copy) @@ -1,7 +1,5 @@ -@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 -@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 -etc/postfix/dist-postgrey_whitelist_recipients -etc/postfix/dist-postgrey_whitelist_clients +@sample etc/postfix/postgrey_whitelist_recipients.sample +@sample etc/postfix/postgrey_whitelist_clients.sample man/man1/policy-test.1.gz man/man1/postgrey.1.gz man/man1/postgreyreport.1.gz @@ -8,5 +6,5 @@ sbin/postgrey sbin/policy-test sbin/postgreyreport -@dirrmtry etc/postfix -@unexec rmdir /var/db/postgrey 2>/dev/null || true +@dir etc/postfix +@dir(%%PGY_USER%%,%%PGY_GROUP%%,750) %%PGY_DIR%%