- Update to version 1.35

- Add LICENSE
- Remove pkg-install script, move directory creation to pkg-plist
- Use @sample keyword for config files

PR:		194019
Submitted by:	TEUBEL Györg y<tgyurci@gmail.com>
Approved by:	maintainer
This commit is contained in:
Pawel Pekala 2014-11-05 17:35:38 +00:00
parent adfa6917d0
commit ea2f6e254b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=372199
7 changed files with 72 additions and 87 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= postgrey
PORTVERSION= 1.34
PORTREVISION= 8
PORTVERSION= 1.35
CATEGORIES= mail
MASTER_SITES= http://postgrey.schweikert.ch/pub/ \
http://postgrey.schweikert.ch/pub/old/
@ -11,6 +10,8 @@ MASTER_SITES= http://postgrey.schweikert.ch/pub/ \
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,21 +23,27 @@ USE_RC_SUBR= ${PORTNAME}
NO_BUILD= yes
POD2MAN?= pod2man
PORTDOCS= README Changes README.exim
SUB_FILES= pkg-install
PLIST_SUB= USER=${PGY_USERNAME} \
GROUP=${PGY_GROUPNAME}
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
USERS= ${PGY_USERNAME}
GROUPS= ${PGY_GROUPNAME}
MPAGES= postgrey.1 policy-test.1 postgreyreport.1
PG_DBDIR?= /var/db/postgrey
PG_GROUP?= postgrey
PG_RUNDIR?= /var/run/postgrey
PG_USER?= postgrey
SUB_LIST= PG_DBDIR=${PG_DBDIR} \
PG_RUNDIR=${PG_RUNDIR}
PLIST_SUB+= PG_DBDIR=${PG_DBDIR} \
PG_GROUP=${PG_GROUP} \
PG_RUNDIR=${PG_RUNDIR} \
PG_USER=${PG_USER}
USERS= ${PG_USER}
GROUPS= ${PG_GROUP}
MANPAGES= postgrey.1 policy-test.1 postgreyreport.1
ETCFILES= whitelist_clients whitelist_recipients
USE_RC_SUBR= postgrey
USES= shebangfix perl5
SHEBANG_FILES= postgrey policy-test contrib/postgreyreport
@ -46,25 +53,26 @@ OPTIONS_DEFINE= DOCS
.include <bsd.port.options.mk>
post-patch:
@${REINPLACE_CMD} -e 's#nogroup#${PGY_GROUPNAME}#' \
@${REINPLACE_CMD} -e 's#nogroup#${PG_GROUP}#' \
-e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' \
${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DIR}#' \
@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PG_DBDIR}#' \
${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
${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${STAGEDIR}${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport \
${STAGEDIR}${PREFIX}/sbin
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PGY_DIR}
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/postfix ${STAGEDIR}/${PG_DBDIR} \
${STAGEDIR}/${PG_RUNDIR}
.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}
@ -72,6 +80,6 @@ do-install:
@cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.endif
@cd ${WRKSRC} && \
${INSTALL_MAN} ${MPAGES} ${STAGEDIR}${MANPREFIX}/man/man1
${INSTALL_MAN} ${MANPAGES} ${STAGEDIR}${MANPREFIX}/man/man1
.include <bsd.port.mk>

View file

@ -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

View file

@ -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;

View file

@ -1,28 +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)
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

View file

@ -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: %%PG_DBDIR%%
# postgrey_flags (extra args) Additional command-line parameters.
# Default: --inet=10023
#
@ -30,15 +30,13 @@ rcvar=postgrey_enable
load_rc_config $name
: ${postgrey_enable:=NO}
: ${postgrey_dbdir:=/var/db/postgrey}
: ${postgrey_dbdir:=%%PG_DBDIR%%}
: ${postgrey_flags:=--inet=10023}
command=%%PREFIX%%/sbin/postgrey
pidfile=/var/run/postgrey.pid
required_dirs=${postgrey_dbdir}
pidfile=%%PG_RUNDIR%%/postgrey.pid
required_dirs="${postgrey_dbdir} %%PG_RUNDIR%%"
command_args="-d --pidfile=${pidfile} --dbdir=${postgrey_dbdir}"
stop_postcmd="rm -f ${pidfile}"
run_rc_command "$1"

View file

@ -1,7 +1,33 @@
ATTENTION
NETWORK LISTENER WARNING
------------------------
By default, the startup script specifies "--inet=10023" in postgrey_flags.
This makes postgrey listen on localhost TCP port 10023. If you want to use a
unix socket, a different port, or an external interface, please see the
postgrey(1) man page about the use of the --inet and --unix flags and set
postgrey_flags as appropriate.
THIRD-PARTY DISCLOSURE WARNING
------------------------------
The default text used when postgrey returns a "greylisted" response includes a
URL of the form:
http://postgrey.schweikert.ch/help/example.com.html
where example.com is the FQDN of the RCPT TO address of the greylisted message.
This is a potential information disclosure in the following ways:
- Indicates you are using David Schweikert's postgrey;
- Someone who goes to that link may disclose to the website's operator that
they sent email to your domain.
If you do not want this behaviour, you can override the default text by
setting --greylist-text in postgrey_flags. An example of a generic setting
would be --greylist-text='4.7.1 Greylisted'.
Please see the "Greylist Text" section of the postgrey(1) man page for more
information.
The startup script for postgrey will make it listen on TCP port
10023 by default. If you want to use a different setting, please
read the comments in the RC script and set the appropriate settings
via rc.conf before starting postgrey.

View file

@ -1,11 +1,11 @@
@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_clients.sample
@sample etc/postfix/postgrey_whitelist_recipients.sample
man/man1/policy-test.1.gz
man/man1/postgrey.1.gz
man/man1/postgreyreport.1.gz
sbin/postgrey
sbin/policy-test
sbin/postgreyreport
@dir(%%USER%%,%%GROUP%%,2775) /var/db/postgrey
@dir etc/postfix
@dir(%%PG_USER%%,%%PG_GROUP%%,750) %%PG_DBDIR%%
@dir(%%PG_USER%%,%%PG_GROUP%%,750) %%PG_RUNDIR%%