FreeBSD Bugzilla – Attachment 119602 Details for
Bug 162188
[PATCH] mail/postgrey: add rc script options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
postgrey_1.34_1.patch.txt
postgrey_1.34_1.patch.txt (text/plain), 7.84 KB, created by
darren
on 2011-11-06 11:55:17 UTC
(
hide
)
Description:
postgrey_1.34_1.patch.txt
Filename:
MIME Type:
Creator:
darren
Created:
2011-11-06 11:55:17 UTC
Size:
7.84 KB
patch
obsolete
>--- Makefile.orig 2011-10-20 14:12:06.000000000 -0700 >+++ Makefile 2011-11-06 03:13:36.000000000 -0800 >@@ -7,6 +7,7 @@ > > PORTNAME= postgrey > PORTVERSION= 1.34 >+PORTREVISION= 1 > CATEGORIES= mail > MASTER_SITES= http://postgrey.schweikert.ch/pub/ \ > http://postgrey.schweikert.ch/pub/old/ >@@ -14,6 +15,9 @@ > MAINTAINER= ports.maintainer@evilphi.com > COMMENT= Greylisting policy server for Postfix > >+LICENSE= GPLv2 >+LICENSE_FILE= ${WRKSRC}/COPYING >+ > RUN_DEPENDS= ${SITE_PERL}/Net/Server.pm:${PORTSDIR}/net/p5-Net-Server \ > ${SITE_PERL}/IO/Multiplex.pm:${PORTSDIR}/devel/p5-IO-Multiplex \ > ${SITE_PERL}/Parse/Syslog.pm:${PORTSDIR}/textproc/p5-Parse-Syslog \ >@@ -25,37 +29,38 @@ > NO_BUILD= yes > POD2MAN?= pod2man > PORTDOCS= README Changes README.exim >-SUB_FILES= pkg-install >-SUB_LIST= USER=${PGY_USERNAME} UID=${PGY_USERID} GROUP=${PGY_GROUPNAME} \ >- GID=${PGY_GROUPID} ETCFILES="${ETCFILES}" \ >- POSTGREYDIR=${PGY_DIR} >-ETCFILES= whitelist_clients whitelist_recipients >-PGY_USERNAME?= postgrey >-PGY_USERID?= 225 >-PGY_GROUPNAME?= ${PGY_USERNAME} >-PGY_GROUPID?= ${PGY_USERID} >-PGY_DIR?= /var/db/postgrey >- >-USERS= ${PGY_USERNAME} >-GROUPS= ${PGY_GROUPNAME} > MAN1= ${PORTNAME}.1 policy-test.1 postgreyreport.1 > >+PGY_DBDIR?= /var/db/postgrey >+PGY_ETCFILES= whitelist_clients whitelist_recipients >+ >+USERS?= postgrey >+GROUPS?= postgrey >+ >+PLIST_SUB= DBDIR=${PGY_DBDIR} >+ >+SUB_FILES= ${PORTNAME} pkg-install pkg-message >+SUB_LIST= USER=${USERS} GROUP=${GROUPS} DBDIR=${PGY_DBDIR} ETCFILES="${PGY_ETCFILES}" >+ > post-patch: > @${REINPLACE_CMD} -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}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport >+ @${REINPLACE_CMD} -e 's#/etc/postfix#${ETCDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_* >+ @${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DBDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport >+ @${REINPLACE_CMD} -e 's#nogroup#${GROUPS}#' ${WRKSRC}/postgrey > >-do-install: >+pre-install: > @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL >+ >+do-install: > @${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1 > @${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1 > @${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1 > @${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${PREFIX}/sbin > @${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${PREFIX}/sbin > @${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport ${PREFIX}/sbin >- @${INSTALL} -d ${PREFIX}/etc/postfix >-.for i in ${ETCFILES} >- ${INSTALL_DATA} ${WRKSRC}/postgrey_${i} ${PREFIX}/etc/postfix/dist-postgrey_${i} >+ @${INSTALL} -d ${ETCDIR} >+.for i in ${PGY_ETCFILES} >+ ${INSTALL_DATA} ${WRKSRC}/postgrey_${i} ${ETCDIR}/dist-postgrey_${i} > .endfor > > .if !defined(NOPORTDOCS) >@@ -66,5 +71,6 @@ > > post-install: > @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL >+ @${CAT} ${PKGMESSAGE} > > .include <bsd.port.mk> >--- pkg-plist.orig 2007-10-27 11:33:58.000000000 -0700 >+++ pkg-plist 2011-11-06 01:48:58.000000000 -0800 >@@ -1,9 +1,9 @@ >-@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 >+@unexec if cmp -s %%ETCDIR%%/dist-postgrey_whitelist_recipients %%ETCDIR%%/postgrey_whitelist_recipients; then rm -f %%ETCDIR%%/postgrey_whitelist_recipients; fi >+@unexec if cmp -s %%ETCDIR%%/dist-postgrey_whitelist_clients %%ETCDIR%%/postgrey_whitelist_clients; then rm -f %%ETCDIR%%/postgrey_whitelist_clients; fi > sbin/postgrey > sbin/policy-test > sbin/postgreyreport >-etc/postfix/dist-postgrey_whitelist_recipients >-etc/postfix/dist-postgrey_whitelist_clients >-@dirrmtry etc/postfix >-@unexec rmdir /var/db/postgrey 2>/dev/null || true >+%%ETCDIR%%/dist-postgrey_whitelist_recipients >+%%ETCDIR%%/dist-postgrey_whitelist_clients >+@dirrmtry %%ETCDIR%% >+@unexec rmdir %%DBDIR%% 2>/dev/null || true >--- files/pkg-install.in.orig 2011-10-20 14:12:06.000000000 -0700 >+++ files/pkg-install.in 2011-11-06 00:09:08.000000000 -0700 >@@ -9,23 +9,21 @@ > PRE-INSTALL) > echo "---> Starting install script:" > >- if [ -z "%%POSTGREYDIR%%" -o \ >- -z "%%USER%%" -o -z "%%GROUP%%" -o \ >- -z "%%UID%%" -o -z "%%GID%%" ]; then >+ if [ -z "%%DBDIR%%" ]; then > echo "ERROR: A required pragma was empty" > exit 1 > fi > > # Create home directory if required >- if [ -d "%%POSTGREYDIR%%" ]; then >- echo "---> Using existing Postgrey database directory (%%POSTGREYDIR%%)" >+ if [ -d "%%DBDIR%%" ]; then >+ echo "---> Using existing Postgrey database directory (%%DBDIR%%)" > 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 >+ echo "---> Creating Postgrey database directory (%%DBDIR%%)" >+ (umask 002 && /bin/mkdir -p "%%DBDIR%%") || exit 1 >+ /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%DBDIR%%" || exit 1 >+ /bin/chmod g+s "%%DBDIR%%" || exit 1 > fi > ;; > >@@ -33,12 +31,12 @@ > echo "---> Starting post-install script:" > > 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} >+ if [ ! -f "%%ETCDIR%%/postgrey_${i}" ]; then >+ echo "---> Installing new config file %%ETCDIR%%/postgrey_${i}" >+ cp -p %%ETCDIR%%/dist-postgrey_${i} \ >+ %%ETCDIR%%/postgrey_${i} > else >- echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}" >+ echo "---> Keeping existing config file %%ETCDIR%%/postgrey_${i}" > fi > done > ;; >--- files/pkg-message.in.orig 2011-11-06 02:50:27.000000000 -0800 >+++ files/pkg-message.in 2011-11-06 03:00:25.000000000 -0800 >@@ -0,0 +1,11 @@ >+ >+ >+ATTENTION: >+ >+The default location of the whitelist files has changed from >+%%PREFIX%%/etc/postfix to %%ETCDIR%%. If you modified the >+whitelists, you will need to either move them to the new location or >+specify their location by adding --whitelist-clients and >+--whitelist-recipients parameters to postgrey_options in /etc/rc.conf. >+ >+ >--- files/postgrey.in.orig 2011-02-16 11:17:06.000000000 -0800 >+++ files/postgrey.in 2011-11-06 01:10:26.000000000 -0800 >@@ -12,7 +12,9 @@ > # > # postgrey_enable="YES" > # >-# See perldoc postgrey for flags >+# See perldoc postgrey or run `postgrey --help` to see options. You can change >+# the --dbdir path by setting postgrey_dbdir. Specify additional options with >+# the postgrey_options variable. > # > > . /etc/rc.subr >@@ -21,7 +23,6 @@ > rcvar=`set_rcvar` > > command=%%PREFIX%%/sbin/postgrey >-required_dirs=/var/db/postgrey > extra_commands=reload > > stop_postcmd=stop_postcmd >@@ -35,13 +36,14 @@ > > load_rc_config $name > >+postgrey_dbdir=${postgrey_dbdir:-"%%DBDIR%%"} > postgrey_enable=${postgrey_enable:-"NO"} >-postgrey_greylist_header=${postgrey_greylist_header:-"X-Greylist: delayed %t seconds by postgrey-%v at %h\; %d"} >+postgrey_options=${postgrey_options:-"--inet:10023"} > postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"} >-postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \ >- --inet=10023 -d --user=%%USER%% --group=%%GROUP%% --dbdir=/var/db/postgrey \ >- --x-greylist-header=${postgrey_greylist_header}"} >+postgrey_flags=${postgrey_flags:-"-d --pidfile=${postgrey_pidfile} \ >+ --dbdir=${postgrey_dbdir} ${postgrey_options}"} > > pidfile="${postgrey_pidfile}" >+required_dirs=${postgrey_dbdir} > > run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 162188
:
119601
| 119602 |
119603
|
119604