FreeBSD Bugzilla – Attachment 119603 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]
[patch]
postgrey.patch
postgrey.patch (text/plain), 9.33 KB, created by
Martin Matuska
on 2011-11-07 07:43:17 UTC
(
hide
)
Description:
postgrey.patch
Filename:
MIME Type:
Creator:
Martin Matuska
Created:
2011-11-07 07:43:17 UTC
Size:
9.33 KB
patch
obsolete
>Index: ports/mail/postgrey/Makefile >=================================================================== >RCS file: /home/pcvs/ports/mail/postgrey/Makefile,v >retrieving revision 1.30 >diff -u -r1.30 Makefile >--- ports/mail/postgrey/Makefile 20 Oct 2011 21:12:06 -0000 1.30 >+++ ports/mail/postgrey/Makefile 7 Nov 2011 07:42:01 -0000 >@@ -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,35 @@ > 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 >+ >+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} >+ > 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: >- @${SH} ${PKGINSTALL} ${PKGNAME} PRE-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 file in postgrey_whitelist_clients postgrey_whitelist_recipients >+ ${INSTALL_DATA} ${WRKSRC}/${file} ${ETCDIR}/dist-${file} >+ @${CP} -n ${ETCDIR}/dist-${file} ${ETCDIR}/${file} > .endfor > > .if !defined(NOPORTDOCS) >@@ -66,5 +68,6 @@ > > post-install: > @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL >+ @${CAT} ${PKGMESSAGE} > > .include <bsd.port.mk> >Index: ports/mail/postgrey/pkg-plist >=================================================================== >RCS file: /home/pcvs/ports/mail/postgrey/pkg-plist,v >retrieving revision 1.8 >diff -u -r1.8 pkg-plist >--- ports/mail/postgrey/pkg-plist 27 Oct 2007 18:33:58 -0000 1.8 >+++ ports/mail/postgrey/pkg-plist 7 Nov 2011 07:42:01 -0000 >@@ -1,9 +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 >+@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_recipients %D/%%ETCDIR%%/postgrey_whitelist_recipients; then rm %D/%%ETCDIR%%/postgrey_whitelist_recipients; fi >+@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_clients %D/%%ETCDIR%%/postgrey_whitelist_clients; then rm %D/%%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 >+@exec [ ! -f %B/postgrey_whitelist_recipients ] && cp %B/%f %B/postgrey_whitelist_recipients >+%%ETCDIR%%/dist-postgrey_whitelist_clients >+@exec [ ! -f %B/postgrey_whitelist_clients ] && cp %B/%f %B/postgrey_whitelist_clients >+@dirrmtry %%ETCDIR%% >+@unexec rmdir %%DBDIR%% 2>/dev/null || true >Index: ports/mail/postgrey/files/pkg-install.in >=================================================================== >RCS file: /home/pcvs/ports/mail/postgrey/files/pkg-install.in,v >retrieving revision 1.3 >diff -u -r1.3 pkg-install.in >--- ports/mail/postgrey/files/pkg-install.in 20 Oct 2011 21:12:06 -0000 1.3 >+++ ports/mail/postgrey/files/pkg-install.in 7 Nov 2011 07:42:01 -0000 >@@ -3,44 +3,30 @@ > # $FreeBSD: ports/mail/postgrey/files/pkg-install.in,v 1.3 2011/10/20 21:12:06 crees Exp $ > > PATH=/bin:/usr/bin:/usr/sbin >+DBDIR="%%DBDIR%%" >+USER="%%USER%%" >+GROUP="%%GROUP%%" > > case $2 in > >-PRE-INSTALL) >- echo "---> Starting install script:" >- >- if [ -z "%%POSTGREYDIR%%" -o \ >- -z "%%USER%%" -o -z "%%GROUP%%" -o \ >- -z "%%UID%%" -o -z "%%GID%%" ]; 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%%)" >+ if [ -z ${DBDIR} ]; then >+ echo "---> Default database directory not specified" >+ elif [ -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.)" >+ elif [ -e ${DBDIR} ]; then >+ echo "---> The default Postgrey database directory (${DBDIR})" >+ echo " exists but is not a directory - you have to create it yourself" > 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 && mkdir -p ${DBDIR}) || exit 1 >+ chown -R ${USER}:${GROUP} ${DBDIR} || exit 1 >+ chmod g+s ${DBDIR} || exit 1 > fi >- ;; >- >-POST-INSTALL) >- 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} >- else >- echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}" >- fi >- done >- ;; > > esac >Index: ports/mail/postgrey/files/pkg-message.in >=================================================================== >RCS file: ports/mail/postgrey/files/pkg-message.in >diff -N ports/mail/postgrey/files/pkg-message.in >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ports/mail/postgrey/files/pkg-message.in 7 Nov 2011 07:42:01 -0000 >@@ -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. >+ >+ >Index: ports/mail/postgrey/files/postgrey.in >=================================================================== >RCS file: /home/pcvs/ports/mail/postgrey/files/postgrey.in,v >retrieving revision 1.5 >diff -u -r1.5 postgrey.in >--- ports/mail/postgrey/files/postgrey.in 17 Aug 2010 23:52:34 -0000 1.5 >+++ ports/mail/postgrey/files/postgrey.in 7 Nov 2011 07:42:01 -0000 >@@ -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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162188
:
119601
|
119602
| 119603 |
119604