Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Sep 2005 17:50:53 -0300 (BRT)
From:      Marcus Grando <marcus@corp.grupos.com.br>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/85587: New port: mail/tumgreyspf
Message-ID:  <200509012050.j81KorKo069247@marcus.grupos.com.br>
Resent-Message-ID: <200509012100.j81L0a3m082001@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         85587
>Category:       ports
>Synopsis:       New port: mail/tumgreyspf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 01 21:00:36 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Marcus Grando
>Release:        FreeBSD 6.0-BETA3 i386
>Organization:
Grupos Internet S/A
>Environment:
System: FreeBSD marcus.grupos.com.br 6.0-BETA3 FreeBSD 6.0-BETA3 #33: Wed Aug 31 12:46:26 BRT 2005 root@marcus.grupos.com.br:/usr/obj/usr/src/sys/MARCUS i386


	
>Description:

- New port: mail/tumgreyspf

	
>How-To-Repeat:
	
>Fix:

	

--- tumgreyspf.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	tumgreyspf
#	tumgreyspf/Makefile
#	tumgreyspf/pkg-descr
#	tumgreyspf/distinfo
#	tumgreyspf/pkg-plist
#	tumgreyspf/files
#	tumgreyspf/files/patch-tumgreyspfsupp.py
#	tumgreyspf/files/patch-tumgreyspf
#	tumgreyspf/files/patch-tumgreyspf-clean
#	tumgreyspf/files/patch-tumgreyspf-stat
#	tumgreyspf/files/patch-tumgreyspf.conf
#	tumgreyspf/files/pkg-message.in
#	tumgreyspf/files/pkg-deinstall.in
#	tumgreyspf/files/pkg-install.in
#
echo c - tumgreyspf
mkdir -p tumgreyspf > /dev/null 2>&1
echo x - tumgreyspf/Makefile
sed 's/^X//' >tumgreyspf/Makefile << 'END-of-tumgreyspf/Makefile'
X# New ports collection makefile for:	tumgreyspf
X# Date created:				31 Aug 2005
X# Whom:					Marcus Grando <marcus@corp.grupos.com.br>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	tumgreyspf
XPORTVERSION=	1.09
XCATEGORIES=	mail
XMASTER_SITES=	ftp://ftp.tummy.com/pub/tummy/tumgreyspf/
X
XMAINTAINER=	marcus@corp.grupos.com.br
XCOMMENT=	External policy checker for the postfix mail server
X
XRUN_DEPENDS=    ${PYTHON_SITELIBDIR}/spf.py:${PORTSDIR}/mail/py-spf
X
XUSE_PYTHON=     2.1+
XNO_BUILD=	yes
XUSE_REINPLACE=	yes
X
XTUMGREYSPF_DIR?=	/var/db/${PORTNAME}
XTUMGREYSPF_USER?=	nobody
XTUMGREYSPF_GROUP?=	nobody
X
XPKGMESSAGE=	${WRKSRC}/pkg-message
XPKGDEINSTALL=	${WRKDIR}/pkg-deinstall
XPKGINSTALL=	${WRKDIR}/pkg-install
X
XSUB_FILES=	pkg-message pkg-deinstall pkg-install
XSUB_LIST+=	TUMGREYSPF_DIR=${TUMGREYSPF_DIR} \
X		TUMGREYSPF_USER=${TUMGREYSPF_USER} \
X		TUMGREYSPF_GROUP=${TUMGREYSPF_GROUP}
X
X.if !defined(NOPORTDOCS)
XPORTDOCS=	*
X.endif
X
Xpre-everything::
X	@${ECHO_MSG}
X	@${ECHO_MSG} "You may set following options:"
X	@${ECHO_MSG}
X	@${ECHO_MSG} "TUMGREYSPF_DIR=/var/db/${PORTNAME}	Local are used to greylist"
X	@${ECHO_MSG} "TUMGREYSPF_USER=nobody			User to run ${PORTNAME} (Default: nobody)"
X	@${ECHO_MSG} "TUMGREYSPF_GROUP=nobody			Group to run ${PORTNAME} (Default: nobody)"
X	@${ECHO_MSG}
X
Xpost-patch:
X	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%TUMGREYSPF_DIR%%|${TUMGREYSPF_DIR}|g" \
X		${WRKSRC}/tumgreyspfsupp.py ${WRKSRC}/tumgreyspf.conf
X
Xdo-install:
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspfsupp.py ${PYTHONPREFIX_SITELIBDIR}
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf ${PREFIX}/bin
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf-clean ${PREFIX}/bin
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf-configtest ${PREFIX}/bin
X	${INSTALL_SCRIPT} ${WRKSRC}/gentest ${PREFIX}/bin/tumgreyspf-gentest
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf-stat ${PREFIX}/bin
X	${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf.conf ${PREFIX}/etc/tumgreyspf.conf.default
X.	if !exists(${PREFIX}/etc/tumgreyspf.conf)
X		${INSTALL_SCRIPT} ${WRKSRC}/tumgreyspf.conf ${PREFIX}/etc
X.	endif
X
Xpost-install:
X	@${MKDIR} ${DATADIR}
X	@${INSTALL_DATA} ${WRKSRC}/__default__.dist ${DATADIR}
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X	@${INSTALL_DATA} ${WRKSRC}/README* ${DOCSDIR}
X.endif
X	@${CAT} ${PKGMESSAGE}
X.if !defined(PACKAGE_BUILDING)
X	@${SETENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
X.endif
X
X.include <bsd.port.mk>
END-of-tumgreyspf/Makefile
echo x - tumgreyspf/pkg-descr
sed 's/^X//' >tumgreyspf/pkg-descr << 'END-of-tumgreyspf/pkg-descr'
XTumgreyspf, an external policy checker for the postfix mail
Xserver. It can optionally greylist and/or use spfquery to 
Xcheck SPF records to determine if email should be accepted 
Xby your server.
X
XBecause of it's design, legitimate e-mail is never trapped 
Xor rejected. Only spam and viruses are caught. Since adding 
Xit to our mail server (which also uses Spam Assassin, ClamAV, 
Xand an outsourced anti-spam system), our spam level has 
Xdropped by an order of magnitude.
X
XIt uses the file-system as it's database, no additional 
Xdatabase is required to use it. 
X
XWWW: http://www.tummy.com/Community/software/tumgreyspf/
X
XMarcus Grando <marcus@corp.grupos.com.br>
END-of-tumgreyspf/pkg-descr
echo x - tumgreyspf/distinfo
sed 's/^X//' >tumgreyspf/distinfo << 'END-of-tumgreyspf/distinfo'
XMD5 (tumgreyspf-1.09.tar.gz) = bb27837d82297698fe1cb9f91b808fc3
XSIZE (tumgreyspf-1.09.tar.gz) = 22456
END-of-tumgreyspf/distinfo
echo x - tumgreyspf/pkg-plist
sed 's/^X//' >tumgreyspf/pkg-plist << 'END-of-tumgreyspf/pkg-plist'
X@unexec if cmp -s %D/etc/tumgreyspf.conf.default %D/etc/tumgreyspf.conf; then rm -f %D/etc/tumgreyspf.conf; fi
Xetc/tumgreyspf.conf.default
Xbin/tumgreyspf
Xbin/tumgreyspf-clean
Xbin/tumgreyspf-configtest
Xbin/tumgreyspf-gentest
Xbin/tumgreyspf-stat
X%%PYTHON_SITELIBDIR%%/tumgreyspfsupp.py
Xshare/tumgreyspf/__default__.dist
X@dirrm share/tumgreyspf
END-of-tumgreyspf/pkg-plist
echo c - tumgreyspf/files
mkdir -p tumgreyspf/files > /dev/null 2>&1
echo x - tumgreyspf/files/patch-tumgreyspfsupp.py
sed 's/^X//' >tumgreyspf/files/patch-tumgreyspfsupp.py << 'END-of-tumgreyspf/files/patch-tumgreyspfsupp.py'
X--- tumgreyspfsupp.py.orig	Wed Aug 31 21:39:42 2005
X+++ tumgreyspfsupp.py	Wed Aug 31 21:41:24 2005
X@@ -10,15 +10,15 @@
X 
X 
X #  default values
X-defaultConfigFilename = '/var/local/tumgreyspf/config/tumgreyspf.conf'
X+defaultConfigFilename = '%%PREFIX%%/etc/tumgreyspf.conf'
X defaultConfigData = {
X 		'debugLevel' : 0,
X 		'defaultSeedOnly' : 0,
X 		'defaultAllowTime' : 600,
X-		'configPath' : 'file:///var/local/lib/tumgreyspf/config',
X-		'greylistDir' : '/var/local/lib/tumgreyspf/data',
X-		'blackholeDir' : '/var/local/lib/tumgreyspf/blackhole',
X-		'spfqueryPath' : '/usr/local/lib/tumgreyspf/spfquery',
X+		'configPath' : 'file:///%%TUMGREYSPF_DIR%%/config',
X+		'greylistDir' : '%%TUMGREYSPF_DIR%%/data',
X+		'blackholeDir' : '%%TUMGREYSPF_DIR%%/blackhole',
X+		'spfqueryPath' : '%%PREFIX%%/bin/spfquery',
X 		}
X 
X 
END-of-tumgreyspf/files/patch-tumgreyspfsupp.py
echo x - tumgreyspf/files/patch-tumgreyspf
sed 's/^X//' >tumgreyspf/files/patch-tumgreyspf << 'END-of-tumgreyspf/files/patch-tumgreyspf'
X--- tumgreyspf.orig	Wed Aug 31 21:42:35 2005
X+++ tumgreyspf	Wed Aug 31 21:43:01 2005
X@@ -11,7 +11,6 @@
X 
X 
X import syslog, os, sys, string, re, time, popen2, urllib, stat
X-sys.path.append('/usr/local/lib/tumgreyspf')
X import tumgreyspfsupp
X 
X syslog.openlog(os.path.basename(sys.argv[0]), syslog.LOG_PID, syslog.LOG_MAIL)
END-of-tumgreyspf/files/patch-tumgreyspf
echo x - tumgreyspf/files/patch-tumgreyspf-clean
sed 's/^X//' >tumgreyspf/files/patch-tumgreyspf-clean << 'END-of-tumgreyspf/files/patch-tumgreyspf-clean'
X--- tumgreyspf-clean.orig	Wed Aug 31 21:43:32 2005
X+++ tumgreyspf-clean	Wed Aug 31 21:43:48 2005
X@@ -8,7 +8,6 @@
X #  <jafo@tummy.com>
X 
X import os, re, string, syslog, sys, time
X-sys.path.append('/usr/local/lib/tumgreyspf')
X import tumgreyspfsupp
X 
X ###################
END-of-tumgreyspf/files/patch-tumgreyspf-clean
echo x - tumgreyspf/files/patch-tumgreyspf-stat
sed 's/^X//' >tumgreyspf/files/patch-tumgreyspf-stat << 'END-of-tumgreyspf/files/patch-tumgreyspf-stat'
X--- tumgreyspf-stat.orig	Wed Aug 31 21:44:32 2005
X+++ tumgreyspf-stat	Wed Aug 31 21:44:42 2005
X@@ -7,7 +7,6 @@
X #  <jafo@tummy.com>
X 
X import os, re, string, syslog, sys, time
X-sys.path.append('/usr/local/lib/tumgreyspf')
X import tumgreyspfsupp
X 
X ###################
END-of-tumgreyspf/files/patch-tumgreyspf-stat
echo x - tumgreyspf/files/patch-tumgreyspf.conf
sed 's/^X//' >tumgreyspf/files/patch-tumgreyspf.conf << 'END-of-tumgreyspf/files/patch-tumgreyspf.conf'
X--- tumgreyspf.conf.orig	Wed Aug 31 22:23:05 2005
X+++ tumgreyspf.conf	Wed Aug 31 22:23:57 2005
X@@ -15,18 +15,18 @@
X #  Path to the directory-based configuration.  This can be used to override
X #  the configuration values for certain remote hosts, senders or
X #  recipients.
X-configPath = 'file:///var/local/lib/tumgreyspf/config'
X+configPath = 'file:///%%TUMGREYSPF_DIR%%/config'
X 
X #  Directory where the greylist resides.
X-greylistDir = '/var/local/lib/tumgreyspf/data'
X+greylistDir = '%%TUMGREYSPF_DIR%%/data'
X 
X #  Path to the program used for greylist checking.  This can either be the
X #  perl version available from http://spf.pobox.com/ or the
X #  "spfquery-static" program built from libspf2, also available from
X #  http://spf.pobox.com/
X-spfqueryPath = '/usr/local/lib/tumgreyspf/spfquery'
X+spfqueryPath = '%%PREFIX%%/bin/spfquery'
X 
X #  Directory where the blackhole information goes.  "ips" sub-directory
X #  contains IPs that have touched us with a bad address.  "addresses"
X #  sub-directory has a file per address named after the bad addresses.
X-blackholeDir = '/var/lib/tumgreyspf/blackhole'
X+blackholeDir = '%%TUMGREYSPF_DIR%%/blackhole'
END-of-tumgreyspf/files/patch-tumgreyspf.conf
echo x - tumgreyspf/files/pkg-message.in
sed 's/^X//' >tumgreyspf/files/pkg-message.in << 'END-of-tumgreyspf/files/pkg-message.in'
X#
X# To configure Postfix
X#
X
XAdd to your postfix master.cf:
X
Xtumgreyspf  unix  -       n       n       -       -       spawn
X	user=%%TUMGREYSPF_USER%% argv=%%PREFIX%%/bin/tumgreyspf
X      
XNext, main.cf must be configured so that "smtpd_sender_restrictions"
Xincludes a call to the tumgreyspf policy filter.  If you already have
Xa "smtpd_sender_restrictions" line(s), you can add the following line
Xanywhere after the line which reads "reject_unauth_destination".
X         
Xcheck_policy_service unix:private/tumgreyspf
X         
XWARNING: It's very important that you have
X"reject_unauth_destination" before the "check_policy_service".  If
Xyou do not, your system may be an open relay.
X         
XSo, for example, a minimal "smtpd_sender_restrictions" may look like:
X
Xsmtpd_sender_restrictions = reject_unauth_destination,
X                            check_policy_service unix:private/tumgreyspf
X
XYou will also need to have a line in the main.cf which reads:
X
Xtumgreyspf_time_limit = 3600
X
XPlease consult the postfix documentation for more information on
Xthese and other settings you may wish to have in the
X"smtpd_recipient_restrictions" configuration.
END-of-tumgreyspf/files/pkg-message.in
echo x - tumgreyspf/files/pkg-deinstall.in
sed 's/^X//' >tumgreyspf/files/pkg-deinstall.in << 'END-of-tumgreyspf/files/pkg-deinstall.in'
X#!/bin/sh
X
Xcase "$2" in
X	DEINSTALL)
X		if cmp -s %%DATADIR%%/__default__.dist %%TUMGREYSPF_DIR%%/config/__default__; then
X			rm %%TUMGREYSPF_DIR%%/config/__default__ 2>/dev/null
X		fi
X		rmdir %%TUMGREYSPF_DIR%%/config 2>/dev/null
X		rmdir %%TUMGREYSPF_DIR%%/data 2>/dev/null
X		rmdir %%TUMGREYSPF_DIR%% 2>/dev/null
X		if [ -d %%TUMGREYSPF_DIR%% ]; then
X			echo ""
X			echo "If you are deinstalling completely tumgreyspf, run:"
X			echo ""
X			echo "# rm -rf %%TUMGREYSPF_DIR%%"
X			echo ""
X		fi
X		;;
X	*)
X		;;
Xesac
END-of-tumgreyspf/files/pkg-deinstall.in
echo x - tumgreyspf/files/pkg-install.in
sed 's/^X//' >tumgreyspf/files/pkg-install.in << 'END-of-tumgreyspf/files/pkg-install.in'
X#!/bin/sh
X
Xcase "$2" in
X	POST-INSTALL)
X		echo "===> Create %%TUMGREYSPF_DIR%% directories"
X		install -d -o %%TUMGREYSPF_USER%% -g %%TUMGREYSPF_GROUP%% -m 755 %%TUMGREYSPF_DIR%%
X		install -d -o %%TUMGREYSPF_USER%% -g %%TUMGREYSPF_GROUP%% -m 700 %%TUMGREYSPF_DIR%%/data
X		install -d -m 755 %%TUMGREYSPF_DIR%%/config
X		if [ ! -f %%TUMGREYSPF_DIR%%/config/__default__ ]; then
X			install %%DATADIR%%/__default__.dist %%TUMGREYSPF_DIR%%/config/__default__
X		fi
X		;;
X	*)
X		;;
Xesac
END-of-tumgreyspf/files/pkg-install.in
exit
--- tumgreyspf.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509012050.j81KorKo069247>